2012-09-27 04:33:43 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim:set ts=2 sw=2 sts=2 et cindent: */
|
|
|
|
/* 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/. */
|
2012-11-14 19:46:40 +00:00
|
|
|
#if !defined(MediaOmxReader_h_)
|
|
|
|
#define MediaOmxReader_h_
|
2012-09-27 04:33:43 +00:00
|
|
|
|
|
|
|
#include "MediaResource.h"
|
2012-11-14 19:46:40 +00:00
|
|
|
#include "MediaDecoderReader.h"
|
2012-09-27 04:33:43 +00:00
|
|
|
|
2013-02-01 22:13:23 +00:00
|
|
|
namespace android {
|
|
|
|
class OmxDecoder;
|
|
|
|
}
|
2012-09-27 04:33:43 +00:00
|
|
|
|
2012-11-14 19:45:33 +00:00
|
|
|
namespace mozilla {
|
|
|
|
|
2013-03-02 19:14:44 +00:00
|
|
|
namespace dom {
|
|
|
|
class TimeRanges;
|
|
|
|
}
|
|
|
|
|
2012-11-19 15:11:21 +00:00
|
|
|
class AbstractMediaDecoder;
|
|
|
|
|
2012-11-14 19:46:40 +00:00
|
|
|
class MediaOmxReader : public MediaDecoderReader
|
2012-09-27 04:33:43 +00:00
|
|
|
{
|
|
|
|
nsCString mType;
|
2013-02-16 02:27:18 +00:00
|
|
|
android::sp<android::OmxDecoder> mOmxDecoder;
|
2012-09-27 04:33:43 +00:00
|
|
|
bool mHasVideo;
|
|
|
|
bool mHasAudio;
|
|
|
|
nsIntRect mPicture;
|
|
|
|
nsIntSize mInitialFrame;
|
|
|
|
int64_t mVideoSeekTimeUs;
|
|
|
|
int64_t mAudioSeekTimeUs;
|
2012-11-27 04:08:40 +00:00
|
|
|
int32_t mSkipCount;
|
2012-09-27 04:33:43 +00:00
|
|
|
public:
|
2012-11-19 15:11:21 +00:00
|
|
|
MediaOmxReader(AbstractMediaDecoder* aDecoder);
|
2012-11-14 19:46:40 +00:00
|
|
|
~MediaOmxReader();
|
2012-09-27 04:33:43 +00:00
|
|
|
|
2012-11-14 19:46:40 +00:00
|
|
|
virtual nsresult Init(MediaDecoderReader* aCloneDonor);
|
2012-09-27 04:33:43 +00:00
|
|
|
virtual nsresult ResetDecode();
|
|
|
|
|
|
|
|
virtual bool DecodeAudioData();
|
|
|
|
virtual bool DecodeVideoFrame(bool &aKeyframeSkip,
|
|
|
|
int64_t aTimeThreshold);
|
|
|
|
|
|
|
|
virtual bool HasAudio()
|
|
|
|
{
|
|
|
|
return mHasAudio;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual bool HasVideo()
|
|
|
|
{
|
|
|
|
return mHasVideo;
|
|
|
|
}
|
|
|
|
|
2012-11-28 19:40:07 +00:00
|
|
|
virtual nsresult ReadMetadata(VideoInfo* aInfo,
|
2012-11-09 00:40:08 +00:00
|
|
|
MetadataTags** aTags);
|
2012-09-27 04:33:43 +00:00
|
|
|
virtual nsresult Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime);
|
2013-03-02 19:14:44 +00:00
|
|
|
virtual nsresult GetBuffered(mozilla::dom::TimeRanges* aBuffered, int64_t aStartTime);
|
2012-09-27 04:33:43 +00:00
|
|
|
};
|
|
|
|
|
2012-11-14 19:45:33 +00:00
|
|
|
} // namespace mozilla
|
|
|
|
|
2012-09-27 04:33:43 +00:00
|
|
|
#endif
|