Bug 1299415 - Clear ImageContainer cached resources When VideoSink pause playing r=jwwang

This commit is contained in:
Sotaro Ikeda 2016-09-01 01:14:57 -07:00
Родитель 19ec5f9a2a
Коммит 758fb640f4
3 изменённых файлов: 12 добавлений и 0 удалений

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

@ -294,6 +294,12 @@ void VideoFrameContainer::ClearFutureFrames()
}
}
void
VideoFrameContainer::ClearCachedResources()
{
mImageContainer->ClearCachedResources();
}
ImageContainer* VideoFrameContainer::GetImageContainer() {
return mImageContainer;
}

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

@ -73,6 +73,9 @@ public:
// but was actually painted at t+n, this returns n in seconds. Threadsafe.
double GetFrameDelay();
// Clear any resources that are not immediately necessary.
void ClearCachedResources();
// Returns a new frame ID for SetCurrentFrames(). The client must either
// call this on only one thread or provide barriers. Do not use together
// with SetCurrentFrame().

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

@ -145,6 +145,9 @@ VideoSink::SetPlaying(bool aPlaying)
mUpdateScheduler.Reset();
// Since playback is paused, tell compositor to render only current frame.
RenderVideoFrames(1);
if (mContainer) {
mContainer->ClearCachedResources();
}
}
mAudioSink->SetPlaying(aPlaying);