rtspsrc Internal data flow error. in C code

teguhginanjar tghgnjr at gmail.com
Fri Aug 30 00:41:49 PDT 2013


hi there i use gstreamer for receive an ipcamera streaming via rtsp  video
with CLI 

gst-launch rtsp://admin:12345@172.16.6.10:7070  ! decodebin !
ffmpegcolorspace ! xvimagesink

its work fine,  when i  write similar code in C but its get following "error
: Internal data flow error."

here its C code :

#include <gst/gst.h>
#include <glib.h>


static gboolean bus_call (GstBus *bus, GstMessage *msg, gpointer data)
{
  GMainLoop *loop = (GMainLoop *) data;

  switch (GST_MESSAGE_TYPE (msg)) {
    case GST_MESSAGE_EOS:
      g_print ("End of stream\n");
      g_main_loop_quit (loop);
      break;
    case GST_MESSAGE_ERROR: {
      gchar *debug;
      GError *error;
      gst_message_parse_error (msg, &error, &debug);
      g_free (debug);
      g_printerr ("Error: %s\n", error->message);
      g_error_free (error);
      g_main_loop_quit (loop);
      break;
    }
    default:
      break;
  }

return TRUE;
}


int main (int argc, char ** argv)
{
	gst_init (&argc, &argv);
	
	GMainLoop * loop = g_main_loop_new (NULL, FALSE);
	GstBus * bus;
	GstElement * pipeline, * decoder, * sink, * colorspace, * source;
	pipeline = gst_pipeline_new ("players");
	source = gst_element_factory_make ("rtspsrc", NULL);
	decoder = gst_element_factory_make ("decodebin", NULL);
	colorspace = gst_element_factory_make ("ffmpegcolorspace", NULL);
	sink = gst_element_factory_make ("autovideosink", NULL);
	
	g_object_set (G_OBJECT (source), "location",
"rtsp://admin:123456@172.16.6.11:7070", NULL);
	
	bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
	gst_bus_add_watch (bus, bus_call, loop);
	g_object_unref (bus);
	
	gst_bin_add_many (GST_BIN (pipeline), source, decoder, colorspace, sink,
NULL);
	gst_element_link_many (decoder, colorspace, sink, NULL);
	
	gst_element_set_state (pipeline, GST_STATE_PLAYING);
	g_main_loop_run (loop);
	return 0;
}


where is the problem in my C code ? thanks for help



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/rtspsrc-Internal-data-flow-error-in-C-code-tp4661784.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list