[M155] [Tab Share Protection] Deliver a black frame when capture is paused Original change's description: > [Tab Share Protection] Deliver a black frame when capture is paused > > Pausing a video source pushes one black frame to the consumer so that it > stops showing whatever the source was displaying. The frame was built by > media::VideoFrame::CreateBlackFrame(), which stamps it with a > default-constructed capture version. That compares equal to the track's > initial watermark, so it works right up until something raises the > watermark -- in practice a source change, which bumps > capture_version_source in > MediaStreamVideoCapturerSource::ChangeSourceImpl. From that point > MediaStreamVideoTrack discards every black frame as kOldCaptureVersion > and the consumer keeps rendering the last real frame. A tab paused by > enterprise tab sharing protection therefore kept showing protected > content to the remote peer, but only once the user had switched shared > surfaces at least once, which is why the failure looked intermittent. > * Add VideoTrackAdapter::DeliverBlackFrameOnVideoTaskRunner, which builds > the frame on the video task runner and stamps it with the source's > current capture version and a timestamp that continues the source's > timeline. The advance is deliberately past kMaxTimeBetweenFrames: a > merely monotonic delta is discarded as > kResolutionAdapterFrameRateIsHigherThanRequested whenever the source > has a max frame rate, which is the norm for screen share. > * In MediaStreamVideoSource::StopForRestart, post the frame size and the > capture version to that method instead of a pre-built frame. > * In UserMediaProcessor::OnDeviceRequestStateChange, bail out unless the > source is a video source. The browser sends this notification once per > device sharing the DesktopMediaID, so with tab audio it also arrives > for the audio source, and a static_cast of a non-null pointer is never > null, so the existing null check could not catch it. Also skip the > restart when the source has no current format. > * Add VideoTrackAdapterFixtureTest.BlackFrameIsDeliveredAndStamped and > MediaStreamVideoSourceTest.StopForRestartDeliversBlackFrameToSink. > > TAG=agy > CONV=71d2c3c2-20a2-42dd-a7df-c2e37f4bf62f > > Bug: 563063637 > Change-Id: I56f7017860eb525b6b986b10dcfb0f0a36a686e2 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8414448 > Auto-Submit: Nasser Al-shawwa <alshawwa@chromium.org> > Reviewed-by: Guido Urdaneta <guidou@chromium.org> > Commit-Queue: Guido Urdaneta <guidou@chromium.org> > Reviewed-by: Jordan Bayles <jophba@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1700650} (cherry picked from commit f1dce53dc3f97d825e6ac95f0b010fafa058c5df) Bug: 563481114,563063637 Change-Id: I56f7017860eb525b6b986b10dcfb0f0a36a686e2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8427543 Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> Auto-Submit: chrome-cherry-picker@chops-service-accounts.iam.gserviceaccount.com <chrome-cherry-picker@chops-service-accounts.iam.gserviceaccount.com> Commit-Queue: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Nasser Al-shawwa <alshawwa@chromium.org> Cr-Commit-Position: refs/branch-heads/8059@{#409} Cr-Branched-From: 199ac2cd7ab289e11c2236bd2cede848781213da-refs/heads/main@{#1697595}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure.
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.