Bug 210858

Summary: getDisplayMedia is not respecting aspect ratio with max constraints
Product: WebKit Reporter: youenn fablet <youennf>
Component: WebRTCAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: aakash_jain, ap, eric.carlson, ews-watchlist, glenn, hta, jer.noble, philipj, sergio, tommyw, webkit-bot-watchers-bugzilla, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch for landing
none
Patch none

Description youenn fablet 2020-04-22 08:41:50 PDT
getDisplayMedia is not respecting aspect ratio with max constraints
Comment 1 youenn fablet 2020-04-22 09:35:30 PDT
Created attachment 397209 [details]
Patch
Comment 2 youenn fablet 2020-04-22 09:36:24 PDT
<rdar://problem/61405434>
Comment 3 youenn fablet 2020-04-22 09:39:43 PDT
Created attachment 397210 [details]
Patch
Comment 4 youenn fablet 2020-04-22 10:05:30 PDT
Created attachment 397214 [details]
Patch
Comment 5 youenn fablet 2020-04-22 10:15:42 PDT
Created attachment 397215 [details]
Patch
Comment 6 youenn fablet 2020-04-22 10:34:43 PDT
Created attachment 397221 [details]
Patch
Comment 7 Eric Carlson 2020-04-22 10:46:42 PDT
Comment on attachment 397221 [details]
Patch

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

> Source/WebCore/platform/mediastream/mac/ScreenDisplayCapturerMac.mm:56
> +        RELEASE_LOG(Media, "CGGetActiveDisplayList() returned error %d when trying to get display count", static_cast<int>(err));

This isn't new, but other logging uses the WebRTC channel. If you made this a member function it could use ERROR_LOG_IF.

> Source/WebCore/platform/mediastream/mac/ScreenDisplayCapturerMac.mm:203
> +    return DisplayCaptureSourceCocoa::DisplayFrameType { RetainPtr<IOSurfaceRef> { m_currentFrame.ioSurface() } };

This isn't new, but shouldn't we have a lock around access to m_currentFrame since it is changed on another thread?
Comment 8 youenn fablet 2020-04-22 12:36:15 PDT
Created attachment 397237 [details]
Patch
Comment 9 youenn fablet 2020-04-23 00:55:22 PDT
Created attachment 397325 [details]
Patch for landing
Comment 10 EWS 2020-04-23 01:59:35 PDT
Committed r260561: <https://trac.webkit.org/changeset/260561>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 397325 [details].
Comment 11 Aakash Jain 2020-04-23 18:30:17 PDT
Newly added layout test fast/mediastream/getDisplayMedia-max-constraints.html seems to be failing consistently and slowing down ios-wk2 EWS. This issue was also indicated by red ios-wk2 ews bubble.
Comment 12 youenn fablet 2020-04-24 00:48:31 PDT
(In reply to Aakash Jain from comment #11)
> Newly added layout test
> fast/mediastream/getDisplayMedia-max-constraints.html seems to be failing
> consistently and slowing down ios-wk2 EWS. This issue was also indicated by
> red ios-wk2 ews bubble.

They should have been skipped on iOS
Comment 13 youenn fablet 2020-04-24 00:51:49 PDT
Reopening to attach new patch.
Comment 14 youenn fablet 2020-04-24 00:51:52 PDT
Created attachment 397434 [details]
Patch
Comment 15 EWS 2020-04-24 03:36:00 PDT
Committed r260638: <https://trac.webkit.org/changeset/260638>

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