Q: HowTo: Detect video/audio DecodeBin's before linking Pads?

Izzy Softy izzysoft2000 at gmail.com
Tue Mar 20 21:33:28 PDT 2012


hi All,

1st time poster. 2 months since i started. :)
GStreamer looks awesome. ;)

Now... down to the nitty gritty.

Problem:
 - I want to automatically detect if a DecodeBin has Audio and Video.
 - If just Audio, then Tee DecodeBin's Src0 pad to create a VideoSink for
GOOM (or other Visualizers)
   and Tee DecodeBin's Src0 pad for AlsaSink (or whatever)

Tried:
  - g_signal_connect( decoder, "new-decoded-pad", G_CALLBACK(
on_decoder_pad_added ), NULL );
  - on_decoder_pad_added(...) is only aware of One pad at a time. is there
no way to check for audio/video?

Tried:
  - I removed "new-decoded-pad", and instead added this (src follows)
after gst_element_link( src, decoder );

res = gst_element_set_state( pipeline, GST_STATE_PAUSED );
if (res == GST_STATE_CHANGE_FAILURE)
{
g_print("Gstreamer ERROR: could not pause\n");
gst_object_unref(GST_OBJECT (pipeline));
return FALSE;
}

res = gst_element_get_state(pipeline, NULL, NULL, GST_CLOCK_TIME_NONE);
if (res != GST_STATE_CHANGE_SUCCESS)
{
g_print("Gstreamer ERROR: could not complete pause\n");
gst_object_unref(GST_OBJECT (pipeline));
return FALSE;
}

    it = gst_element_iterate_src_pads( decoder );
    while (gst_iterator_next (it, &data) == GST_ITERATOR_OK)
    {
        GstPad *pad = GST_PAD (data);
        ...
        // added a Bin and Queues etc...,  works fine when done
in "new-decoded-pad" method.
    }

Answer: ????

Any help is Greatly Appreciated, Any!  I accepet PayPay!  :D     No wait...
They deleted that account. :(
hehe

mucho thanks,
Izzy.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20120320/ba61853e/attachment.html>


More information about the gstreamer-devel mailing list