mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:18:48 +00:00
5d8f4a0ceb
- Bug 1130710 - xre: Use stdint uint*_t instead of nonstandard __uint*_t. r=bsmedberg# Please enter the commit message for your changes. Lines starting (8ee5fbe479) - partial revert of PM (bcd354aa6b) - Bug 1158866 - Enable MAR verification on linux via NSS. r=rstrong (d3a4eff858) - Bug 1159090 - Only append library path for updater if it is a unique value. r=rstrong (5aeece0f47) - Bug 1168720 - Remove use of test env var MOZ_NO_REPLACE_FALLBACK and associated tests that are covered by other tests. r=spohl (4c8fb7266d) - more backport (a30d3a5c9d) - Bug 1158870: Disable mar signing code path in updater for gonk until mar signing is available there. r=bbondy (d08701cdb4) - Bug 1217985 - Don't depend on Windows crypto DLLs (e313b1d3b7) - more backports (fa8e0ff050) - Bug 1168009 - heap-use-after-free (ASAN build) in updater.cpp mstrtok. r=spohl (9ffe217d90) - Bug 1234033 - Unbreak build --with-system-bz2 using Clang. r=dvander (1109f20b70) - backports (3f418fc789) - Bug 1213130 - Make several string function to accept char16ptr_t instead of char16_t*, and remove redundant overloads. rs=froydnj (95a4cb53cd) - Bug 1210871 - don't use reinterpret_cast in nsTHashtable.h; r=erahm (f742409381) - Bug 1217125 - remove pointless includes from nsTHashtable.h; r=mccr8 (ad26d04f77) - Bug 1159081 - Bad PR_SetEnv usage for Gonk. r=dhylands, r=rstrong (855a00ae4b) - bit of Bug 1237140 - Move DefinesAction (d0d8fffb86) - Bug 1157212 - Teach clang-analyzer about XPT_ASSERT; r=froydnj (d75e87012c) - Bug 1208320 - Do not stage some reftest support files before archiving; r=glandium (5a547ca126) - Bug 1208320 - Do not stage reftest test files before archiving; r=glandium (28944e3a87) - Bug 1208320 - Print message when done with archiving; r=glandium (27e0b00dcd) - Bug 1208320 - Decrease compression level of test zip archives; r=glandium (d01f75ea8b) - Bug 1232887 - "make package MOZ_PKG_PRETTYNAMES=1" is busted. r=glandium (9f978b70f0) - Bug 1212609 - Add common test package rules for firefox-ui-tests. r=gps (3fa329714a) - Bug 1239442 - Update common.tests.zip to contain dom/media/test/external-media-sites. r=gps (94e917c5e7) - Bug 1233774 - fix Leak EventTokenBucket on shutdown r=dragana (37db0e5752) - Bug 1241295 - Limit time for PR_Close calls during shutdown in nsUDPSocket. r=mcmanus (451f8663b9) - Bug 1242464 - Call shutdown() before closesocket() and change linger option on windows. r=mcmanus (2b4f7e327c) - Bug 1240122 - threadsafe fix for getselfaddr() r=dragana (0cdeefb33e) - Bug 544986 - 64KB rwin for windows xp r=dragana (cbe034ebf5) - Bug 1239655 - Do not do PR_ConnectContinue during the shutdown. r=mcmanus (2361129b62) - Bug 1240120 - Move external-media-tests to subdirectory to generate correct packaging; r=maja_zf,whimboo (0742e93414) - Bug 1235232 - Fix -Wclass-varargs warnings in dom/media/. r=kentuckyfriedtakahe (b13b325846) - Bug 1231793: Part 1 - Added read functions for Little Endian integers to ByteReader.h. r=jya (6dc6519fe9) - Bug 1231793: Part 2 - Added conversions to AudioSampleFormat.h. r=jya (59d48c4d82) - Bug 1231793: Part 3 - Fixed reading of Metadata tags. r=jya (3931a82ce7) - Bug 1192539 - [2.4] Use MediaCodecList to check for decoder support. r=snorp (35e0427a2b) - Bug 1231793: Part 4 - Added checks for Wave type in AndroidDecoderModule. r=jya (a80b83691c) - Bug 1237836 - Add support for MetadataTags to MediaFormatReader. r=jya (9b813ae38c) - Bug 1231793: Part 5 - Added Wave Data Demuxer and Decoder. r=jya (6f7131a2d8) - Bug 1231793: Part 6 - Enabled the new Wave Data Decoder in DecoderTraits. r=jya (1574922fc7) - Bug 1241677: P1. Add MediaDataDecoder::GetDescriptionName() method. r=cpearce (767413678e) - Bug 1241677: P2. Add media decoder's description to about:media report. r=cpearce (b6d300d864) - Bug 1231793: Part 7 - Fixed various tests. r=jya (baa4a844c1) - Bug 1231793: Part 8 - Added checks for various metadata errors. r=jya (53af45d8de)
142 lines
3.8 KiB
C++
142 lines
3.8 KiB
C++
/* 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 AndroidDecoderModule_h_
|
|
#define AndroidDecoderModule_h_
|
|
|
|
#include "PlatformDecoderModule.h"
|
|
#include "AndroidSurfaceTexture.h"
|
|
|
|
#include "MediaCodec.h"
|
|
#include "TimeUnits.h"
|
|
#include "mozilla/Monitor.h"
|
|
|
|
#include <queue>
|
|
|
|
namespace mozilla {
|
|
|
|
typedef std::queue<RefPtr<MediaRawData>> SampleQueue;
|
|
|
|
class AndroidDecoderModule : public PlatformDecoderModule {
|
|
public:
|
|
already_AddRefed<MediaDataDecoder>
|
|
CreateVideoDecoder(const VideoInfo& aConfig,
|
|
layers::LayersBackend aLayersBackend,
|
|
layers::ImageContainer* aImageContainer,
|
|
FlushableTaskQueue* aVideoTaskQueue,
|
|
MediaDataDecoderCallback* aCallback) override;
|
|
|
|
already_AddRefed<MediaDataDecoder>
|
|
CreateAudioDecoder(const AudioInfo& aConfig,
|
|
FlushableTaskQueue* aAudioTaskQueue,
|
|
MediaDataDecoderCallback* aCallback) override;
|
|
|
|
|
|
AndroidDecoderModule() {}
|
|
virtual ~AndroidDecoderModule() {}
|
|
|
|
bool SupportsMimeType(const nsACString& aMimeType) const override;
|
|
|
|
ConversionRequired
|
|
DecoderNeedsConversion(const TrackInfo& aConfig) const override;
|
|
};
|
|
|
|
class MediaCodecDataDecoder : public MediaDataDecoder {
|
|
public:
|
|
|
|
MediaCodecDataDecoder(MediaData::Type aType,
|
|
const nsACString& aMimeType,
|
|
widget::sdk::MediaFormat::Param aFormat,
|
|
MediaDataDecoderCallback* aCallback);
|
|
|
|
virtual ~MediaCodecDataDecoder();
|
|
|
|
RefPtr<MediaDataDecoder::InitPromise> Init() override;
|
|
nsresult Flush() override;
|
|
nsresult Drain() override;
|
|
nsresult Shutdown() override;
|
|
nsresult Input(MediaRawData* aSample) override;
|
|
const char* GetDescriptionName() const override
|
|
{
|
|
return "android decoder";
|
|
}
|
|
|
|
protected:
|
|
enum ModuleState {
|
|
kDecoding = 0,
|
|
kFlushing,
|
|
kDrainQueue,
|
|
kDrainDecoder,
|
|
kDrainWaitEOS,
|
|
kStopping,
|
|
kShutdown
|
|
};
|
|
|
|
friend class AndroidDecoderModule;
|
|
|
|
static const char* ModuleStateStr(ModuleState aState);
|
|
|
|
virtual nsresult InitDecoder(widget::sdk::Surface::Param aSurface);
|
|
|
|
virtual nsresult Output(widget::sdk::BufferInfo::Param aInfo, void* aBuffer,
|
|
widget::sdk::MediaFormat::Param aFormat, const media::TimeUnit& aDuration)
|
|
{
|
|
return NS_OK;
|
|
}
|
|
|
|
virtual nsresult PostOutput(widget::sdk::BufferInfo::Param aInfo,
|
|
widget::sdk::MediaFormat::Param aFormat, const media::TimeUnit& aDuration)
|
|
{
|
|
return NS_OK;
|
|
}
|
|
|
|
virtual void Cleanup() {};
|
|
|
|
nsresult ResetInputBuffers();
|
|
nsresult ResetOutputBuffers();
|
|
|
|
nsresult GetInputBuffer(JNIEnv* env, int index, jni::Object::LocalRef* buffer);
|
|
bool WaitForInput();
|
|
MediaRawData* PeekNextSample();
|
|
nsresult QueueSample(const MediaRawData* aSample);
|
|
nsresult QueueEOS();
|
|
void HandleEOS(int32_t aOutputStatus);
|
|
media::TimeUnit GetOutputDuration();
|
|
nsresult ProcessOutput(widget::sdk::BufferInfo::Param aInfo,
|
|
widget::sdk::MediaFormat::Param aFormat,
|
|
int32_t aStatus);
|
|
ModuleState State() const;
|
|
void State(ModuleState aState);
|
|
void DecoderLoop();
|
|
|
|
virtual void ClearQueue();
|
|
|
|
MediaData::Type mType;
|
|
|
|
nsAutoCString mMimeType;
|
|
widget::sdk::MediaFormat::GlobalRef mFormat;
|
|
|
|
MediaDataDecoderCallback* mCallback;
|
|
|
|
widget::sdk::MediaCodec::GlobalRef mDecoder;
|
|
|
|
jni::ObjectArray::GlobalRef mInputBuffers;
|
|
jni::ObjectArray::GlobalRef mOutputBuffers;
|
|
|
|
nsCOMPtr<nsIThread> mThread;
|
|
|
|
// Only these members are protected by mMonitor.
|
|
Monitor mMonitor;
|
|
|
|
ModuleState mState;
|
|
|
|
SampleQueue mQueue;
|
|
// Durations are stored in microseconds.
|
|
std::queue<media::TimeUnit> mDurations;
|
|
};
|
|
|
|
} // namespace mozilla
|
|
|
|
#endif
|