Re: Gst::PlayBin2 signal_get_audio_tags trouble



On Sun, 2009-12-13 at 23:19 -0500, José Alburquerque wrote:
> On Sun, 2009-12-13 at 11:27 +0100, kitone wrote: 
> > Hi,
> > I've some trouble to using the Gst::PlayBin2 element, specially the
> > signals signal_get_*_tags.
> > 
> > With gstreamer (C) we can used g_signal_emit_by_name to received the
> > tags. ex:
> > 
> >  for (i = 0; i < n_audio; i++) {
> >    g_signal_emit_by_name (pipeline, "get-audio-tags", i, &tags);
> >    ...

This is unpleasant. I hope it's not the documented way to use that API.
GTK+, for instance, would have a method that happened to do this in it's
implementation, maybe along with other checks.

But I guess gstreamer plugins rarely have actual API. They are usually
used in C via generic property and signal functions, right? But can't we
add a method in our C++ API?

> > Now, how can I do used the Gst::PlayBin2::signal_get_audio_tags to
> > receive the tags list ? In this case, connect to my own callback is not
> > what I want to do and I don't thing is what we need to do, I'm wrong ?
> 
> No, you're not wrong (I think).  What's wrong was my understanding of
> these signals.  Apparently, these are "action" signals (which I was not
> fully aware of).  From the docs[1], they can be thought of as object
> methods that can be called generically (sort of like how a regular
> method might be used).
> 
> [1]
> http://library.gnome.org/devel/gobject/2.22/gobject-Signals.html#GSignalFlags
> 
> One way to get similar functionality in C++ is to include an equivalent
> method definition in the plug-in source to emit the signal with the
> right parameters and generate the correct return.
> 
> Another way (more general, but would affect all *mm module signals)
> would be to make it possible for the Glib::SignalProxy<> classes to emit
> their corresponding signals.

No, this is generally a bad idea. It's interferring with the internals
of a class.

> The first way (modifying the plug-in sources) is easily achievable by
> modifying the plug-in generation tool in gstreamermm.  The second also
> seems possible but only from having quickly skimmed the
> Glib::SignalProxy<> source code.
> 
> To get this right I know I could work on the first way fairly quickly.
> I can also submit a patch for the second, but that would require
> approval from the glibmm maintainers.
> 
> For now, I guess that using the Gst::PlayBin2's gobj() with the C API
> and the Gst::TagList's specific Glib::wrap() method to wrap the
> resulting GstTagList would be the way to do things until this is
> resolved in an upcoming release.
> 


-- 
murrayc murrayc com
www.murrayc.com
www.openismus.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]