Udpsrc to autovideosink

chrplus3 christian.bauer at mekra.de
Wed Sep 13 07:49:49 UTC 2017


I've just seen, that raw text is not working in this mailing list.

Here is the code again:
Working:
gst-launch-1.0 -v \
udpsrc port=5016 caps="application/x-rtp,encoding-name=JPEG,payload=26" ! \
rtpjpegdepay ! jpegparse ! queue max-size-time=0 max-size-buffers=0 !
jpegdec ! autovideosink

Not working (because element link failed):
...
GstElement *pipeline, *source, *depay, *parse, *queue, *decode, *sink;
GstCaps *caps;
gst_init(&argc, &argv);
pipeline = gst_pipeline_new("pipe");
source = gst_element_factory_make("udpsrc", "source");
depay = gst_element_factory_make("rtpjpegdepay", "depay");
parse = gst_element_factory_make("jpegparse", "parse");
queue = gst_element_factory_make("queue", "queue");
decode = gst_element_factory_make("jpegdec", "decode");
sink = gst_element_factory_make("autovideosink", "sink");
caps = gst_caps_new_simple(
	"video/x-rtp",
	"encoding-name", G_TYPE_STRING, "JPEG",
	"payload", G_TYPE_INT, 26, NULL);
g_object_set(G_OBJECT(source),
	"port", 5016,
	"caps", caps, NULL);
g_object_set(G_OBJECT(queue),
	"max-size-time", 0,
	"max-size-buffers", 0, NULL);
gst_bin_add_many(GST_BIN(pipeline), source, depay, parse, queue, decode,
sink, NULL);
if(!gst_element_link_many(source, depay, parse, queue, decode, sink, NULL))
{
	g_printerr("Elements could not be linked.\n");
	gst_object_unref(pipeline);
	return -1;
}
gst_element_set_state(pipeline, GST_STATE_PLAYING);
...



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list