[FFmpeg-devel] [PATCH] avdevice/xcbgrab: Improve non-shm performance

Kusanagi Kouichi slash at ac.auone-net.jp
Wed Dec 4 07:15:05 EET 2019


On 2019-12-03 21:25:37 +0100, Marton Balint wrote:
> 
> 
> On Tue, 3 Dec 2019, Kusanagi Kouichi wrote:
> 
> > On 2019-11-19 22:59:56 +0900, Kusanagi Kouichi wrote:
> > > Use AVBufferPool.
> 
> You don't need a buffer pool for the non-shm case, you should wrap the XCB
> data in a buffer ref instead. I will reply with a patch that shows how it is
> done, please check if it works correctly, as I am not 100% sure how xcb data
> structures should be allocated/freed.
> 

Is it safe to omit AV_INPUT_BUFFER_PADDING_SIZE bytes padding? My first
version is identical to yours. Valgrind reported no error. But I'm not sure.

> What actually would benefit from a buffer pool is the SHM case. A pool of
> SHM buffers which are wrapped in a buffer ref can avoid yet another memcpy.
> Is the amount of SHM space that is usually available is limited or not? If
> so, how much is the limit? Can we safely allocate at least 10-20 buffers?
> 
> Regards,
> Marton
> 


More information about the ffmpeg-devel mailing list