[gst-devel] Why does this working gst-launch pipeline not work when compiled?

Tim-Philipp Müller t.i.m at zen.co.uk
Mon Apr 12 23:45:02 CEST 2010


On Mon, 2010-04-12 at 10:56 -0800, Wes Miller wrote:

> I have this pipeline working in linux and windows:
> 
> gst-Launch -e souphttpsrc location="my_url" ! multipartdemux ! matroskamux !
> filesink location="my_file"
> 
> When I code this up in C, no signal handlers, no callback, just 4 elements,
> add-many-ed and link-many -ed.

That sounds like you already know that that's not going to work ;-)

multipartdemux has sometimes pads, and matroskamux has request pads, so
you can't just link them all from the start (you did check the return
value of _link_many()?)

Alternatively, create the pipeline using gst_parse_launch() - that will
handle these things automagically for you in the same way gst-launch
does.


> When I get to setting the pipeline to playing it returns 2 - async event.

There is no "event" in the GStreamer sense involved here, it's just a
return value. An ASYNC return value is expected when you set a pipeline
to PAUSED or PLAYING state.

See e.g.:
http://cgit.freedesktop.org/gstreamer/gstreamer/tree/docs/design/part-overview.txt


> So, I'm just completely confused.  Why does it work at a command prompt and
> not in a program?

Because gst_parse_launch() does some 'magic' under the hood.


> What's supposed to catch what async event?

Not sure what you mean here. The ASYNC return value tells you that the
pipeline isn't ready to be e.g. seeked yet.

You will be notified when the requested state change completed via a
state-changed message on the pipeline's GstBus, see e.g.:

http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-bus.html


> I know I'll need a callback for errors, but what will it need to be
>  hooked to?

http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-bus.html


> This all seems so simple except it isn't.

No doubt there's a bit of a learning curve and our docs could be both
better and more complete, but frankly, it doesn't look like you've even
worked through the basics of the Application Developer's Manual.

Cheers
 -Tim






More information about the gstreamer-devel mailing list