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">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>I wish that create() method just returned Glib::RefPtr<Gst::QueryDuration><br><br><br><br><div class="gmail_quote">On Thu, Sep 6, 2012 at 10:50 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 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 format) returns<br>
> Glib::RefPtr<Gst::Query> instead of Glib::RefPtr<Gst::QueryDuration><br>
> which makes it impossible to use the parse() method of the returned<br>
> object since parse() only exists in Gst::QueryDuration.<br>
<br>
</div>The create() methods of the Gst::Query* classes wrap the<br>
gst_query_new_*() functions and they return a GstQuery so the create()<br>
methods similarly return a Gst::Query.<br>
<div class="im">><br>
> As a workaround I thought I'd cast the returned value to<br>
> Glib::RefPtr<Gst::QueryDuration> but the compiler refuses to do so.<br>
<br>
</div>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 examples<br>
show how this is done when querying the pipeline for the position of the<br>
stream.<br>
<div class="im">><br>
> Using Ubuntu 12.04 amd64, the documentation (libgstreamermm-0.10-doc)<br>
> doesn't tell how to do it.<br>
><br>
> However, in Ubuntu 12.10 (yet to be released), the documentation is<br>
> updated with an example but it doesn't compile because the example<br>
> calls parse() on a Gst::Query object which doesn't have such a method.<br>
<br>
</div>Really?  What example would that be?  The gstreamermm examples should<br>
compile and work fine with gstreamermm.<br>
<div class="im">><br>
> So how do I create a Gst::QueryDuration object to be able to call<br>
> parse() to get the duration? Is it a broken C++ bindings design?<br>
</div>> _______________________________________________<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>
<span class="HOEnZb"><font color="#888888"><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>
</font></span></blockquote></div><br>