How do we can implement the GstBufferPool - In Gstreamer Custom plugin

Nicolas Dufresne nicolas at ndufresne.ca
Thu Sep 17 14:51:15 UTC 2020


Le mercredi 16 septembre 2020 à 03:19 -0500, deepg799 a écrit :
> I having a GstPipeline where two custom plugin A (upstream) B (Downstream)
> are implemented as a pass through elements.
> 
> *  RTSP ->dec -> A ->B -> videosink. // working fine as a pass through
> design.
> *
> 
> *Requirement*:- My upstream custom element 'A' will fetch a signal video
> frame from decoder and it will crop and procedure multiple frames those will
> be consumed or pass to the downstream element 'B' The B element will mix all
> these frames and will give single frame to videosink.
> 
> To achieve this implementation I has the GstBufferPool concept in gstreamer
> and I hope this concept can be used for my requirement. The link is given
> below.
> 
> https://gstreamer.freedesktop.org/documentation/additional/design/bufferpool.html?gi-language=c#shutting-down
> 
> Below are the doubt I have in order to implement the same.
> 
> 1- How do add the croped Gstbuffer to the GstBufferPool inorder to get it
> back in the downstream element.

Perhaps refer to an elemement doing just that, see videocrop element.
It can copy crop, but if downstream have support for it, it also
implement in-place meta driven crop.

It does not yet have VideoMeta driven crop, which requires deeper
understanding of the color format (sub-sampling notably).

> 
> 2- How do I can share the Pool configuration to the downstream element ('B')
> in order to acquire the Gstbuffer -gst_buffer_pool_acquire_buffer()

Pools are shared the other way around, since it's upstream that will
acquire and push the buffer. The GstBufferPool offer a minimal
handshake mechanism for configuration negotiation. You'll find many
example around which simply validate the "changes" made by a downstream
offerer using gst_buffer_pool_config_validate_params() as a shortcut.

> 
> It will be very much helpful for me if anyone can share some useful
> reference link where the explanation is there along with some reference code
> or anyone can share pseudo code for the same would be great great. thank you
> in advance.

GStreamer code base is your friend. Most base classes offer some
decide_allocation and propose_allocation virtual function. Grep for
these. Note that these function are highly tailored to your use case
and elements and the features you want to enable. If you try and enable
too much, you will quickly see that the decide_allocation functions can
become very complex. Make sure to focus on what you need, there is no
generic answer here.

> 
> 
> 
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel




More information about the gstreamer-devel mailing list