diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2015-09-24 11:33:24 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-09-24 17:39:43 +0200 |
commit | 1fb85733f5dbc28aa113729d5b3f561ee1a34526 (patch) | |
tree | 54b7d07dcb3da2be2dc30594605d74ee0e68595c | |
parent | 94e0279c448fe3997b9833b409f14ec71de8f097 (diff) | |
download | gstreamer-plugins-base-1fb85733f5dbc28aa113729d5b3f561ee1a34526.tar.gz |
video-frame: Fix gst_video_frame_copy() for formats with pstride==0
v210, UYVP and IYU1 are complex formats for which pixel stride does not really
have a meaning. If we copy width*pstride bytes per line, it's not going to do
the right thing. As a fallback, copy stride bytes per line. This might copy
uninitialized bytes at the end of each line, but at least copies the frame.
https://bugzilla.gnome.org/show_bug.cgi?id=755392
-rw-r--r-- | gst-libs/gst/video/video-frame.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gst-libs/gst/video/video-frame.c b/gst-libs/gst/video/video-frame.c index f05958c68..932378422 100644 --- a/gst-libs/gst/video/video-frame.c +++ b/gst-libs/gst/video/video-frame.c @@ -262,10 +262,16 @@ gst_video_frame_copy_plane (GstVideoFrame * dest, const GstVideoFrame * src, return TRUE; } - /* FIXME. assumes subsampling of component N is the same as plane N, which is + /* 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); + /* FIXME: workaround for complex formats like v210, UYVP and IYU1 that have + * pstride == 0 */ + if (w == 0) + w = MIN (GST_VIDEO_INFO_PLANE_STRIDE (dinfo, plane), + GST_VIDEO_INFO_PLANE_STRIDE (sinfo, plane)); + h = GST_VIDEO_FRAME_COMP_HEIGHT (dest, plane); ss = GST_VIDEO_INFO_PLANE_STRIDE (sinfo, plane); |