<div dir="ltr">My bad - the buffer sizing is incorrect. If the width is a multiple of 3 it works.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jun 20, 2021 at 4:03 PM Edward Anon <<a href="mailto:blakat360@gmail.com">blakat360@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Before figuring out how to make an appsrc take an OpenGL texture, I wanted to pass an RGB buffer.  I played with <a href="https://gist.github.com/floe/e35100f091315b86a5bf#file-gst-appsrc-c-L14" target="_blank">this</a> example for a while and ended up with <a href="https://pastebin.com/A0vnK5LB" target="_blank">this code</a>.</div><div><br></div><div>Like
 the example, I can happily get the screen to alternate between white and black. However, I don't understand the structure of the buffer 
GStreamer expects.<br><br></div><div>Why does GStreamer seem to expect the minimum buffer size to be WIDTH * HEIGHT * CHANNELS + HEIGHT? Why is it not just WIDTH * HEIGHT * CHANNELS for an RGB buffer (where the array passed as the buffer is an array of bytes)? Why would I want to pass a larger buffer?</div><div><br></div><div>Also, when I try to set 
the colour to green, red or blue and only write to the first WIDTH * 
CHANNELS bytes in the buffer I get one clean row of the expected colour.
 However, this row changes colour when I write to the next WIDTH * 
CHANNELS bytes. Why is this? How do I fix it?<br><br></div><div>I suspect the queries are related. Thanks in advance.</div></div>
</blockquote></div>