GST_STATE_CHANGE_FAILURE when I set the pipeline to playing state

Dudi.r dudi017 at
Wed Apr 23 08:26:45 PDT 2014

Hi fellows,

I have this pipeline:

#include <gst/app/gstappsrc.h>
#include <gst/app/gstappsink.h>

static GstFlowReturn new_sample(GstElement *sink, gpointer *data)
	g_print("new sample\n");
	GstSample *sample = gst_app_sink_pull_sample(GST_APP_SINK(sink));
	if (sample != NULL)
		GstBuffer *buffer = gst_sample_get_buffer(sample);

	return GST_FLOW_OK;

    GstAppSrc *src;
    GstAppSink *sink;

    src = (GstAppSrc*)gst_element_factory_make("appsrc", "src");
    rtpdepay=gst_element_factory_make("rtph264depay", "rtpdepay");
    sink = (GstAppSink*)gst_element_factory_make("appsink", "sink");

    gst_bin_add_many(GST_BIN(pipeline), (GstElement*)src, rtpdepay,
(GstElement*)sink  , NULL);
     if(!gst_element_link_many((GstElement*)src, rtpdepay,
           g_warning("failed to link");

     g_signal_connect(src, "need-data", G_CALLBACK(start_feed), NULL);
     g_signal_connect(src, "enough-data", G_CALLBACK(stop_feed), NULL);

    g_signal_connect(sink, "new-sample", G_CALLBACK(new_sample), NULL);

    ret= gst_element_set_state (pipeline, GST_STATE_PLAYING);   


I don't know why, but I the "ret" is- GST_STATE_CHANGE_FAILURE.
the link_many part is o.k... 

I can't figure it out what is wrong with the code...


View this message in context:
Sent from the GStreamer-devel mailing list archive at

More information about the gstreamer-devel mailing list