<div dir="ltr">It looks like that the component *2 is because in RGB16 1pixel is 2 bytes, so the 384*288 pixmap requires 384*288*2 bytes. Still wondering why there is 385, not 384.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">pon., 18 lut 2019 o 22:10 Wudo Balmus <<a href="mailto:wudo.balmus@gmail.com">wudo.balmus@gmail.com</a>> napisał(a):<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 dir="ltr"><div dir="ltr">Hello,<br>I'm trying to understand the example for appsrc element described in the official tutorial:<br><br><a href="https://gstreamer.freedesktop.org/documentation/application-development/advanced/pipeline-manipulation.html" target="_blank">https://gstreamer.freedesktop.org/documentation/application-development/advanced/pipeline-manipulation.html</a><br><br>We specify caps like that:<br><br> g_object_set (G_OBJECT (appsrc), "caps",<br> gst_caps_new_simple ("video/x-raw",<br> "format", G_TYPE_STRING, "RGB16",<br> "width", G_TYPE_INT, 384,<br> "height", G_TYPE_INT, 288,<br> "framerate", GST_TYPE_FRACTION, 0, 1,<br> NULL), NULL);<br><br>Then, when need-data function is called, there is created a GstBuffer of size:<br><br>size = 385 * 288 * 2;<br><br>filled with some color and pushed to appsrc.<br><br>Two questions:<br><br>1. Why there is component 385, not 384 in the size of the buffer? In caps there was specified that the width is 384, but in the size of the buffer 385 appeared.<br>2. Why the size is multiplied by 2? Cannot we just send 1 frame? I tried to remove the *2 component, but then the background becomes a different colour than expected.</div><div dir="ltr"> I tried also to modify duration, to make it 1fps, but still doesn't work.<br><br>Best regards,<br>Wudo<br></div></div></div>
</blockquote></div>