After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 683580 - Change Gst::QueryDuration::create() return value
Change Gst::QueryDuration::create() return value
Status: RESOLVED FIXED
Product: gstreamermm
Classification: Bindings
Component: general
0.10.x
Other All
: Normal minor
: ---
Assigned To: gstreamermm-maint
gstreamermm-maint
Depends on:
Blocks:
 
 
Reported: 2012-09-07 14:51 UTC by kangaba
Modified: 2012-09-13 04:14 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description kangaba 2012-09-07 14:51:40 UTC
Gst::QueryDuration::create() returns a Glib::RefPtr<Gst::Query> object instead of Glib::RefPtr<Gst::QueryDuration> which requires a dynamic cast for each call to the methods of Gst::QueryDuration, like this:

Glib::RefPtr<Gst::Query> query = Gst::QueryDuration::create(GST_FORMAT_TIME);

dynamic casting:
gint64 duration = Glib::RefPtr<Gst::QueryDuration>::cast_dynamic(query)->parse();

the "right" approach: return a Gst::QueryDuration object and just do this:
gint64 duration = query->parse();

So, please change the create() constructor of Gst::QueryDuration so that it returns a Gst::QueryDuration object (as expected) instead of Gst::Query.
Comment 1 José Alburquerque 2012-09-13 04:14:41 UTC
This has been fixed not for Gst::Qery derived classes, but also for the Gst::Event and the Gst::Message derived classes by this commit:

http://git.gnome.org/browse/gstreamermm/commit/?id=dda1548634dc4bbc0d9fdb8a0fdc68f3371d86c5

Thanks.