Bug 235838

Summary: [macOS] Expose screen and window capture state to WKWebView
Product: WebKit Reporter: Eric Carlson <eric.carlson>
Component: WebRTCAssignee: Eric Carlson <eric.carlson>
Status: RESOLVED FIXED    
Severity: Normal CC: berto, cdumez, cgarcia, esprehn+autocc, ews-watchlist, glenn, gustavo, hta, jer.noble, kangil.han, philipj, sergio, tommyw, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
ews-feeder: commit-queue-
Patch
youennf: review+
Patch for landing
none
Patch
none
Patch for landing none

Description Eric Carlson 2022-01-28 15:08:20 PST
Expose screen and window capture state to WKWebView
Comment 1 Radar WebKit Bug Importer 2022-01-28 15:41:43 PST
<rdar://problem/88207924>
Comment 2 Eric Carlson 2022-01-28 16:23:18 PST
Created attachment 450287 [details]
Patch
Comment 3 Eric Carlson 2022-01-31 11:52:42 PST
Created attachment 450426 [details]
Patch
Comment 4 EWS Watchlist 2022-01-31 11:54:39 PST
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See https://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 5 Eric Carlson 2022-01-31 13:08:40 PST
Created attachment 450439 [details]
Patch
Comment 6 youenn fablet 2022-01-31 14:15:16 PST
Comment on attachment 450439 [details]
Patch

Probably worth adding a test validating we delay with a timer the start capture/stop capture.
While this is mostly useful for camera, it is good to validate this will work for display as well.

Another question worth exploring. We might add in the future getViewPortMedia which is specific to capturing the self tab.
We probably want a different delegate, but it may be ok to keep the same display states/mutators APIs.
Wdyt?

View in context: https://bugs.webkit.org/attachment.cgi?id=450439&action=review

> Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp:4873
> +    UNUSED_PARAM(isFromDisplayCapture);

FIXME: Remove isFromDisplayCapture?
Comment 7 Eric Carlson 2022-01-31 14:28:32 PST
(In reply to youenn fablet from comment #6)
> Comment on attachment 450439 [details]
> Patch
> 
> Probably worth adding a test validating we delay with a timer the start
> capture/stop capture.
> While this is mostly useful for camera, it is good to validate this will
> work for display as well.
> 
> Another question worth exploring. We might add in the future
> getViewPortMedia which is specific to capturing the self tab.
> We probably want a different delegate, but it may be ok to keep the same
> display states/mutators APIs.
> Wdyt?
> 

Seems reasonable.

> View in context:
> https://bugs.webkit.org/attachment.cgi?id=450439&action=review
> 
> > Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp:4873
> > +    UNUSED_PARAM(isFromDisplayCapture);
> 
> FIXME: Remove isFromDisplayCapture?

Good idea, I'll do that.
Comment 8 Eric Carlson 2022-01-31 14:32:28 PST
Created attachment 450466 [details]
Patch for landing
Comment 9 Eric Carlson 2022-01-31 16:45:07 PST
Created attachment 450473 [details]
Patch
Comment 10 Eric Carlson 2022-02-01 08:56:50 PST
Created attachment 450536 [details]
Patch for landing
Comment 11 EWS 2022-02-01 10:35:31 PST
Committed r288894 (246639@main): <https://commits.webkit.org/246639@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 450536 [details].