HELP: RGB buffer format query (I am trying to pass a buffer to appsrc)

Edward Anon blakat360 at gmail.com
Sun Jun 20 15:03:25 UTC 2021


Before figuring out how to make an appsrc take an OpenGL texture, I wanted
to pass an RGB buffer.  I played with this
<https://gist.github.com/floe/e35100f091315b86a5bf#file-gst-appsrc-c-L14>
example for a while and ended up with this code
<https://pastebin.com/A0vnK5LB>.

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.

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?

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?

I suspect the queries are related. Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20210620/0df5b3d9/attachment.htm>


More information about the gstreamer-devel mailing list