From cefc1c4d501158afcb34a866ea22977ecf2fdd7c Mon Sep 17 00:00:00 2001 From: Jeffy Chen Date: Fri, 15 Jul 2022 12:14:44 +0800 Subject: [PATCH 33/46] waylandsink: Fix buffer size error when video cropped Prefer video meta's size instead of the cropped size from caps. Tested with: gst-launch-1.0 videotestsrc ! videocrop left=100 ! waylandsink Signed-off-by: Jeffy Chen --- ext/wayland/gstwaylandsink.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/wayland/gstwaylandsink.c b/ext/wayland/gstwaylandsink.c index 5f99d6f..d264735 100644 --- a/ext/wayland/gstwaylandsink.c +++ b/ext/wayland/gstwaylandsink.c @@ -1056,6 +1056,10 @@ gst_wayland_sink_show_frame (GstVideoSink * vsink, GstBuffer * buffer) if (vmeta) { gint i; + /* prefer the padded width/height from vmeta */ + self->video_info.width = vmeta->width; + self->video_info.height = vmeta->height; + for (i = 0; i < vmeta->n_planes; i++) { self->video_info.offset[i] = vmeta->offset[i]; self->video_info.stride[i] = vmeta->stride[i]; -- 2.20.1