versatica / mediasoup

Cutting Edge WebRTC Video Conferencing
https://mediasoup.org
ISC License
6.27k stars 1.13k forks source link

DirectTransport consumer not receiving RTP packets in Rust #1454

Closed sw-vish closed 1 month ago

sw-vish commented 1 month ago

Bug Report

Your environment

Issue description

The .on_rtp callback for a Consumer created from a DirectTransport never gets called.

let direct_transport = self.router
    .create_direct_transport(DirectTransportOptions::default())
    .await
    .unwrap();

let options = ConsumerOptions::new(self.producer_id, self.rtp_capabilities);

let consumer = direct_transport
    .consume(options)
    .await
    .unwrap();

// "on_rtp" never gets logged
consumer.on_rtp(|_| info!("on_rtp")).detach();

self.consumers.push(consumer);

Looking at the source, it looks like the RTP notification has been commented out: https://github.com/versatica/mediasoup/blob/v3/rust/src/router/consumer.rs#L846.

ibc commented 1 month ago

@nazar-pc do you know why that notification is commented in the code?

nazar-pc commented 1 month ago

I think it was simply forgotten during conversion to flatbuffers, I don't think it was intentional

ibc commented 1 month ago

@nazar I give you the honor to uncomment it and become a hero if you wish