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,
|
2010-07-26 12:35:16 -07:00
|
|
|
PRInt64 aTimeThreshold);
|
|
|
|
|
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,
|
|
|
|
nsHTMLMediaElement::MetadataTags** aTags);
|
2010-08-19 15:50:37 -07:00
|
|
|
virtual nsresult Seek(PRInt64 aTime, PRInt64 aStartTime, PRInt64 aEndTime, PRInt64 aCurrentTime);
|
2010-08-25 01:43:00 -07:00
|
|
|
virtual nsresult GetBuffered(nsTimeRanges* aBuffered, PRInt64 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-02-14 20:35:01 -08:00
|
|
|
bool ReadFromResource(MediaResource *aResource, PRUint8 *aBuf, PRUint32 aLength);
|
2010-07-26 12:35:16 -07:00
|
|
|
|
|
|
|
nsRawVideoHeader mMetadata;
|
|
|
|
PRUint32 mCurrentFrame;
|
|
|
|
double mFrameRate;
|
|
|
|
PRUint32 mFrameSize;
|
2011-06-23 15:08:54 -07:00
|
|
|
nsIntRect mPicture;
|
2010-07-26 12:35:16 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|