New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 627140 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 14
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Feature
mus



Sign in to add a comment

Detecting video in the UI service

Project Member Reported by sadrul@chromium.org, Jul 11 2016

Issue description

The UI Service (tus) needs to be able to detect when a client is playing a video. In chromeos, this is currently detected using heuristics (e.g. how often a window is updated) in ash::VideoDetector (https://cs.chromium.org/chromium/src/ash/wm/video_detector.h?sq=package:chromium&dr=CSs&l=40). In mus, it should be possible to do this a bit more cleanly, for example, by including this information in the CompositorFrame submitted from the client to mus.

mus needs to expose this information to clients, so that, for example, ash can notify the power-manager when a video is playing (https://cs.chromium.org/chromium/src/ash/system/chromeos/power/video_activity_notifier.cc?sq=package:chromium&dr=CSs&rcl=1468235750&l=30).
 

Comment 1 by derat@chromium.org, Jul 11 2016

I'm currently reworking the existing code for  issue 590311 , by the way.

Comment 2 by sadrul@chromium.org, Jul 11 2016

Yep. This issue is about detecting in mus whether a client is playing video. Since mus has more information available to it about the content of the windows, the hope is that it can use a more reliable mechanism for detecting a video. For example, instead of [or, in addition to] using a heuristic to determine whether a video is playing (which can fail with continuous scrolling, for example), we can inspect the contents of compositor frames the client submits. (e.g. https://codereview.chromium.org/2140783002)

Once mus detects video, it will need to notify the clients (ash, for example). We will likely use the same criteria as  issue 590311  for this notification (i.e. when to notify the client, how often etc.). Does that make sense?

Comment 3 by derat@chromium.org, Jul 11 2016

Sure, makes sense. One thing to keep in mind is that the detection code was originally added in the pre-<video> days to detect Flash video. Will mus need to fall back to something closer to the current heuristics to continue to detect that? If we only needed to detect HTML5 video, I think that that's already not too difficult -- PowerSaveBlocker objects are currently created to keep the screen on, for example.

Comment 4 by sadrul@chromium.org, Jul 13 2016

Cc: jamescook@chromium.org sky@chromium.org
We may need to fall back to using similar heuristics for flash videos, yeah. But I am going to look to see if that can also be annotated into the submitted compositor frame for plugins.
Project Member

Comment 5 by bugdroid1@chromium.org, Jul 30 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/32d1097c5645c0e1b0f49f93502d4f4701b67cec

commit 32d1097c5645c0e1b0f49f93502d4f4701b67cec
Author: sadrul <sadrul@chromium.org>
Date: Sat Jul 30 05:26:21 2016

services/ui: Detect when a video is playing.

Compositor frames submitted by mus clients include a flag to indicate whether the
client is playing a video or not. This information is plumbed through from
cc::Layer to cc::LayerImpl to cc::CompositorFrame[Metadata].

BUG= 627140 
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel

Review-Url: https://codereview.chromium.org/2140783002
Cr-Commit-Position: refs/heads/master@{#408864}

[modify] https://crrev.com/32d1097c5645c0e1b0f49f93502d4f4701b67cec/cc/ipc/cc_param_traits_macros.h
[modify] https://crrev.com/32d1097c5645c0e1b0f49f93502d4f4701b67cec/cc/ipc/compositor_frame_metadata.mojom
[modify] https://crrev.com/32d1097c5645c0e1b0f49f93502d4f4701b67cec/cc/ipc/compositor_frame_metadata_struct_traits.cc
[modify] https://crrev.com/32d1097c5645c0e1b0f49f93502d4f4701b67cec/cc/ipc/compositor_frame_metadata_struct_traits.h
[modify] https://crrev.com/32d1097c5645c0e1b0f49f93502d4f4701b67cec/cc/ipc/struct_traits_unittest.cc
[modify] https://crrev.com/32d1097c5645c0e1b0f49f93502d4f4701b67cec/cc/layers/layer.cc
[modify] https://crrev.com/32d1097c5645c0e1b0f49f93502d4f4701b67cec/cc/layers/layer.h
[modify] https://crrev.com/32d1097c5645c0e1b0f49f93502d4f4701b67cec/cc/layers/layer_impl.cc
[modify] https://crrev.com/32d1097c5645c0e1b0f49f93502d4f4701b67cec/cc/layers/layer_impl.h
[modify] https://crrev.com/32d1097c5645c0e1b0f49f93502d4f4701b67cec/cc/layers/layer_unittest.cc
[modify] https://crrev.com/32d1097c5645c0e1b0f49f93502d4f4701b67cec/cc/layers/video_layer.cc
[modify] https://crrev.com/32d1097c5645c0e1b0f49f93502d4f4701b67cec/cc/layers/video_layer_impl.cc
[modify] https://crrev.com/32d1097c5645c0e1b0f49f93502d4f4701b67cec/cc/output/compositor_frame_metadata.h
[modify] https://crrev.com/32d1097c5645c0e1b0f49f93502d4f4701b67cec/cc/proto/layer.proto
[modify] https://crrev.com/32d1097c5645c0e1b0f49f93502d4f4701b67cec/cc/surfaces/surface_aggregator.cc
[modify] https://crrev.com/32d1097c5645c0e1b0f49f93502d4f4701b67cec/cc/surfaces/surface_aggregator.h
[modify] https://crrev.com/32d1097c5645c0e1b0f49f93502d4f4701b67cec/cc/trees/layer_tree_host_impl.cc
[modify] https://crrev.com/32d1097c5645c0e1b0f49f93502d4f4701b67cec/cc/trees/layer_tree_host_impl.h
[modify] https://crrev.com/32d1097c5645c0e1b0f49f93502d4f4701b67cec/cc/trees/layer_tree_host_impl_unittest.cc
[modify] https://crrev.com/32d1097c5645c0e1b0f49f93502d4f4701b67cec/content/renderer/pepper/pepper_plugin_instance_impl.cc
[modify] https://crrev.com/32d1097c5645c0e1b0f49f93502d4f4701b67cec/services/ui/ws/frame_generator.cc
[modify] https://crrev.com/32d1097c5645c0e1b0f49f93502d4f4701b67cec/services/ui/ws/frame_generator.h
[modify] https://crrev.com/32d1097c5645c0e1b0f49f93502d4f4701b67cec/services/ui/ws/frame_generator_unittest.cc
[modify] https://crrev.com/32d1097c5645c0e1b0f49f93502d4f4701b67cec/services/ui/ws/server_window_surface.cc
[modify] https://crrev.com/32d1097c5645c0e1b0f49f93502d4f4701b67cec/services/ui/ws/server_window_surface.h

Components: Internals>MUS
Labels: Proj-Mustash
Note that this code has been removed and needs to be revisited.

Comment 8 by sadrul@chromium.org, Jan 25 2017

I think the mus code (i.e. code in services/ui/ws) has been removed. The code in cc should still be functional, and it should be possible to use that from the display-compositor to detect when video is playing. It will then need to notify the WS about it too.
Components: Internals>Compositing
Labels: Type-Feature
Cc: weiliangc@chromium.org
Cc: varkha@chromium.org
Components: -Internals>MUS
Components: -MUS Internals>Services>WindowService
Labels: -Proj-Mustash Proj-Mash-MultiProcess Proj-Mash-SingleProcess
Bug scrub: Is this still needed for mash? If so, SingleProcessMash vs. Multiprocess mash?

Status: Fixed (was: Started)
This is done.

Sign in to add a comment