0

I have a GstBufferList *list inside the upstream element and wanted to pass the same to the downstream element for further processing.

Is there any way in Gstreamer to pass this Gstbufferlist to the next element?

1 Answers1

0

https://gstreamer.freedesktop.org/documentation/gstreamer/gstpad.html?gi-language=c#gst_pad_push_list

gst_pad_push_list() pushes GstBufferList downstream. If the downstream pad has a chain_list implementation it will get the complete list - if not it will call the chain function with each GstBuffer individually.

Florian Zwoch
  • 6,764
  • 2
  • 12
  • 21
  • Thanks for your input. The upstream element does not have any chain_list implementation. and I have one doubt how do I will catch this list and downstream side? could you please provide some pseudo-code. new this environment. any valuable input will be great helpful for me. – Preeti Gill Sep 21 '20 at 16:04
  • Your upstream has the list, right? Just push it downstream via `gst_pad_push_list()`. Your downstream will get the list or single buffers depending whether it can handle a list or not. – Florian Zwoch Sep 21 '20 at 16:10
  • can you please help me on what will be the value of the GstPad argument in the below function. GstFlowReturn gst_pad_push_list (GstPad * pad, GstBufferList * list); – Preeti Gill Sep 22 '20 at 06:01
  • if the downstream element having the below pad configuration. gst_element_class_add_pad_template (GST_ELEMENT_CLASS(klass), gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, gst_caps_from_string ("{BGR}" ",width = (int) [1, 420], height = (int) [1, 420]"))); – Preeti Gill Sep 22 '20 at 06:01
  • The pad argument would be the `src` pad of the upstream element. – Florian Zwoch Sep 22 '20 at 07:40
  • gst_my_transform_frame_ip (GstVideoFilter * filter, GstVideoFrame * frame) { GstStaticPadTemplate pad_temp = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, gst_caps_from_string (VIDEO_SRC_CAPS)); pad = gst_pad_new_from_static_template (&pad_temp, "src"); // create static pad GstBufferList *buf_list = gst_buffer_list_new (); // create list create GstBuffer buf // here gst_buffer_list_insert(buf_list, idx++, buf); // insert buf. gst_pad_push_list(pad, buf_list); // To push the bugger list to downstream element return GST_FLOW_OK;} – Preeti Gill Sep 22 '20 at 12:47
  • Hi @Florian above is my implementation code to create the Gstbufeer list and push it to the downstream element. while executing the function gst_pad_push_list(pad, buf_list); am getting the error "double free or corruption (out) " – Preeti Gill Sep 22 '20 at 12:49
  • could you help me to find out what wrong I did our here – Preeti Gill Sep 22 '20 at 12:50
  • I have not made if changes in rx side (downstream element) with respect to gstbuf list. Anything I needs to do here also? – Preeti Gill Sep 22 '20 at 13:15
  • Hii @Florian, could you please provide your valuable input on the same – Preeti Gill Sep 23 '20 at 08:27
  • I cant double check/debug your code. But that error sounds like you need to read up upon which functions takes ownership of allocated objects. And who is responsible to release them (and who is not). – Florian Zwoch Sep 23 '20 at 08:44
  • Hii @Florian, Yes It is working fine now. Just wanted your valuable command on the below forum https://stackoverflow.com/questions/64044659/adding-inserting-a-gstbuffer-to-the-gstbuffer-pool – Preeti Gill Sep 24 '20 at 13:53
  • please try to give your valuable feedback on the above forum. – Preeti Gill Sep 24 '20 at 13:53
  • Hii @Florian, could you please help me to implement the chain list at downstream element? – Preeti Gill Sep 29 '20 at 13:40
  • Some pseudo code if you can provide that will be appreciated – Preeti Gill Sep 29 '20 at 13:41