winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
June 2024
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
613 discussions
Start a n
N
ew thread
Rémi Bernon : winegstreamer: Request the new transform output format explicitly.
by Alexandre Julliard
06 Jun '24
06 Jun '24
Module: wine Branch: master Commit: 1e8e0d41b4b55953f5366d072397b07659d46019 URL:
https://gitlab.winehq.org/wine/wine/-/commit/1e8e0d41b4b55953f5366d072397b0…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Mar 11 12:47:06 2024 +0100 winegstreamer: Request the new transform output format explicitly. --- dlls/winegstreamer/aac_decoder.c | 2 +- dlls/winegstreamer/color_convert.c | 2 +- dlls/winegstreamer/gst_private.h | 9 ++++- dlls/winegstreamer/main.c | 19 ++++++++--- dlls/winegstreamer/resampler.c | 2 +- dlls/winegstreamer/unix_private.h | 1 + dlls/winegstreamer/unixlib.h | 8 ++++- dlls/winegstreamer/video_decoder.c | 12 ++++--- dlls/winegstreamer/video_processor.c | 3 +- dlls/winegstreamer/wg_parser.c | 19 +++++++++-- dlls/winegstreamer/wg_sample.c | 19 +++-------- dlls/winegstreamer/wg_transform.c | 66 +++++++++++++++++++++++------------- dlls/winegstreamer/wma_decoder.c | 2 +- 13 files changed, 107 insertions(+), 57 deletions(-)
1
0
0
0
Rémi Bernon : winegstreamer: Use a caps to store the desired output format.
by Alexandre Julliard
06 Jun '24
06 Jun '24
Module: wine Branch: master Commit: 3dd3535a2c5ba0970602106a9fe8f4544f412701 URL:
https://gitlab.winehq.org/wine/wine/-/commit/3dd3535a2c5ba0970602106a9fe8f4…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Jun 3 10:22:50 2024 +0200 winegstreamer: Use a caps to store the desired output format. --- dlls/winegstreamer/wg_transform.c | 85 +++++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 35 deletions(-) diff --git a/dlls/winegstreamer/wg_transform.c b/dlls/winegstreamer/wg_transform.c index 25bfb453dd4..98d3cf8760c 100644 --- a/dlls/winegstreamer/wg_transform.c +++ b/dlls/winegstreamer/wg_transform.c @@ -56,10 +56,10 @@ struct wg_transform bool input_is_flipped; GstElement *video_flip; - struct wg_format output_format; GstAtomicQueue *output_queue; GstSample *output_sample; bool output_caps_changed; + GstCaps *desired_caps; GstCaps *output_caps; }; @@ -188,28 +188,53 @@ static gboolean transform_sink_query_allocation(struct wg_transform *transform, return true; } -static GstCaps *transform_format_to_caps(struct wg_transform *transform, const struct wg_format *format) +static void caps_remove_field(GstCaps *caps, const char *field) { - struct wg_format copy = *format; + guint i; - if (format->major_type == WG_MAJOR_TYPE_VIDEO) + for (i = 0; i < gst_caps_get_size(caps); ++i) { - if (transform->attrs.allow_format_change) - copy.u.video.width = copy.u.video.height = 0; - copy.u.video.fps_n = copy.u.video.fps_d = 0; + GstStructure *structure = gst_caps_get_structure(caps, i); + gst_structure_remove_fields(structure, field, NULL); } +} + +static GstCaps *caps_strip_fields(GstCaps *caps, bool strip_size) +{ + if (stream_type_from_caps(caps) != GST_STREAM_TYPE_VIDEO) + return gst_caps_ref(caps); + + if ((caps = gst_caps_copy(caps))) + { + if (strip_size) + { + caps_remove_field(caps, "width"); + caps_remove_field(caps, "height"); + } - return wg_format_to_caps(©); + /* strip fields which we do not support and could cause pipeline failure or spurious format changes */ + caps_remove_field(caps, "framerate"); + caps_remove_field(caps, "colorimetry"); + caps_remove_field(caps, "chroma-site"); + caps_remove_field(caps, "interlace-mode"); + caps_remove_field(caps, "pixel-aspect-ratio"); + } + + return caps; } static gboolean transform_sink_query_caps(struct wg_transform *transform, GstQuery *query) { GstCaps *caps, *filter, *temp; + bool strip_size = false; GST_LOG("transform %p, %"GST_PTR_FORMAT, transform, query); gst_query_parse_caps(query, &filter); - if (!(caps = transform_format_to_caps(transform, &transform->output_format))) + if (filter && gst_structure_has_field(gst_caps_get_structure(filter, 0), "width")) + strip_size = transform->attrs.allow_format_change; + + if (!(caps = caps_strip_fields(transform->desired_caps, strip_size))) return false; if (filter) @@ -248,23 +273,6 @@ static gboolean transform_sink_query_cb(GstPad *pad, GstObject *parent, GstQuery return gst_pad_query_default(pad, parent, query); } -static gboolean transform_output_caps_is_compatible(struct wg_transform *transform, GstCaps *caps) -{ - GstCaps *copy = gst_caps_copy(caps); - gboolean ret; - gsize i; - - for (i = 0; i < gst_caps_get_size(copy); ++i) - { - GstStructure *structure = gst_caps_get_structure(copy, i); - gst_structure_remove_fields(structure, "framerate", NULL); - } - - ret = gst_caps_is_always_compatible(transform->output_caps, copy); - gst_caps_unref(copy); - return ret; -} - static void transform_sink_event_caps(struct wg_transform *transform, GstEvent *event) { GstCaps *caps; @@ -274,6 +282,8 @@ static void transform_sink_event_caps(struct wg_transform *transform, GstEvent * gst_event_parse_caps(event, &caps); transform->output_caps_changed = true; + gst_caps_unref(transform->desired_caps); + transform->desired_caps = gst_caps_ref(caps); gst_caps_unref(transform->output_caps); transform->output_caps = gst_caps_ref(caps); } @@ -318,6 +328,7 @@ NTSTATUS wg_transform_destroy(void *args) g_object_unref(transform->my_sink); g_object_unref(transform->my_src); gst_query_unref(transform->drain_query); + gst_caps_unref(transform->desired_caps); gst_caps_unref(transform->output_caps); gst_atomic_queue_unref(transform->output_queue); free(transform); @@ -409,9 +420,8 @@ NTSTATUS wg_transform_create(void *args) if (!(transform->allocator = wg_allocator_create())) goto out; transform->attrs = *params->attrs; - transform->output_format = output_format; - if (!(src_caps = transform_format_to_caps(transform, &input_format))) + if (!(src_caps = wg_format_to_caps(&input_format))) goto out; if (!(template = gst_pad_template_new("src", GST_PAD_SRC, GST_PAD_ALWAYS, src_caps))) goto out; @@ -425,8 +435,9 @@ NTSTATUS wg_transform_create(void *args) gst_pad_set_element_private(transform->my_src, transform); gst_pad_set_query_function(transform->my_src, transform_src_query_cb); - if (!(transform->output_caps = transform_format_to_caps(transform, &output_format))) + if (!(transform->output_caps = wg_format_to_caps(&output_format))) goto out; + transform->desired_caps = gst_caps_ref(transform->output_caps); if (!(template = gst_pad_template_new("sink", GST_PAD_SINK, GST_PAD_ALWAYS, transform->output_caps))) goto out; transform->my_sink = gst_pad_new_from_template(template, "sink"); @@ -575,6 +586,8 @@ NTSTATUS wg_transform_create(void *args) out: if (transform->my_sink) gst_object_unref(transform->my_sink); + if (transform->desired_caps) + gst_caps_unref(transform->desired_caps); if (transform->output_caps) gst_caps_unref(transform->output_caps); if (transform->my_src) @@ -608,23 +621,25 @@ NTSTATUS wg_transform_set_output_format(void *args) struct wg_transform_set_output_format_params *params = args; struct wg_transform *transform = get_transform(params->transform); const struct wg_format *format = params->format; + GstCaps *caps, *stripped; GstSample *sample; - GstCaps *caps; - if (!(caps = transform_format_to_caps(transform, format))) + if (!(caps = wg_format_to_caps(format))) { GST_ERROR("Failed to convert format %p to caps.", format); return STATUS_UNSUCCESSFUL; } - transform->output_format = *format; GST_INFO("transform %p output caps %"GST_PTR_FORMAT, transform, caps); - if (transform_output_caps_is_compatible(transform, caps)) + stripped = caps_strip_fields(caps, transform->attrs.allow_format_change); + if (gst_caps_is_always_compatible(transform->output_caps, stripped)) { + gst_caps_unref(stripped); gst_caps_unref(caps); return STATUS_SUCCESS; } + gst_caps_unref(stripped); if (!gst_pad_peer_query(transform->my_src, transform->drain_query)) { @@ -632,8 +647,8 @@ NTSTATUS wg_transform_set_output_format(void *args) return STATUS_UNSUCCESSFUL; } - gst_caps_unref(transform->output_caps); - transform->output_caps = caps; + gst_caps_unref(transform->desired_caps); + transform->desired_caps = caps; if (transform->video_flip) {
1
0
0
0
Rémi Bernon : winegstreamer: Only report format changes when frontend supports it.
by Alexandre Julliard
06 Jun '24
06 Jun '24
Module: wine Branch: master Commit: a8bdb0a6378884ca20df7878e05dc2f3a9e09107 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a8bdb0a6378884ca20df7878e05dc2…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon May 6 14:51:48 2024 +0200 winegstreamer: Only report format changes when frontend supports it. --- dlls/quartz/tests/mpegvideo.c | 9 ++++----- dlls/winegstreamer/wg_transform.c | 6 ++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/dlls/quartz/tests/mpegvideo.c b/dlls/quartz/tests/mpegvideo.c index 08c59e169fb..835bc5bec42 100644 --- a/dlls/quartz/tests/mpegvideo.c +++ b/dlls/quartz/tests/mpegvideo.c @@ -1201,7 +1201,7 @@ static void test_quality_control(IFilterGraph2 *graph, IBaseFilter *filter, testsource->qc = NULL; } -static void test_send_sample(IMemInputPin *input, IMediaSample *sample, const BYTE *data, LONG len, BOOL todo) +static void test_send_sample(IMemInputPin *input, IMediaSample *sample, const BYTE *data, LONG len) { BYTE *target_data; HRESULT hr; @@ -1216,8 +1216,7 @@ static void test_send_sample(IMemInputPin *input, IMediaSample *sample, const BY ok(hr == S_OK, "Got hr %#lx.\n", hr); hr = IMemInputPin_Receive(input, sample); - todo_wine_if(todo) /* 0xc00d6d61 is MF_E_TRANSFORM_STREAM_CHANGE */ - ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(hr == S_OK, "Got hr %#lx.\n", hr); } static void test_send_video(IMemInputPin *input, IMediaSample *sample) @@ -1248,8 +1247,8 @@ static void test_send_video(IMemInputPin *input, IMediaSample *sample) IPin *pin; /* native won't emit anything until an unknown-sized internal buffer is filled, or EOS is announced */ - test_send_sample(input, sample, empty_mpg_frames, ARRAY_SIZE(empty_mpg_frames), TRUE); - test_send_sample(input, sample, empty_mpg_eos, ARRAY_SIZE(empty_mpg_eos), FALSE); + test_send_sample(input, sample, empty_mpg_frames, ARRAY_SIZE(empty_mpg_frames)); + test_send_sample(input, sample, empty_mpg_eos, ARRAY_SIZE(empty_mpg_eos)); hr = IMemInputPin_QueryInterface(input, &IID_IPin, (void **)&pin); ok(hr == S_OK, "Got hr %#lx.\n", hr); diff --git a/dlls/winegstreamer/wg_transform.c b/dlls/winegstreamer/wg_transform.c index 4cfdad40848..25bfb453dd4 100644 --- a/dlls/winegstreamer/wg_transform.c +++ b/dlls/winegstreamer/wg_transform.c @@ -96,7 +96,7 @@ static GstFlowReturn transform_sink_chain_cb(GstPad *pad, GstObject *parent, Gst return GST_FLOW_ERROR; } - if (transform->output_caps_changed) + if (transform->output_caps_changed && transform->attrs.allow_format_change) GST_MINI_OBJECT_FLAG_SET(sample, GST_SAMPLE_FLAG_WG_CAPS_CHANGED); transform->output_caps_changed = false; @@ -273,9 +273,7 @@ static void transform_sink_event_caps(struct wg_transform *transform, GstEvent * gst_event_parse_caps(event, &caps); - transform->output_caps_changed = transform->output_caps_changed - || !transform_output_caps_is_compatible(transform, caps); - + transform->output_caps_changed = true; gst_caps_unref(transform->output_caps); transform->output_caps = gst_caps_ref(caps); }
1
0
0
0
Rémi Bernon : winegstreamer: Rename allow_size_change to allow_format_change.
by Alexandre Julliard
06 Jun '24
06 Jun '24
Module: wine Branch: master Commit: aaa83820752e5313540e5e7127381b9c81de58dc URL:
https://gitlab.winehq.org/wine/wine/-/commit/aaa83820752e5313540e5e7127381b…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Jun 3 09:53:16 2024 +0200 winegstreamer: Rename allow_size_change to allow_format_change. --- dlls/winegstreamer/unixlib.h | 2 +- dlls/winegstreamer/video_decoder.c | 2 +- dlls/winegstreamer/wg_transform.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/winegstreamer/unixlib.h b/dlls/winegstreamer/unixlib.h index 907cbb2c9b4..406f275f9ae 100644 --- a/dlls/winegstreamer/unixlib.h +++ b/dlls/winegstreamer/unixlib.h @@ -302,7 +302,7 @@ struct wg_transform_attrs { UINT32 output_plane_align; UINT32 input_queue_length; - BOOL allow_size_change; + BOOL allow_format_change; BOOL low_latency; }; diff --git a/dlls/winegstreamer/video_decoder.c b/dlls/winegstreamer/video_decoder.c index 60b6c705eaf..a56b454f353 100644 --- a/dlls/winegstreamer/video_decoder.c +++ b/dlls/winegstreamer/video_decoder.c @@ -1638,7 +1638,7 @@ HRESULT h264_decoder_create(REFIID riid, void **out) decoder->output_info.cbSize = 1920 * 1088 * 2; decoder->wg_transform_attrs.output_plane_align = 15; - decoder->wg_transform_attrs.allow_size_change = TRUE; + decoder->wg_transform_attrs.allow_format_change = TRUE; TRACE("Created h264 transform %p.\n", &decoder->IMFTransform_iface); diff --git a/dlls/winegstreamer/wg_transform.c b/dlls/winegstreamer/wg_transform.c index d85da3d7633..4cfdad40848 100644 --- a/dlls/winegstreamer/wg_transform.c +++ b/dlls/winegstreamer/wg_transform.c @@ -194,7 +194,7 @@ static GstCaps *transform_format_to_caps(struct wg_transform *transform, const s if (format->major_type == WG_MAJOR_TYPE_VIDEO) { - if (transform->attrs.allow_size_change) + if (transform->attrs.allow_format_change) copy.u.video.width = copy.u.video.height = 0; copy.u.video.fps_n = copy.u.video.fps_d = 0; }
1
0
0
0
Rémi Bernon : winegstreamer: Enforce default stride presence in the video processor.
by Alexandre Julliard
06 Jun '24
06 Jun '24
Module: wine Branch: master Commit: 2fef494765deccb98258d749e876e663081e90e1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/2fef494765deccb98258d749e876e6…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon May 6 11:42:50 2024 +0200 winegstreamer: Enforce default stride presence in the video processor. --- dlls/mf/tests/transform.c | 1 - dlls/winegstreamer/video_processor.c | 40 +++++++++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index febb1e33365..38e31af97c1 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -9377,7 +9377,6 @@ static void test_video_processor_with_dxgi_manager(void) IMFSample_Release(output.pSample); ret = check_mf_sample_collection(output_samples, &output_sample_desc_rgb32, L"rgb32frame.bmp"); - todo_wine /* FIXME: video process vertically flips the frame... */ ok(ret <= 5, "got %lu%% diff\n", ret); for (i = 0; i < 9; i++) diff --git a/dlls/winegstreamer/video_processor.c b/dlls/winegstreamer/video_processor.c index 6cc504727a9..2461140ab21 100644 --- a/dlls/winegstreamer/video_processor.c +++ b/dlls/winegstreamer/video_processor.c @@ -91,9 +91,36 @@ struct video_processor IMFVideoSampleAllocatorEx *allocator; }; +static HRESULT normalize_stride(IMFMediaType *media_type, BOOL bottom_up, IMFMediaType **ret) +{ + MFVIDEOFORMAT *format; + LONG stride; + UINT32 size; + HRESULT hr; + + if (SUCCEEDED(hr = IMFMediaType_GetUINT32(media_type, &MF_MT_DEFAULT_STRIDE, (UINT32 *)&stride))) + { + *ret = media_type; + IMFMediaType_AddRef(media_type); + return hr; + } + + if (SUCCEEDED(hr = MFCreateMFVideoFormatFromMFMediaType(media_type, &format, &size))) + { + if (bottom_up) format->videoInfo.VideoFlags |= MFVideoFlag_BottomUpLinearRep; + hr = MFCreateVideoMediaType(format, (IMFVideoMediaType **)ret); + CoTaskMemFree(format); + } + + return hr; +} + static HRESULT try_create_wg_transform(struct video_processor *impl) { + BOOL bottom_up = !impl->device_manager; /* when not D3D-enabled, the transform outputs bottom up RGB buffers */ + IMFMediaType *input_type, *output_type; struct wg_transform_attrs attrs = {0}; + HRESULT hr; if (impl->wg_transform) { @@ -101,7 +128,18 @@ static HRESULT try_create_wg_transform(struct video_processor *impl) impl->wg_transform = 0; } - return wg_transform_create_mf(impl->input_type, impl->output_type, &attrs, &impl->wg_transform); + if (FAILED(hr = normalize_stride(impl->input_type, bottom_up, &input_type))) + return hr; + if (FAILED(hr = normalize_stride(impl->output_type, bottom_up, &output_type))) + { + IMFMediaType_Release(input_type); + return hr; + } + hr = wg_transform_create_mf(input_type, output_type, &attrs, &impl->wg_transform); + IMFMediaType_Release(output_type); + IMFMediaType_Release(input_type); + + return hr; } static HRESULT video_processor_init_allocator(struct video_processor *processor)
1
0
0
0
Rémi Bernon : winegstreamer: Enforce default stride value in the video decoder.
by Alexandre Julliard
06 Jun '24
06 Jun '24
Module: wine Branch: master Commit: 5b8b20c82acf3bebd971c9ee191391e1bd721d9c URL:
https://gitlab.winehq.org/wine/wine/-/commit/5b8b20c82acf3bebd971c9ee191391…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon May 6 11:47:43 2024 +0200 winegstreamer: Enforce default stride value in the video decoder. --- dlls/mf/tests/transform.c | 7 +++---- dlls/winegstreamer/video_decoder.c | 42 +++++++++++++++++++++++++++++++++----- 2 files changed, 40 insertions(+), 9 deletions(-) diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index 1ca6652598d..febb1e33365 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -5909,7 +5909,7 @@ static void test_wmv_decoder(void) .expect_output_info = &expect_output_info, .output_sample_desc = &output_sample_desc_nv12_todo_time, .result_bitmap = L"nv12frame.bmp", - .delta = 0, .todo = TRUE, + .delta = 0, }, { @@ -5935,14 +5935,14 @@ static void test_wmv_decoder(void) }, { - /* WMV1 -> RGB (positive stride */ + /* WMV1 -> RGB (positive stride) */ .output_type_desc = output_type_desc_rgb_positive_stride, .expect_output_type_desc = expect_output_type_desc_rgb, .expect_input_info = &expect_input_info_rgb, .expect_output_info = &expect_output_info_rgb, .output_sample_desc = &output_sample_desc_rgb, .result_bitmap = L"rgb32frame-flip.bmp", - .delta = 5, .todo = TRUE, + .delta = 5, }, }; @@ -6115,7 +6115,6 @@ static void test_wmv_decoder(void) ret = check_mf_sample_collection(output_samples, transform_tests[j].output_sample_desc, transform_tests[j].result_bitmap); - todo_wine_if(transform_tests[j].todo) ok(ret <= transform_tests[j].delta, "got %lu%% diff\n", ret); IMFCollection_Release(output_samples); diff --git a/dlls/winegstreamer/video_decoder.c b/dlls/winegstreamer/video_decoder.c index 948fc6ab0ec..60b6c705eaf 100644 --- a/dlls/winegstreamer/video_decoder.c +++ b/dlls/winegstreamer/video_decoder.c @@ -238,7 +238,23 @@ static struct video_decoder *impl_from_IMFTransform(IMFTransform *iface) return CONTAINING_RECORD(iface, struct video_decoder, IMFTransform_iface); } -static HRESULT try_create_wg_transform(struct video_decoder *decoder) +static HRESULT normalize_stride(IMFMediaType *media_type, IMFMediaType **ret) +{ + DMO_MEDIA_TYPE amt; + HRESULT hr; + + if (SUCCEEDED(hr = MFInitAMMediaTypeFromMFMediaType(media_type, FORMAT_VideoInfo, &amt))) + { + VIDEOINFOHEADER *vih = (VIDEOINFOHEADER *)amt.pbFormat; + vih->bmiHeader.biHeight = abs(vih->bmiHeader.biHeight); + hr = MFCreateMediaTypeFromRepresentation(AM_MEDIA_TYPE_REPRESENTATION, &amt, ret); + FreeMediaType(&amt); + } + + return hr; +} + +static HRESULT try_create_wg_transform(struct video_decoder *decoder, IMFMediaType *output_type) { /* Call of Duty: Black Ops 3 doesn't care about the ProcessInput/ProcessOutput * return values, it calls them in a specific order and expects the decoder @@ -256,7 +272,7 @@ static HRESULT try_create_wg_transform(struct video_decoder *decoder) if (SUCCEEDED(IMFAttributes_GetUINT32(decoder->attributes, &MF_LOW_LATENCY, &low_latency))) decoder->wg_transform_attrs.low_latency = !!low_latency; - return wg_transform_create_mf(decoder->input_type, decoder->output_type, &decoder->wg_transform_attrs, &decoder->wg_transform); + return wg_transform_create_mf(decoder->input_type, output_type, &decoder->wg_transform_attrs, &decoder->wg_transform); } static HRESULT create_output_media_type(struct video_decoder *decoder, const GUID *subtype, @@ -612,6 +628,7 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF { struct video_decoder *decoder = impl_from_IMFTransform(iface); UINT64 frame_size, stream_frame_size; + IMFMediaType *output_type; GUID major, subtype; HRESULT hr; ULONG i; @@ -662,25 +679,40 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF IMFMediaType_Release(decoder->output_type); IMFMediaType_AddRef((decoder->output_type = type)); + /* WMV decoder outputs RGB formats with default stride forced to negative, likely a + * result of internal conversion to DMO media type */ + if (!decoder->IMediaObject_iface.lpVtbl) + { + output_type = decoder->output_type; + IMFMediaType_AddRef(output_type); + } + else if (FAILED(hr = normalize_stride(decoder->output_type, &output_type))) + { + IMFMediaType_Release(decoder->output_type); + decoder->output_type = NULL; + return hr; + } + if (decoder->wg_transform) { struct wg_format output_format; - mf_media_type_to_wg_format(decoder->output_type, &output_format); + mf_media_type_to_wg_format(output_type, &output_format); if (output_format.major_type == WG_MAJOR_TYPE_UNKNOWN || !wg_transform_set_output_format(decoder->wg_transform, &output_format)) { IMFMediaType_Release(decoder->output_type); decoder->output_type = NULL; - return MF_E_INVALIDMEDIATYPE; + hr = MF_E_INVALIDMEDIATYPE; } } - else if (FAILED(hr = try_create_wg_transform(decoder))) + else if (FAILED(hr = try_create_wg_transform(decoder, output_type))) { IMFMediaType_Release(decoder->output_type); decoder->output_type = NULL; } + IMFMediaType_Release(output_type); return hr; }
1
0
0
0
Rémi Bernon : winegstreamer: Allow to clear video decoder input/output types.
by Alexandre Julliard
06 Jun '24
06 Jun '24
Module: wine Branch: master Commit: 6bed7314ca10918d1454bf4602a648a997cd28d7 URL:
https://gitlab.winehq.org/wine/wine/-/commit/6bed7314ca10918d1454bf4602a648…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon May 6 18:09:36 2024 +0200 winegstreamer: Allow to clear video decoder input/output types. --- dlls/mf/tests/transform.c | 10 ++++++++-- dlls/winegstreamer/video_decoder.c | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index 0291fe16e18..1ca6652598d 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -5886,6 +5886,7 @@ static void test_wmv_decoder(void) const struct sample_desc *output_sample_desc; const WCHAR *result_bitmap; ULONG delta; + BOOL todo; } transform_tests[] = { @@ -5908,7 +5909,7 @@ static void test_wmv_decoder(void) .expect_output_info = &expect_output_info, .output_sample_desc = &output_sample_desc_nv12_todo_time, .result_bitmap = L"nv12frame.bmp", - .delta = 0, + .delta = 0, .todo = TRUE, }, { @@ -5941,7 +5942,7 @@ static void test_wmv_decoder(void) .expect_output_info = &expect_output_info_rgb, .output_sample_desc = &output_sample_desc_rgb, .result_bitmap = L"rgb32frame-flip.bmp", - .delta = 5, + .delta = 5, .todo = TRUE, }, }; @@ -6114,8 +6115,13 @@ static void test_wmv_decoder(void) ret = check_mf_sample_collection(output_samples, transform_tests[j].output_sample_desc, transform_tests[j].result_bitmap); + todo_wine_if(transform_tests[j].todo) ok(ret <= transform_tests[j].delta, "got %lu%% diff\n", ret); IMFCollection_Release(output_samples); + + hr = IMFTransform_SetOutputType(transform, 0, NULL, 0); + ok(hr == S_OK, "SetOutputType returned %#lx\n", hr); + winetest_pop_context(); } diff --git a/dlls/winegstreamer/video_decoder.c b/dlls/winegstreamer/video_decoder.c index 6525cbff513..948fc6ab0ec 100644 --- a/dlls/winegstreamer/video_decoder.c +++ b/dlls/winegstreamer/video_decoder.c @@ -546,6 +546,27 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM TRACE("iface %p, id %#lx, type %p, flags %#lx.\n", iface, id, type, flags); + if (!type) + { + if (decoder->input_type) + { + IMFMediaType_Release(decoder->input_type); + decoder->input_type = NULL; + } + if (decoder->output_type) + { + IMFMediaType_Release(decoder->output_type); + decoder->output_type = NULL; + } + if (decoder->wg_transform) + { + wg_transform_destroy(decoder->wg_transform); + decoder->wg_transform = 0; + } + + return S_OK; + } + if (FAILED(hr = IMFMediaType_GetGUID(type, &MF_MT_MAJOR_TYPE, &major)) || FAILED(hr = IMFMediaType_GetGUID(type, &MF_MT_SUBTYPE, &subtype))) return E_INVALIDARG; @@ -597,6 +618,22 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF TRACE("iface %p, id %#lx, type %p, flags %#lx.\n", iface, id, type, flags); + if (!type) + { + if (decoder->output_type) + { + IMFMediaType_Release(decoder->output_type); + decoder->output_type = NULL; + } + if (decoder->wg_transform) + { + wg_transform_destroy(decoder->wg_transform); + decoder->wg_transform = 0; + } + + return S_OK; + } + if (!decoder->input_type) return MF_E_TRANSFORM_TYPE_NOT_SET;
1
0
0
0
Ziqing Hui : qasf/dmowrapper: Sync Stop() and Receive() for dmo wrapper filter.
by Alexandre Julliard
06 Jun '24
06 Jun '24
Module: wine Branch: master Commit: cce09111dfda7bdb08a5f898008bc066f4fddcdb URL:
https://gitlab.winehq.org/wine/wine/-/commit/cce09111dfda7bdb08a5f898008bc0…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Fri May 24 19:29:13 2024 +0800 qasf/dmowrapper: Sync Stop() and Receive() for dmo wrapper filter. --- dlls/qasf/dmowrapper.c | 2 ++ dlls/qasf/tests/dmowrapper.c | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/qasf/dmowrapper.c b/dlls/qasf/dmowrapper.c index 76704f88cd4..18d40a5671a 100644 --- a/dlls/qasf/dmowrapper.c +++ b/dlls/qasf/dmowrapper.c @@ -703,6 +703,7 @@ static HRESULT dmo_wrapper_cleanup_stream(struct strmbase_filter *iface) IUnknown_QueryInterface(filter->dmo, &IID_IMediaObject, (void **)&dmo); + EnterCriticalSection(&filter->filter.stream_cs); for (i = 0; i < filter->source_count; ++i) { if (filter->sources[i].pin.pin.peer) @@ -712,6 +713,7 @@ static HRESULT dmo_wrapper_cleanup_stream(struct strmbase_filter *iface) IMediaObject_Flush(dmo); IMediaObject_Release(dmo); + LeaveCriticalSection(&filter->filter.stream_cs); return S_OK; } diff --git a/dlls/qasf/tests/dmowrapper.c b/dlls/qasf/tests/dmowrapper.c index 70dcc0c453e..388004de783 100644 --- a/dlls/qasf/tests/dmowrapper.c +++ b/dlls/qasf/tests/dmowrapper.c @@ -1740,7 +1740,6 @@ static void test_sample_processing(IMediaControl *control, IMemInputPin *input, stop_thread = CreateThread(NULL, 0, stop_filter_proc, dmo_filter, 0, NULL); ok(!!stop_thread, "CreateThread returned NULL thread.\n"); ret = WaitForSingleObject(stop_thread, 200); - todo_wine ok(ret == WAIT_TIMEOUT, "WaitForSingleObject returned %#lx.\n", ret); /* Signal event to end Receive(). */ SetEvent(testsink->event);
1
0
0
0
Ziqing Hui : qasf/dmowrapper: Return VFW_E_WRONG_STATE in dmo_wrapper_sink_Receive.
by Alexandre Julliard
06 Jun '24
06 Jun '24
Module: wine Branch: master Commit: 86de254ecd62c4225b1e6d5cd6d94534d13105f0 URL:
https://gitlab.winehq.org/wine/wine/-/commit/86de254ecd62c4225b1e6d5cd6d945…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Thu May 16 18:14:57 2024 +0800 qasf/dmowrapper: Return VFW_E_WRONG_STATE in dmo_wrapper_sink_Receive. --- dlls/qasf/dmowrapper.c | 3 +++ dlls/qasf/tests/dmowrapper.c | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/qasf/dmowrapper.c b/dlls/qasf/dmowrapper.c index f94b00dbb44..76704f88cd4 100644 --- a/dlls/qasf/dmowrapper.c +++ b/dlls/qasf/dmowrapper.c @@ -309,6 +309,9 @@ static HRESULT WINAPI dmo_wrapper_sink_Receive(struct strmbase_sink *iface, IMed DWORD flags = 0; HRESULT hr; + if (filter->filter.state == State_Stopped) + return VFW_E_WRONG_STATE; + IUnknown_QueryInterface(filter->dmo, &IID_IMediaObject, (void **)&dmo); if (IMediaSample_IsDiscontinuity(sample) == S_OK) diff --git a/dlls/qasf/tests/dmowrapper.c b/dlls/qasf/tests/dmowrapper.c index ada45c447b1..70dcc0c453e 100644 --- a/dlls/qasf/tests/dmowrapper.c +++ b/dlls/qasf/tests/dmowrapper.c @@ -1716,12 +1716,10 @@ static void test_sample_processing(IMediaControl *control, IMemInputPin *input, hr = IBaseFilter_Stop(dmo_filter); ok(hr == S_OK, "Stop returned %#lx.\n", hr); hr = IMemInputPin_Receive(input, sample); - todo_wine ok(hr == VFW_E_WRONG_STATE, "Receive returned %#lx.\n", hr); ok(got_ProcessInput == 0, "Got %u calls to ProcessInput().\n", got_ProcessInput); ok(got_ProcessOutput == 0, "Got %u calls to ProcessOutput().\n", got_ProcessOutput); ok(got_Receive == 0, "Got %u calls to Receive().\n", got_Receive); - todo_wine ok(got_Discontinuity == 0, "Got %u calls to Discontinuity().\n", got_Discontinuity); hr = IMediaControl_Run(control); ok(hr == S_OK, "Run returned %#lx.\n", hr);
1
0
0
0
Ziqing Hui : qasf/dmowrapper: Allocate output samples before calling ProcessInput().
by Alexandre Julliard
06 Jun '24
06 Jun '24
Module: wine Branch: master Commit: c6f4d04697d2b2f7575a66ae978dbd0bdbab2c9d URL:
https://gitlab.winehq.org/wine/wine/-/commit/c6f4d04697d2b2f7575a66ae978dbd…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Wed Jun 5 13:56:23 2024 +0800 qasf/dmowrapper: Allocate output samples before calling ProcessInput(). --- dlls/qasf/dmowrapper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/qasf/dmowrapper.c b/dlls/qasf/dmowrapper.c index 2caf59c746d..f94b00dbb44 100644 --- a/dlls/qasf/dmowrapper.c +++ b/dlls/qasf/dmowrapper.c @@ -327,6 +327,9 @@ static HRESULT WINAPI dmo_wrapper_sink_Receive(struct strmbase_sink *iface, IMed process_output(filter, dmo); } + if (FAILED(hr = get_output_samples(filter))) + goto out; + if (IMediaSample_IsSyncPoint(sample) == S_OK) flags |= DMO_INPUT_DATA_BUFFERF_SYNCPOINT; @@ -345,8 +348,6 @@ static HRESULT WINAPI dmo_wrapper_sink_Receive(struct strmbase_sink *iface, IMed goto out; } - if (FAILED(hr = get_output_samples(filter))) - goto out; process_output(filter, dmo); out:
1
0
0
0
← Newer
1
...
47
48
49
50
51
52
53
...
62
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Results per page:
10
25
50
100
200