Bug 219148 - Add support for RTCRtpScriptTransform
Summary: Add support for RTCRtpScriptTransform
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-11-19 00:27 PST by youenn fablet
Modified: 2020-11-20 04:26 PST (History)
19 users (show)

See Also:


Attachments
Patch (166.39 KB, patch)
2020-11-19 02:41 PST, youenn fablet
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (171.06 KB, patch)
2020-11-19 02:49 PST, youenn fablet
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (171.41 KB, patch)
2020-11-19 02:51 PST, youenn fablet
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (171.43 KB, patch)
2020-11-19 03:01 PST, youenn fablet
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (171.46 KB, patch)
2020-11-19 03:12 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (171.58 KB, patch)
2020-11-19 04:00 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (171.73 KB, patch)
2020-11-20 00:50 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 2020-11-19 00:27:12 PST
Add support for RTCRtpScriptTransform
Comment 1 youenn fablet 2020-11-19 02:41:18 PST
Created attachment 414553 [details]
Patch
Comment 2 youenn fablet 2020-11-19 02:49:25 PST
Created attachment 414556 [details]
Patch
Comment 3 youenn fablet 2020-11-19 02:51:40 PST
Created attachment 414557 [details]
Patch
Comment 4 youenn fablet 2020-11-19 03:01:54 PST
Created attachment 414559 [details]
Patch
Comment 5 youenn fablet 2020-11-19 03:12:03 PST
Created attachment 414560 [details]
Patch
Comment 6 youenn fablet 2020-11-19 04:00:40 PST
Created attachment 414564 [details]
Patch
Comment 7 Eric Carlson 2020-11-19 13:02:23 PST
Comment on attachment 414564 [details]
Patch

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

> Source/WebCore/Modules/mediastream/RTCRtpScriptTransform.cpp:117
> +        m_backend = makeRef(backend);

You only set `m_backend` if `setupTransformer` fails?

> Source/WebCore/Modules/mediastream/RTCRtpScriptTransformer.cpp:174
> +            auto value = isAudio ? toJS(&globalObject, &globalObject, RTCEncodedAudioFrame::create(WTFMove(frame))) : toJS(&globalObject, &globalObject, RTCEncodedAudioFrame::create(WTFMove(frame)));

Don’t you want to create a Video frame when `isAudio` is false?
Comment 8 youenn fablet 2020-11-20 00:35:26 PST
(In reply to Eric Carlson from comment #7)
> Comment on attachment 414564 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=414564&action=review
> 
> > Source/WebCore/Modules/mediastream/RTCRtpScriptTransform.cpp:117
> > +        m_backend = makeRef(backend);
> 
> You only set `m_backend` if `setupTransformer` fails?

Yes, it means the transformer is not yet there but will be soon.
So we keep a ref to m_backend so that we can call setupTransformer at the time the transformer is hooked to its transform.

> > Source/WebCore/Modules/mediastream/RTCRtpScriptTransformer.cpp:174
> > +            auto value = isAudio ? toJS(&globalObject, &globalObject, RTCEncodedAudioFrame::create(WTFMove(frame))) : toJS(&globalObject, &globalObject, RTCEncodedAudioFrame::create(WTFMove(frame)));
> 
> Don’t you want to create a Video frame when `isAudio` is false?

Good catch, will add a test for it.
Comment 9 youenn fablet 2020-11-20 00:50:38 PST
Created attachment 414659 [details]
Patch for landing
Comment 10 EWS 2020-11-20 04:25:55 PST
Committed r270107: <https://trac.webkit.org/changeset/270107>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 414659 [details].
Comment 11 Radar WebKit Bug Importer 2020-11-20 04:26:16 PST
<rdar://problem/71623266>