зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1511235 - part1 : suspend video decoding for video whose visibility state is UNTRACK. r=jya
If video has not been within the potential visible range (which is larger than viewport) yet, its visibility state won't be updated and would stay in 'UNTRACK'. As those kinds of video are still invisible to users, we don't need to decode any video frames, we can suspend their video decoding until they're going to be visible. Differential Revision: https://phabricator.services.mozilla.com/D13804 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
dd8abd37d5
Коммит
7b4432b505
|
@ -967,11 +967,13 @@ void MediaDecoder::UpdateVideoDecodeMode() {
|
|||
return;
|
||||
}
|
||||
|
||||
// If an element is in-tree with UNTRACKED visibility, the visibility is
|
||||
// incomplete and don't update the video decode mode.
|
||||
// If the element is in-tree with UNTRACKED visibility, that means the element
|
||||
// is not close enough to the viewport so we have not start to update its
|
||||
// visibility. In this case, it's equals to invisible.
|
||||
if (mIsElementInTree && mElementVisibility == Visibility::UNTRACKED) {
|
||||
LOG("UpdateVideoDecodeMode(), early return because we have incomplete "
|
||||
"visibility states.");
|
||||
LOG("UpdateVideoDecodeMode(), set Suspend because element hasn't be "
|
||||
"updated visibility state.");
|
||||
mDecoderStateMachine->SetVideoDecodeMode(VideoDecodeMode::Suspend);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче