mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1091008 - Implement a sensible GetBuffered override for MediaSourceReader using the existing GetBuffered on MediaSource. r=cajbir
This commit is contained in:
parent
2c76301bbe
commit
e1fdd341c3
@ -353,6 +353,7 @@ MediaSource::Detach()
|
||||
void
|
||||
MediaSource::GetBuffered(TimeRanges* aBuffered)
|
||||
{
|
||||
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
|
||||
MOZ_ASSERT(aBuffered->Length() == 0);
|
||||
if (mActiveSourceBuffers->IsEmpty()) {
|
||||
return;
|
||||
|
@ -74,6 +74,11 @@ private:
|
||||
// mMediaSource.
|
||||
dom::MediaSource* mMediaSource;
|
||||
nsRefPtr<MediaSourceReader> mReader;
|
||||
|
||||
// XXXbholley - This is to allow the reader to invoke GetBuffered on
|
||||
// mMediaSource. It goes away in a subsequent patch when that function gets
|
||||
// hoisted into MediaSourceReader.
|
||||
friend class MediaSourceReader;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
@ -446,6 +446,13 @@ MediaSourceReader::Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
MediaSourceReader::GetBuffered(dom::TimeRanges* aBuffered)
|
||||
{
|
||||
static_cast<MediaSourceDecoder*>(mDecoder)->mMediaSource->GetBuffered(aBuffered);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
MediaSourceReader::ReadMetadata(MediaInfo* aInfo, MetadataTags** aTags)
|
||||
{
|
||||
|
@ -77,6 +77,8 @@ public:
|
||||
nsresult Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime,
|
||||
int64_t aCurrentTime) MOZ_OVERRIDE;
|
||||
|
||||
nsresult GetBuffered(dom::TimeRanges* aBuffered) MOZ_OVERRIDE;
|
||||
|
||||
already_AddRefed<SourceBufferDecoder> CreateSubDecoder(const nsACString& aType);
|
||||
|
||||
void AddTrackBuffer(TrackBuffer* aTrackBuffer);
|
||||
|
@ -191,7 +191,6 @@ double
|
||||
TrackBuffer::Buffered(dom::TimeRanges* aRanges)
|
||||
{
|
||||
ReentrantMonitorAutoEnter mon(mParentDecoder->GetReentrantMonitor());
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
double highestEndTime = 0;
|
||||
|
||||
|
@ -43,7 +43,7 @@ public:
|
||||
|
||||
// Returns the highest end time of all of the buffered ranges in the
|
||||
// decoders managed by this TrackBuffer, and returns the union of the
|
||||
// decoders buffered ranges in aRanges.
|
||||
// decoders buffered ranges in aRanges. This may be called on any thread.
|
||||
double Buffered(dom::TimeRanges* aRanges);
|
||||
|
||||
// Mark the current decoder's resource as ended, clear mCurrentDecoder and
|
||||
|
Loading…
Reference in New Issue
Block a user