gstbin test...

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

gstbin test...

율제 조
Hello...

I tested gstbin..

gst-launch-0.10 audiotestsrc ! queue ! audioconvert ! { vorbisenc ! oggmux } ! filesink location=audio.ogg
is successed...

but...below is
Error: Internal data flow error. (gstbasesrc.c(2234): gst_base_src_loop (): /GstPipeline:pipeline0/GstAudioTestSrc:audiotestsrc0:
streaming task paused, reason not-linked (-1))



static GstElement *make_encoder (void)
{
    GstElement *result;
    GstElement *codec;
    GstElement *mux;
    GstPad *pad;
    GstCaps *caps;

    /* create result bin */
    result = gst_bin_new(NULL);
    g_assert(result);

    /* create elements */
    codec = gst_element_factory_make("vorbisenc", NULL);
    g_assert(codec);

    mux = gst_element_factory_make("oggmux", NULL);
    g_assert(mux);

    /* add elements to result bin */
    gst_bin_add(GST_BIN(result), codec);
    gst_bin_add(GST_BIN(result), mux);

    /* link elements */
    gst_element_link_pads(codec, "src", mux, "sink");

    /* ghost src and sink pads */
    pad = gst_element_get_static_pad(codec, "sink");
    gst_element_add_pad(result, gst_ghost_pad_new("sink", pad));
    gst_object_unref(pad);

    pad = gst_element_get_static_pad(mux, "src");
    gst_element_add_pad(result, gst_ghost_pad_new("src", pad));
    gst_object_unref(pad);

    return result;
}


static GstElement *make_pipeline(void)
{
    GstElement *result;
    GstElement *audiosrc;
    GstElement *queue;
    GstElement *aconv;
    GstElement *sink;
    GstElement *encoder;

    result = gst_pipeline_new(NULL);
    g_assert(result);

    /* create various elements */
    audiosrc = gst_element_factory_make("audiotestsrc", NULL);
    g_assert(audiosrc);

    queue = gst_element_factory_make("queue", NULL);
    g_assert(queue);

    aconv = gst_element_factory_make("audioconvert", NULL);
    g_assert(aconv);


    sink = gst_element_factory_make("filesink", NULL);
    g_object_set(sink, "location", "audio.ogg", NULL);
    g_assert(sink);

    /* add elements */
    gst_bin_add(GST_BIN(result), audiosrc);
    gst_bin_add(GST_BIN(result), queue);
    gst_bin_add(GST_BIN(result), aconv);
    gst_bin_add(GST_BIN(result), sink);

    encoder = make_encoder();

    gst_bin_add(GST_BIN(result), encoder);

    /* link elements */
    gst_element_link_pads(audiosrc, "src", queue, "sink");
    gst_element_link_pads(queue, "src", aconv, "sink");
    gst_element_link_pads(aconv, "src", encoder, "sink");
    gst_element_link_pads(encoder, "src", sink, "sink");

    gst_element_set_state(result, GST_STATE_READY);

    return result;
}


Where is incorrect?

Thanks..



180° 달라진 야후! 메일
두둥! 새로운 야후! 메일에서는 메시지를 여기저기 끌어다 놓을 수 있답니다.


------------------------------------------------------------------------------

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gstbin test...

Thiago Sousa Santos-2


On Mon, Dec 29, 2008 at 2:51 PM, Yool-Je Cho <[hidden email]> wrote:
Hello...

I tested gstbin..

gst-launch-0.10 audiotestsrc ! queue ! audioconvert ! { vorbisenc ! oggmux } ! filesink location=audio.ogg
is successed...

but...below is
Error: Internal data flow error. (gstbasesrc.c(2234): gst_base_src_loop (): /GstPipeline:pipeline0/GstAudioTestSrc:audiotestsrc0:
streaming task paused, reason not-linked (-1))



static GstElement *make_encoder (void)
{
    GstElement *result;
    GstElement *codec;
    GstElement *mux;
    GstPad *pad;
    GstCaps *caps;

    /* create result bin */
    result = gst_bin_new(NULL);
    g_assert(result);

    /* create elements */
    codec = gst_element_factory_make("vorbisenc", NULL);
    g_assert(codec);

    mux = gst_element_factory_make("oggmux", NULL);
    g_assert(mux);

    /* add elements to result bin */
    gst_bin_add(GST_BIN(result), codec);
    gst_bin_add(GST_BIN(result), mux);

    /* link elements */
    gst_element_link_pads(codec, "src", mux, "sink");
 
You should have tested the result of this call, it is failing because 'mux' has no pad named 'sink'. oggmux uses 'request pads', read the docs about it and you'll see how to fix this.


    /* ghost src and sink pads */
    pad = gst_element_get_static_pad(codec, "sink");
    gst_element_add_pad(result, gst_ghost_pad_new("sink", pad));
    gst_object_unref(pad);

    pad = gst_element_get_static_pad(mux, "src");
    gst_element_add_pad(result, gst_ghost_pad_new("src", pad));
    gst_object_unref(pad);

    return result;
}


static GstElement *make_pipeline(void)
{
    GstElement *result;
    GstElement *audiosrc;
    GstElement *queue;
    GstElement *aconv;
    GstElement *sink;
    GstElement *encoder;

    result = gst_pipeline_new(NULL);
    g_assert(result);

    /* create various elements */
    audiosrc = gst_element_factory_make("audiotestsrc", NULL);
    g_assert(audiosrc);

    queue = gst_element_factory_make("queue", NULL);
    g_assert(queue);

    aconv = gst_element_factory_make("audioconvert", NULL);
    g_assert(aconv);


    sink = gst_element_factory_make("filesink", NULL);
    g_object_set(sink, "location", "audio.ogg", NULL);
    g_assert(sink);

    /* add elements */
    gst_bin_add(GST_BIN(result), audiosrc);
    gst_bin_add(GST_BIN(result), queue);
    gst_bin_add(GST_BIN(result), aconv);
    gst_bin_add(GST_BIN(result), sink);

    encoder = make_encoder();

    gst_bin_add(GST_BIN(result), encoder);

    /* link elements */
    gst_element_link_pads(audiosrc, "src", queue, "sink");
    gst_element_link_pads(queue, "src", aconv, "sink");
    gst_element_link_pads(aconv, "src", encoder, "sink");
    gst_element_link_pads(encoder, "src", sink, "sink");

    gst_element_set_state(result, GST_STATE_READY);

    return result;
}


Where is incorrect?

Thanks..



180° 달라진 야후! 메일
두둥! 새로운 야후! 메일에서는 메시지를 여기저기 끌어다 놓을 수 있답니다.


------------------------------------------------------------------------------

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
Thiago Sousa Santos

Embedded Systems and Pervasive Computing Lab (Embedded)
Center of Electrical Engineering and Informatics (CEEI)
Federal University of Campina Grande (UFCG)

------------------------------------------------------------------------------

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel