va: refine the VIDEO_ALIGNMENT inside va buffer pool.
-
Review changes -
-
Download -
Patches
-
Plain diff
The current way of VIDEO_ALIGNMENT handling in VA is not precise. First, we still get a lot of warning such as:
0:00:01.402578248 2729491 0x55c9811a6720 WARN videometa gstvideometa.c:414:gst_video_meta_validate_alignment: Stride of plane 0 defined in meta (1024) is different from the one computed from
the alignment (1000)
And the alignment of output buffer's video meta is not correct if we have a left or top offset for output display picture.
We now meet a lot of H265 stream with conformance_window_flag=1 and conf_win_left/top_offset>0, which means the output display picture is in the middle of the decoded picture, not in the left-up cornor. We can not handle this now.
In current manner,
- We just use the video align to expand the decoded surface resolution, such as:
base->valign = (GstVideoAlignment) {
.padding_bottom = self->coded_height - base->height,
.padding_left = self->coded_width - base->width,
};
We do not really care about the real position of the output display picture position here, we just assume it in the up-right corner.
-
In gst_va_pool_set_config, the video_align is just used for calculation the real decoded buffer's width and height. https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/blob/master/sys/va/gstvapool.c#L124 in fact has no effect. The gst_video_info_align just calculate the offset and stride based on the video_align. But all the offsets and strides are overwritten in gst_va_dmabuf_allocator_try or gst_va_allocator_try later. Here, we assume the output display picture is in the left-up corner.
-
When allocate buffer, https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/blob/master/sys/va/gstvapool.c#L256 assign the wrong video_align. Again we assumes that the output display picture is in the right-up corner.
-
In real buffer usage, we assume the output display picture is in the left-up corner again, like: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/blob/master/sys/va/gstvafilter.c#L1177
So, the conclusion is, we just use video_align to calculate the real decoded buffer's width and height now and do not care about the real position of output display picture inside the decoded buffer. When the output display picture is not in the left-up corner, we have error.
Merge request reports
- version 18f239bca8
- version 17551ff41f
- version 1628120842
- version 15fab64f4c
- version 14fb903169
- version 13533e0f07
- version 1220692843
- version 11cb5b67de
- version 106f3279fa
- version 9b5eb98fe
- version 8e7e6cea5
- version 76f6cbad2
- version 6eafb4056
- version 5df6c803b
- version 4e7f2eae7
- version 3bec0a44d
- version 2c5ac1979
- version 101312a1f
- master (base)
- latest versiona2d522348 commits,
- version 18f239bca88 commits,
- version 17551ff41f8 commits,
- version 16281208428 commits,
- version 15fab64f4c8 commits,
- version 14fb9031698 commits,
- version 13533e0f078 commits,
- version 12206928438 commits,
- version 11cb5b67de8 commits,
- version 106f3279fa8 commits,
- version 9b5eb98fe8 commits,
- version 8e7e6cea58 commits,
- version 76f6cbad28 commits,
- version 6eafb40568 commits,
- version 5df6c803b7 commits,
- version 4e7f2eae77 commits,
- version 3bec0a44d7 commits,
- version 2c5ac19799 commits,
- version 101312a1f1 commit,
- Side-by-side
- Inline