video: allow frame copy where destination dimensions are smaller than source

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/695>
This commit is contained in:
Aaron Boxer 2020-06-15 09:46:17 -04:00
parent 02602dd63c
commit b813c40788

View file

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