Bug 973408 - Remove MediaDecoderStateMachine::GetAmpleVideoFrames(), and MediaOMXStateMachine. r=kinetik

This commit is contained in:
Chris Pearce 2014-03-11 11:44:08 +08:00
parent 75c8af6426
commit 9789b23076
5 changed files with 8 additions and 36 deletions

View File

@ -206,7 +206,7 @@ MediaDecoderStateMachine::MediaDecoderStateMachine(MediaDecoder* aDecoder,
mBufferingWait = mRealTime ? 0 : BUFFERING_WAIT_S;
mLowDataThresholdUsecs = mRealTime ? 0 : LOW_DATA_THRESHOLD_USECS;
mVideoPrerollFrames = mRealTime ? 0 : GetAmpleVideoFrames() / 2;
mVideoPrerollFrames = mRealTime ? 0 : mAmpleVideoFrames / 2;
mAudioPrerollUsecs = mRealTime ? 0 : LOW_AUDIO_USECS * 2;
#ifdef XP_WIN
@ -578,7 +578,7 @@ bool MediaDecoderStateMachine::HaveEnoughDecodedVideo()
{
AssertCurrentThreadInMonitor();
if (static_cast<uint32_t>(mReader->VideoQueue().GetSize()) < GetAmpleVideoFrames() * mPlaybackRate) {
if (static_cast<uint32_t>(mReader->VideoQueue().GetSize()) < mAmpleVideoFrames * mPlaybackRate) {
return false;
}

View File

@ -358,7 +358,6 @@ public:
bool IsPlaying();
protected:
virtual uint32_t GetAmpleVideoFrames() { return mAmpleVideoFrames; }
void AssertCurrentThreadInMonitor() const { mDecoder->GetReentrantMonitor().AssertCurrentThreadIn(); }

View File

@ -6,7 +6,7 @@
#include "MediaOmxDecoder.h"
#include "MediaOmxReader.h"
#include "MediaOmxStateMachine.h"
#include "MediaDecoderStateMachine.h"
namespace mozilla {
@ -22,7 +22,7 @@ MediaDecoder* MediaOmxDecoder::Clone()
MediaDecoderStateMachine* MediaOmxDecoder::CreateStateMachine()
{
return new MediaOmxStateMachine(this, new MediaOmxReader(this));
return new MediaDecoderStateMachine(this, new MediaOmxReader(this));
}
MediaOmxDecoder::~MediaOmxDecoder()

View File

@ -1,28 +0,0 @@
#include "MediaDecoder.h"
#include "MediaDecoderReader.h"
#include "MediaDecoderStateMachine.h"
namespace mozilla {
class MediaOmxStateMachine : public MediaDecoderStateMachine
{
public:
MediaOmxStateMachine(MediaDecoder *aDecoder,
MediaDecoderReader *aReader,
bool aRealTime = false)
: MediaDecoderStateMachine(aDecoder, aReader, aRealTime) { }
protected:
// Due to a bug in the OMX.qcom.video.decoder.mpeg4 decoder, we can't own too
// many video buffers before shutting down the decoder. When we release these
// buffers, they asynchronously signal to OMXCodec that we have returned
// ownership of the buffer.
// If this signal happens while the OMXCodec is shutting down, OMXCodec will
// crash. If the OMXCodec shuts down before all buffers are returned,
// OMXCodec will crash.
// So we need few enough buffers in the queue that all buffers will be
// returned before OMXCodec begins shutdown.
uint32_t GetAmpleVideoFrames() { return 3; }
};
} // namespace mozilla

View File

@ -7,7 +7,7 @@
#include "RtspMediaResource.h"
#include "RtspOmxDecoder.h"
#include "RtspOmxReader.h"
#include "MediaOmxStateMachine.h"
#include "MediaDecoderStateMachine.h"
namespace mozilla {
@ -18,8 +18,9 @@ MediaDecoder* RtspOmxDecoder::Clone()
MediaDecoderStateMachine* RtspOmxDecoder::CreateStateMachine()
{
return new MediaOmxStateMachine(this, new RtspOmxReader(this),
mResource->IsRealTime());
return new MediaDecoderStateMachine(this,
new RtspOmxReader(this),
mResource->IsRealTime());
}
} // namespace mozilla