Line data Source code
1 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim:set ts=2 sw=2 sts=2 et cindent: */
3 : /* This Source Code Form is subject to the terms of the Mozilla Public
4 : * License, v. 2.0. If a copy of the MPL was not distributed with this
5 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 :
7 : #if !defined(DummyMediaDataDecoder_h_)
8 : #define DummyMediaDataDecoder_h_
9 :
10 : #include "MediaInfo.h"
11 : #include "mozilla/UniquePtr.h"
12 : #include "PlatformDecoderModule.h"
13 : #include "ReorderQueue.h"
14 :
15 : namespace mozilla {
16 :
17 : class MediaRawData;
18 :
19 0 : class DummyDataCreator
20 : {
21 : public:
22 : virtual ~DummyDataCreator();
23 : virtual already_AddRefed<MediaData> Create(MediaRawData* aSample) = 0;
24 : };
25 :
26 : // Decoder that uses a passed in object's Create function to create Null
27 : // MediaData objects.
28 0 : class DummyMediaDataDecoder : public MediaDataDecoder
29 : {
30 : public:
31 : DummyMediaDataDecoder(UniquePtr<DummyDataCreator>&& aCreator,
32 : const char* aDescription,
33 : const CreateDecoderParams& aParams);
34 :
35 : RefPtr<InitPromise> Init() override;
36 :
37 : RefPtr<ShutdownPromise> Shutdown() override;
38 :
39 : RefPtr<DecodePromise> Decode(MediaRawData* aSample) override;
40 :
41 : RefPtr<DecodePromise> Drain() override;
42 :
43 : RefPtr<FlushPromise> Flush() override;
44 :
45 : const char* GetDescriptionName() const override;
46 :
47 : ConversionRequired NeedsConversion() const override;
48 :
49 : private:
50 : UniquePtr<DummyDataCreator> mCreator;
51 : const bool mIsH264;
52 : const uint32_t mMaxRefFrames;
53 : ReorderQueue mReorderQueue;
54 : TrackInfo::TrackType mType;
55 : nsCString mDescription;
56 : };
57 :
58 : } // namespace mozilla
59 :
60 : #endif // !defined(DummyMediaDataDecoder_h_)
|