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
|
|
|
|
2012-11-14 11:46:40 -08:00
|
|
|
#if !defined(RawReader_h_)
|
|
|
|
#define RawReader_h_
|
2010-07-26 12:35:16 -07:00
|
|
|
|
2012-11-14 11:46:40 -08:00
|
|
|
#include "MediaDecoderReader.h"
|
|
|
|
#include "RawStructs.h"
|
2010-07-26 12:35:16 -07:00
|
|
|
|
2012-11-14 11:45:33 -08:00
|
|
|
namespace mozilla {
|
|
|
|
|
2012-11-14 11:46:40 -08:00
|
|
|
class RawReader : public MediaDecoderReader
|
2010-07-26 12:35:16 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-11-19 07:11:21 -08:00
|
|
|
RawReader(AbstractMediaDecoder* aDecoder);
|
2012-11-14 11:46:40 -08:00
|
|
|
~RawReader();
|
2010-07-26 12:35:16 -07:00
|
|
|
|
2012-11-14 11:46:40 -08:00
|
|
|
virtual nsresult Init(MediaDecoderReader* 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-11-28 11:40:07 -08:00
|
|
|
virtual nsresult ReadMetadata(VideoInfo* 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
|
|
|
|
|
|
|
private:
|
2012-11-14 11:46:40 -08:00
|
|
|
bool ReadFromResource(MediaResource *aResource, uint8_t *aBuf, uint32_t aLength);
|
2010-07-26 12:35:16 -07:00
|
|
|
|
2012-11-14 11:46:40 -08:00
|
|
|
RawVideoHeader 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
|
|
|
};
|
|
|
|
|
2012-11-14 11:45:33 -08:00
|
|
|
} // namespace mozilla
|
|
|
|
|
2010-07-26 12:35:16 -07:00
|
|
|
#endif
|