Bug 237421

Summary: LibWebRTCCodecs::setEncodeRates should send LibWebRTCCodecsProxy::SetEncodeRates only when the encoder is live
Product: WebKit Reporter: youenn fablet <youennf>
Component: WebRTCAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

Description youenn fablet 2022-03-03 05:02:56 PST
LibWebRTCCodecs::setEncodeRates should send LibWebRTCCodecsProxy::SetEncodeRates only when the encoder is live
Comment 1 youenn fablet 2022-03-03 05:06:58 PST
Created attachment 453722 [details]
Patch
Comment 2 Darin Adler 2022-03-03 10:09:11 PST
Comment on attachment 453722 [details]
Patch

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

> Source/WebKit/WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp:525
> +            auto* encoder = m_encoders.get(encoderIdentifier);

If this is guaranteed non-null, then I suggest putting in a reference, not a pointer. Maybe also add an assertion? Not clear to me why this is strongly guaranteed.
Comment 3 youenn fablet 2022-03-03 11:03:46 PST
(In reply to Darin Adler from comment #2)
> Comment on attachment 453722 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=453722&action=review
> 
> > Source/WebKit/WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp:525
> > +            auto* encoder = m_encoders.get(encoderIdentifier);
> 
> If this is guaranteed non-null, then I suggest putting in a reference, not a
> pointer. Maybe also add an assertion? Not clear to me why this is strongly
> guaranteed.

Will do.
It is guaranteed to be non null as creation/deletion of the pointer is doing the same journey (hop to main-thread then hop to work queue).
I'll update the code to directly use the LibWebRTCCodecs connection instead, which is more efficient anyway.
Comment 4 youenn fablet 2022-03-04 00:27:01 PST
Created attachment 453818 [details]
Patch for landing
Comment 5 EWS 2022-03-04 05:23:19 PST
Committed r290829 (248065@main): <https://commits.webkit.org/248065@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 453818 [details].
Comment 6 Radar WebKit Bug Importer 2022-03-04 05:24:16 PST
<rdar://problem/89809391>