[gst-devel] Newbie question about Pipelines

Manuel.Serrano at sophia.inria.fr Manuel.Serrano at sophia.inria.fr
Thu Jul 31 09:56:28 CEST 2008


Hello there,

I hope that this mailing is the good place to post this mail, if not, you
will pardon me...

I'm quite new to Gstreamer and I have a stupid question. It's probably
very naive and also it has probably been already asked. However, I
have browsed the mailing list archive without discovering the
information I'm looking for.

I'm currently developing a binding for Gstreamer for Hop
(http://hop.inria.fr), a new programming language dedicated to
programming interactive and multimedia applications on the Web. I have
a roughly operational binding (even though, I'm still struggling with
some multi-threading and GC issues) and I'm now conducting several
tests. One of this test fail and I cannot find the reason for that
failure.

For those that are interested, I attach the actual source code in the
mail but since I don't expect any of you to be familiar with Hop ;-)
I will explain it too...

I have defined a function named "play-streams" that creates an pipeline
containing:

 - a filesrc element
 - a decodebin element
 - an audioconvert element
 - an audioresample element
 - an audiosink element

All the elements are linked together and an asynchronous event handler is
attached for "pad-added" signals.

The function then starts a thread that sets the location property of
the filesrc element, then it sets the state of the pipeline to
GST_STATE_PLAYING.  and it runs a loop that calls "gst_bus_poll" until
and EOS message is intercepted. So far, so good. The music is played
and the signals correctly intercepted.

Now, the problem comes from a second function, named "replay", that
sets the pipeline state to GST_STATE_NULL, then to GST_STATE_READY.
Then it kills the first threads, and it invokes again the function
"play-streams". That is, the function "replay" creates a new pipeline,
filesrc, a new decodebin, etc, and it starts a new thread for polling
messages coming from the associated bus.

This second time, the music is played (that is sound is emitted by the
output speakers) but the threads hangs either in the call
   gst_element_state_set( pipeline, GST_STATE_PLAYING )

or (in a way that looks like unpredictable) in the call to gst_bus_poll.

I imagine that some cleanup is needed on the first pipeline or on the
first audiosink element. I have browsed the Gstreamer's documentation
without discovering the information that could help me solving this
problem. Is there someone here that could help me with this issue?
Many thanks in advance.

Cheers,

-- 
Manuel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bgst-play.scm
Type: application/octet-stream
Size: 6299 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20080731/3f8dc297/attachment.obj>


More information about the gstreamer-devel mailing list