Bug 1109437 - Generalize GetBufferingWait to UseBufferingHeuristics. r=cpearce

This commit is contained in:
Bobby Holley 2014-12-22 00:20:30 -08:00
Родитель ffd128ab61
Коммит 05224076bc
3 изменённых файлов: 11 добавлений и 10 удалений

Просмотреть файл

@ -175,10 +175,11 @@ public:
virtual int64_t ComputeStartTime(const VideoData* aVideo, const AudioData* aAudio);
// Wait this number of seconds when buffering, then leave and play
// as best as we can if the required amount of data hasn't been
// retrieved.
virtual uint32_t GetBufferingWait() { return 30; }
// The MediaDecoderStateMachine uses various heuristics that assume that
// raw media data is arriving sequentially from a network channel. This
// makes sense in the <video src="foo"> case, but not for more advanced use
// cases like MSE.
virtual bool UseBufferingHeuristics() { return true; }
// Returns the number of bytes of memory allocated by structures/frames in
// the video queue.

Просмотреть файл

@ -229,7 +229,7 @@ MediaDecoderStateMachine::MediaDecoderStateMachine(MediaDecoder* aDecoder,
mAmpleVideoFrames =
std::max<uint32_t>(Preferences::GetUint("media.video-queue.default-size", 10), 3);
mBufferingWait = mScheduler->IsRealTime() ? 0 : mReader->GetBufferingWait();
mBufferingWait = mScheduler->IsRealTime() ? 0 : 30;
mLowDataThresholdUsecs = mScheduler->IsRealTime() ? 0 : LOW_DATA_THRESHOLD_USECS;
mVideoPrerollFrames = mScheduler->IsRealTime() ? 0 : mAmpleVideoFrames / 2;

Просмотреть файл

@ -78,11 +78,11 @@ public:
// as chrome/blink and assumes that we always start at t=0.
virtual int64_t ComputeStartTime(const VideoData* aVideo, const AudioData* aAudio) MOZ_OVERRIDE { return 0; }
// Buffering waits (in which we decline to present decoded frames because we
// "don't have enough") don't really make sense for MSE. The delay is
// essentially a streaming heuristic, but JS is supposed to take care of that
// in the MSE world. Avoid injecting inexplicable delays.
virtual uint32_t GetBufferingWait() { return 0; }
// Buffering heuristics don't make sense for MSE, because the arrival of data
// is at least partly controlled by javascript, and javascript does not expect
// us to sit on unplayed data just because it may not be enough to play
// through.
bool UseBufferingHeuristics() MOZ_OVERRIDE { return false; }
bool IsMediaSeekable() { return true; }