v4l2: Enhancement to send video alignment info for padding requirements in propose allocation
"Pratik Pachange \(QUIC\) via gstreamer-devel" <[email protected]> Tue, 6 May 2025 09:54:47 +0000
| Newsgroups | gmane.comp.video.gstreamer.devel |
|---|---|
| Message-ID | <BL0PR02MB55076920568BA6F9E2CB1D23F0892@BL0PR02MB5507.namprd02.prod.outlook.com> |
--_000_BL0PR02MB55076920568BA6F9E2CB1D23F0892BL0PR02MB5507namp_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Hi
Our video driver expects buffer size to be aligned to 4096 bytes (4 KB). Th=
e 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 di=
fference 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 19=
20x544 (height is 32 bytes aligned) and sizeimage as 1568768.
As per NV12 format, the actual buffer size for this resolution is 1920x544x=
3/2 =3D 1566720. But driver expects buffer size of 1568768 (4KB alignment o=
f 1566720).
So, this difference of the expected buffer size and actual buffer size shou=
ld be provided as padding requirement in propose allocation.
Thanks
Pratik
--_000_BL0PR02MB55076920568BA6F9E2CB1D23F0892BL0PR02MB5507namp_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Aptos;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:12.0pt;
font-family:"Aptos",sans-serif;
mso-ligatures:standardcontextual;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Aptos",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"EN-US" link=3D"#467886" vlink=3D"#96607D" style=3D"word-wrap:=
break-word">
<div class=3D"WordSection1">
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">Hi<br>
<br>
Our video driver expects buffer size to be aligned to 4096 bytes (4 KB). Th=
e 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 <br>
<br>
For a particular resolution and format (mostly NV12), we expect that the di=
fference 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. <br>
<br>
For example, for resolution 1920x540, driver returns width and height as 19=
20x544 (height is 32 bytes aligned) and sizeimage as 1568768.<br>
As per NV12 format, the actual buffer size for this resolution is 1920x544x=
3/2 =3D 1566720. But driver expects buffer size of 1568768 (4KB alignment o=
f 1566720).<br>
So, this difference of the expected buffer size and actual buffer size shou=
ld be provided as padding requirement in propose allocation.<o:p></o:p></sp=
an></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p> </o:p></=
span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p> </o:p></=
span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">Thanks<br>
Pratik<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p> </o:p></=
span></p>
</div>
</body>
</html>
--_000_BL0PR02MB55076920568BA6F9E2CB1D23F0892BL0PR02MB5507namp_--