We were assunming that GStreamer size for RGB (24bit packed) data was width x
height x 3, but GStreamer defaults to specific alignment. Use GstVideoInfo API
in order to obtain the buffer size.
This fixes failure seen when trying to merge: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/998
which make us negoaite 1x1 instead of 16x16 in this test.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2297>
gst_test_video_src_alloc (GstPushSrc * src, GstBuffer ** buf)
{
GstTestVideoSrc *self = GST_TEST_VIDEO_SRC (src);
+ GstVideoInfo vinfo;
guint8 *data;
gsize data_size;
self->caps = NULL;
}
- data_size = self->width * self->height * 3; /* RGB size */
+ gst_video_info_set_format (&vinfo, GST_VIDEO_FORMAT_RGB, self->width,
+ self->height);
+
+ data_size = vinfo.size;
data = g_malloc (data_size);
*buf = gst_buffer_new_wrapped (data, data_size);