Re: why skip overlay when video capture is on.

387 views
Skip to first unread message

Sunny Sachanandani

unread,
Mar 11, 2024, 8:01:43 PMMar 11
to jingge yu, Graphics-dev, Xiaohan Wang (王消寒)
+graphi...@chromium.org for a broader audience

In general DRM video is not going to be compatible with screen/tab capture, but I suspect what we do in such cases is platform dependent. At least on Windows, having a copy output request or video capture, we disable overlays completely: https://source.chromium.org/chromium/chromium/src/+/main:components/viz/service/display/dc_layer_overlay.cc;l=1247

We could change the logic on Windows to avoid skipping overlays for "IsOverlayRequiresForQuad" cases here: https://source.chromium.org/chromium/chromium/src/+/main:components/viz/service/display/dc_layer_overlay.cc;l=574

It's probably better UX to do this since today playing hardware protected video (L1 DRM) when tab capture is enabled will cause the video to turn black both on display and captured frame IIUC and for software protected video we lose the anti-screenshot capability as you observed. With the above change, we would only see black in captured frame for hardware protected video and still maintain the anti-screenshot capability. It's likely not a high priority for us, but we could accept contributions if you'd like to fix this - please reach out on the Chromium Slack in the #gpu-overlayz channel and we can discuss some implementation details.


On Mon, Mar 11, 2024 at 6:02 AM jingge yu <jingg...@gmail.com> wrote:
Hi, Sunny! 
I am a chromium learner. My team implemented a customized browser based on chromium, and added a white screen detection ability which detects whether the page has a white screen by obtaining a thumbnail.
But after adding the ability, we found that DRM protected video can't anti-screenshot. As far as I know, the implementation of the DRM anti-screenshot capability is related to the overlay, and the white screen detection ability will turn on video capture, so overlay will be skipped, which causes DRM protected video won't use overlay. Thus, I can capture the content of the DRM video area. However, capture is not allowed in the DRM area.
So I want to know about why skip overlay when video capture is on, and if I force CompositorFrameSinkSupport::IsVideoCaptureStarted() returns false, what impact will it have?
I really need your help! And thanks very much if  you can help answer my questions!

Sushanth Rajasankar

unread,
Mar 11, 2024, 8:20:11 PMMar 11
to Sunny Sachanandani, jingge yu, Michael Tang, Graphics-dev, Xiaohan Wang (王消寒)

On Windows with Media Foundation based protected content, skipping overlays poses an additional problem - the black frame will persist until the user interacts with the browser or some other event causes display invalidation.

With Media Foundation based playback since the media engine handles frame presentations there is no additional invalidation once the initial video setup quad is passed through the system and Dcomp handles initialized and so the black frames / missing videos persist until the next fortuitous invalidation.

 

I believe @Michael Tang added some logic to continue to promote MF protected videos to overlays during copy output requests. Please add us to your Code review, if you are making changes to overlay promotion for protected videos.

 

From: Sunny Sachanandani <sun...@chromium.org>
Sent: Monday, March 11, 2024 5:01 PM
To: jingge yu <jingg...@gmail.com>
Cc: Graphics-dev <graphi...@chromium.org>; Xiaohan Wang (
王消寒) <xhw...@chromium.org>
Subject: [EXTERNAL] [Graphics-Dev] Re: why skip overlay when video capture is on.

 

You don't often get email from sun...@chromium.org. Learn why this is important

--
To unsubscribe from this group and stop receiving emails from it, send an email to graphics-dev...@chromium.org.

Reply all
Reply to author
Forward
0 new messages