2012-09-26 21:33:43 -07: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 11:46:40 -08:00
|
|
|
#if !defined(MediaOmxReader_h_)
|
|
|
|
#define MediaOmxReader_h_
|
2012-09-26 21:33:43 -07:00
|
|
|
|
|
|
|
#include "MediaResource.h"
|
2012-11-14 11:46:40 -08:00
|
|
|
#include "MediaDecoderReader.h"
|
2012-09-26 21:33:43 -07:00
|
|
|
|
2013-02-01 14:13:23 -08:00
|
|
|
namespace android {
|
|
|
|
class OmxDecoder;
|
|
|
|
}
|
2012-09-26 21:33:43 -07:00
|
|
|
|
2012-11-14 11:45:33 -08:00
|
|
|
namespace mozilla {
|
|
|
|
|
2012-11-19 07:11:21 -08:00
|
|
|
class AbstractMediaDecoder;
|
|
|
|
|
2012-11-14 11:46:40 -08:00
|
|
|
class MediaOmxReader : public MediaDecoderReader
|
2012-09-26 21:33:43 -07:00
|
|
|
{
|
|
|
|
nsCString mType;
|
|
|
|
android::OmxDecoder *mOmxDecoder;
|
|
|
|
bool mHasVideo;
|
|
|
|
bool mHasAudio;
|
|
|
|
nsIntRect mPicture;
|
|
|
|
nsIntSize mInitialFrame;
|
|
|
|
int64_t mVideoSeekTimeUs;
|
|
|
|
int64_t mAudioSeekTimeUs;
|
|
|
|
VideoData *mLastVideoFrame;
|
2012-11-26 20:08:40 -08:00
|
|
|
int32_t mSkipCount;
|
2012-09-26 21:33:43 -07:00
|
|
|
public:
|
2012-11-19 07:11:21 -08:00
|
|
|
MediaOmxReader(AbstractMediaDecoder* aDecoder);
|
2012-11-14 11:46:40 -08:00
|
|
|
~MediaOmxReader();
|
2012-09-26 21:33:43 -07:00
|
|
|
|
2012-11-14 11:46:40 -08:00
|
|
|
virtual nsresult Init(MediaDecoderReader* aCloneDonor);
|
2012-09-26 21:33:43 -07: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 11:40:07 -08:00
|
|
|
virtual nsresult ReadMetadata(VideoInfo* aInfo,
|
2012-11-08 16:40:08 -08:00
|
|
|
MetadataTags** aTags);
|
2012-09-26 21:33:43 -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);
|
|
|
|
};
|
|
|
|
|
2012-11-14 11:45:33 -08:00
|
|
|
} // namespace mozilla
|
|
|
|
|
2012-09-26 21:33:43 -07:00
|
|
|
#endif
|