Bug 237421 - LibWebRTCCodecs::setEncodeRates should send LibWebRTCCodecsProxy::SetEncodeRates only when the encoder is live
Summary: LibWebRTCCodecs::setEncodeRates should send LibWebRTCCodecsProxy::SetEncodeRa...
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: 2022-03-03 05:02 PST by youenn fablet
Modified: 2022-03-04 05:24 PST (History)
3 users (show)

See Also:


Attachments
Patch (3.63 KB, patch)
2022-03-03 05:06 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (3.78 KB, patch)
2022-03-04 00:27 PST, 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 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>