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
July
June
May
April
March
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
April 2022
----- 2025 -----
July 2025
June 2025
May 2025
April 2025
March 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
2 participants
1024 discussions
Start a n
N
ew thread
Anton Baskanov : quartz/tests: Add tests for IBaseFilter_FindPin() on MPEG audio decoder.
by Alexandre Julliard
25 Apr '22
25 Apr '22
Module: wine Branch: master Commit: da0524a777893df07cb16aa30c812249ac021e9f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=da0524a777893df07cb16aa3…
Author: Anton Baskanov <baskanov(a)gmail.com> Date: Mon Apr 25 14:32:11 2022 +0700 quartz/tests: Add tests for IBaseFilter_FindPin() on MPEG audio decoder. Signed-off-by: Anton Baskanov <baskanov(a)gmail.com> Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/mpegaudio.c | 49 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/dlls/quartz/tests/mpegaudio.c b/dlls/quartz/tests/mpegaudio.c index 3cf4afd9ca4..11816e65cfc 100644 --- a/dlls/quartz/tests/mpegaudio.c +++ b/dlls/quartz/tests/mpegaudio.c @@ -402,6 +402,54 @@ static void test_enum_pins(void) ok(!ref, "Got outstanding refcount %ld.\n", ref); } +static void test_find_pin(void) +{ + IBaseFilter *filter; + IEnumPins *enum_pins; + IPin *pin, *pin2; + HRESULT hr; + ULONG ref; + + filter = create_mpeg_audio_codec(); + if (!filter) + { + skip("Failed to create MPEG audio decoder instance, skipping tests.\n"); + return; + } + + hr = IBaseFilter_EnumPins(filter, &enum_pins); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IBaseFilter_FindPin(filter, L"In", &pin); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IEnumPins_Next(enum_pins, 1, &pin2, NULL); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(pin == pin2, "Pins didn't match.\n"); + IPin_Release(pin); + IPin_Release(pin2); + + hr = IBaseFilter_FindPin(filter, L"Out", &pin); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IEnumPins_Next(enum_pins, 1, &pin2, NULL); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(pin == pin2, "Pins didn't match.\n"); + IPin_Release(pin); + IPin_Release(pin2); + + hr = IBaseFilter_FindPin(filter, L"XForm In", &pin); + ok(hr == VFW_E_NOT_FOUND, "Got hr %#lx.\n", hr); + hr = IBaseFilter_FindPin(filter, L"XForm Out", &pin); + ok(hr == VFW_E_NOT_FOUND, "Got hr %#lx.\n", hr); + hr = IBaseFilter_FindPin(filter, L"input pin", &pin); + ok(hr == VFW_E_NOT_FOUND, "Got hr %#lx.\n", hr); + hr = IBaseFilter_FindPin(filter, L"output pin", &pin); + ok(hr == VFW_E_NOT_FOUND, "Got hr %#lx.\n", hr); + + IEnumPins_Release(enum_pins); + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %ld.\n", ref); +} + START_TEST(mpegaudio) { CoInitialize(NULL); @@ -410,6 +458,7 @@ START_TEST(mpegaudio) test_aggregation(); test_unconnected_filter_state(); test_enum_pins(); + test_find_pin(); CoUninitialize(); }
1
0
0
0
Anton Baskanov : quartz/tests: Add tests for IBaseFilter_EnumPins() on MPEG audio decoder.
by Alexandre Julliard
25 Apr '22
25 Apr '22
Module: wine Branch: master Commit: 4e311ec13ad742768f18fbba3f7c33dcc19121d0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4e311ec13ad742768f18fbba…
Author: Anton Baskanov <baskanov(a)gmail.com> Date: Mon Apr 25 14:32:10 2022 +0700 quartz/tests: Add tests for IBaseFilter_EnumPins() on MPEG audio decoder. Signed-off-by: Anton Baskanov <baskanov(a)gmail.com> Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/mpegaudio.c | 129 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) diff --git a/dlls/quartz/tests/mpegaudio.c b/dlls/quartz/tests/mpegaudio.c index 9dac3645041..3cf4afd9ca4 100644 --- a/dlls/quartz/tests/mpegaudio.c +++ b/dlls/quartz/tests/mpegaudio.c @@ -274,6 +274,134 @@ static void test_unconnected_filter_state(void) ok(!ref, "Got outstanding refcount %ld.\n", ref); } +static void test_enum_pins(void) +{ + IBaseFilter *filter; + IEnumPins *enum1, *enum2; + ULONG count, ref; + IPin *pins[3]; + HRESULT hr; + + filter = create_mpeg_audio_codec(); + if (!filter) + { + skip("Failed to create MPEG audio decoder instance, skipping tests.\n"); + return; + } + + ref = get_refcount(filter); + ok(ref == 1, "Got unexpected refcount %ld.\n", ref); + + hr = IBaseFilter_EnumPins(filter, NULL); + ok(hr == E_POINTER, "Got hr %#lx.\n", hr); + + hr = IBaseFilter_EnumPins(filter, &enum1); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ref = get_refcount(filter); + ok(ref == 2, "Got unexpected refcount %ld.\n", ref); + ref = get_refcount(enum1); + ok(ref == 1, "Got unexpected refcount %ld.\n", ref); + + hr = IEnumPins_Next(enum1, 1, NULL, NULL); + ok(hr == E_POINTER, "Got hr %#lx.\n", hr); + + hr = IEnumPins_Next(enum1, 1, pins, NULL); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ref = get_refcount(filter); + ok(ref == 3, "Got unexpected refcount %ld.\n", ref); + ref = get_refcount(pins[0]); + ok(ref == 3, "Got unexpected refcount %ld.\n", ref); + ref = get_refcount(enum1); + ok(ref == 1, "Got unexpected refcount %ld.\n", ref); + IPin_Release(pins[0]); + ref = get_refcount(filter); + ok(ref == 2, "Got unexpected refcount %ld.\n", ref); + + hr = IEnumPins_Next(enum1, 1, pins, NULL); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ref = get_refcount(filter); + ok(ref == 3, "Got unexpected refcount %ld.\n", ref); + ref = get_refcount(pins[0]); + ok(ref == 3, "Got unexpected refcount %ld.\n", ref); + ref = get_refcount(enum1); + ok(ref == 1, "Got unexpected refcount %ld.\n", ref); + IPin_Release(pins[0]); + ref = get_refcount(filter); + ok(ref == 2, "Got unexpected refcount %ld.\n", ref); + + hr = IEnumPins_Next(enum1, 1, pins, NULL); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IEnumPins_Next(enum1, 1, pins, &count); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(count == 1, "Got count %lu.\n", count); + IPin_Release(pins[0]); + + hr = IEnumPins_Next(enum1, 1, pins, &count); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(count == 1, "Got count %lu.\n", count); + IPin_Release(pins[0]); + + hr = IEnumPins_Next(enum1, 1, pins, &count); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(!count, "Got count %lu.\n", count); + + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IEnumPins_Next(enum1, 2, pins, NULL); + ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); + + hr = IEnumPins_Next(enum1, 2, pins, &count); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(count == 2, "Got count %lu.\n", count); + IPin_Release(pins[0]); + IPin_Release(pins[1]); + + hr = IEnumPins_Next(enum1, 2, pins, &count); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(!count, "Got count %lu.\n", count); + + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IEnumPins_Next(enum1, 3, pins, &count); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(count == 2, "Got count %lu.\n", count); + IPin_Release(pins[0]); + IPin_Release(pins[1]); + + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IEnumPins_Clone(enum1, &enum2); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IEnumPins_Skip(enum1, 3); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + + hr = IEnumPins_Skip(enum1, 2); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IEnumPins_Skip(enum1, 1); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + + hr = IEnumPins_Next(enum1, 1, pins, NULL); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + + hr = IEnumPins_Next(enum2, 1, pins, NULL); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + IPin_Release(pins[0]); + + IEnumPins_Release(enum2); + IEnumPins_Release(enum1); + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %ld.\n", ref); +} + START_TEST(mpegaudio) { CoInitialize(NULL); @@ -281,6 +409,7 @@ START_TEST(mpegaudio) test_interfaces(); test_aggregation(); test_unconnected_filter_state(); + test_enum_pins(); CoUninitialize(); }
1
0
0
0
Anton Baskanov : quartz/tests: Add tests for MPEG audio decoder unconnected filter state change.
by Alexandre Julliard
25 Apr '22
25 Apr '22
Module: wine Branch: master Commit: 1a2697e58ee4514d70924adc520593f265f770cb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1a2697e58ee4514d70924adc…
Author: Anton Baskanov <baskanov(a)gmail.com> Date: Mon Apr 25 14:32:09 2022 +0700 quartz/tests: Add tests for MPEG audio decoder unconnected filter state change. Signed-off-by: Anton Baskanov <baskanov(a)gmail.com> Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/mpegaudio.c | 65 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/dlls/quartz/tests/mpegaudio.c b/dlls/quartz/tests/mpegaudio.c index acd1ecd537e..9dac3645041 100644 --- a/dlls/quartz/tests/mpegaudio.c +++ b/dlls/quartz/tests/mpegaudio.c @@ -210,12 +210,77 @@ static void test_aggregation(void) ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref); } +static void test_unconnected_filter_state(void) +{ + IBaseFilter *filter; + FILTER_STATE state; + HRESULT hr; + ULONG ref; + + filter = create_mpeg_audio_codec(); + if (!filter) + { + skip("Failed to create MPEG audio decoder instance, skipping tests.\n"); + return; + } + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %ld.\n", ref); +} + START_TEST(mpegaudio) { CoInitialize(NULL); test_interfaces(); test_aggregation(); + test_unconnected_filter_state(); CoUninitialize(); }
1
0
0
0
Anton Baskanov : quartz/tests: Add tests for MPEG audio decoder aggregation.
by Alexandre Julliard
25 Apr '22
25 Apr '22
Module: wine Branch: master Commit: c4d4424358f257fb92de4c6fbdf76405fff786fe URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c4d4424358f257fb92de4c6f…
Author: Anton Baskanov <baskanov(a)gmail.com> Date: Mon Apr 25 14:32:08 2022 +0700 quartz/tests: Add tests for MPEG audio decoder aggregation. Signed-off-by: Anton Baskanov <baskanov(a)gmail.com> Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/mpegaudio.c | 107 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/dlls/quartz/tests/mpegaudio.c b/dlls/quartz/tests/mpegaudio.c index 7ca07575451..acd1ecd537e 100644 --- a/dlls/quartz/tests/mpegaudio.c +++ b/dlls/quartz/tests/mpegaudio.c @@ -32,6 +32,13 @@ static IBaseFilter *create_mpeg_audio_codec(void) return filter; } +static ULONG get_refcount(void *iface) +{ + IUnknown *unknown = iface; + IUnknown_AddRef(unknown); + return IUnknown_Release(unknown); +} + #define check_interface(a, b, c) check_interface_(__LINE__, a, b, c) static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOOL supported) { @@ -104,11 +111,111 @@ static void test_interfaces(void) IBaseFilter_Release(filter); } +static const GUID test_iid = {0x33333333}; +static LONG outer_ref = 1; + +static HRESULT WINAPI outer_QueryInterface(IUnknown *iface, REFIID iid, void **out) +{ + if (IsEqualGUID(iid, &IID_IUnknown) + || IsEqualGUID(iid, &IID_IBaseFilter) + || IsEqualGUID(iid, &test_iid)) + { + *out = (IUnknown *)0xdeadbeef; + return S_OK; + } + ok(0, "unexpected call %s\n", wine_dbgstr_guid(iid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI outer_AddRef(IUnknown *iface) +{ + return InterlockedIncrement(&outer_ref); +} + +static ULONG WINAPI outer_Release(IUnknown *iface) +{ + return InterlockedDecrement(&outer_ref); +} + +static const IUnknownVtbl outer_vtbl = +{ + outer_QueryInterface, + outer_AddRef, + outer_Release, +}; + +static IUnknown test_outer = {&outer_vtbl}; + +static void test_aggregation(void) +{ + IBaseFilter *filter, *filter2; + IUnknown *unk, *unk2; + HRESULT hr; + ULONG ref; + + filter = (IBaseFilter *)0xdeadbeef; + hr = CoCreateInstance(&CLSID_CMpegAudioCodec, &test_outer, CLSCTX_INPROC_SERVER, + &IID_IBaseFilter, (void **)&filter); + todo_wine ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr); + ok(!filter, "Got interface %p.\n", filter); + + hr = CoCreateInstance(&CLSID_CMpegAudioCodec, &test_outer, CLSCTX_INPROC_SERVER, + &IID_IUnknown, (void **)&unk); + todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); + if (FAILED(hr)) + { + skip("Failed to create MPEG audio decoder instance, skipping tests.\n"); + return; + } + ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref); + ok(unk != &test_outer, "Returned IUnknown should not be outer IUnknown.\n"); + ref = get_refcount(unk); + ok(ref == 1, "Got unexpected refcount %ld.\n", ref); + + ref = IUnknown_AddRef(unk); + ok(ref == 2, "Got unexpected refcount %ld.\n", ref); + ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref); + + ref = IUnknown_Release(unk); + ok(ref == 1, "Got unexpected refcount %ld.\n", ref); + ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref); + + hr = IUnknown_QueryInterface(unk, &IID_IUnknown, (void **)&unk2); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(unk2 == unk, "Got unexpected IUnknown %p.\n", unk2); + IUnknown_Release(unk2); + + hr = IUnknown_QueryInterface(unk, &IID_IBaseFilter, (void **)&filter); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IBaseFilter_QueryInterface(filter, &IID_IUnknown, (void **)&unk2); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2); + + hr = IBaseFilter_QueryInterface(filter, &IID_IBaseFilter, (void **)&filter2); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(filter2 == (IBaseFilter *)0xdeadbeef, "Got unexpected IBaseFilter %p.\n", filter2); + + hr = IUnknown_QueryInterface(unk, &test_iid, (void **)&unk2); + ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr); + ok(!unk2, "Got unexpected IUnknown %p.\n", unk2); + + hr = IBaseFilter_QueryInterface(filter, &test_iid, (void **)&unk2); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2); + + IBaseFilter_Release(filter); + ref = IUnknown_Release(unk); + ok(!ref, "Got unexpected refcount %ld.\n", ref); + ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref); +} + START_TEST(mpegaudio) { CoInitialize(NULL); test_interfaces(); + test_aggregation(); CoUninitialize(); }
1
0
0
0
Anton Baskanov : quartz/tests: Add tests for MPEG audio decoder interfaces.
by Alexandre Julliard
25 Apr '22
25 Apr '22
Module: wine Branch: master Commit: 0f4b8a3e85706d0372bbbfcb4dfe3adbe53cc141 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0f4b8a3e85706d0372bbbfcb…
Author: Anton Baskanov <baskanov(a)gmail.com> Date: Mon Apr 25 14:32:07 2022 +0700 quartz/tests: Add tests for MPEG audio decoder interfaces. Signed-off-by: Anton Baskanov <baskanov(a)gmail.com> Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/Makefile.in | 1 + dlls/quartz/tests/mpegaudio.c | 114 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+) diff --git a/dlls/quartz/tests/Makefile.in b/dlls/quartz/tests/Makefile.in index 423abc78ef6..8031a766295 100644 --- a/dlls/quartz/tests/Makefile.in +++ b/dlls/quartz/tests/Makefile.in @@ -10,6 +10,7 @@ C_SRCS = \ filtergraph.c \ filtermapper.c \ memallocator.c \ + mpegaudio.c \ mpegsplit.c \ passthrough.c \ systemclock.c \ diff --git a/dlls/quartz/tests/mpegaudio.c b/dlls/quartz/tests/mpegaudio.c new file mode 100644 index 00000000000..7ca07575451 --- /dev/null +++ b/dlls/quartz/tests/mpegaudio.c @@ -0,0 +1,114 @@ +/* + * MPEG audio decoder filter unit tests + * + * Copyright 2022 Anton Baskanov + * Copyright 2018 Zebediah Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS +#include "dshow.h" +#include "wine/test.h" + +static IBaseFilter *create_mpeg_audio_codec(void) +{ + IBaseFilter *filter = NULL; + HRESULT hr = CoCreateInstance(&CLSID_CMpegAudioCodec, NULL, CLSCTX_INPROC_SERVER, + &IID_IBaseFilter, (void **)&filter); + todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); + return filter; +} + +#define check_interface(a, b, c) check_interface_(__LINE__, a, b, c) +static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOOL supported) +{ + IUnknown *iface = iface_ptr; + HRESULT hr, expected_hr; + IUnknown *unk; + + expected_hr = supported ? S_OK : E_NOINTERFACE; + + hr = IUnknown_QueryInterface(iface, iid, (void **)&unk); + ok_(__FILE__, line)(hr == expected_hr, "Got hr %#lx, expected %#lx.\n", hr, expected_hr); + if (SUCCEEDED(hr)) + IUnknown_Release(unk); +} + +static void test_interfaces(void) +{ + IBaseFilter *filter; + IPin *pin; + + filter = create_mpeg_audio_codec(); + if (!filter) + { + skip("Failed to create MPEG audio decoder instance, skipping tests.\n"); + return; + } + + check_interface(filter, &IID_IBaseFilter, TRUE); + check_interface(filter, &IID_IMediaFilter, TRUE); + check_interface(filter, &IID_IPersist, TRUE); + check_interface(filter, &IID_IUnknown, TRUE); + + check_interface(filter, &IID_IAMFilterMiscFlags, FALSE); + check_interface(filter, &IID_IBasicAudio, FALSE); + check_interface(filter, &IID_IBasicVideo, FALSE); + check_interface(filter, &IID_IKsPropertySet, FALSE); + check_interface(filter, &IID_IMediaPosition, FALSE); + check_interface(filter, &IID_IMediaSeeking, FALSE); + check_interface(filter, &IID_IPin, FALSE); + check_interface(filter, &IID_IQualityControl, FALSE); + check_interface(filter, &IID_IQualProp, FALSE); + check_interface(filter, &IID_IReferenceClock, FALSE); + check_interface(filter, &IID_IVideoWindow, FALSE); + check_interface(filter, &IID_IPersistPropertyBag, FALSE); + + IBaseFilter_FindPin(filter, L"In", &pin); + + check_interface(pin, &IID_IMemInputPin, TRUE); + check_interface(pin, &IID_IPin, TRUE); + todo_wine check_interface(pin, &IID_IQualityControl, TRUE); + check_interface(pin, &IID_IUnknown, TRUE); + + check_interface(pin, &IID_IMediaPosition, FALSE); + check_interface(pin, &IID_IMediaSeeking, FALSE); + + IPin_Release(pin); + + IBaseFilter_FindPin(filter, L"Out", &pin); + + check_interface(pin, &IID_IPin, TRUE); + todo_wine check_interface(pin, &IID_IMediaPosition, TRUE); + todo_wine check_interface(pin, &IID_IMediaSeeking, TRUE); + todo_wine check_interface(pin, &IID_IQualityControl, TRUE); + check_interface(pin, &IID_IUnknown, TRUE); + + check_interface(pin, &IID_IAsyncReader, FALSE); + + IPin_Release(pin); + + IBaseFilter_Release(filter); +} + +START_TEST(mpegaudio) +{ + CoInitialize(NULL); + + test_interfaces(); + + CoUninitialize(); +}
1
0
0
0
Huw Davies : wineoss: Move MODM_RESET to the unixlib.
by Alexandre Julliard
25 Apr '22
25 Apr '22
Module: wine Branch: master Commit: 6784845f3f8866e7642bf248b953a01951d32b64 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6784845f3f8866e7642bf248…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Apr 22 07:08:41 2022 +0100 wineoss: Move MODM_RESET to the unixlib. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wineoss.drv/midi.c | 47 ---------------------------------------------- dlls/wineoss.drv/ossmidi.c | 43 +++++++++++++++++++++++++++++++++++++++--- dlls/wineoss.drv/unixlib.h | 14 -------------- 3 files changed, 40 insertions(+), 64 deletions(-) diff --git a/dlls/wineoss.drv/midi.c b/dlls/wineoss.drv/midi.c index 8c3a2405b0f..470e8e4403d 100644 --- a/dlls/wineoss.drv/midi.c +++ b/dlls/wineoss.drv/midi.c @@ -64,13 +64,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(midi); static WINE_MIDIIN *MidiInDev; -static WINE_MIDIOUT *MidiOutDev; - -/* this is the total number of MIDI out devices found (synth and port) */ -static int MODM_NumDevs = 0; -/* this is the number of FM synthesizers (index from 0 to NUMFMSYNTHDEVS - 1) */ -static int MODM_NumFMSynthDevs = 0; -/* the Midi ports have index from NUMFMSYNTHDEVS to NumDevs - 1 */ /* this is the total number of MIDI out devices found */ static int MIDM_NumDevs = 0; @@ -119,9 +112,6 @@ static LRESULT OSS_MidiInit(void) if (!err) { MidiInDev = params.srcs; - MidiOutDev = params.dests; - MODM_NumDevs = params.num_dests; - MODM_NumFMSynthDevs = params.num_synths; MIDM_NumDevs = params.num_srcs; } return err; @@ -140,10 +130,6 @@ static LRESULT OSS_MidiExit(void) return 1; MidiInDev = NULL; - MidiOutDev = NULL; - - MODM_NumDevs = 0; - MODM_NumFMSynthDevs = 0; MIDM_NumDevs = 0; return 0; @@ -646,37 +632,6 @@ static DWORD midStop(WORD wDevID) return MMSYSERR_NOERROR; } -/*-----------------------------------------------------------------------*/ - -DWORD WINAPI OSS_modMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, - DWORD_PTR dwParam1, DWORD_PTR dwParam2); - -/************************************************************************** - * modReset [internal] - */ -static DWORD modReset(WORD wDevID) -{ - unsigned chn; - - TRACE("(%04X);\n", wDevID); - - if (wDevID >= MODM_NumDevs) return MMSYSERR_BADDEVICEID; - if (!MidiOutDev[wDevID].bEnabled) return MIDIERR_NODEVICE; - - /* stop all notes */ - /* FIXME: check if 0x78B0 is channel dependent or not. I coded it so that - * it's channel dependent... - */ - for (chn = 0; chn < 16; chn++) { - /* turn off every note */ - OSS_modMessage(wDevID, MODM_DATA, 0, 0x7800 | MIDI_CTL_CHANGE | chn, 0); - /* remove sustain on all channels */ - OSS_modMessage(wDevID, MODM_DATA, 0, (CTL_SUSTAIN << 8) | MIDI_CTL_CHANGE | chn, 0); - } - /* FIXME: the LongData buffers must also be returned to the app */ - return MMSYSERR_NOERROR; -} - /*======================================================================* * MIDI entry points * *======================================================================*/ @@ -742,8 +697,6 @@ DWORD WINAPI OSS_modMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, return OSS_MidiInit(); case DRVM_EXIT: return OSS_MidiExit(); - case MODM_RESET: - return modReset(wDevID); } params.dev_id = wDevID; diff --git a/dlls/wineoss.drv/ossmidi.c b/dlls/wineoss.drv/ossmidi.c index 4b419c2716c..ba3017a5ad7 100644 --- a/dlls/wineoss.drv/ossmidi.c +++ b/dlls/wineoss.drv/ossmidi.c @@ -48,6 +48,17 @@ #include "unixlib.h" +struct midi_dest +{ + BOOL bEnabled; + MIDIOPENDESC midiDesc; + WORD wFlags; + MIDIHDR *lpQueueHdr; + void *lpExtra; /* according to port type (MIDI, FM...), extra data when needed */ + MIDIOUTCAPSW caps; + int fd; +}; + static unsigned int num_dests, num_srcs, num_synths, seq_refs; static struct midi_dest dests[MAX_MIDIOUTDRV]; static struct midi_src srcs[MAX_MIDIINDRV]; @@ -381,10 +392,7 @@ wrapup: *params->err = 0; params->num_srcs = num_srcs; - params->num_dests = num_dests; - params->num_synths = num_synths; params->srcs = srcs; - params->dests = dests; return STATUS_SUCCESS; } @@ -1065,6 +1073,32 @@ static UINT midi_out_get_volume(WORD dev_id, UINT *volume) return (dests[dev_id].caps.dwSupport & MIDICAPS_VOLUME) ? 0 : MMSYSERR_NOTSUPPORTED; } +static UINT midi_out_reset(WORD dev_id) +{ + struct midi_dest *dest; + unsigned chn; + + TRACE("(%04X);\n", dev_id); + + if (dev_id >= num_dests) return MMSYSERR_BADDEVICEID; + dest = dests + dev_id; + if (!dest->bEnabled) return MIDIERR_NODEVICE; + + /* stop all notes */ + /* FIXME: check if 0x78B0 is channel dependent or not. I coded it so that + * it's channel dependent... + */ + for (chn = 0; chn < 16; chn++) + { + /* turn off every note */ + midi_out_data(dev_id, 0x7800 | MIDI_CTL_CHANGE | chn); + /* remove sustain on all channels */ + midi_out_data(dev_id, (CTL_SUSTAIN << 8) | MIDI_CTL_CHANGE | chn); + } + /* FIXME: the LongData buffers must also be returned to the app */ + return MMSYSERR_NOERROR; +} + NTSTATUS midi_out_message(void *args) { struct midi_out_message_params *params = args; @@ -1108,6 +1142,9 @@ NTSTATUS midi_out_message(void *args) case MODM_SETVOLUME: *params->err = 0; break; + case MODM_RESET: + *params->err = midi_out_reset(params->dev_id); + break; default: TRACE("Unsupported message\n"); *params->err = MMSYSERR_NOTSUPPORTED; diff --git a/dlls/wineoss.drv/unixlib.h b/dlls/wineoss.drv/unixlib.h index d56e11b8d23..183f5017d04 100644 --- a/dlls/wineoss.drv/unixlib.h +++ b/dlls/wineoss.drv/unixlib.h @@ -225,24 +225,10 @@ typedef struct midi_src int fd; } WINE_MIDIIN; -typedef struct midi_dest -{ - BOOL bEnabled; - MIDIOPENDESC midiDesc; - WORD wFlags; - MIDIHDR *lpQueueHdr; - void *lpExtra; /* according to port type (MIDI, FM...), extra data when needed */ - MIDIOUTCAPSW caps; - int fd; -} WINE_MIDIOUT; - struct midi_init_params { UINT *err; - unsigned int num_dests; unsigned int num_srcs; - unsigned int num_synths; - struct midi_dest *dests; struct midi_src *srcs; };
1
0
0
0
Huw Davies : wineoss: Move MODM_GETVOLUME and MODM_SETVOLUME to the unixlib.
by Alexandre Julliard
25 Apr '22
25 Apr '22
Module: wine Branch: master Commit: 03d2bddc95051b930c597d931ad8173890f18655 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=03d2bddc95051b930c597d93…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Apr 22 07:08:40 2022 +0100 wineoss: Move MODM_GETVOLUME and MODM_SETVOLUME to the unixlib. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wineoss.drv/midi.c | 15 --------------- dlls/wineoss.drv/ossmidi.c | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/dlls/wineoss.drv/midi.c b/dlls/wineoss.drv/midi.c index cc8fc54568c..8c3a2405b0f 100644 --- a/dlls/wineoss.drv/midi.c +++ b/dlls/wineoss.drv/midi.c @@ -648,17 +648,6 @@ static DWORD midStop(WORD wDevID) /*-----------------------------------------------------------------------*/ -/************************************************************************** - * modGetVolume [internal] - */ -static DWORD modGetVolume(WORD wDevID, DWORD* lpdwVolume) -{ - if (!lpdwVolume) return MMSYSERR_INVALPARAM; - if (wDevID >= MODM_NumDevs) return MMSYSERR_BADDEVICEID; - *lpdwVolume = 0xFFFFFFFF; - return (MidiOutDev[wDevID].caps.dwSupport & MIDICAPS_VOLUME) ? 0 : MMSYSERR_NOTSUPPORTED; -} - DWORD WINAPI OSS_modMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, DWORD_PTR dwParam1, DWORD_PTR dwParam2); @@ -753,10 +742,6 @@ DWORD WINAPI OSS_modMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, return OSS_MidiInit(); case DRVM_EXIT: return OSS_MidiExit(); - case MODM_GETVOLUME: - return modGetVolume(wDevID, (DWORD*)dwParam1); - case MODM_SETVOLUME: - return 0; case MODM_RESET: return modReset(wDevID); } diff --git a/dlls/wineoss.drv/ossmidi.c b/dlls/wineoss.drv/ossmidi.c index f307a54b81f..4b419c2716c 100644 --- a/dlls/wineoss.drv/ossmidi.c +++ b/dlls/wineoss.drv/ossmidi.c @@ -1056,6 +1056,14 @@ static UINT midi_out_get_devcaps(WORD dev_id, MIDIOUTCAPSW *caps, UINT size) return MMSYSERR_NOERROR; } +static UINT midi_out_get_volume(WORD dev_id, UINT *volume) +{ + if (!volume) return MMSYSERR_INVALPARAM; + if (dev_id >= num_dests) return MMSYSERR_BADDEVICEID; + + *volume = 0xFFFFFFFF; + return (dests[dev_id].caps.dwSupport & MIDICAPS_VOLUME) ? 0 : MMSYSERR_NOTSUPPORTED; +} NTSTATUS midi_out_message(void *args) { @@ -1094,6 +1102,12 @@ NTSTATUS midi_out_message(void *args) case MODM_GETNUMDEVS: *params->err = num_dests; break; + case MODM_GETVOLUME: + *params->err = midi_out_get_volume(params->dev_id, (UINT *)params->param_1); + break; + case MODM_SETVOLUME: + *params->err = 0; + break; default: TRACE("Unsupported message\n"); *params->err = MMSYSERR_NOTSUPPORTED;
1
0
0
0
Huw Davies : wineoss: Move MODM_GETNUMDEVS to the unixlib.
by Alexandre Julliard
25 Apr '22
25 Apr '22
Module: wine Branch: master Commit: 19c20d6ae2ffad673a0d2e1186af0f857b85fda0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=19c20d6ae2ffad673a0d2e11…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Apr 22 07:08:39 2022 +0100 wineoss: Move MODM_GETNUMDEVS to the unixlib. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wineoss.drv/midi.c | 2 -- dlls/wineoss.drv/ossmidi.c | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/wineoss.drv/midi.c b/dlls/wineoss.drv/midi.c index cda733b9ca3..cc8fc54568c 100644 --- a/dlls/wineoss.drv/midi.c +++ b/dlls/wineoss.drv/midi.c @@ -753,8 +753,6 @@ DWORD WINAPI OSS_modMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, return OSS_MidiInit(); case DRVM_EXIT: return OSS_MidiExit(); - case MODM_GETNUMDEVS: - return MODM_NumDevs; case MODM_GETVOLUME: return modGetVolume(wDevID, (DWORD*)dwParam1); case MODM_SETVOLUME: diff --git a/dlls/wineoss.drv/ossmidi.c b/dlls/wineoss.drv/ossmidi.c index d9b2bbe7c92..f307a54b81f 100644 --- a/dlls/wineoss.drv/ossmidi.c +++ b/dlls/wineoss.drv/ossmidi.c @@ -1091,6 +1091,9 @@ NTSTATUS midi_out_message(void *args) case MODM_GETDEVCAPS: *params->err = midi_out_get_devcaps(params->dev_id, (MIDIOUTCAPSW *)params->param_1, params->param_2); break; + case MODM_GETNUMDEVS: + *params->err = num_dests; + break; default: TRACE("Unsupported message\n"); *params->err = MMSYSERR_NOTSUPPORTED;
1
0
0
0
Huw Davies : wineoss: Move MODM_GETDEVCAPS to the unixlib.
by Alexandre Julliard
25 Apr '22
25 Apr '22
Module: wine Branch: master Commit: 3a52e003a63e7504817bed577cdf52b65e7a1c05 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3a52e003a63e7504817bed57…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Apr 22 07:08:38 2022 +0100 wineoss: Move MODM_GETDEVCAPS to the unixlib. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wineoss.drv/midi.c | 17 ----------------- dlls/wineoss.drv/ossmidi.c | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/dlls/wineoss.drv/midi.c b/dlls/wineoss.drv/midi.c index 9615c9892b9..cda733b9ca3 100644 --- a/dlls/wineoss.drv/midi.c +++ b/dlls/wineoss.drv/midi.c @@ -648,21 +648,6 @@ static DWORD midStop(WORD wDevID) /*-----------------------------------------------------------------------*/ -/************************************************************************** - * modGetDevCaps [internal] - */ -static DWORD modGetDevCaps(WORD wDevID, LPMIDIOUTCAPSW lpCaps, DWORD dwSize) -{ - TRACE("(%04X, %p, %08X);\n", wDevID, lpCaps, dwSize); - - if (wDevID >= MODM_NumDevs) return MMSYSERR_BADDEVICEID; - if (lpCaps == NULL) return MMSYSERR_INVALPARAM; - - memcpy(lpCaps, &MidiOutDev[wDevID].caps, min(dwSize, sizeof(*lpCaps))); - - return MMSYSERR_NOERROR; -} - /************************************************************************** * modGetVolume [internal] */ @@ -768,8 +753,6 @@ DWORD WINAPI OSS_modMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, return OSS_MidiInit(); case DRVM_EXIT: return OSS_MidiExit(); - case MODM_GETDEVCAPS: - return modGetDevCaps(wDevID, (LPMIDIOUTCAPSW)dwParam1, dwParam2); case MODM_GETNUMDEVS: return MODM_NumDevs; case MODM_GETVOLUME: diff --git a/dlls/wineoss.drv/ossmidi.c b/dlls/wineoss.drv/ossmidi.c index b97c5159e89..d9b2bbe7c92 100644 --- a/dlls/wineoss.drv/ossmidi.c +++ b/dlls/wineoss.drv/ossmidi.c @@ -1044,6 +1044,19 @@ static UINT midi_out_unprepare(WORD dev_id, MIDIHDR *hdr, UINT hdr_size) return MMSYSERR_NOERROR; } +static UINT midi_out_get_devcaps(WORD dev_id, MIDIOUTCAPSW *caps, UINT size) +{ + TRACE("(%04X, %p, %08X);\n", dev_id, caps, size); + + if (dev_id >= num_dests) return MMSYSERR_BADDEVICEID; + if (!caps) return MMSYSERR_INVALPARAM; + + memcpy(caps, &dests[dev_id].caps, min(size, sizeof(*caps))); + + return MMSYSERR_NOERROR; +} + + NTSTATUS midi_out_message(void *args) { struct midi_out_message_params *params = args; @@ -1075,6 +1088,9 @@ NTSTATUS midi_out_message(void *args) case MODM_UNPREPARE: *params->err = midi_out_unprepare(params->dev_id, (MIDIHDR *)params->param_1, params->param_2); break; + case MODM_GETDEVCAPS: + *params->err = midi_out_get_devcaps(params->dev_id, (MIDIOUTCAPSW *)params->param_1, params->param_2); + break; default: TRACE("Unsupported message\n"); *params->err = MMSYSERR_NOTSUPPORTED;
1
0
0
0
Zebediah Figura : wined3d: Clear GL texture using glClear() if possible in wined3d_texture_gl_load_location().
by Alexandre Julliard
25 Apr '22
25 Apr '22
Module: wine Branch: master Commit: 43e151f8bc7834a9bafa5c756d35858435b41253 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=43e151f8bc7834a9bafa5c75…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri Apr 22 15:42:57 2022 -0500 wined3d: Clear GL texture using glClear() if possible in wined3d_texture_gl_load_location(). Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/texture.c | 102 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 91 insertions(+), 11 deletions(-) diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index e2a75282a48..18a60ecbf52 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -3328,6 +3328,90 @@ static BOOL wined3d_texture_gl_prepare_location(struct wined3d_texture *texture, } } +static bool use_ffp_clear(const struct wined3d_texture *texture, unsigned int location) +{ + if (location == WINED3D_LOCATION_DRAWABLE) + return true; + + /* If we are not using FBOs (and not rendering to the drawable), always + * upload. The upload should always succeed in this case; we cannot have + * ARB_texture_multisample without ARB_framebuffer_object. */ + if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) + return false; + + if (location == WINED3D_LOCATION_TEXTURE_RGB + && !(texture->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE)) + return false; + if (location == WINED3D_LOCATION_TEXTURE_SRGB + && !(texture->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB)) + return false; + + return location & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED + | WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB); +} + +static bool wined3d_texture_gl_clear(struct wined3d_texture *texture, + unsigned int sub_resource_idx, struct wined3d_context_gl *context_gl, unsigned int location) +{ + struct wined3d_texture_sub_resource *sub_resource = &texture->sub_resources[sub_resource_idx]; + const struct wined3d_format *format = texture->resource.format; + const struct wined3d_gl_info *gl_info = context_gl->gl_info; + struct wined3d_bo_address addr; + + if (use_ffp_clear(texture, location)) + { + GLbitfield clear_mask = 0; + + context_gl_apply_texture_draw_state(context_gl, texture, sub_resource_idx, location); + + gl_info->gl_ops.gl.p_glDisable(GL_SCISSOR_TEST); + context_invalidate_state(&context_gl->c, STATE_RASTERIZER); + + if (format->depth_size) + { + gl_info->gl_ops.gl.p_glDepthMask(GL_TRUE); + context_invalidate_state(&context_gl->c, STATE_DEPTH_STENCIL); + + if (gl_info->supported[ARB_ES2_COMPATIBILITY]) + GL_EXTCALL(glClearDepthf(0.0f)); + else + gl_info->gl_ops.gl.p_glClearDepth(0.0); + clear_mask |= GL_DEPTH_BUFFER_BIT; + } + + if (format->stencil_size) + { + if (gl_info->supported[EXT_STENCIL_TWO_SIDE]) + gl_info->gl_ops.gl.p_glDisable(GL_STENCIL_TEST_TWO_SIDE_EXT); + gl_info->gl_ops.gl.p_glStencilMask(~0u); + context_invalidate_state(&context_gl->c, STATE_DEPTH_STENCIL); + gl_info->gl_ops.gl.p_glClearStencil(0); + clear_mask |= GL_STENCIL_BUFFER_BIT; + } + + if (!format->depth_size && !format->stencil_size) + { + gl_info->gl_ops.gl.p_glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); + context_invalidate_state(&context_gl->c, STATE_BLEND); + gl_info->gl_ops.gl.p_glClearColor(0.0f, 0.0f, 0.0f, 0.0f); + clear_mask |= GL_COLOR_BUFFER_BIT; + } + + gl_info->gl_ops.gl.p_glClear(clear_mask); + checkGLcall("clear texture"); + + wined3d_texture_validate_location(texture, sub_resource_idx, location); + return true; + } + + if (!wined3d_texture_prepare_location(texture, sub_resource_idx, &context_gl->c, WINED3D_LOCATION_SYSMEM)) + return false; + wined3d_texture_get_bo_address(texture, sub_resource_idx, &addr, WINED3D_LOCATION_SYSMEM); + memset(addr.addr, 0, sub_resource->size); + wined3d_texture_validate_location(texture, sub_resource_idx, WINED3D_LOCATION_SYSMEM); + return true; +} + /* Context activation is done by the caller. */ static BOOL wined3d_texture_gl_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location) @@ -3339,21 +3423,17 @@ static BOOL wined3d_texture_gl_load_location(struct wined3d_texture *texture, TRACE("texture %p, sub_resource_idx %u, context %p, location %s.\n", texture, sub_resource_idx, context, wined3d_debug_location(location)); + if (!wined3d_texture_gl_prepare_location(texture, sub_resource_idx, context, location)) + return FALSE; + if (sub_resource->locations & WINED3D_LOCATION_CLEARED) { - struct wined3d_bo_address addr; - - /* FIXME: Clear textures on the GPU if possible. */ - - if (!wined3d_texture_prepare_location(texture, sub_resource_idx, context, WINED3D_LOCATION_SYSMEM)) + if (!wined3d_texture_gl_clear(texture, sub_resource_idx, context_gl, location)) return FALSE; - wined3d_texture_get_bo_address(texture, sub_resource_idx, &addr, WINED3D_LOCATION_SYSMEM); - memset(addr.addr, 0, sub_resource->size); - wined3d_texture_validate_location(texture, sub_resource_idx, WINED3D_LOCATION_SYSMEM); - } - if (!wined3d_texture_gl_prepare_location(texture, sub_resource_idx, context, location)) - return FALSE; + if (sub_resource->locations & location) + return TRUE; + } switch (location) {
1
0
0
0
← Newer
1
...
17
18
19
20
21
22
23
...
103
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
Results per page:
10
25
50
100
200