Module: wine Branch: master Commit: 4d1a331c6619703e5766d50ddf0399eaa079ffe3 URL: https://gitlab.winehq.org/wine/wine/-/commit/4d1a331c6619703e5766d50ddf0399e...
Author: Rémi Bernon rbernon@codeweavers.com Date: Thu May 25 15:03:22 2023 +0200
winegstreamer: Use the output wg_format in CAPS sink query.
Instead of constraining the output caps to the current resolution, which breaks when streams with different resolutions are concatenated.
---
dlls/mf/tests/mf_test.h | 1 + dlls/mf/tests/transform.c | 15 ++++++++++++--- dlls/winegstreamer/wg_transform.c | 6 +++++- 3 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/dlls/mf/tests/mf_test.h b/dlls/mf/tests/mf_test.h index e48204224b4..47b05e14777 100644 --- a/dlls/mf/tests/mf_test.h +++ b/dlls/mf/tests/mf_test.h @@ -95,6 +95,7 @@ struct sample_desc DWORD repeat_count; BOOL todo_length; BOOL todo_duration; + BOOL todo_time; };
#define check_mf_sample_collection(a, b, c) check_mf_sample_collection_(__FILE__, __LINE__, a, b, c) diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index c7b001bfb11..85102bee70d 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -1205,6 +1205,7 @@ static DWORD check_mf_sample_(const char *file, int line, IMFSample *sample, con timestamp = 0xdeadbeef; hr = IMFSample_GetSampleTime(sample, ×tamp); ok_(file, line)(hr == S_OK, "GetSampleTime returned %#lx\n", hr); + todo_wine_if(expect->todo_time) ok_(file, line)(llabs(timestamp - expect->sample_time) <= 50, "got sample time %I64d\n", timestamp);
@@ -4024,7 +4025,7 @@ static void test_h264_decoder_concat_streams(void) { {.length = 0x3600}, {.length = 0x4980}, - {.length = 0x4980, .todo_length = TRUE}, + {.length = 0, .todo_length = TRUE}, }; const struct attribute_desc output_sample_attributes[] = { @@ -4041,18 +4042,26 @@ static void test_h264_decoder_concat_streams(void) { .attributes = output_sample_attributes + 0, .sample_time = 12000000, .sample_duration = 400000, - .buffer_count = 1, .buffers = output_buffer_desc + 2, .repeat_count = 29, - .todo_length = TRUE, + .buffer_count = 1, .buffers = output_buffer_desc + 1, .repeat_count = 29, }, { .attributes = output_sample_attributes + 0, .sample_time = 0, .sample_duration = 400000, .buffer_count = 1, .buffers = output_buffer_desc + 0, .repeat_count = 29, + .todo_time = TRUE, }, { .attributes = output_sample_attributes + 0, .sample_time = 12000000, .sample_duration = 400000, .buffer_count = 1, .buffers = output_buffer_desc + 1, .repeat_count = 6, + .todo_time = TRUE, + }, + { + /* Wine outputs spurious buffers */ + .attributes = output_sample_attributes + 0, + .sample_time = 0, .sample_duration = 400000, + .buffer_count = 1, .buffers = output_buffer_desc + 2, .repeat_count = 22, + .todo_time = TRUE, .todo_length = TRUE, }, {0}, }; diff --git a/dlls/winegstreamer/wg_transform.c b/dlls/winegstreamer/wg_transform.c index d0f94ed7649..8f1f595ea76 100644 --- a/dlls/winegstreamer/wg_transform.c +++ b/dlls/winegstreamer/wg_transform.c @@ -56,6 +56,7 @@ struct wg_transform GstElement *video_flip;
guint output_plane_align; + struct wg_format output_format; struct wg_sample *output_wg_sample; GstAtomicQueue *output_queue; GstSample *output_sample; @@ -174,7 +175,8 @@ static gboolean transform_sink_query_cb(GstPad *pad, GstObject *parent, GstQuery gchar *str;
gst_query_parse_caps(query, &filter); - caps = gst_caps_ref(transform->output_caps); + if (!(caps = wg_format_to_caps(&transform->output_format))) + break;
if (filter) { @@ -300,6 +302,7 @@ NTSTATUS wg_transform_create(void *args) goto out; transform->input_max_length = 1; transform->output_plane_align = 0; + transform->output_format = output_format;
if (!(src_caps = wg_format_to_caps(&input_format))) goto out; @@ -493,6 +496,7 @@ NTSTATUS wg_transform_set_output_format(void *args) GST_ERROR("Failed to convert format %p to caps.", format); return STATUS_UNSUCCESSFUL; } + transform->output_format = *format;
if (gst_caps_is_always_compatible(transform->output_caps, caps)) {