From b813c407888c17f5105d9aa54bdec2c7d865d55f Mon Sep 17 00:00:00 2001 From: Aaron Boxer Date: Mon, 15 Jun 2020 09:46:17 -0400 Subject: [PATCH] video: allow frame copy where destination dimensions are smaller than source Part-of: --- gst-libs/gst/video/video-frame.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/video/video-frame.c b/gst-libs/gst/video/video-frame.c index 6cef04a8b3..05a1e97d02 100644 --- a/gst-libs/gst/video/video-frame.c +++ b/gst-libs/gst/video/video-frame.c @@ -286,6 +286,9 @@ gst_video_frame_unmap (GstVideoFrame * frame) * * Copy the plane with index @plane from @src to @dest. * + * Note: Since: 1.18, @dest dimensions are allowed to be + * smaller than @src dimensions. + * * Returns: TRUE if the contents could be copied. */ gboolean @@ -309,8 +312,8 @@ gst_video_frame_copy_plane (GstVideoFrame * dest, const GstVideoFrame * src, finfo = dinfo->finfo; - g_return_val_if_fail (dinfo->width == sinfo->width - && dinfo->height == sinfo->height, FALSE); + g_return_val_if_fail (dinfo->width <= sinfo->width + && dinfo->height <= sinfo->height, FALSE); g_return_val_if_fail (finfo->n_planes > plane, FALSE); sp = src->data[plane];