Testing the newly wrapped Gst::Query classes



I'm running into something a bit peculiar while testing the newly wrapped Gst::Query classes. To make sure that queries work, I decided to modify the ogg player gui version to use the Element::query() method (with a Gst::Query) instead of Element::query_position() to get the stream position in the PlayerWindow::on_forward() method when the forward button is pressed.

The problem arises if I attempt to cast the Glib::RefPtr<> of the Gst::Query class to a Glib::RefPtr<> of the derived type (Gst::QueryPosition) before "querying the element" (calling Gst::Element::query()) in the following way:

void PlayerWindow::on_forward(void)
{
   ...
   Gst::Format fmt = Gst::FORMAT_TIME;

   Glib::RefPtr<Gst::Query> query = Gst::QueryPosition::create(fmt);

   Glib::RefPtr<Gst::QueryPosition> posQuery =
       Glib::RefPtr<Gst::QueryPosition>::cast_dynamic(query);

   if (mainPipeline->query(posQuery))
   {
        ...
   }
}

When the forward button is pressed, gstreamer gives two warnings which essentially mean that the Gst::Query is refcounted more than once (I found this out by looking at the definition of the IS_MUTABLE macro in gststructure.h):

(lt-oggplayer:7134): GStreamer-CRITICAL **: gst_structure_id_set_valist: assertion `IS_MUTABLE (structure)' failed

(lt-oggplayer:7134): GStreamer-CRITICAL **: gst_structure_id_set_valist: assertion `IS_MUTABLE (structure)' failed

If, on the other hand, I don't do the cast until after the element query (in the if block), the warnings are gone which tells me that gstreamer has a problem with the Gst::Query being referenced more than once before the query is sent (the cast is necessary to "parse" the Gst::QueryPosition). Is this something I should worry about or should it be overlooked? I've checked in the changes to svn with the cast so it can be tested. After, I'll simply place the cast in the if block to avoid the warnings. Suggestions appreciated. Thanks.

-Jose


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