How to create a gst plugin with two sink pads

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) AGX Xavier
• DeepStream Version 5.0
• JetPack Version (valid for Jetson only) 4.4

I try to modify the gstdsexample.cpp to have two sink pads.
In the gst_dsexample_class_init, I add one more sink pad as below

> gst_element_class_add_pad_template (gstelement_class,
>       gst_static_pad_template_get (&gst_dsexample_sink_template));
> gst_element_class_add_pad_template (gstelement_class,
>       gst_static_pad_template_get (&gst_dsexample_sink_template));

Questions:

  1. do I need to modify _start, _stop, _set_caps accordingly? how?
  2. how do I modify gst_dsexample_transform_ip to receive two inbuf which associated with each sink pad respectively?
  3. is there an example source code for multiple sink pads plugin? prefer two GST_PAD_ALWAYS example and process both sink pad bufs and frames metadata at the same time instead of sequentially like mux.

Thank you very much for your help.

I don’t think dsexample is a proper sample for mux. It is based on GstBaseTransform. It suits some conversion tasks.

There are a lot of mux samples in Gstreamer source codes.

https://gstreamer.freedesktop.org/documentation/plugin-development/index.html
https://gstreamer.freedesktop.org/src/

Thanks for your insights, Fiona.

To be more relevant, it would be much easier to modify from nvstreammux. Would the nvstreammux source code (or equivalent) be available as a template? where could we find it? Thank you again for your help.

nvstreammux is proprietary. It is not open source.