video: allow frame copy destination to have dimensions smaller than source

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/707>
This commit is contained in:
Aaron Boxer 2020-06-16 11:44:08 -04:00 committed by Nicolas Dufresne
parent e6823576ce
commit c770f0b68e

View file

@ -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;