Chaining connect_pad_added in gstreamer-rs

Guru Govindan gurunathan.govindan at gmail.com
Tue Apr 4 14:30:08 UTC 2023


Thanks a lot Sebastian!! You are my savior!
sync_state_with_parent() fixed the problem!

On Tue, Apr 4, 2023 at 12:52 AM Sebastian Dröge <sebastian at centricular.com>
wrote:

> 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/89805ca6/attachment.htm>


More information about the gstreamer-devel mailing list