|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #if !defined(RawReader_h_) |
|
7 #define RawReader_h_ |
|
8 |
|
9 #include "MediaDecoderReader.h" |
|
10 #include "RawStructs.h" |
|
11 |
|
12 namespace mozilla { |
|
13 |
|
14 class RawReader : public MediaDecoderReader |
|
15 { |
|
16 public: |
|
17 RawReader(AbstractMediaDecoder* aDecoder); |
|
18 ~RawReader(); |
|
19 |
|
20 virtual nsresult Init(MediaDecoderReader* aCloneDonor); |
|
21 virtual nsresult ResetDecode(); |
|
22 virtual bool DecodeAudioData(); |
|
23 |
|
24 virtual bool DecodeVideoFrame(bool &aKeyframeSkip, |
|
25 int64_t aTimeThreshold); |
|
26 |
|
27 virtual bool HasAudio() |
|
28 { |
|
29 return false; |
|
30 } |
|
31 |
|
32 virtual bool HasVideo() |
|
33 { |
|
34 return true; |
|
35 } |
|
36 |
|
37 virtual nsresult ReadMetadata(MediaInfo* aInfo, |
|
38 MetadataTags** aTags); |
|
39 virtual nsresult Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime); |
|
40 virtual nsresult GetBuffered(dom::TimeRanges* aBuffered, int64_t aStartTime); |
|
41 |
|
42 private: |
|
43 bool ReadFromResource(MediaResource *aResource, uint8_t *aBuf, uint32_t aLength); |
|
44 |
|
45 RawVideoHeader mMetadata; |
|
46 uint32_t mCurrentFrame; |
|
47 double mFrameRate; |
|
48 uint32_t mFrameSize; |
|
49 nsIntRect mPicture; |
|
50 }; |
|
51 |
|
52 } // namespace mozilla |
|
53 |
|
54 #endif |