GstBufferPool support in gstomxvideoenc.c

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

GstBufferPool support in gstomxvideoenc.c

Jeegar32
Hi All

In gst-omx for decoder (https://github.com/GStreamer/gst-omx/blob/master/omx/gstomxvideodec.c
) for o/p buffer there is support for GstBufferPool So OMX Buffer are wrapped in GstBuffer and passed to next element in pipeline. (No copy is happening)

But same support is missing in gst-omx for Encoder (https://github.com/GStreamer/gst-omx/blob/master/omx/gstomxvideoenc.c ) Here for every output new GstBuffer with new Memory is created and OMX buffer is copied in this new GstBuffer and passed to next element in pipeline.

So is there any reason why this is not implemented? I am planning to implemented GstBufferPool support same as Decoder in encoder so is this feasible right? No design Prohibition right?

Any suggestion for this?

Thanks,
Jeegar Patel
 
Reply | Threaded
Open this post in threaded view
|

Re: GstBufferPool support in gstomxvideoenc.c

sudipj
I would suggest to check the official repo https://cgit.freedesktop.org/gstreamer/gst-omx/

Sudip

On 1 December 2016 at 22:19, Jeegar32 [via GStreamer-devel] <[hidden email]> wrote:
Hi All

In gst-omx for decoder (https://github.com/GStreamer/gst-omx/blob/master/omx/gstomxvideodec.c
) for o/p buffer there is support for GstBufferPool So OMX Buffer are wrapped in GstBuffer and passed to next element in pipeline. (No copy is happening)

But same support is missing in gst-omx for Encoder (https://github.com/GStreamer/gst-omx/blob/master/omx/gstomxvideoenc.c ) Here for every output new GstBuffer with new Memory is created and OMX buffer is copied in this new GstBuffer and passed to next element in pipeline.

So is there any reason why this is not implemented? I am planning to implemented GstBufferPool support same as Decoder in encoder so is this feasible right? No design Prohibition right?

Any suggestion for this?

Thanks,
Jeegar Patel
 


If you reply to this email, your message will be added to the discussion below:
http://gstreamer-devel.966125.n4.nabble.com/GstBufferPool-support-in-gstomxvideoenc-c-tp4680981.html
To start a new topic under GStreamer-devel, email [hidden email]
To unsubscribe from GStreamer-devel, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: GstBufferPool support in gstomxvideoenc.c

Sebastian Dröge-3
In reply to this post by Jeegar32
On Thu, 2016-12-01 at 08:49 -0800, Jeegar32 wrote:

> Hi All
>
> In gst-omx for decoder
> (https://github.com/GStreamer/gst-omx/blob/master/omx/gstomxvideodec.
> c
> ) for o/p buffer there is support for GstBufferPool So OMX Buffer are
> wrapped in GstBuffer and passed to next element in pipeline. (No copy
> is
> happening)
>
> But same support is missing in gst-omx for Encoder
> (https://github.com/GStreamer/gst-omx/blob/master/omx/gstomxvideoenc.
> c )
> Here for every output new GstBuffer with new Memory is created and
> OMX
> buffer is copied in this new GstBuffer and passed to next element in
> pipeline.
>
> So is there any reason why this is not implemented? I am planning to
> implemented GstBufferPool support same as Decoder in encoder so is
> this feasible right? No design Prohibition right? 
Do you need the pool for the input or output port of the encoder?

In any case, it only wasn't implemented so far because nobody did it or
considered it important enough. Go for it :)

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (981 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: GstBufferPool support in gstomxvideoenc.c

Jeegar32
Hi Sebastian Dröge

Yes i am interested for output port of the encoder.

Thanks,
Jeegar Patel
Reply | Threaded
Open this post in threaded view
|

Re: GstBufferPool support in gstomxvideoenc.c

Nicolas Dufresne-5
Le jeudi 01 décembre 2016 à 10:16 -0800, Jeegar32 a écrit :
> Yes i am interested for output port of the encoder.

The output port of the encoder is encoded data. GstBufferPool is meant
for fixed sized buffers. This is not a good fit.

BufferPool is a good fit for the input port, since the data is raw and
fixed size. It is also the type of data that cost a lot of CPU to copy
as it's much larger.

Implementing a buffer pool around fixed set of buffers may introduce
certain difficulties. One thing you need to make sure is to never send
twice the same pool instance in propose_allocation() method.

good luck,
Nicolas
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: GstBufferPool support in gstomxvideoenc.c

Sebastian Dröge-3
On Thu, 2016-12-01 at 14:43 -0500, Nicolas Dufresne wrote:
> Le jeudi 01 décembre 2016 à 10:16 -0800, Jeegar32 a écrit :
> > Yes i am interested for output port of the encoder.
>
> The output port of the encoder is encoded data. GstBufferPool is meant
> for fixed sized buffers. This is not a good fit.

OpenMAX limits this, output buffers have a specific maximum size they
are allocated with. And a maximum size is enough to work with buffer
pools.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (981 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: GstBufferPool support in gstomxvideoenc.c

Jeegar32
Hello guys,

As discussed earlier, I am trying to implement GstBufferPool support in gstomxvideoenc.c just like gstomxvideodec.c

In decoder, using gst_video_decoder_get_buffer_pool() it gets pool and its config and caps value and then it uses them to config new buffer pool  created by gst_omx_buffer_pool_new() and call gst_buffer_pool_set_active().

But for encoder, there is no such  gst_video_encoder_get_buffer_pool() in base class. So how to go ahead here?

I have tried creating new pool using gst_buffer_pool_new() and getting its config and caps value and using it to configure our new pool created by gst_omx_buffer_pool_new(). But here it get fails in  gst_buffer_pool_set_active().

Whats is the correct way of doing this? Any example code will be helpful.

Regards,
Jeegar