mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
33bb32f549
This patch was automatically generated using the following script: function convert() { echo "Converting $1 to $2..." find . \ ! -wholename "*/.git*" \ ! -wholename "obj-ff-dbg*" \ -type f \ \( -iname "*.cpp" \ -o -iname "*.h" \ -o -iname "*.c" \ -o -iname "*.cc" \ -o -iname "*.idl" \ -o -iname "*.ipdl" \ -o -iname "*.ipdlh" \ -o -iname "*.mm" \) | \ xargs -n 1 sed -i -e "s/\b$1\b/$2/g" } convert MOZ_OVERRIDE override convert MOZ_FINAL final
95 lines
2.3 KiB
C++
95 lines
2.3 KiB
C++
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef OmxTrackEncoder_h_
|
|
#define OmxTrackEncoder_h_
|
|
|
|
#include "TrackEncoder.h"
|
|
|
|
namespace android {
|
|
class OMXVideoEncoder;
|
|
class OMXAudioEncoder;
|
|
}
|
|
|
|
/**
|
|
* There are two major classes defined in file OmxTrackEncoder;
|
|
* OmxVideoTrackEncoder and OmxAudioTrackEncoder, the video and audio track
|
|
* encoder for media type AVC/H.264 and AAC. OMXCodecWrapper wraps and controls
|
|
* an instance of MediaCodec, defined in libstagefright, runs on Android Jelly
|
|
* Bean platform.
|
|
*/
|
|
|
|
namespace mozilla {
|
|
|
|
class OmxVideoTrackEncoder: public VideoTrackEncoder
|
|
{
|
|
public:
|
|
OmxVideoTrackEncoder();
|
|
~OmxVideoTrackEncoder();
|
|
|
|
already_AddRefed<TrackMetadataBase> GetMetadata() override;
|
|
|
|
nsresult GetEncodedTrack(EncodedFrameContainer& aData) override;
|
|
|
|
protected:
|
|
nsresult Init(int aWidth, int aHeight,
|
|
int aDisplayWidth, int aDisplayHeight,
|
|
TrackRate aTrackRate) override;
|
|
|
|
private:
|
|
nsAutoPtr<android::OMXVideoEncoder> mEncoder;
|
|
};
|
|
|
|
class OmxAudioTrackEncoder : public AudioTrackEncoder
|
|
{
|
|
public:
|
|
OmxAudioTrackEncoder();
|
|
~OmxAudioTrackEncoder();
|
|
|
|
already_AddRefed<TrackMetadataBase> GetMetadata() = 0;
|
|
|
|
nsresult GetEncodedTrack(EncodedFrameContainer& aData) override;
|
|
|
|
protected:
|
|
nsresult Init(int aChannels, int aSamplingRate) = 0;
|
|
|
|
// Append encoded frames to aContainer.
|
|
nsresult AppendEncodedFrames(EncodedFrameContainer& aContainer);
|
|
|
|
nsAutoPtr<android::OMXAudioEncoder> mEncoder;
|
|
};
|
|
|
|
class OmxAACAudioTrackEncoder final : public OmxAudioTrackEncoder
|
|
{
|
|
public:
|
|
OmxAACAudioTrackEncoder()
|
|
: OmxAudioTrackEncoder()
|
|
{}
|
|
|
|
already_AddRefed<TrackMetadataBase> GetMetadata() override;
|
|
|
|
protected:
|
|
nsresult Init(int aChannels, int aSamplingRate) override;
|
|
};
|
|
|
|
class OmxAMRAudioTrackEncoder final : public OmxAudioTrackEncoder
|
|
{
|
|
public:
|
|
OmxAMRAudioTrackEncoder()
|
|
: OmxAudioTrackEncoder()
|
|
{}
|
|
|
|
enum {
|
|
AMR_NB_SAMPLERATE = 8000,
|
|
};
|
|
already_AddRefed<TrackMetadataBase> GetMetadata() override;
|
|
|
|
protected:
|
|
nsresult Init(int aChannels, int aSamplingRate) override;
|
|
};
|
|
|
|
}
|
|
#endif
|