<html><head>


<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>
<style>pre,code,address {
  margin: 0px;
}
h1,h2,h3,h4,h5,h6 {
  margin-top: 0.2em;
  margin-bottom: 0.2em;
}
ol,ul {
  margin-top: 0em;
  margin-bottom: 0em;
}
blockquote {
  margin-top: 0em;
  margin-bottom: 0em;
}
</style></head>
<body lang="EN-US" link="#467886" vlink="#96607D" style="word-wrap:break-word"><div>Hi,</div><div><br></div><div>Le mardi 06 mai 2025 à 09:54 +0000, Pratik Pachange (QUIC) a écrit :</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Hi<br><br>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 </span></p><p class="MsoNormal"></p></div></blockquote><div><br></div><div>Apparently that was to work around a bug on the Pi (in 2017). I don't remember much, its related to this archived issue report:<br><br><a href="https://bugzilla.gnome.org/show_bug.cgi?id=775564">https://bugzilla.gnome.org/show_bug.cgi?id=775564</a></div><div><br></div><div>The driver would report what was "probably" aligned size, but then in bytesused, it would report the actual pixel data surface. Feel free to propose a patch. You can't just revert that old change, since otherwise the pool will consider your raw frames truncated and will drop them. This probably need a proper split so that we correctly populate maxsize vs size in GstMemory.</div><div><br></div><div>regards,</div><div>Nicolas</div><div><br></div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div class="WordSection1"><p class="MsoNormal"><span style="font-size:11.0pt"><br>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. <br><br>For example, for resolution 1920x540, driver returns width and height as 1920x544  (height is 32 bytes aligned) and sizeimage as 1568768.<br>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).<br>So, this difference of the expected buffer size and actual buffer size should be provided as padding requirement in propose allocation.<o:p></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt">Thanks<br>Pratik<o:p></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p></div></blockquote><div><br></div><div><span></span></div></body></html>