Attaching a few tests, which use canvas.captureStream(), RTCConnectionPeer, and <video> to convert an sRGB canvas to a video, locally. In Safari on Monterey, the colors are not quite right. Debugging showed that the CMSampleBuffers that are provided by the VTDecompressionSession have the VT default guessed color space attachments of Rec.601. I think these should be sRGB, as that's the default for WebRTC streams.
Created attachment 440479 [details]
Created attachment 440480 [details]
Created attachment 440481 [details]
Created attachment 440483 [details]
Created attachment 440539 [details]
Comment on attachment 440539 [details]
Let's add a test if possible by adding an Internals API method to grab the color space of webrtc tracks.
You can look at Internals.observeMediaStreamTrack and related.
As of the test, you can write your own WebRTC test or update an existing one, for instance webrtc/video.html
I wanted to use grabNextMediaStreamTrackFrame() and inspect the converted-to-RGB pixel values, but that doesn't seem to be working when the frame is not already RGB. Filed bug 231555 for that. I'll write a test that relies on canvas.drawImage(video), once bug 229025 lands.
Created attachment 441028 [details]
Patch for landing
Test in bug 231645.
Committed r284082 (242910@main): <https://commits.webkit.org/242910@main>
All reviewed patches have been landed. Closing bug and clearing flags on attachment 441028 [details].