Skip to content
Snippets Groups Projects
Commit 4d1a331c authored by Rémi Bernon's avatar Rémi Bernon :speech_balloon: Committed by Alexandre Julliard
Browse files

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.
parent 52387aa1
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
......@@ -1205,6 +1205,7 @@ static DWORD check_mf_sample_(const char *file, int line, IMFSample *sample, con
timestamp = 0xdeadbeef;
hr = IMFSample_GetSampleTime(sample, &timestamp);
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},
};
......
......@@ -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))
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment