[gst-devel] Immutable structure when GstQuery is referenced more than once

José Alburquerque jaalburquerque at cox.net
Thu Jan 10 22:22:35 CET 2008

As you might know, I'm working on C++ bindings for gst (if interested in 
testing or looking at it, it can be checked out via svn using the url 
http://svn.gnome.org/svn/gnomemm/gstreamermm/trunk).  I just finished 
wrapping the GstQuery and modified a mini ogg player application I had 
written to test element querying (specifically I modified a call back 
function, which is called when the forward button in the application is 
pressed, to query the main pipeline for the stream position which is 
displayed in the main window).

I'm getting a couple of warnings which I think are related to the how 
many references to the GstQuery I have before I send the query.  This is 
what they look like:

(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

I'm pretty sure I get these because I'm referencing the GstQuery more 
than once before the call to gst_element_query().  The referencing 
occurs in the C++ code because we've made a class for each of the 
queries and use/create/pass them only with an "auto pointer" class 
(called RefPtr) which automatically references and unreferences 
gobjects/miniobjects.  The extra reference to the GstQuery occurs 
because of a C++ cast of the auto pointer from referring to the base 
Query class to a derived QueryPosition class (shown below to clarify) 
just before the element query (in the if statement):

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

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

    // Cast from base to derived
    Glib::RefPtr<Gst::QueryPosition> posQuery =

    if (mainPipeline->query(posQuery))

I know that the cast causes the warnings because they go away without 
it.  Is there a reason a GstQuery's structure becomes immutable if it is 
referenced more than once?  Thanks.


More information about the gstreamer-devel mailing list