Immutable structure when GstQuery is referenced more than once

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Immutable structure when GstQuery is referenced more than once

José Alburquerque-3
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 =
        Glib::RefPtr<Gst::QueryPosition>::cast_dynamic(query);

    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.

-Jose

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Immutable structure when GstQuery is referenced more than once

José Alburquerque-3
José Alburquerque wrote:
> 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.
>
>  
I'm guessing it's to protect the structure from changing if the Query is
being referenced in a local function.  Right?  Thanks.

-Jose

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel