mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 1194624: [MSE] P2. Enable NextFrameBufferedStatus() for MediaSourceDecoder. r=jwwang
We require a slightly variation on the default implementation as mediasource allows for gaps of up to 125ms between samples and often videos do not start with a time of 0.
This commit is contained in:
parent
b43e4839aa
commit
8e5e1f7311
@ -250,6 +250,21 @@ MediaSourceDecoder::GetDuration()
|
||||
return ExplicitDuration();
|
||||
}
|
||||
|
||||
MediaDecoderOwner::NextFrameStatus
|
||||
MediaSourceDecoder::NextFrameBufferedStatus()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
// Next frame hasn't been decoded yet.
|
||||
// Use the buffered range to consider if we have the next frame available.
|
||||
TimeUnit currentPosition = TimeUnit::FromMicroseconds(CurrentPosition());
|
||||
TimeInterval interval(currentPosition,
|
||||
currentPosition + media::TimeUnit::FromMicroseconds(DEFAULT_NEXT_FRAME_AVAILABLE_BUFFERED),
|
||||
MediaSourceDemuxer::EOS_FUZZ);
|
||||
return GetBuffered().Contains(interval)
|
||||
? MediaDecoderOwner::NEXT_FRAME_AVAILABLE
|
||||
: MediaDecoderOwner::NEXT_FRAME_UNAVAILABLE;
|
||||
}
|
||||
|
||||
#undef MSE_DEBUG
|
||||
#undef MSE_DEBUGV
|
||||
|
||||
|
@ -77,6 +77,8 @@ public:
|
||||
|
||||
void AddSizeOfResources(ResourceSizes* aSizes) override;
|
||||
|
||||
MediaDecoderOwner::NextFrameStatus NextFrameBufferedStatus() override;
|
||||
|
||||
private:
|
||||
void DoSetMediaSourceDuration(double aDuration);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user