Video info calculating incorrect size for RGB format
I am getting an "invalid buffer size" when using appsrc to push RGB buffers (occasionally changing dimensions) to a simple pipeline "appsrc -> videoconvert -> autovideosink".
Looking into it more i found out that the message comes from a mismatch between the buffer size and the video info expected size, while transforming in videoconvert. The expected size is calculated as following
info->stride[0] = GST_ROUND_UP_4 (width * 2);
info->size = info->stride[0] * height;
So for example, for a 350x350 RGB video, the size should be 350x350x3 = 367,500
However it is expected to be 368200
This can be reproduced with creating caps = (width 350, height 350, format = RGB) and converting them with gst_video_info_from_caps
;
I would appreciate any suggestion on how to work around this, and why the rounding is needed. Thank you in advance