mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
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
This commit is contained in:
parent
94e0279c44
commit
1fb85733f5
1 changed files with 7 additions and 1 deletions
|
@ -262,10 +262,16 @@ gst_video_frame_copy_plane (GstVideoFrame * dest, const GstVideoFrame * src,
|
||||||
return TRUE;
|
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. */
|
* currently true for all formats we have but it might not be in the future. */
|
||||||
w = GST_VIDEO_FRAME_COMP_WIDTH (dest,
|
w = GST_VIDEO_FRAME_COMP_WIDTH (dest,
|
||||||
plane) * GST_VIDEO_FRAME_COMP_PSTRIDE (dest, plane);
|
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);
|
h = GST_VIDEO_FRAME_COMP_HEIGHT (dest, plane);
|
||||||
|
|
||||||
ss = GST_VIDEO_INFO_PLANE_STRIDE (sinfo, plane);
|
ss = GST_VIDEO_INFO_PLANE_STRIDE (sinfo, plane);
|
||||||
|
|
Loading…
Reference in a new issue