gst_bin_get_by_name returns NULL

Marcin Rosner rsnr at tlen.pl
Thu Oct 27 12:29:11 UTC 2016


Hi all,
I am using gstreamer 1.2.4 and the function gst_bin_get_by_name always returns NULL when I pass a valid and working pipeline to it. 
Here a code which I took from a gstreamer tutorial and modified a bit:
gst_init (NULL, NULL);
GstElement* pipeline = gst_parse_launch("videotestsrc ! xvimagesink", NULL);
GstElement* sink = gst_bin_get_by_name(GST_BIN(pipeline), "sink");
gst_element_set_state (pipeline, GST_STATE_PLAYING);
GMainLoop *loop;
loop = g_main_loop_new (NULL, FALSE);
g_main_loop_run (loop);
The code works and a test video is shown on a screen, but sink is NULL as also sinkpads and srcpads from the pipeline.
Why is that? How should I do it properly?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20161027/fb261d0f/attachment.html>


More information about the gstreamer-devel mailing list