how to control a ghost pad by gst-launch-1.0

赵凤明 zhaofengming.zfm at alibaba-inc.com
Wed Mar 2 11:58:17 UTC 2022


Hi Everyone

I want to control a BIN(which contain 3 elements) and a related "src" ghost pad(which will be used by downstream) by gst-launch-1.0 to achieve the following pseudocode.
----------------------------------------------------------------------------
GstElement *bin = gst_bin_new("xxxx");
GstElement *source = gst_element_factory_make ("filesrc", "source");
GstElement *jpegparser = gst_element_factory_make ("jpegparse", "jpeg-parser");
GstElement *decoder = gst_element_factory_make ("nvv4l2decoder", "nvv4l2-decoder");

gst_bin_add_many (GST_BIN (bin), source, jpegparser, decoder, NULL);
gst_element_link_many (source, jpegparser, decoder, NULL);

gst_element_add_pad (bin, gst_ghost_pad_new_no_target ("src", GST_PAD_SRC));
GstPad *srcpad = gst_element_get_static_pad (decoder, "src");
GstPad *bin_ghost_pad = gst_element_get_static_pad (bin, "src");
gst_ghost_pad_set_target (GST_GHOST_PAD (bin_ghost_pad), srcpad);
----------------------------------------------------------------------------


I've learned how to control the BIN - #### gst-launch-1.0 bin. \( filesrc ! jpegparse ! nvv4l2decoder \)
but don't know how to meanwhile control the ghost pad, would you please give me some advice?
Thank you!

Regards

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20220302/b721785e/attachment.htm>


More information about the gstreamer-devel mailing list