gst_bin_get_by_name returns NULL

Tim Müller tim at centricular.com
Thu Oct 27 13:18:53 UTC 2016


On Thu, 2016-10-27 at 14:29 +0200, Marcin Rosner wrote:

Hi Marcin,

> 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);
> ...
> 
> 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?

You're not giving a name to the xvimagesink element, so gstreamer picks
its own default name, which will be "xvimagesink0" most likely.

Try: "videotestsrc ! xvimagesink name=sink"

Cheers
 -Tim

-- 
Tim Müller, Centricular Ltd - http://www.centricular.com


More information about the gstreamer-devel mailing list