mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-01 21:18:52 +00:00
v4l2bufferpool: Fix stride for NV12/NV21
https://bugzilla.gnome.org/show_bug.cgi?id=707758
This commit is contained in:
parent
a5ceab82dd
commit
78adf28a61
1 changed files with 9 additions and 2 deletions
|
@ -247,8 +247,15 @@ gst_v4l2_buffer_pool_alloc_buffer (GstBufferPool * bpool, GstBuffer ** buffer,
|
||||||
offs = 0;
|
offs = 0;
|
||||||
for (i = 0; i < n_planes; i++) {
|
for (i = 0; i < n_planes; i++) {
|
||||||
offset[i] = offs;
|
offset[i] = offs;
|
||||||
stride[i] =
|
if (info->finfo->format == GST_VIDEO_FORMAT_NV12
|
||||||
GST_VIDEO_FORMAT_INFO_SCALE_WIDTH (finfo, i, obj->bytesperline);
|
|| info->finfo->format == GST_VIDEO_FORMAT_NV21) {
|
||||||
|
stride[i] =
|
||||||
|
(i == 0) ? GST_VIDEO_FORMAT_INFO_SCALE_WIDTH (finfo, i,
|
||||||
|
obj->bytesperline) : stride[0];
|
||||||
|
} else {
|
||||||
|
stride[i] =
|
||||||
|
GST_VIDEO_FORMAT_INFO_SCALE_WIDTH (finfo, i, obj->bytesperline);
|
||||||
|
}
|
||||||
|
|
||||||
offs +=
|
offs +=
|
||||||
stride[i] * GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT (finfo, i, height);
|
stride[i] * GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT (finfo, i, height);
|
||||||
|
|
Loading…
Reference in a new issue