Bug 231555 - Internals.grabNextMediaStreamTrackFrame doesn't always convert to RGBA
Summary: Internals.grabNextMediaStreamTrackFrame doesn't always convert to RGBA
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-10-11 21:34 PDT by Cameron McCormack (:heycam)
Modified: 2021-10-18 21:35 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cameron McCormack (:heycam) 2021-10-11 21:34:51 PDT
I tried using Internals.grabNextMediaStreamTrackFrame for a test.  It relies on MediaSample::getRGBAImageData.  MediaSampleAVFObjC::getRGBAImageData does try to convert the sample's underlying CVPixelBuffer to RGBA, but it doesn't seem to work, at least for the case I was trying.  When the frame was using a YUV420 pixel format, the PixelBufferConformerCV failed to do a conversion and instead produced a new CVPixelBuffer with the same format.  The result is that in the test, the ImageData object passed to the grabNextMediaStreamTrackFrame Promise callback contained planar YUV data pretending to be RGBA.  I failed to trace into VTPixelBufferConformerCopyConformedPixelBuffer to work out why this wasn't working.
Comment 1 Radar WebKit Bug Importer 2021-10-18 21:35:20 PDT
<rdar://problem/84400615>