video-frame: only copy the visible region

Make sure to only copy the visible region instead of assuming that the complete
stride is visible (which is not the case when padding is used).
This commit is contained in:
Wim Taymans 2012-08-20 16:17:27 +02:00
parent 6702a2f64c
commit 211b8b6004

View file

@ -230,7 +230,10 @@ gst_video_frame_copy_plane (GstVideoFrame * dest, const GstVideoFrame * src,
ss = sinfo->stride[plane];
ds = dinfo->stride[plane];
w = MIN (ABS (ss), ABS (ds));
/* FIXME. assumes subsampling of component N is the same as plane N, which is
* currently true for all formats we have but it might not be in the future. */
w = GST_VIDEO_FRAME_COMP_WIDTH (dest,
plane) * GST_VIDEO_FRAME_COMP_PSTRIDE (dest, plane);
h = GST_VIDEO_FRAME_COMP_HEIGHT (dest, plane);
GST_CAT_DEBUG (GST_CAT_PERFORMANCE, "copy plane %d, w:%d h:%d ", plane, w, h);