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

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

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

deepg799
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.

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()

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.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

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

Gary Metalle
Hi

Aren't 'A' and 'B' performing the features of the 'compositor'?
________________________________________
From: gstreamer-devel <[hidden email]> on behalf of deepg799 <[hidden email]>
Sent: 16 September 2020 09:19
To: [hidden email]
Subject: How do we can implement the GstBufferPool - In Gstreamer Custom plugin

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.

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()

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.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

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

deepg799
Hii @Gary,

sorry, I dont get you.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

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

Nicolas Dufresne-5
In reply to this post by deepg799
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
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

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

deepg799
Thanks for your update.

Could be help me on the below points?

1- Which API I need to use in order to insert the GstBuffer in side the
GstBuffer Pool.
2- How do I can link a GstBuffer Pool with Gstbuffer?



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel