Bug 228759

Summary: [GPUP] Test WebKit2.CrashGPUProcessAfterApplyingConstraints fails when Media in GPU Process is enabled
Product: WebKit Reporter: Peng Liu <peng.liu6>
Component: MediaAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: eric.carlson, ews-watchlist, ggaren, glenn, hta, jer.noble, philipj, pnormand, sergio, tommyw, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=228589
https://bugs.webkit.org/show_bug.cgi?id=228941
Attachments:
Description Flags
Patch none

Description Peng Liu 2021-08-03 15:47:48 PDT
/Volumes/Data/webkit/OpenSource/Tools/TestWebKitAPI/Tests/WebKit/GetUserMedia.mm:82
Expected equality of these values:
  @"PASS"
    Which is: "PASS"
  [message body]
    Which is: "FAIL checkConstraints, width is not 320 but 640"

worker/0 TestWebKitAPI.WebKit2.CrashGPUProcessAfterApplyingConstraints Failed
Comment 1 Radar WebKit Bug Importer 2021-08-04 13:09:24 PDT
<rdar://problem/81529641>
Comment 2 youenn fablet 2021-08-06 02:51:46 PDT
Created attachment 435060 [details]
Patch
Comment 3 youenn fablet 2021-08-06 02:52:44 PDT
@Phil, is reverting this change breaking GStreamer backend?
How about if GStreamerVideoCaptureSource is wrapped around a RealtimeVideoSource?
Comment 4 youenn fablet 2021-08-06 05:44:03 PDT
Comment on attachment 435060 [details]
Patch

Mac-wk2 debug error is unrelated
Comment 5 youenn fablet 2021-08-06 05:45:17 PDT
@Eric, it seems https://bugs.webkit.org/show_bug.cgi?id=228795 did not fix the audio shared unit assert.
Comment 6 Geoffrey Garen 2021-08-06 09:39:06 PDT
Comment on attachment 435060 [details]
Patch

r=me
Comment 7 youenn fablet 2021-08-06 11:58:58 PDT
Comment on attachment 435060 [details]
Patch

Landing fix since it removes the regression.
@Philn, let me know if you need further help for GStreamer layer
Comment 8 EWS 2021-08-06 12:06:22 PDT
Committed r280732 (240319@main): <https://commits.webkit.org/240319@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 435060 [details].
Comment 9 Philippe Normand 2021-08-16 04:10:38 PDT
(In reply to youenn fablet from comment #7)
> Comment on attachment 435060 [details]
> Patch
> 
> Landing fix since it removes the regression.
> @Philn, let me know if you need further help for GStreamer layer

Maybe it fixed your regression but it introduced another one in WPE/GTK:
https://bugs.webkit.org/show_bug.cgi?id=228941

I think I'll have to add a ifdef there, I don´t see how else to fix this, the mock sources of Cocoa and GStreamer ports differ regarding constraints validation.
Comment 10 youenn fablet 2021-08-16 04:30:47 PDT
(In reply to Philippe Normand from comment #9)
> (In reply to youenn fablet from comment #7)
> > Comment on attachment 435060 [details]
> > Patch
> > 
> > Landing fix since it removes the regression.
> > @Philn, let me know if you need further help for GStreamer layer
> 
> Maybe it fixed your regression but it introduced another one in WPE/GTK:
> https://bugs.webkit.org/show_bug.cgi?id=228941
> 
> I think I'll have to add a ifdef there, I don´t see how else to fix this,
> the mock sources of Cocoa and GStreamer ports differ regarding constraints
> validation.

Could you try updating GStreamer to wrap GStreamerVideoCaptureSource with a RealtimeVideoSource?
That is how it is used by other classes like AVVideoCaptureSource. Ideally RealtimeVideoCaptureSource should not be a RealtimeMediaSource, but I haven't refactored the code to do so.
Comment 11 Philippe Normand 2021-08-16 04:41:58 PDT
(In reply to youenn fablet from comment #10)
> (In reply to Philippe Normand from comment #9)
> > (In reply to youenn fablet from comment #7)
> > > Comment on attachment 435060 [details]
> > > Patch
> > > 
> > > Landing fix since it removes the regression.
> > > @Philn, let me know if you need further help for GStreamer layer
> > 
> > Maybe it fixed your regression but it introduced another one in WPE/GTK:
> > https://bugs.webkit.org/show_bug.cgi?id=228941
> > 
> > I think I'll have to add a ifdef there, I don´t see how else to fix this,
> > the mock sources of Cocoa and GStreamer ports differ regarding constraints
> > validation.
> 
> Could you try updating GStreamer to wrap GStreamerVideoCaptureSource with a
> RealtimeVideoSource?

I tried already, didn't change anything :(