From c770f0b68ee2493d836ef02669604a2ec7a6fa55 Mon Sep 17 00:00:00 2001 From: Aaron Boxer Date: Tue, 16 Jun 2020 11:44:08 -0400 Subject: [PATCH] video: allow frame copy destination to have dimensions 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 05a1e97d02..74b548d146 100644 --- a/gst-libs/gst/video/video-frame.c +++ b/gst-libs/gst/video/video-frame.c @@ -398,6 +398,9 @@ gst_video_frame_copy_plane (GstVideoFrame * dest, const GstVideoFrame * src, * * Copy the contents 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 @@ -414,8 +417,8 @@ gst_video_frame_copy (GstVideoFrame * dest, const GstVideoFrame * src) dinfo = &dest->info; g_return_val_if_fail (dinfo->finfo->format == sinfo->finfo->format, FALSE); - 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); n_planes = dinfo->finfo->n_planes;