Mobile/Firefox for Android/shutdown decoder: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 45: Line 45:
<bugzilla>
<bugzilla>
     {
     {
         "id":["1345768", "1345403", "1309492", "1346120", "1346498", "1346116", "1309494", "1346705", "1345034", "1345339", "1344357", "1345179"],
         "id":["1345768", "1345403", "1309492", "1346120", "1346498", "1346116", "1309494", "1346705", "1345034", "1345339","1345179"],
         "include_fields": "id, priority, summary, status, resolution, assigned_to, last_change_time",
         "include_fields": "id, priority, summary, status, resolution, assigned_to, last_change_time",
         "order": "bug_id"
         "order": "bug_id"

Revision as of 08:15, 23 March 2017

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.

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.

Trade-off

The trade-off 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.

Working flow

The following is a step-by-step description of suspending decoder working flow.

  1. At the very beginning of the decoding framework, the raw media data is sent to demuxer.
  2. Demuxer helps to separate a combined signal, e.g., a streaming can be separated into audio data and video data by demuxer. After that, audio and video data are sent to audio and video decoder separately.
  3. In data decoding period, audio decoder keeps working as normal because a user may be listening to the music. But, Firefox uses a blank video decoder to replace current video decoder if the video element is invisible.

Fx Shutdown Decoder Architecture v2.png

Overall Project Health

[GREEN]

Target Milestone

Firefox55

Engineer Owner

Tzuhao Kuo [:kaku]

QA Contact

Ioana Chiorean <ioana.chiorean@softvision.ro>
Bogdan Surd, QA [:bogdan] <bogdan.surd@softvision.ro>

MVP Scope-Bug Tracking

  • bug 1293963 -[Meta] Suspend-video-decoder: phase-1 shipping
Full Query
ID Priority Summary Status Resolution Assigned to Last change time
1276556 P3 [META] Tracking enable of background tab video decoder suspend NEW 2022-10-11T18:31:13Z
1294349 -- Telemetry to support background video decoder suspend: Recovery time from video-decode-suspended RESOLVED FIXED Gerald Squelart (he/him) (not at Mozilla since 2022-09-15) 2016-08-25T07:57:28Z
1294656 -- Seek to nearest keyframe when resuming videos with no audio - no audio track RESOLVED FIXED Tzuhao Kuo [:kaku] 2016-09-05T03:51:20Z
1305338 P1 [UX] UX Spec for Shutdown Decoder Phase 1 RESOLVED FIXED Mark Liang(:mark_liang) 2017-03-10T06:42:07Z
1309492 P3 If a video element's video is suspended, make it draw black frames. RESOLVED WONTFIX Tzuhao Kuo [:kaku] 2017-03-30T08:23:32Z
1309494 P3 Use spinning loading UI if resuming video element's video decoder is longer than 250ms. RESOLVED FIXED Tzuhao Kuo [:kaku] 2017-05-17T09:08:05Z
1345403 -- Mark a video element as taint and never suspend it again if it is passed into drawImage() RESOLVED FIXED Tzuhao Kuo [:kaku] 2017-03-30T07:46:19Z
1346116 -- Consider a video element is in tree or not to suspend its video decoder RESOLVED FIXED Tzuhao Kuo [:kaku] 2017-03-14T13:27:37Z
1346120 -- If a video element's video is suspended, keep the last decoded video frame on the screen RESOLVED FIXED Tzuhao Kuo [:kaku] 2017-03-30T09:00:23Z
1346235 P1 Fennec has stopped working while playing videos VERIFIED FIXED John Lin [:jhlin][:jolin] 2020-12-21T18:31:00Z
1348432 P1 Missing audio in YouTube videos that were requested within the same tab. Refreshing page fixes audio. VERIFIED FIXED Tzuhao Kuo [:kaku] 2017-04-27T07:31:42Z
1348864 P1 Black frame displayed on video decoder resume RESOLVED DUPLICATE Tzuhao Kuo [:kaku] 2020-12-21T18:31:00Z
1349456 -- Mark a video element as taint and never suspend it again if it is aptured via mozCaptureStream() RESOLVED FIXED Tzuhao Kuo [:kaku] 2017-03-30T07:46:19Z
1349459 -- Mark a video element as taint and never suspend it again if it is passed into createImageBitmap() VERIFIED FIXED Tzuhao Kuo [:kaku] 2017-04-24T08:10:15Z
1365581 P3 [Shutdown Decoder] OGV video elements are not suspended. RESOLVED INVALID Tzuhao Kuo [:kaku] 2020-12-21T18:31:00Z
1365584 P1 [Shutdown Decoder] On WEBM video element resume the player returns a error RESOLVED DUPLICATE Tzuhao Kuo [:kaku] 2020-12-21T18:31:00Z
1369970 -- [Shutdown Decoder] enable the preference. RESOLVED FIXED Tzuhao Kuo [:kaku] 2017-06-08T14:09:25Z

17 Total; 1 Open (5.88%); 13 Resolved (76.47%); 3 Verified (17.65%);


Full Query
ID Priority Summary Status Resolution Assigned to Last change time
1309492 P3 If a video element's video is suspended, make it draw black frames. RESOLVED WONTFIX Tzuhao Kuo [:kaku] 2017-03-30T08:23:32Z
1309494 P3 Use spinning loading UI if resuming video element's video decoder is longer than 250ms. RESOLVED FIXED Tzuhao Kuo [:kaku] 2017-05-17T09:08:05Z
1345034 -- Label runnables in dom/media/WMFMediaDataDecoder.cpp RESOLVED FIXED Tzuhao Kuo [:kaku] 2017-03-29T06:28:46Z
1345179 -- Crash in OOM | large | mozalloc_abort | mozalloc_handle_oom | moz_xmalloc | mozilla::MakeUnique<T> RESOLVED FIXED Tzuhao Kuo [:kaku] 2017-03-31T12:53:03Z
1345339 -- Label runnables in dom/media/VideoUtils.h RESOLVED FIXED Tzuhao Kuo [:kaku] 2017-03-29T06:32:06Z
1345403 -- Mark a video element as taint and never suspend it again if it is passed into drawImage() RESOLVED FIXED Tzuhao Kuo [:kaku] 2017-03-30T07:46:19Z
1345768 -- Fix build error in H264Converter.h/cpp under unified builds. RESOLVED FIXED Tzuhao Kuo [:kaku] 2017-03-10T06:42:07Z
1346116 -- Consider a video element is in tree or not to suspend its video decoder RESOLVED FIXED Tzuhao Kuo [:kaku] 2017-03-14T13:27:37Z
1346120 -- If a video element's video is suspended, keep the last decoded video frame on the screen RESOLVED FIXED Tzuhao Kuo [:kaku] 2017-03-30T09:00:23Z
1346498 -- Clean up the suspend-video-decoder call path RESOLVED FIXED Tzuhao Kuo [:kaku] 2017-03-15T17:20:45Z
1346705 P3 Enable suspend-video-decoder related mochitests on autophone NEW 2022-10-11T19:05:31Z

11 Total; 1 Open (9.09%); 10 Resolved (90.91%); 0 Verified (0%);


Signoff-Report issued on March21 by Bogdan Surd

Feature testing status: COMPLETED

performed Smoke and Exploratory testing on Fennec Nightly 55.0a1 build on multiple Android versions (from 5.1.1 to 7.0).

Overall feature status after testing: GREEN

One new issues was found during the Nightly 55.0a1 testing related to the "Suspend Video Decoder Elements" feature.

Recommendation from QE: SHIP IT

Based on the test results, I'm signing off this feature for the Aurora merge.

Bugs tracking

Full Query
ID Priority Summary Status Resolution Assigned to Last change time
1346235 P1 Fennec has stopped working while playing videos VERIFIED FIXED John Lin [:jhlin][:jolin] 2020-12-21T18:31:00Z
1348432 P1 Missing audio in YouTube videos that were requested within the same tab. Refreshing page fixes audio. VERIFIED FIXED Tzuhao Kuo [:kaku] 2017-04-27T07:31:42Z
1348864 P1 Black frame displayed on video decoder resume RESOLVED DUPLICATE Tzuhao Kuo [:kaku] 2020-12-21T18:31:00Z

3 Total; 0 Open (0%); 1 Resolved (33.33%); 2 Verified (66.67%);


UX Spec

others

Decoder resuming latency

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 since we don't want to block the main thread and might be time-consuming which depends on the resolution of the video file and whether it contains audio tracks or not.

Currently, we have no way to boost the resuming time, however, we have telemetries for collecting the needed time of different resolutions on different platforms.