<br><br><div class="gmail_quote">On Fri, Feb 6, 2009 at 9:13 PM, Dan Taylor <span dir="ltr"><<a href="mailto:dtaylor@startrac.com">dtaylor@startrac.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I am trying to use multiple frontends to feed an audio/video backend<br>
pair.<br>
<br>
When I switch frontends, I unlink the front/back ends, remove them from<br>
their respective pipelines and unref the pipelines. After I have done<br>
that,<br>
the backend object has been destroyed.<br>
<br>
I've attached a code snippet and XML dumps of an affected object before<br>
it<br>
is removed from the pipeline, the pipeline after removal, and the<br>
complaint<br>
about the object after it is removed.<br>
<br>
With the object removed from the pipeline, unreffing the pipeline<br>
shouldn't<br>
change any of the objects it used to contain. Any hints about what I've<br>
missed?</blockquote><div> <br>Removing them from the bin unrefs them.<br><br></div><div>Maybe this will clarify:<br><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstBin.html#gst-bin-remove">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstBin.html#gst-bin-remove</a><br>
<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Sorry about the length of the xml.<br>
<br>
Code:<br>
<br>
gst_element_set_state (GST_ELEMENT (audio_pipeline),<br>
GST_STATE_NULL);<br>
<br>
/* unlink ends */<br>
unlink_backend_sink(audio_backend);<br>
<br>
if (dump_xml) gst_xml_write_file (GST_ELEMENT (audio_backend),<br>
stdout);<br>
<br>
/* remove them from bin, so they are not freed */<br>
gst_bin_remove_many(GST_BIN (audio_pipeline), audio_frontend,<br>
audio_backend, NULL);<br>
<br>
if (dump_xml) gst_xml_write_file (GST_ELEMENT (audio_pipeline),<br>
stdout);<br>
<br>
gst_object_unref (audio_pipeline);<br>
audio_pipeline = NULL;<br>
<br>
if (dump_xml) gst_xml_write_file (GST_ELEMENT (audio_backend),<br>
stdout);<br>
<br>
Messages and debug prints:<br>
<br>
backend audio_backend<br>
backend unlink successful<br>
<br>
<?xml version="1.0"?><br>
<gstreamer xmlns:gst="<a href="http://gstreamer.net/gst-core/1.0/" target="_blank">http://gstreamer.net/gst-core/1.0/</a>"><br>
<gst:element><br>
<gst:name>audio_backend</gst:name><br>
<gst:type>bin</gst:type><br>
<gst:param><br>
<gst:name>name</gst:name><br>
<gst:value>audio_backend</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>async-handling</gst:name><br>
<gst:value>FALSE</gst:value><br>
</gst:param><br>
<gst:pad><br>
<gst:ghostpad><br>
<gst:name>ghost3</gst:name><br>
<gst:parent>audio_backend</gst:parent><br>
<gst:direction>sink</gst:direction><br>
<gst:peer>audio_frontend.ghost2</gst:peer><br>
</gst:ghostpad><br>
</gst:pad><br>
<gst:children><br>
<gst:element><br>
<gst:name>alsasink0</gst:name><br>
<gst:type>alsasink</gst:type><br>
<gst:param><br>
<gst:name>name</gst:name><br>
<gst:value>alsasink0</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>preroll-queue-len</gst:name><br>
<gst:value>0</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>sync</gst:name><br>
<gst:value>TRUE</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>max-lateness</gst:name><br>
<gst:value>-1</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>qos</gst:name><br>
<gst:value>FALSE</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>async</gst:name><br>
<gst:value>TRUE</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>ts-offset</gst:name><br>
<gst:value>0</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>last-buffer</gst:name><br>
<gst:value>NULL</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>buffer-time</gst:name><br>
<gst:value>200000</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>latency-time</gst:name><br>
<gst:value>10000</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>provide-clock</gst:name><br>
<gst:value>TRUE</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>slave-method</gst:name><br>
<gst:value>1</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>device</gst:name><br>
<gst:value>default</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>device-name</gst:name><br>
<gst:value/><br>
</gst:param><br>
<gst:pad><br>
<gst:name>sink</gst:name><br>
<gst:direction>sink</gst:direction><br>
<gst:peer>audioconvert0.src</gst:peer><br>
</gst:pad><br>
</gst:element><br>
<gst:element><br>
<gst:name>audioconvert0</gst:name><br>
<gst:type>audioconvert</gst:type><br>
<gst:param><br>
<gst:name>name</gst:name><br>
<gst:value>audioconvert0</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>qos</gst:name><br>
<gst:value>FALSE</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>dithering</gst:name><br>
<gst:value>2</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>noise-shaping</gst:name><br>
<gst:value>0</gst:value><br>
</gst:param><br>
<gst:pad><br>
<gst:name>src</gst:name><br>
<gst:direction>source</gst:direction><br>
<gst:peer>alsasink0.sink</gst:peer><br>
</gst:pad><br>
<gst:pad><br>
<gst:name>sink</gst:name><br>
<gst:direction>sink</gst:direction><br>
<gst:peer>audio_q.src</gst:peer><br>
</gst:pad><br>
</gst:element><br>
<gst:element><br>
<gst:name>audio_q</gst:name><br>
<gst:type>queue</gst:type><br>
<gst:param><br>
<gst:name>name</gst:name><br>
<gst:value>audio_q</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>current-level-buffers</gst:name><br>
<gst:value>0</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>current-level-bytes</gst:name><br>
<gst:value>0</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>current-level-time</gst:name><br>
<gst:value>0</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>max-size-buffers</gst:name><br>
<gst:value>0</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>max-size-bytes</gst:name><br>
<gst:value>10485760</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>max-size-time</gst:name><br>
<gst:value>0</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>min-threshold-buffers</gst:name><br>
<gst:value>0</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>min-threshold-bytes</gst:name><br>
<gst:value>0</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>min-threshold-time</gst:name><br>
<gst:value>0</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>leaky</gst:name><br>
<gst:value>0</gst:value><br>
</gst:param><br>
<gst:pad><br>
<gst:name>src</gst:name><br>
<gst:direction>source</gst:direction><br>
<gst:peer>audioconvert0.sink</gst:peer><br>
</gst:pad><br>
<gst:pad><br>
<gst:name>sink</gst:name><br>
<gst:direction>sink</gst:direction><br>
<gst:peer/><br>
</gst:pad><br>
</gst:element><br>
</gst:children><br>
</gst:element><br>
</gstreamer><br>
<br>
<?xml version="1.0"?><br>
<gstreamer xmlns:gst="<a href="http://gstreamer.net/gst-core/1.0/" target="_blank">http://gstreamer.net/gst-core/1.0/</a>"><br>
<gst:element><br>
<gst:name>audio_pipeline</gst:name><br>
<gst:type>pipeline</gst:type><br>
<gst:param><br>
<gst:name>name</gst:name><br>
<gst:value>audio_pipeline</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>async-handling</gst:name><br>
<gst:value>FALSE</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>delay</gst:name><br>
<gst:value>0</gst:value><br>
</gst:param><br>
<gst:param><br>
<gst:name>auto-flush-bus</gst:name><br>
<gst:value>TRUE</gst:value><br>
</gst:param><br>
<gst:children/><br>
</gst:element><br>
</gstreamer><br>
<br>
(avMediaDaemon:22708): GLib-GObject-WARNING **: invalid uninstantiatable<br>
type `(null)' in cast to `GstElement'<br>
<br>
(avMediaDaemon:22708): GLib-GObject-WARNING **: invalid uninstantiatable<br>
type `(null)' in cast to `GstObject'<br>
<br>
(avMediaDaemon:22708): GStreamer-CRITICAL **: gst_object_save_thyself:<br>
assertion `GST_IS_OBJECT (object)' failed<br>
<br>
<?xml version="1.0"?><br>
<gstreamer xmlns:gst="<a href="http://gstreamer.net/gst-core/1.0/" target="_blank">http://gstreamer.net/gst-core/1.0/</a>"><br>
<gst:element/><br>
</gstreamer><br>
<br>
<br>
------------------------------------------------------------------------------<br>
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)<br>
software. With Adobe AIR, Ajax developers can use existing skills and code to<br>
build responsive, highly engaging applications that combine the power of local<br>
resources and data with the reach of the web. Download the Adobe AIR SDK and<br>
Ajax docs to start building applications today-<a href="http://p.sf.net/sfu/adobe-com" target="_blank">http://p.sf.net/sfu/adobe-com</a><br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Thiago Sousa Santos<br><br>Embedded Systems and Pervasive Computing Lab (Embedded)<br>Center of Electrical Engineering and Informatics (CEEI)<br>Federal University of Campina Grande (UFCG)<br>