Bug 184281 - RealtimeOutgoingVideoSourceMac should pass a ObjCFrameBuffer buffer
Summary: RealtimeOutgoingVideoSourceMac should pass a ObjCFrameBuffer buffer
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-04-03 16:01 PDT by youenn fablet
Modified: 2018-04-04 11:29 PDT (History)
6 users (show)

See Also:


Attachments
Patch (7.13 KB, patch)
2018-04-03 16:11 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (8.08 KB, patch)
2018-04-03 16:29 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2018-04-03 16:01:15 PDT
RealtimeOutgoingVideoSourceMac should pass a ObjCFrameBuffer buffer
Comment 1 youenn fablet 2018-04-03 16:04:28 PDT
<rdar://problem/39153262>
Comment 2 youenn fablet 2018-04-03 16:11:08 PDT
Created attachment 337124 [details]
Patch
Comment 3 youenn fablet 2018-04-03 16:29:19 PDT
Created attachment 337129 [details]
Patch
Comment 4 youenn fablet 2018-04-03 16:30:44 PDT
A follow-up should make getUserMedia mock produce kCVPixelFormatType_420YpCbCr8Planar
That way, we would catch this issue in bots.
And we can continue covering ARGB cases with captureCanvas.
Comment 5 WebKit Commit Bot 2018-04-03 17:44:29 PDT
Comment on attachment 337129 [details]
Patch

Clearing flags on attachment: 337129

Committed r230227: <https://trac.webkit.org/changeset/230227>
Comment 6 WebKit Commit Bot 2018-04-03 17:44:30 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 youenn fablet 2018-04-04 08:40:14 PDT
(In reply to youenn fablet from comment #4)
> A follow-up should make getUserMedia mock produce
> kCVPixelFormatType_420YpCbCr8Planar
> That way, we would catch this issue in bots.
> And we can continue covering ARGB cases with captureCanvas.

Filed bug 184304 as a follow-up
Comment 8 Jeremy Jones 2018-04-04 11:29:09 PDT
Comment on attachment 337129 [details]
Patch

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

> Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitUtilities.mm:123
> +    return new rtc::RefCountedObject<webrtc::ObjCFrameBuffer>(frameBuffer);

As-is, ObjCFrameBuffer() has semantics like adoptNS, but is not annotated as such. This will cause problems if arc is enabled.
The parameter to ObjCFrameBuffer() should be annotated with NS_RELEASES_ARGUMENT.

The other option is to release or autorelease frameBuffer here, and retain it in ObjCFrameBuffer().

> Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/Video/objc_frame_buffer.mm:51
>      : frame_buffer_(frame_buffer), width_(frame_buffer.width), height_(frame_buffer.height) {}

This should either add the annotation NS_RELEASES_ARGUMENT to frame_buffer parameter, or [frame_buffer retain] in the body.