This ensures that the stride calculation performed by `gst_video_info_align` matches the result in `wg_format_get_stride`. Otherwise, we can get a size mismatch which will result in a `STATUS_BUFFER_TOO_SMALL` error.
This affected formats where not all planes had the same stride. For example: I420, YV12, etc (where the 'U' and 'V' planes are horizontally subsampled and stored in their own plane).
The error would occur if half the aligned primary plane stride was not also on the desired alignment. For example: a width of 1828 would be padded to 1840 (aligned to the next multiple of 16), but half of this is 920 which is not a multiple of 16. Hence `gst_video_info_align` was adding additional padding to also align that, which is 928. The result would be a stride of 1856 for the primary plane, whilst `wg_format_get_stride` would stay with the original value of 1840.
From: Brendan McGrath bmcgrath@codeweavers.com
This ensures that the stride calculation performed by gst_video_info_align matches the result in wg_format_get_stride. Otherwise, we can get a size mismatch which will result in a STATUS_BUFFER_TOO_SMALL error.
This affected formats where not all planes had the same stride. For example: I420, YV12, etc (where the 'U' and 'V' planes are horizontally subsampled and stored in their own plane).
The error would occur if half the aligned primary plane stride was not also on the desired alignment. For example: a width of 1828 would be padded to 1840 (aligned to the next multiple of 16), but half of this is 920 which is not a multiple of 16. Hence gst_video_info_align was adding additional padding to also align that, which is 928. The result would be a stride of 1856 for the primary plane, whilst wg_format_get_stride would stay with the original value of 1840. --- dlls/winegstreamer/wg_transform.c | 3 --- 1 file changed, 3 deletions(-)
diff --git a/dlls/winegstreamer/wg_transform.c b/dlls/winegstreamer/wg_transform.c index b8dc6d98b98..5c1f2fd62bc 100644 --- a/dlls/winegstreamer/wg_transform.c +++ b/dlls/winegstreamer/wg_transform.c @@ -129,9 +129,6 @@ static void align_video_info_planes(MFVideoInfo *video_info, gsize plane_align, }
align->stride_align[0] = plane_align; - align->stride_align[1] = plane_align; - align->stride_align[2] = plane_align; - align->stride_align[3] = plane_align;
gst_video_info_align(info, align);
Can we test and confirm how windows aligns such planes?
On Sun May 4 23:44:04 2025 +0000, Rémi Bernon wrote:
Can we test and confirm how windows aligns such planes?
I'll look to add a test to this MR. But I tested locally and the value of `MF_MT_DEFAULT_STRIDE` returned by Windows was 1840. I would then half this to copy the 'U' and 'V' planes.
On Mon May 5 08:02:38 2025 +0000, Brendan McGrath wrote:
I'll look to add a test to this MR. But I tested locally and the value of `MF_MT_DEFAULT_STRIDE` returned by Windows was 1840. I would then half this to copy the 'U' and 'V' planes.
Okay sounds good then, thanks.
This merge request was approved by Rémi Bernon.
This merge request was approved by Elizabeth Figura.