<div dir="ltr"><div dir="ltr">On Thu, Apr 23, 2020 at 5:49 AM Erik Rull <<a href="mailto:erik.rull@rdsoftware.de">erik.rull@rdsoftware.de</a>> wrote:</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> I ran your pipelines but with videotestsrc instead of appsink, and it works<br>
> fine. Only thing I can see going on is that your appsrc isn't actually producing<br>
> data as GRAY8, 401x404. Also, are you padding the rows to 404x404? GStreamer<br>
> assumes widths are multiples of 4-bytes, so you'll need to pad rows with three<br>
> pixels.<br>
<br>
Oh - I was not aware of that. This would explain a lot - the BGRx is<br>
automatically 4 byte-aligned, the 8 bit data not.<br>
Do you have more information on these constraints? How do I have to handle the<br>
padding? Must I pad to 4 byte and also round up the width to be a multiple of 4?<br>
Or is the pad to 4 sufficient and gstreamer leaves out what is not necessary?<br></blockquote><div><br></div><div>Allocate enough memory for the 404x404 padded image, then memcpy each 401 pixel row to the start of each 404 pixel row, leaving the caps as saying 401. In other words you pad each row with 3 bytes, uninitialized data is fine. GStreamer elements and the video library assume there is padding and will account for it. I have to do this all the time in my plugins, see [0] for an example.</div><div><br></div><div>[0]: <a href="https://github.com/joshdoe/gst-plugins-vision/blob/master/sys/imperxflex/gstframelinksrc.c#L603">https://github.com/joshdoe/gst-plugins-vision/blob/master/sys/imperxflex/gstframelinksrc.c#L603</a></div><div><br></div><div>-Josh </div></div></div>