v4l2: Enhancement to send video alignment info for padding requirements in propose allocation

Pratik Pachange (QUIC) quic_ppachang at quicinc.com
Tue May 6 09:54:47 UTC 2025


Hi

Our video driver expects buffer size to be aligned to 4096 bytes (4 KB). The expected sizeimage is returned in S_FMT ioctl call by the driver. But in gst_v4l2_object_extrapolate_info (), the info->size value is updated as per the width and height returned by driver

For a particular resolution and format (mostly NV12), we expect that the difference in actual buffer size and the size expected by the video driver be provided as padding in propose allocation, so that the upstream plugin can allocate buffer as per the driver requirement.

For example, for resolution 1920x540, driver returns width and height as 1920x544  (height is 32 bytes aligned) and sizeimage as 1568768.
As per NV12 format, the actual buffer size for this resolution is 1920x544x3/2 = 1566720. But driver expects buffer size of 1568768 (4KB alignment of 1566720).
So, this difference of the expected buffer size and actual buffer size should be provided as padding requirement in propose allocation.


Thanks
Pratik

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20250506/4330a3d3/attachment.htm>


More information about the gstreamer-devel mailing list