From e011a048e431bd850bfd42b5fb8c6eec0b6b878e Mon Sep 17 00:00:00 2001 From: Moonchild Date: Sun, 27 Dec 2020 13:11:19 +0000 Subject: Issue #1053 - Part 3b: Remove AndroidSurfaceTexture and Android media decoder interface. --- .../platforms/android/MediaCodecDataDecoder.h | 126 --------------------- 1 file changed, 126 deletions(-) delete mode 100644 dom/media/platforms/android/MediaCodecDataDecoder.h (limited to 'dom/media/platforms/android/MediaCodecDataDecoder.h') diff --git a/dom/media/platforms/android/MediaCodecDataDecoder.h b/dom/media/platforms/android/MediaCodecDataDecoder.h deleted file mode 100644 index 0db6407bf..000000000 --- a/dom/media/platforms/android/MediaCodecDataDecoder.h +++ /dev/null @@ -1,126 +0,0 @@ -/* 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 MediaCodecDataDecoder_h_ -#define MediaCodecDataDecoder_h_ - -#include "AndroidDecoderModule.h" - -#include "MediaCodec.h" -#include "SurfaceTexture.h" -#include "TimeUnits.h" -#include "mozilla/Monitor.h" -#include "mozilla/Maybe.h" - -#include - -namespace mozilla { - -typedef std::deque> SampleQueue; - -class MediaCodecDataDecoder : public MediaDataDecoder { -public: - static MediaDataDecoder* CreateAudioDecoder(const AudioInfo& aConfig, - java::sdk::MediaFormat::Param aFormat, - MediaDataDecoderCallback* aCallback); - - static MediaDataDecoder* CreateVideoDecoder(const VideoInfo& aConfig, - java::sdk::MediaFormat::Param aFormat, - MediaDataDecoderCallback* aCallback, - layers::ImageContainer* aImageContainer); - - virtual ~MediaCodecDataDecoder(); - - RefPtr Init() override; - void Flush() override; - void Drain() override; - void Shutdown() override; - void Input(MediaRawData* aSample) override; - const char* GetDescriptionName() const override - { - return "Android MediaCodec decoder"; - } - -protected: - enum class ModuleState : uint8_t { - kDecoding = 0, - kFlushing, - kDrainQueue, - kDrainDecoder, - kDrainWaitEOS, - kStopping, - kShutdown - }; - - friend class AndroidDecoderModule; - - MediaCodecDataDecoder(MediaData::Type aType, - const nsACString& aMimeType, - java::sdk::MediaFormat::Param aFormat, - MediaDataDecoderCallback* aCallback); - - static const char* ModuleStateStr(ModuleState aState); - - virtual nsresult InitDecoder(java::sdk::Surface::Param aSurface); - - virtual nsresult Output(java::sdk::BufferInfo::Param aInfo, void* aBuffer, - java::sdk::MediaFormat::Param aFormat, const media::TimeUnit& aDuration) - { - return NS_OK; - } - - virtual nsresult PostOutput(java::sdk::BufferInfo::Param aInfo, - java::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(); - already_AddRefed PeekNextSample(); - nsresult QueueSample(const MediaRawData* aSample); - nsresult QueueEOS(); - void HandleEOS(int32_t aOutputStatus); - Maybe GetOutputDuration(); - nsresult ProcessOutput(java::sdk::BufferInfo::Param aInfo, - java::sdk::MediaFormat::Param aFormat, - int32_t aStatus); - // Sets decoder state and returns whether the new state has become effective. - bool SetState(ModuleState aState); - void DecoderLoop(); - - virtual void ClearQueue(); - - MediaData::Type mType; - - nsAutoCString mMimeType; - java::sdk::MediaFormat::GlobalRef mFormat; - - MediaDataDecoderCallback* mCallback; - - java::sdk::MediaCodec::GlobalRef mDecoder; - - jni::ObjectArray::GlobalRef mInputBuffers; - jni::ObjectArray::GlobalRef mOutputBuffers; - - nsCOMPtr mThread; - - // Only these members are protected by mMonitor. - Monitor mMonitor; - - ModuleState mState; - - SampleQueue mQueue; - // Durations are stored in microseconds. - std::deque mDurations; -}; - -} // namespace mozilla - -#endif -- cgit v1.2.3