[gst-devel] How can I know that playbin2 has created rtspsrc element, as soon as possible?

wl2776 wl2776 at gmail.com
Wed Sep 8 12:56:57 CEST 2010



Tim-Philipp Müller-2 wrote:
> 
>> Till now I was experimenting with the element-added signal.
>> Just for the information - how can I catch all "element-added" signals
>> non-depending of their source?
> 
> What's wrong with g_signal_connect (obj, "element-added", ...) ?
> 
> Not sure if there's a good way to get element-added signals from
> grand-children though (maybe deep-notify::parent works, maybe not).
> 

That was exactly that, rtspsrc is added to the bin somewhere in playbin2's
depth.

That said, I can only do 
  g_signal_connect(m_player,"element-added",...)
where m_player is my instance of the playbin2.

And all I'll receive is a notification, that the playbin2 has added
uridecodebin, playsink and something else.
I tried checking elements' names in the signal-added callback and connect
this callback to them, but it didn't work for some reason.

BTW, is it correct? Can I connect the callback to the signals from the same
callback?

Is the code correct?
static void element_added(GstBin *bin, GstElement *element, gpointer
user_data)
{
  ....
  if( < we have proper element >){
    g_signal_connect(element,"element-added",GCallback(element_added),NULL);
  }
  ...
}

....
g_signal_connect(m_player,"element-added",GCallback(element_added),NULL);
...



Tim-Philipp Müller-2 wrote:
> 
>> I've found g_signal_add_emission_hook() function. 
>> It requires signal-ID and signal-details Quark.
>> I could get them from g_signal_parse_name, but its second parameter is 
>> "GType itype - The interface/instance type that introduced "signal-name".
>> So, how should I fill this parameter? 
> 
> Not sure what you are asking here, or what the context is.
> 
This is a question about GLib and GObject, not GStreamer.
I had problems making a call to g_signal_parse_name(), because didn't know
how to fill the second parameter.
Not sure it is needed now, after I know about "notify::source".
Just for information.
-- 
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/How-can-I-know-that-playbin2-has-created-rtspsrc-element-as-soon-as-possible-tp2530906p2531112.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.




More information about the gstreamer-devel mailing list