Gst::QueryDuration issue

Jiergir Ogoerg f35f22fan at gmail.com
Thu Sep 6 21:20:19 PDT 2012


Thanks,
your cast works!

The code I'm talking about which doesn't compile is at the bottom
of this screenshot:
http://f35f22fan.blogspot.com/2012/09/gstreamer.html

As one can see
1) The guy who wrote it calls "parse()" on a Gst::Query object
2) He uses "." to refer to the "parse()" method instead of "->"
So clearly it wouldn't compile, so I didn't even try.

I wish that create() method just returned Glib::RefPtr<Gst::QueryDuration>



On Thu, Sep 6, 2012 at 10:50 PM, José Alburquerque
<jaalburquerque at cox.net>wrote:

> On Thu, 2012-09-06 at 19:14 +0300, Jiergir Ogoerg wrote:
> > Hi,
> > I'm using the C++ backend of gstreamer (0.10)
> >
> > The problem is that Gst::QueryDuration::create(Format format) returns
> > Glib::RefPtr<Gst::Query> instead of Glib::RefPtr<Gst::QueryDuration>
> > which makes it impossible to use the parse() method of the returned
> > object since parse() only exists in Gst::QueryDuration.
>
> The create() methods of the Gst::Query* classes wrap the
> gst_query_new_*() functions and they return a GstQuery so the create()
> methods similarly return a Gst::Query.
> >
> > As a workaround I thought I'd cast the returned value to
> > Glib::RefPtr<Gst::QueryDuration> but the compiler refuses to do so.
>
> The proper way to cast it would be something like:
>
> Glib::RefPtr<Gst::QueryDuration> durQuery =
>       Glib::RefPtr<Gst::QueryDuration>::cast_dynamic(query);
>
> The ogg_player, ogg_player_gtkmm and the media_player_gtkmm examples
> show how this is done when querying the pipeline for the position of the
> stream.
> >
> > Using Ubuntu 12.04 amd64, the documentation (libgstreamermm-0.10-doc)
> > doesn't tell how to do it.
> >
> > However, in Ubuntu 12.10 (yet to be released), the documentation is
> > updated with an example but it doesn't compile because the example
> > calls parse() on a Gst::Query object which doesn't have such a method.
>
> Really?  What example would that be?  The gstreamermm examples should
> compile and work fine with gstreamermm.
> >
> > So how do I create a Gst::QueryDuration object to be able to call
> > parse() to get the duration? Is it a broken C++ bindings design?
> > _______________________________________________
> > gstreamer-devel mailing list
> > gstreamer-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
> --
> José
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20120907/c8af2d0a/attachment-0001.html>


More information about the gstreamer-devel mailing list