[PATCH 3/5] winegstreamer: Remove width/height from caps when format uses 0.
Rémi Bernon
wine at gitlab.winehq.org
Thu May 12 03:15:09 CDT 2022
From: Rémi Bernon <rbernon at codeweavers.com>
To support formats with no forced width/height in the H264 transform.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45988
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47084
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49715
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52183
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
dlls/mf/tests/mf.c | 1 -
dlls/winegstreamer/h264_decoder.c | 6 ++++++
dlls/winegstreamer/wg_format.c | 4 ++++
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
index 8f2c050e3c6..97c0c94159b 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -7160,7 +7160,6 @@ static void test_h264_decoder(void)
"got status %#lx\n", status);
hr = IMFSample_GetTotalLength(output.pSample, &length);
ok(hr == S_OK, "GetTotalLength returned %#lx\n", hr);
- todo_wine_if(length == 1920 * 1080 * 3 / 2)
ok(length == 0, "got length %lu\n", length);
ret = IMFSample_Release(output.pSample);
ok(ret == 0, "Release returned %lu\n", ret);
diff --git a/dlls/winegstreamer/h264_decoder.c b/dlls/winegstreamer/h264_decoder.c
index de823741ba9..58960cd632a 100644
--- a/dlls/winegstreamer/h264_decoder.c
+++ b/dlls/winegstreamer/h264_decoder.c
@@ -75,6 +75,12 @@ static HRESULT try_create_wg_transform(struct h264_decoder *decoder)
if (output_format.major_type == WG_MAJOR_TYPE_UNKNOWN)
return MF_E_INVALIDMEDIATYPE;
+ /* Don't force any specific size, H264 streams already have the metadata for it
+ * and will generate a MF_E_TRANSFORM_STREAM_CHANGE result later.
+ */
+ output_format.u.video.width = 0;
+ output_format.u.video.height = 0;
+
if (!(decoder->wg_transform = wg_transform_create(&input_format, &output_format)))
return E_FAIL;
diff --git a/dlls/winegstreamer/wg_format.c b/dlls/winegstreamer/wg_format.c
index 5b3a5617ff1..d313c285d73 100644
--- a/dlls/winegstreamer/wg_format.c
+++ b/dlls/winegstreamer/wg_format.c
@@ -399,6 +399,10 @@ static GstCaps *wg_format_to_caps_video(const struct wg_format *format)
{
gst_structure_remove_fields(gst_caps_get_structure(caps, i),
"framerate", "pixel-aspect-ratio", "colorimetry", "chroma-site", NULL);
+ if (!format->u.video.width)
+ gst_structure_remove_fields(gst_caps_get_structure(caps, i), "width", NULL);
+ if (!format->u.video.height)
+ gst_structure_remove_fields(gst_caps_get_structure(caps, i), "height", NULL);
}
}
return caps;
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/61
More information about the wine-devel
mailing list