207
edits
Line 1: | Line 1: | ||
=Overview= | =Overview= | ||
== Background == | |||
Suspending video element's video decoder, when the video element is in background tabs or is invisible even in the foreground tab, is a Firefox feature that reduces CPU/GPU & memory usage. | Suspending video element's video decoder, when the video element is in background tabs or is invisible even in the foreground tab, is a Firefox feature that reduces CPU/GPU & memory usage. | ||
The mechanism is that, when a video element is invisible, we replace its original video decoder with '''blank video decoder''' which only produces white frames with right resolution and right time information. The original video decoder is released and the black video decoder is light so that we reduce CPU/GPU & memory usage. | The mechanism is that, when a video element is invisible, we replace its original video decoder with '''blank video decoder''' which only produces white frames with right resolution and right time information. The original video decoder is released and the black video decoder is light so that we reduce CPU/GPU & memory usage. | ||
== Drawback == | |||
The drawback is that, while the suspended-video-element is switched back to be visible again, we should resume its original video decoder. The resuming operation must be asynchronous and might be time-consuming which depends on the resolution of the video file and whether it contains audio tracks or not. | The drawback is that, while the suspended-video-element is switched back to be visible again, we should resume its original video decoder. The resuming operation must be asynchronous and might be time-consuming which depends on the resolution of the video file and whether it contains audio tracks or not. | ||
In the prototype (Phase 0), we have enabled this feature on the Firefox Nightly channel for any video element. We also add telemetry to collect needed information, especially on the resuming time. | == Project stage == | ||
=== Phase0 === | |||
In the prototype (Phase 0), we have enabled this feature on the Firefox Nightly channel for any video element. We also add telemetry to collect needed information, especially on the resuming time. | |||
=== Phase1 === | |||
In Phase1, we are going to enable this feature on the Firefox Release channel for videos that is able to be resumed quickly and the criteria is '''1) videos without audio track''' or '''2) videos with both audio and video tracks but with low resolution (480P for now)'''. | |||
=== Phase2 === | |||
In the future (Phase 2), our goal is to enable this feature on all videos without observable latency while resuming. | |||
== Working flow == | |||
The following is a step-by-step description of suspending decoder working flow. | The following is a step-by-step description of suspending decoder working flow. | ||
# At the very beginning of the decoding framework, the raw media data is sent to demuxer. | # At the very beginning of the decoding framework, the raw media data is sent to demuxer. |
edits