Closed Bug 2076099 Opened 1 month ago Closed 1 month ago

[wpt-sync] Sync PR 63006 - [blink] Enable Region Capture on cloned MediaStreamTracks

Categories

(Core :: Audio/Video: MediaStreamGraph, task, P4)

task

Tracking

()

RESOLVED FIXED
159 Branch
Tracking Status
firefox159 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 63006 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/63006
Details from upstream follow.

Johannes Kron <kron@chromium.org> wrote:

[blink] Enable Region Capture on cloned MediaStreamTracks

Enable dynamic sub-capture target tracking and per-track cropping on
cloned MediaStreamTrack instances:

  • Update MediaStreamVideoSource::GetNextCaptureVersion() and
    ApplySubCaptureTarget() to take SubCaptureTargetType and
    MediaStreamVideoTrack* respectively.
  • Add OnTrackCloned()/OnTrackRemoved() hooks and protected Tracks()/
    SetTrackSubCaptureTarget() helpers to MediaStreamVideoSource, so
    subclasses can manage per-track targets without accessing
    VideoTrackAdapter directly.
  • Track sub-capture targets for individual MediaStreamVideoTrack
    instances in MediaStreamVideoCapturerSource.
  • Use the single-target GPU crop path when all active tracks share the
    same crop target.
  • Switch to full-frame capture on GPU when tracks target different
    regions or when uncropped tracks coexist, allowing VideoTrackAdapter
    to crop per-track.
  • Stop delivering GPU-cropped frames to tracks that have no sub-capture
    target. Now that the capturer alternates between the single-target
    GPU crop path and full-frame capture, an untargeted track can observe
    a frame that was physically cropped to another track's target, which
    it must not be given. VideoTrackAdapter treats the presence of
    metadata.region_capture_rect as the signal that such cropping
    occurred.
  • Propagate crop targets to cloned tracks during track cloning.
  • Allow cloned BrowserCaptureMediaStreamTrack instances to invoke
    cropTo() independently while preserving rejection for Element Capture
    (restrictTo) when clones exist, and reject cropTo() while a
    restriction target is active.
  • Add unit tests verifying independent sub-capture on clones.
  • Update Web Platform Tests and browser tests to verify independent
    cropTo() on cloned tracks while ensuring restrictTo() continues to be
    rejected when clones exist. The WPT subtests now stop their tracks so
    that later getDisplayMedia() calls can start.

Bug: 555826257
Change-Id: I7d4028360bac4cd110b011010819fa784164f4f2

Reviewed-on: https://chromium-review.googlesource.com/8344692
WPT-Export-Revision: 08f34cee2a06977332d63b5e83bc94c6c3f733a4

Component: web-platform-tests → Audio/Video: MediaStreamGraph
Product: Testing → Core

CI Results

Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 1 tests and 3 subtests

Status Summary

Firefox

OK : 1
FAIL: 3

Chrome

OK : 1
PASS: 1
FAIL: 2

Safari

OK : 1
FAIL: 3

Links

GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /mediacapture-streams/BrowserCaptureMediaStreamTrack-cropTo.https.html [wpt.fyi]
    • Tests that cropping MediaStreamTrack objects works as expected: FAIL (Chrome: PASS, Safari: FAIL)
    • Tests that cropping cloned MediaStreamTrack objects works independently: FAIL (Chrome: FAIL, Safari: FAIL)
    • Tests that cloning cropped tracks preserves target and allows independent cropTo: FAIL (Chrome: FAIL, Safari: FAIL)
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 159 Branch
See Also: → 2082849
You need to log in before you can comment on or make changes to this bug.