2010-07-26 12:35:16 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* 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/. */
|
2010-07-26 12:35:16 -07:00
|
|
|
|
|
|
|
#if !defined(nsRawReader_h_)
|
|
|
|
#define nsRawReader_h_
|
|
|
|
|
|
|
|
#include "nsBuiltinDecoderReader.h"
|
2011-09-26 17:25:41 -07:00
|
|
|
#include "nsRawStructs.h"
|
2010-07-26 12:35:16 -07:00
|
|
|
|
|
|
|
class nsRawReader : public nsBuiltinDecoderReader
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsRawReader(nsBuiltinDecoder* aDecoder);
|
|
|
|
~nsRawReader();
|
|
|
|
|
2010-09-20 17:49:50 -07:00
|
|
|
virtual nsresult Init(nsBuiltinDecoderReader* aCloneDonor);
|
2010-07-26 12:35:16 -07:00
|
|
|
virtual nsresult ResetDecode();
|
2011-09-28 23:19:26 -07:00
|
|
|
virtual bool DecodeAudioData();
|
2010-07-26 12:35:16 -07:00
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
virtual bool DecodeVideoFrame(bool &aKeyframeSkip,
|
2012-08-22 08:56:38 -07:00
|
|
|
int64_t aTimeThreshold);
|
2010-07-26 12:35:16 -07:00
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
virtual bool HasAudio()
|
2010-07-26 12:35:16 -07:00
|
|
|
{
|
2011-09-29 16:34:37 -07:00
|
|
|
return false;
|
2010-07-26 12:35:16 -07:00
|
|
|
}
|
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
virtual bool HasVideo()
|
2010-07-26 12:35:16 -07:00
|
|
|
{
|
2011-09-29 16:34:37 -07:00
|
|
|
return true;
|
2010-07-26 12:35:16 -07:00
|
|
|
}
|
|
|
|
|
2012-07-30 17:14:29 -07:00
|
|
|
virtual nsresult ReadMetadata(nsVideoInfo* aInfo,
|
2012-11-08 16:40:08 -08:00
|
|
|
MetadataTags** aTags);
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual nsresult Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime);
|
|
|
|
virtual nsresult GetBuffered(nsTimeRanges* aBuffered, int64_t aStartTime);
|
2010-07-26 12:35:16 -07:00
|
|
|
|
2012-05-18 10:35:43 -07:00
|
|
|
// By seeking in the media resource, it is possible to seek.
|
|
|
|
bool IsSeekableInBufferedRanges() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2010-07-26 12:35:16 -07:00
|
|
|
private:
|
2012-10-27 10:24:04 -07:00
|
|
|
bool ReadFromResource(mozilla::MediaResource *aResource, uint8_t *aBuf, uint32_t aLength);
|
2010-07-26 12:35:16 -07:00
|
|
|
|
|
|
|
nsRawVideoHeader mMetadata;
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t mCurrentFrame;
|
2010-07-26 12:35:16 -07:00
|
|
|
double mFrameRate;
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t mFrameSize;
|
2011-06-23 15:08:54 -07:00
|
|
|
nsIntRect mPicture;
|
2010-07-26 12:35:16 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|