mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 23:06:49 +00:00
v4l2bufferpool: Also fix strides for other semi-planar video formats
This commit is contained in:
parent
78adf28a61
commit
1e7c3e4520
1 changed files with 15 additions and 8 deletions
|
@ -247,14 +247,21 @@ 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;
|
||||||
if (info->finfo->format == GST_VIDEO_FORMAT_NV12
|
|
||||||
|| info->finfo->format == GST_VIDEO_FORMAT_NV21) {
|
switch (info->finfo->format) {
|
||||||
stride[i] =
|
case GST_VIDEO_FORMAT_NV12:
|
||||||
(i == 0) ? GST_VIDEO_FORMAT_INFO_SCALE_WIDTH (finfo, i,
|
case GST_VIDEO_FORMAT_NV21:
|
||||||
obj->bytesperline) : stride[0];
|
case GST_VIDEO_FORMAT_NV16:
|
||||||
} else {
|
case GST_VIDEO_FORMAT_NV24:
|
||||||
stride[i] =
|
stride[i] =
|
||||||
GST_VIDEO_FORMAT_INFO_SCALE_WIDTH (finfo, i, obj->bytesperline);
|
2 * GST_VIDEO_FORMAT_INFO_SCALE_WIDTH (finfo, i,
|
||||||
|
obj->bytesperline);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
stride[i] =
|
||||||
|
GST_VIDEO_FORMAT_INFO_SCALE_WIDTH (finfo, i,
|
||||||
|
obj->bytesperline);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
offs +=
|
offs +=
|
||||||
|
|
Loading…
Reference in a new issue