Closed Bug 1969603 Opened 11 months ago Closed 10 months ago

Worker passed to RTCRtpScriptTransform never receives video frames from the ReadableStream

Categories

(Core :: WebRTC: Audio/Video, defect)

Firefox 139
defect

Tracking

()

RESOLVED FIXED
142 Branch
Tracking Status
firefox142 --- fixed

People

(Reporter: clement.brisset, Assigned: clement.brisset, NeedInfo)

Details

Attachments

(1 file)

Steps to reproduce:

I am creating webrtc call using insertable streams:

const pc = (this.pc = new RTCPeerConnection({
  bundlePolicy: 'max-bundle',
  sdpSemantics: 'unified-plan',
  encodedInsertableStreams: true,
}));

and then setting a RTCRtpScriptTransform on each of the transceiver like so:

rtcParticipant.transform = new RTCRtpScriptTransform(this.worker, {});

The worker listens to onrtctransform and installs a TransformStream like so:

self.onrtctransform = (event: RTCTransformEvent) => {
  const readable = event.transformer.readable;
  const writable = event.transformer.writable;
  const transformStream = new TransformStream({transform: transformFrame});
  readable.pipeThrough(transformStream).pipeTo(writable);
};

Actual results:

With this setup, when the call start I can see that onrtctransform gets called but transformFrame never receives any video frames

Expected results:

The ReadableStream emits RTCEncodedVideoFramesthat are then passed totransformFrame`

I managed to track down the problem to a recursive deadlock inside FrameTransformerProxy. I'm about to submit a patch for review

If there are any frames in mQueue TransformFrame will be called while
holding mMutex. TransformFrame in turn may call IsVideo back on the
proxy which will try to lock mMutex again

Assignee: nobody → clement.brisset
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

The Bugbug bot thinks this bug should belong to the 'Core::Audio/Video: Playback' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core
Attachment #9491881 - Attachment description: Bug 1969603: Fix recursive deadlock in RTCTrpScriptTransform. r=pehrsons,jib,asuth,emilio,saschanaz → Bug 1969603: Fix recursive deadlock in RTCRtpScriptTransform. r=pehrsons,jib,asuth,emilio,saschanaz

The severity field is not set for this bug.
:jimm, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(jmathies)
Component: Audio/Video: Playback → WebRTC: Audio/Video
Flags: needinfo?(jmathies)

Hey Byron, can we land this at this point? Jib mentioned in the standup it might be good if we had a test.

Flags: needinfo?(docfaraday)
Flags: needinfo?(clement.brisset)

I think it is ready to land.

Flags: needinfo?(docfaraday)

There is an r+ patch which didn't land and no activity in this bug for 2 weeks.
:clement.brisset, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.

Flags: needinfo?(docfaraday)
Flags: needinfo?(clement.brisset)

Hey Jim, my apologies I did not see the flag for info in my inbox.
What additional information would you like me to provide?

Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 142 Branch
QA Whiteboard: [qa-triage-done-c143/b142]
Flags: needinfo?(docfaraday)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: