Chaining connect_pad_added in gstreamer-rs

Sebastian Dröge sebastian at centricular.com
Tue Apr 4 07:52:40 UTC 2023


On Mon, 2023-04-03 at 17:38 -0700, Guru Govindan via gstreamer-devel
wrote:
> [...]
> 
> For some reason the I receive the callback for the rtspsrc
> `connect_pad_added`, but I dont receive the callback that I connect
> the audio channel with.
> Am I missing something?
> 
> I appreciate any help with this.
> Here is a code snippet.
> 
> 
> let decoder = ElementFactory::make("decodebin", None).unwrap();
> pipeline.add(&decoder).unwrap();
> 
> src_pad.link(&decoder.static_pad("sink").unwrap()).unwrap();
> log::info!("linked rtspsrc.audio->decoder.sink!!");
> 
> let pipeline_weak = pipeline.downgrade();
> 
> decoder.connect_pad_added(move |src, pad| {
> log::info!("recieved connect_pad added signal!!");
> if pad.direction() == gst::PadDirection::Src {
> // received the src pad for the decoder!!
> log::info!("GUGURURURU received decoder pad from src!!!");
> }
> });

At this point you'll also have to change the state of the decodebin.
That doesn't happen automatically as bin state changes only propagate
to the children that are already existing at the time of the state
change.
The easiest would be to call decoder.sync_state_with_parent() here.

-- 
Sebastian Dröge, Centricular Ltd · https://www.centricular.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20230404/73454b72/attachment-0001.htm>


More information about the gstreamer-devel mailing list