mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
video: respect stride alignment when calculating planes offsets
https://bugzilla.gnome.org/show_bug.cgi?id=694299
This commit is contained in:
parent
0bb5065b62
commit
28e1dadbfa
1 changed files with 10 additions and 4 deletions
|
@ -767,6 +767,7 @@ gst_video_info_align (GstVideoInfo * info, GstVideoAlignment * align)
|
|||
|
||||
for (i = 0; i < n_planes; i++) {
|
||||
gint vedge, hedge, comp;
|
||||
guint offset;
|
||||
|
||||
/* Find the component for this plane, FIXME, we assume the plane number and
|
||||
* component number is the same for now, for scaling the dimensions this is
|
||||
|
@ -780,10 +781,15 @@ gst_video_info_align (GstVideoInfo * info, GstVideoAlignment * align)
|
|||
vedge =
|
||||
GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT (vinfo, comp, align->padding_top);
|
||||
|
||||
GST_DEBUG ("plane %d: comp: %d, hedge %d vedge %d align %d stride %d", i,
|
||||
comp, hedge, vedge, align->stride_align[i], info->stride[i]);
|
||||
|
||||
info->offset[i] += (vedge * info->stride[i]) +
|
||||
offset = (vedge * info->stride[i]) +
|
||||
(hedge * GST_VIDEO_FORMAT_INFO_PSTRIDE (vinfo, comp));
|
||||
|
||||
offset = (offset + align->stride_align[i]) & ~align->stride_align[i];
|
||||
|
||||
GST_DEBUG ("plane %d: comp: %d, hedge %d vedge %d align %d stride %d "
|
||||
"offset %u", i, comp, hedge, vedge, align->stride_align[i],
|
||||
info->stride[i], offset);
|
||||
|
||||
info->offset[i] += offset;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue