[gst-devel] HELP: how to using c to implement this ?

Freeman Zhang pcman.zhang at gmail.com
Wed Nov 4 11:29:03 CET 2009


Well, for simplify my work.

I'm using gst_parse_launch to create the pipeline:

gchar str[200];
sprintf(str, "filesrc location=./media/%s" \
 "! audio/x-alaw, channels=1, rate=8000" \
 "! alawdec ! autoaudiosink", cmd->filename);

GError* err = NULL;
pipeline = gst_parse_launch(str, &err);
g_assert(pipeline != NULL);

                      // Play
                g_print("Playing.");
                gst_element_set_state (pipeline, GST_STATE_PLAYING);
                g_loop = g_main_loop_new (NULL, FALSE);
                g_main_loop_run (g_loop);
                gst_element_set_state (pipeline, GST_STATE_NULL);
                g_print("Stopped\n");

But no sound output,  I tried at command-line, it works.  What's the
problem?

Thanks




2009/11/4 Freeman Zhang <pcman.zhang at gmail.com>

> Get it.
>
> Thank you very much.
>
> 2009/11/4 Tim-Philipp Müller <t.i.m at zen.co.uk>
>
> On Wed, 2009-11-04 at 18:02 +0800, Freeman Zhang wrote:
>>
>> > decoder = gst_element_factory_make("alawdec", "decoder");
>> > res = gst_element_link_filtered (filesrc, decoder, caps);
>> > g_assert(res == TRUE);
>> >
>> > But it return:
>> >                          gst_element_link_pads_filtered: assertion
>> > `GST_IS_BIN (parent)' failed
>>
>> You need to add elements to a pipeline/bin before linking them.
>>
>> Cheers
>>  -Tim
>>
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
>> 30-Day
>> trial. Simplify your report design, integration and deployment - and focus
>> on
>> what you do best, core application coding. Discover what's new with
>> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20091104/8451716f/attachment.htm>


More information about the gstreamer-devel mailing list