Files
palemoon27/dom/media/platforms/ffmpeg/FFmpegDataDecoder.h
T
roytam1 dd9173e4d3 import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1146086: use promise to Init() in PlatformDecoderModule. r=jya,r=cpearce (aed679865)
- partial of Bug 1128380: Add IsHardwareAccelerated implementation for AVCC and mac decoder. r=cpearce (8b376df05)
- Bug 1192675: P1. Ensure VDA/VT APIs are only ever accessed from the same thread. r=cpearce (fa9c8de6a)
- Bug 1178098 - Report why DXVA initialization failed to about:support. r=cpearce (0b06a28e9)
- Bug 1167690 - Part 1: Hook up NPPVpluginIsPlayingAudio to the plugin process; r=josh (30df04ca2)
- Bug 1167690 - Add NPAPI:AudioControl enums to npapi.h. r=josh (5369f6fa9)
- Bug 1167690 - Part 2: Integrate plugins which support the NPAPI audio extensions with the Audio Channel Service; r=BenWa (145cecdc4)
- Bug 1167690 - Part 3: Hook up NPNVmuteAudioBool to the plugin process; r=josh (36558b729)
- Bug 1167690 - Part 4: Add support for testing plugin audio channel integration to the test plugin; r=josh (04af51882)
2021-08-20 11:16:41 +08:00

58 lines
1.4 KiB
C++

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* 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 __FFmpegDataDecoder_h__
#define __FFmpegDataDecoder_h__
#include "PlatformDecoderModule.h"
#include "FFmpegLibs.h"
#include "mozilla/StaticMutex.h"
namespace mozilla
{
template <int V>
class FFmpegDataDecoder : public MediaDataDecoder
{
};
template <>
class FFmpegDataDecoder<LIBAV_VER> : public MediaDataDecoder
{
public:
FFmpegDataDecoder(FlushableTaskQueue* aTaskQueue, AVCodecID aCodecID);
virtual ~FFmpegDataDecoder();
static bool Link();
virtual nsRefPtr<InitPromise> Init() override = 0;
virtual nsresult Input(MediaRawData* aSample) override = 0;
virtual nsresult Flush() override;
virtual nsresult Drain() override = 0;
virtual nsresult Shutdown() override;
static AVCodec* FindAVCodec(AVCodecID aCodec);
protected:
virtual void InitCodecContext() {}
AVFrame* PrepareFrame();
nsresult InitDecoder();
FlushableTaskQueue* mTaskQueue;
AVCodecContext* mCodecContext;
AVFrame* mFrame;
nsRefPtr<MediaByteBuffer> mExtraData;
AVCodecID mCodecID;
private:
static bool sFFmpegInitDone;
static StaticMutex sMonitor;
};
} // namespace mozilla
#endif // __FFmpegDataDecoder_h__