michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #if !defined(RawReader_h_) michael@0: #define RawReader_h_ michael@0: michael@0: #include "MediaDecoderReader.h" michael@0: #include "RawStructs.h" michael@0: michael@0: namespace mozilla { michael@0: michael@0: class RawReader : public MediaDecoderReader michael@0: { michael@0: public: michael@0: RawReader(AbstractMediaDecoder* aDecoder); michael@0: ~RawReader(); michael@0: michael@0: virtual nsresult Init(MediaDecoderReader* aCloneDonor); michael@0: virtual nsresult ResetDecode(); michael@0: virtual bool DecodeAudioData(); michael@0: michael@0: virtual bool DecodeVideoFrame(bool &aKeyframeSkip, michael@0: int64_t aTimeThreshold); michael@0: michael@0: virtual bool HasAudio() michael@0: { michael@0: return false; michael@0: } michael@0: michael@0: virtual bool HasVideo() michael@0: { michael@0: return true; michael@0: } michael@0: michael@0: virtual nsresult ReadMetadata(MediaInfo* aInfo, michael@0: MetadataTags** aTags); michael@0: virtual nsresult Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime); michael@0: virtual nsresult GetBuffered(dom::TimeRanges* aBuffered, int64_t aStartTime); michael@0: michael@0: private: michael@0: bool ReadFromResource(MediaResource *aResource, uint8_t *aBuf, uint32_t aLength); michael@0: michael@0: RawVideoHeader mMetadata; michael@0: uint32_t mCurrentFrame; michael@0: double mFrameRate; michael@0: uint32_t mFrameSize; michael@0: nsIntRect mPicture; michael@0: }; michael@0: michael@0: } // namespace mozilla michael@0: michael@0: #endif