Thanks for your efforts,<br>I submitted the bug here:<br><a href="https://bugzilla.gnome.org/show_bug.cgi?id=683580">https://bugzilla.gnome.org/show_bug.cgi?id=683580</a><br><br><br><div class="gmail_quote">On Fri, Sep 7, 2012 at 3:03 PM, José Alburquerque <span dir="ltr"><<a href="mailto:jaalburquerque@cox.net" target="_blank">jaalburquerque@cox.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Fri, 2012-09-07 at 07:20 +0300, Jiergir Ogoerg wrote:<br>
> Thanks,<br>
> your cast works!<br>
><br>
> The code I'm talking about which doesn't compile is at the bottom<br>
> of this screenshot:<br>
> <a href="http://f35f22fan.blogspot.com/2012/09/gstreamer.html" target="_blank">http://f35f22fan.blogspot.com/2012/09/gstreamer.html</a><br>
><br>
> As one can see<br>
> 1) The guy who wrote it calls "parse()" on a Gst::Query object<br>
> 2) He uses "." to refer to the "parse()" method instead of "->"<br>
> So clearly it wouldn't compile, so I didn't even try.<br>
<br>
</div>Ah, that's a beginner's attempt at a crude C++ translation of the usage<br>
example found in GstQuery's description section.  It was placed in the<br>
Gst::Query class docs as an attempt to also show how the class could be<br>
used.  I guess little thought was put into the need to cast correctly<br>
before using the parse() method as you describe.<br>
<br>
The line which should cast has been fixed in this commit:<br>
<a href="http://git.gnome.org/browse/gstreamermm/commit/?id=a6933d2012fbe626eb110320ab6c4338c583e7bc" target="_blank">http://git.gnome.org/browse/gstreamermm/commit/?id=a6933d2012fbe626eb110320ab6c4338c583e7bc</a><br>
<br>
Please feel free to report any errors you find here:<br>
<a href="https://bugzilla.gnome.org/enter_bug.cgi?product=gstreamermm" target="_blank">https://bugzilla.gnome.org/enter_bug.cgi?product=gstreamermm</a><br>
<div class="im"><br>
><br>
> I wish that create() method just returned<br>
> Glib::RefPtr<Gst::QueryDuration><br>
><br>
</div>Feel free to file a bug about that also.<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> On Thu, Sep 6, 2012 at 10:50 PM, José Alburquerque<br>
> <<a href="mailto:jaalburquerque@cox.net">jaalburquerque@cox.net</a>> wrote:<br>
>         On Thu, 2012-09-06 at 19:14 +0300, Jiergir Ogoerg wrote:<br>
>         > Hi,<br>
>         > I'm using the C++ backend of gstreamer (0.10)<br>
>         ><br>
>         > The problem is that Gst::QueryDuration::create(Format<br>
>         format) returns<br>
>         > Glib::RefPtr<Gst::Query> instead of<br>
>         Glib::RefPtr<Gst::QueryDuration><br>
>         > which makes it impossible to use the parse() method of the<br>
>         returned<br>
>         > object since parse() only exists in Gst::QueryDuration.<br>
><br>
><br>
>         The create() methods of the Gst::Query* classes wrap the<br>
>         gst_query_new_*() functions and they return a GstQuery so the<br>
>         create()<br>
>         methods similarly return a Gst::Query.<br>
>         ><br>
>         > As a workaround I thought I'd cast the returned value to<br>
>         > Glib::RefPtr<Gst::QueryDuration> but the compiler refuses to<br>
>         do so.<br>
><br>
><br>
>         The proper way to cast it would be something like:<br>
><br>
>         Glib::RefPtr<Gst::QueryDuration> durQuery =<br>
>               Glib::RefPtr<Gst::QueryDuration>::cast_dynamic(query);<br>
><br>
>         The ogg_player, ogg_player_gtkmm and the media_player_gtkmm<br>
>         examples<br>
>         show how this is done when querying the pipeline for the<br>
>         position of the<br>
>         stream.<br>
>         ><br>
>         > Using Ubuntu 12.04 amd64, the documentation<br>
>         (libgstreamermm-0.10-doc)<br>
>         > doesn't tell how to do it.<br>
>         ><br>
>         > However, in Ubuntu 12.10 (yet to be released), the<br>
>         documentation is<br>
>         > updated with an example but it doesn't compile because the<br>
>         example<br>
>         > calls parse() on a Gst::Query object which doesn't have such<br>
>         a method.<br>
><br>
><br>
>         Really?  What example would that be?  The gstreamermm examples<br>
>         should<br>
>         compile and work fine with gstreamermm.<br>
>         ><br>
>         > So how do I create a Gst::QueryDuration object to be able to<br>
>         call<br>
>         > parse() to get the duration? Is it a broken C++ bindings<br>
>         design?<br>
><br>
>         > _______________________________________________<br>
>         > gstreamer-devel mailing list<br>
>         > <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
>         ><br>
>         <a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
><br>
>         --<br>
>         José<br>
><br>
>         _______________________________________________<br>
>         gstreamer-devel mailing list<br>
>         <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
>         <a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
><br>
> _______________________________________________<br>
> gstreamer-devel mailing list<br>
> <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br>
--<br>
José<br>
<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</div></div></blockquote></div><br>