2010-07-26 19:35:16 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00: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 19:35:16 +00:00
|
|
|
|
2012-11-14 19:46:40 +00:00
|
|
|
#if !defined(RawReader_h_)
|
|
|
|
#define RawReader_h_
|
2010-07-26 19:35:16 +00:00
|
|
|
|
2012-11-14 19:46:40 +00:00
|
|
|
#include "MediaDecoderReader.h"
|
|
|
|
#include "RawStructs.h"
|
2010-07-26 19:35:16 +00:00
|
|
|
|
2012-11-14 19:45:33 +00:00
|
|
|
namespace mozilla {
|
|
|
|
|
2012-11-14 19:46:40 +00:00
|
|
|
class RawReader : public MediaDecoderReader
|
2010-07-26 19:35:16 +00:00
|
|
|
{
|
|
|
|
public:
|
2014-09-01 03:50:23 +00:00
|
|
|
explicit RawReader(AbstractMediaDecoder* aDecoder);
|
2014-07-15 15:37:45 +00:00
|
|
|
|
|
|
|
protected:
|
2012-11-14 19:46:40 +00:00
|
|
|
~RawReader();
|
2010-07-26 19:35:16 +00:00
|
|
|
|
2014-07-15 15:37:45 +00:00
|
|
|
public:
|
2015-01-03 02:08:06 +00:00
|
|
|
virtual nsresult Init(MediaDecoderReader* aCloneDonor) MOZ_OVERRIDE;
|
|
|
|
virtual nsresult ResetDecode() MOZ_OVERRIDE;
|
|
|
|
virtual bool DecodeAudioData() MOZ_OVERRIDE;
|
2010-07-26 19:35:16 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
virtual bool DecodeVideoFrame(bool &aKeyframeSkip,
|
2015-01-03 02:08:06 +00:00
|
|
|
int64_t aTimeThreshold) MOZ_OVERRIDE;
|
2010-07-26 19:35:16 +00:00
|
|
|
|
2015-01-03 02:08:06 +00:00
|
|
|
virtual bool HasAudio() MOZ_OVERRIDE
|
2010-07-26 19:35:16 +00:00
|
|
|
{
|
2011-09-29 23:34:37 +00:00
|
|
|
return false;
|
2010-07-26 19:35:16 +00:00
|
|
|
}
|
|
|
|
|
2015-01-03 02:08:06 +00:00
|
|
|
virtual bool HasVideo() MOZ_OVERRIDE
|
2010-07-26 19:35:16 +00:00
|
|
|
{
|
2011-09-29 23:34:37 +00:00
|
|
|
return true;
|
2010-07-26 19:35:16 +00:00
|
|
|
}
|
|
|
|
|
2013-09-27 05:22:38 +00:00
|
|
|
virtual nsresult ReadMetadata(MediaInfo* aInfo,
|
2015-01-03 02:08:06 +00:00
|
|
|
MetadataTags** aTags) MOZ_OVERRIDE;
|
2014-12-16 09:52:57 +00:00
|
|
|
virtual nsRefPtr<SeekPromise>
|
2015-01-16 18:57:59 +00:00
|
|
|
Seek(int64_t aTime, int64_t aEndTime) MOZ_OVERRIDE;
|
2014-12-16 09:52:57 +00:00
|
|
|
|
2015-01-03 02:08:06 +00:00
|
|
|
virtual nsresult GetBuffered(dom::TimeRanges* aBuffered) MOZ_OVERRIDE;
|
2010-07-26 19:35:16 +00:00
|
|
|
|
2014-06-23 10:08:34 +00:00
|
|
|
virtual bool IsMediaSeekable() MOZ_OVERRIDE;
|
|
|
|
|
2010-07-26 19:35:16 +00:00
|
|
|
private:
|
2012-11-14 19:46:40 +00:00
|
|
|
bool ReadFromResource(MediaResource *aResource, uint8_t *aBuf, uint32_t aLength);
|
2010-07-26 19:35:16 +00:00
|
|
|
|
2014-11-05 00:32:26 +00:00
|
|
|
nsresult SeekInternal(int64_t aTime);
|
|
|
|
|
2012-11-14 19:46:40 +00:00
|
|
|
RawVideoHeader mMetadata;
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mCurrentFrame;
|
2010-07-26 19:35:16 +00:00
|
|
|
double mFrameRate;
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mFrameSize;
|
2011-06-23 22:08:54 +00:00
|
|
|
nsIntRect mPicture;
|
2010-07-26 19:35:16 +00:00
|
|
|
};
|
|
|
|
|
2012-11-14 19:45:33 +00:00
|
|
|
} // namespace mozilla
|
|
|
|
|
2010-07-26 19:35:16 +00:00
|
|
|
#endif
|