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
November 2023
----- 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
989 discussions
Start a n
N
ew thread
Davide Beatrici : wineoss: Fix sound not working.
by Alexandre Julliard
22 Nov '23
22 Nov '23
Module: wine Branch: master Commit: 029697598356028517be1ac10b6807cb877d3cf6 URL:
https://gitlab.winehq.org/wine/wine/-/commit/029697598356028517be1ac10b6807…
Author: Davide Beatrici <git(a)davidebeatrici.dev> Date: Mon Nov 20 01:29:09 2023 +0100 wineoss: Fix sound not working. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=55886
--- dlls/wineoss.drv/mmdevdrv.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c index 48a46473956..7b7d426d1df 100644 --- a/dlls/wineoss.drv/mmdevdrv.c +++ b/dlls/wineoss.drv/mmdevdrv.c @@ -144,18 +144,11 @@ exit: void WINAPI get_device_guid(EDataFlow flow, const char *device, GUID *guid) { + OSSDevice *oss_dev; HKEY key = NULL, dev_key; DWORD type, size = sizeof(*guid); WCHAR key_name[256]; const unsigned int dev_size = strlen(device) + 1; - OSSDevice *oss_dev = HeapAlloc(GetProcessHeap(), 0, offsetof(OSSDevice, devnode[dev_size])); - - if(oss_dev){ - oss_dev->flow = flow; - oss_dev->guid = *guid; - memcpy(oss_dev->devnode, device, dev_size); - device_add(oss_dev); - } if(flow == eCapture) key_name[0] = '1'; @@ -171,7 +164,7 @@ void WINAPI get_device_guid(EDataFlow flow, const char *device, GUID *guid) if(type == REG_BINARY){ RegCloseKey(dev_key); RegCloseKey(key); - return; + goto exit; } ERR("Invalid type for device %s GUID: %lu; ignoring and overwriting\n", wine_dbgstr_w(key_name), type); @@ -183,9 +176,17 @@ void WINAPI get_device_guid(EDataFlow flow, const char *device, GUID *guid) CoCreateGuid(guid); set_device_guid(flow, key, key_name, guid); - +exit: if(key) RegCloseKey(key); + + oss_dev = HeapAlloc(GetProcessHeap(), 0, offsetof(OSSDevice, devnode[dev_size])); + if(oss_dev){ + oss_dev->flow = flow; + oss_dev->guid = *guid; + memcpy(oss_dev->devnode, device, dev_size); + device_add(oss_dev); + } } BOOL WINAPI get_device_name_from_guid(GUID *guid, char **name, EDataFlow *flow)
1
0
0
0
Francois Gouget : user32/tests: Add a trailing linefeed to ok() and skip() calls.
by Alexandre Julliard
22 Nov '23
22 Nov '23
Module: wine Branch: master Commit: 70f15b93f2e4db4469d0b25240e7962bf820a8c8 URL:
https://gitlab.winehq.org/wine/wine/-/commit/70f15b93f2e4db4469d0b25240e796…
Author: Francois Gouget <fgouget(a)free.fr> Date: Wed Nov 22 14:04:34 2023 +0100 user32/tests: Add a trailing linefeed to ok() and skip() calls. --- dlls/user32/tests/input.c | 2 +- dlls/user32/tests/monitor.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index c5ffeadea5b..6a28bd24301 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -2591,7 +2591,7 @@ static LRESULT CALLBACK rawinput_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPA ret = GetRawInputData((HRAWINPUT)lparam, RID_INPUT, NULL, &raw_size, sizeof(RAWINPUTHEADER)); ok(ret == 0, "GetRawInputData failed\n"); - ok(raw_size <= sizeof(raw), "Unexpected rawinput data size: %u", raw_size); + ok(raw_size <= sizeof(raw), "Unexpected rawinput data size: %u\n", raw_size); raw_size = sizeof(raw); ret = GetRawInputData((HRAWINPUT)lparam, RID_INPUT, &raw, &raw_size, sizeof(RAWINPUTHEADER)); diff --git a/dlls/user32/tests/monitor.c b/dlls/user32/tests/monitor.c index 7131d1fe75f..d172eb900df 100644 --- a/dlls/user32/tests/monitor.c +++ b/dlls/user32/tests/monitor.c @@ -1791,7 +1791,7 @@ static void test_QueryDisplayConfig_result(UINT32 flags, /* Check corresponding modes */ if (pi[i].sourceInfo.modeInfoIdx == DISPLAYCONFIG_PATH_MODE_IDX_INVALID) { - skip("Path doesn't contain source modeInfoIdx"); + skip("Path doesn't contain source modeInfoIdx\n"); continue; } ok(pi[i].sourceInfo.modeInfoIdx < modes, "Expected index <%d, got %d\n", modes, pi[i].sourceInfo.modeInfoIdx); @@ -1814,7 +1814,7 @@ static void test_QueryDisplayConfig_result(UINT32 flags, if (pi[i].targetInfo.modeInfoIdx == DISPLAYCONFIG_PATH_MODE_IDX_INVALID) { - skip("Path doesn't contain target modeInfoIdx"); + skip("Path doesn't contain target modeInfoIdx\n"); continue; } ok(pi[i].targetInfo.modeInfoIdx < modes, "Expected index <%d, got %d\n", modes, pi[i].targetInfo.modeInfoIdx);
1
0
0
0
Piotr Caban : msvcp140: Add codecvt<char16> class stub.
by Alexandre Julliard
22 Nov '23
22 Nov '23
Module: wine Branch: master Commit: 70e240949c2a400caf16b24d7b68b9f58ee8ef38 URL:
https://gitlab.winehq.org/wine/wine/-/commit/70e240949c2a400caf16b24d7b68b9…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Nov 22 14:24:28 2023 +0100 msvcp140: Add codecvt<char16> class stub. --- dlls/msvcp140/msvcp140.spec | 108 +++++++++--------- dlls/msvcp90/locale.c | 249 ++++++++++++++++++++++++++++++++++++++++++ dlls/msvcp90/msvcp90.h | 5 + dlls/msvcp_win/msvcp_win.spec | 108 +++++++++--------- 4 files changed, 362 insertions(+), 108 deletions(-)
1
0
0
0
Rémi Bernon : mfplat: Implement IMFMediaType_(Get|Free)Representation.
by Alexandre Julliard
22 Nov '23
22 Nov '23
Module: wine Branch: master Commit: 2e1fe519e7551f197392b446a153699b8e983ee5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/2e1fe519e7551f197392b446a15369…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sat Nov 18 21:21:46 2023 +0100 mfplat: Implement IMFMediaType_(Get|Free)Representation. --- dlls/mfplat/mediatype.c | 48 ++++++++++++++++++++++++++++++++-------------- dlls/mfplat/tests/mfplat.c | 14 ++++++-------- 2 files changed, 40 insertions(+), 22 deletions(-) diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index 5467241712e..2ba967c6719 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -634,16 +634,30 @@ static HRESULT WINAPI mediatype_IsEqual(IMFMediaType *iface, IMFMediaType *type, static HRESULT WINAPI mediatype_GetRepresentation(IMFMediaType *iface, GUID guid, void **representation) { - FIXME("%p, %s, %p.\n", iface, debugstr_guid(&guid), representation); + TRACE("%p, %s, %p.\n", iface, debugstr_guid(&guid), representation); - return E_NOTIMPL; + if (IsEqualGUID(&guid, &AM_MEDIA_TYPE_REPRESENTATION)) + return MFCreateAMMediaTypeFromMFMediaType(iface, GUID_NULL, (AM_MEDIA_TYPE **)representation); + + if (IsEqualGUID(&guid, &FORMAT_WaveFormatEx) + || IsEqualGUID(&guid, &FORMAT_VideoInfo) + || IsEqualGUID(&guid, &FORMAT_VideoInfo2) + || IsEqualGUID(&guid, &FORMAT_MFVideoFormat)) + return MFCreateAMMediaTypeFromMFMediaType(iface, guid, (AM_MEDIA_TYPE **)representation); + + FIXME("Format %s not implemented!\n", debugstr_guid(&guid)); + return MF_E_UNSUPPORTED_REPRESENTATION; } static HRESULT WINAPI mediatype_FreeRepresentation(IMFMediaType *iface, GUID guid, void *representation) { - FIXME("%p, %s, %p.\n", iface, debugstr_guid(&guid), representation); + AM_MEDIA_TYPE *am_type = representation; - return E_NOTIMPL; + TRACE("%p, %s, %p.\n", iface, debugstr_guid(&guid), representation); + + CoTaskMemFree(am_type->pbFormat); + CoTaskMemFree(am_type); + return S_OK; } static const IMFMediaTypeVtbl mediatypevtbl = @@ -1009,16 +1023,18 @@ static HRESULT WINAPI video_mediatype_IsEqual(IMFVideoMediaType *iface, IMFMedia static HRESULT WINAPI video_mediatype_GetRepresentation(IMFVideoMediaType *iface, GUID guid, void **representation) { - FIXME("%p, %s, %p.\n", iface, debugstr_guid(&guid), representation); + TRACE("%p, %s, %p.\n", iface, debugstr_guid(&guid), representation); - return E_NOTIMPL; + if (IsEqualGUID(&guid, &FORMAT_WaveFormatEx)) + return MF_E_UNSUPPORTED_REPRESENTATION; + + return mediatype_GetRepresentation((IMFMediaType *)iface, guid, representation); } static HRESULT WINAPI video_mediatype_FreeRepresentation(IMFVideoMediaType *iface, GUID guid, void *representation) { - FIXME("%p, %s, %p.\n", iface, debugstr_guid(&guid), representation); - - return E_NOTIMPL; + TRACE("%p, %s, %p.\n", iface, debugstr_guid(&guid), representation); + return mediatype_FreeRepresentation((IMFMediaType *)iface, guid, representation); } static const MFVIDEOFORMAT * WINAPI video_mediatype_GetVideoFormat(IMFVideoMediaType *iface) @@ -1410,16 +1426,20 @@ static HRESULT WINAPI audio_mediatype_IsEqual(IMFAudioMediaType *iface, IMFMedia static HRESULT WINAPI audio_mediatype_GetRepresentation(IMFAudioMediaType *iface, GUID guid, void **representation) { - FIXME("%p, %s, %p.\n", iface, debugstr_guid(&guid), representation); + TRACE("%p, %s, %p.\n", iface, debugstr_guid(&guid), representation); - return E_NOTIMPL; + if (IsEqualGUID(&guid, &FORMAT_VideoInfo) + || IsEqualGUID(&guid, &FORMAT_VideoInfo2) + || IsEqualGUID(&guid, &FORMAT_MFVideoFormat)) + return E_INVALIDARG; + + return mediatype_GetRepresentation((IMFMediaType *)iface, guid, representation); } static HRESULT WINAPI audio_mediatype_FreeRepresentation(IMFAudioMediaType *iface, GUID guid, void *representation) { - FIXME("%p, %s, %p.\n", iface, debugstr_guid(&guid), representation); - - return E_NOTIMPL; + TRACE("%p, %s, %p.\n", iface, debugstr_guid(&guid), representation); + return mediatype_FreeRepresentation((IMFMediaType *)iface, guid, representation); } static const WAVEFORMATEX * WINAPI audio_mediatype_GetAudioFormat(IMFAudioMediaType *iface) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 1565434cc2c..7fab1598181 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -7603,27 +7603,26 @@ static void test_IMFMediaType_GetRepresentation(void) ok(hr == S_OK, "Failed to create media type, hr %#lx.\n", hr); hr = IMFMediaType_GetRepresentation(media_type, GUID_NULL, (void **)&am_type); - todo_wine ok(hr == MF_E_UNSUPPORTED_REPRESENTATION, "Unexpected hr %#lx.\n", hr); + ok(hr == MF_E_UNSUPPORTED_REPRESENTATION, "Unexpected hr %#lx.\n", hr); hr = IMFMediaType_GetRepresentation(media_type, AM_MEDIA_TYPE_REPRESENTATION, (void **)&am_type); - todo_wine ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#lx.\n", hr); + ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#lx.\n", hr); hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IMFMediaType_GetRepresentation(media_type, AM_MEDIA_TYPE_REPRESENTATION, (void **)&am_type); - todo_wine ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#lx.\n", hr); + ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#lx.\n", hr); hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Video); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IMFMediaType_GetRepresentation(media_type, AM_MEDIA_TYPE_REPRESENTATION, (void **)&am_type); - todo_wine ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#lx.\n", hr); + ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#lx.\n", hr); hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, &MFAudioFormat_PCM); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IMFMediaType_GetRepresentation(media_type, FORMAT_VideoInfo, (void **)&am_type); - todo_wine ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); hr = IMFMediaType_GetRepresentation(media_type, AM_MEDIA_TYPE_REPRESENTATION, (void **)&am_type); - todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - if (hr != S_OK) goto skip_tests; + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(IsEqualGUID(&am_type->majortype, &MFMediaType_Audio), "got %s.\n", debugstr_guid(&am_type->majortype)); ok(IsEqualGUID(&am_type->subtype, &MFAudioFormat_PCM), "got %s.\n", debugstr_guid(&am_type->subtype)); ok(IsEqualGUID(&am_type->formattype, &FORMAT_WaveFormatEx), "got %s.\n", debugstr_guid(&am_type->formattype)); @@ -7663,7 +7662,6 @@ static void test_IMFMediaType_GetRepresentation(void) hr = IMFMediaType_FreeRepresentation(media_type, AM_MEDIA_TYPE_REPRESENTATION, am_type); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); -skip_tests: IMFMediaType_Release(media_type); }
1
0
0
0
Rémi Bernon : mfplat: Implement MFCreateAMMediaTypeFromMFMediaType.
by Alexandre Julliard
22 Nov '23
22 Nov '23
Module: wine Branch: master Commit: 77a71bc43b73db79e0bd972c51fe955bccd7b9e5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/77a71bc43b73db79e0bd972c51fe95…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Nov 20 10:32:51 2023 +0100 mfplat: Implement MFCreateAMMediaTypeFromMFMediaType. --- dlls/mfplat/mediatype.c | 18 ++++++++++++++++-- dlls/mfplat/tests/mfplat.c | 10 ++++------ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index bb7383960c8..5467241712e 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -3178,8 +3178,22 @@ static void media_type_get_ratio(IMFMediaType *media_type, const GUID *attr, DWO */ HRESULT WINAPI MFCreateAMMediaTypeFromMFMediaType(IMFMediaType *media_type, GUID format, AM_MEDIA_TYPE **am_type) { - FIXME("%p, %s, %p stub!\n", media_type, debugstr_mf_guid(&format), am_type); - return E_NOTIMPL; + AM_MEDIA_TYPE *mt; + HRESULT hr; + + TRACE("%p, %s, %p.\n", media_type, debugstr_mf_guid(&format), am_type); + + *am_type = NULL; + if (!(mt = CoTaskMemAlloc(sizeof(*mt)))) + return E_OUTOFMEMORY; + if (FAILED(hr = MFInitAMMediaTypeFromMFMediaType(media_type, format, mt))) + { + CoTaskMemFree(mt); + return hr; + } + + *am_type = mt; + return hr; } /*********************************************************************** diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index d597ab8b7c2..1565434cc2c 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -7566,23 +7566,22 @@ static void test_MFCreateAMMediaTypeFromMFMediaType(void) ok(hr == S_OK, "Failed to create media type, hr %#lx.\n", hr); hr = MFCreateAMMediaTypeFromMFMediaType(media_type, GUID_NULL, &am_type); - todo_wine ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#lx.\n", hr); + ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#lx.\n", hr); hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = MFCreateAMMediaTypeFromMFMediaType(media_type, GUID_NULL, &am_type); - todo_wine ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#lx.\n", hr); + ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#lx.\n", hr); hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Video); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = MFCreateAMMediaTypeFromMFMediaType(media_type, GUID_NULL, &am_type); - todo_wine ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#lx.\n", hr); + ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#lx.\n", hr); hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, &MFAudioFormat_PCM); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = MFCreateAMMediaTypeFromMFMediaType(media_type, GUID_NULL, &am_type); - todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - if (hr != S_OK) goto skip_tests; + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(IsEqualGUID(&am_type->majortype, &MFMediaType_Audio), "got %s.\n", debugstr_guid(&am_type->majortype)); ok(IsEqualGUID(&am_type->subtype, &MFAudioFormat_PCM), "got %s.\n", debugstr_guid(&am_type->subtype)); ok(IsEqualGUID(&am_type->formattype, &FORMAT_WaveFormatEx), "got %s.\n", debugstr_guid(&am_type->formattype)); @@ -7590,7 +7589,6 @@ static void test_MFCreateAMMediaTypeFromMFMediaType(void) CoTaskMemFree(am_type->pbFormat); CoTaskMemFree(am_type); -skip_tests: IMFMediaType_Release(media_type); }
1
0
0
0
Rémi Bernon : mfplat: Implement MFInitAMMediaTypeFromMFMediaType.
by Alexandre Julliard
22 Nov '23
22 Nov '23
Module: wine Branch: master Commit: 7f1eef65bf7c779ea39ea102b8f4d66eb7cd729f URL:
https://gitlab.winehq.org/wine/wine/-/commit/7f1eef65bf7c779ea39ea102b8f4d6…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Nov 22 14:52:51 2023 +0100 mfplat: Implement MFInitAMMediaTypeFromMFMediaType. --- dlls/mfplat/mediatype.c | 317 ++++++++++++++++++++++++++++++++++++++++----- dlls/mfplat/tests/mfplat.c | 20 ++- 2 files changed, 294 insertions(+), 43 deletions(-)
1
0
0
0
Rémi Bernon : mfplat: Use bits per pixel in uncompressed formats metadata.
by Alexandre Julliard
22 Nov '23
22 Nov '23
Module: wine Branch: master Commit: f9723bc274566bb212eaa15688f12f72995f511e URL:
https://gitlab.winehq.org/wine/wine/-/commit/f9723bc274566bb212eaa15688f12f…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sat Nov 18 14:13:30 2023 +0100 mfplat: Use bits per pixel in uncompressed formats metadata. --- dlls/mfplat/mediatype.c | 66 ++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index 1707df87f6d..6eb3d875f10 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -2625,7 +2625,7 @@ HRESULT WINAPI MFCreatePresentationDescriptor(DWORD count, IMFStreamDescriptor * struct uncompressed_video_format { const GUID *subtype; - unsigned char bytes_per_pixel; + unsigned char bpp; unsigned char alignment; unsigned char bottom_up; unsigned char yuv; @@ -2640,36 +2640,36 @@ static int __cdecl uncompressed_video_format_compare(const void *a, const void * static const struct uncompressed_video_format video_formats[] = { - { &MFVideoFormat_RGB24, 3, 3, 1, 0 }, - { &MFVideoFormat_ARGB32, 4, 3, 1, 0 }, - { &MFVideoFormat_RGB32, 4, 3, 1, 0 }, - { &MFVideoFormat_RGB565, 2, 3, 1, 0 }, - { &MFVideoFormat_RGB555, 2, 3, 1, 0 }, - { &MFVideoFormat_A2R10G10B10, 4, 3, 1, 0 }, - { &MFVideoFormat_A2B10G10R10, 4, 3, 1, 0 }, - { &MFVideoFormat_RGB8, 1, 3, 1, 0 }, - { &MFVideoFormat_L8, 1, 3, 1, 0 }, - { &MFVideoFormat_AYUV, 4, 3, 0, 1 }, - { &MFVideoFormat_I420, 1, 0, 0, 1 }, - { &MFVideoFormat_IMC1, 2, 3, 0, 1 }, - { &MFVideoFormat_IMC2, 1, 0, 0, 1 }, - { &MFVideoFormat_IMC3, 2, 3, 0, 1 }, - { &MFVideoFormat_IMC4, 1, 0, 0, 1 }, - { &MFVideoFormat_IYUV, 1, 0, 0, 1 }, - { &MFVideoFormat_NV11, 1, 0, 0, 1 }, - { &MFVideoFormat_NV12, 1, 0, 0, 1 }, - { &MFVideoFormat_D16, 2, 3, 0, 0 }, - { &MFVideoFormat_L16, 2, 3, 0, 0 }, - { &MFVideoFormat_UYVY, 2, 0, 0, 1 }, - { &MFVideoFormat_YUY2, 2, 0, 0, 1 }, - { &MFVideoFormat_YV12, 1, 0, 0, 1 }, - { &MFVideoFormat_YVYU, 2, 0, 0, 1 }, - { &MFVideoFormat_A16B16G16R16F, 8, 3, 1, 0 }, - { &MEDIASUBTYPE_RGB8, 1, 3, 1, 0 }, - { &MEDIASUBTYPE_RGB565, 2, 3, 1, 0 }, - { &MEDIASUBTYPE_RGB555, 2, 3, 1, 0 }, - { &MEDIASUBTYPE_RGB24, 3, 3, 1, 0 }, - { &MEDIASUBTYPE_RGB32, 4, 3, 1, 0 }, + { &MFVideoFormat_RGB24, 24, 3, 1, 0 }, + { &MFVideoFormat_ARGB32, 32, 3, 1, 0 }, + { &MFVideoFormat_RGB32, 32, 3, 1, 0 }, + { &MFVideoFormat_RGB565, 16, 3, 1, 0 }, + { &MFVideoFormat_RGB555, 16, 3, 1, 0 }, + { &MFVideoFormat_A2R10G10B10, 32, 3, 1, 0 }, + { &MFVideoFormat_A2B10G10R10, 32, 3, 1, 0 }, + { &MFVideoFormat_RGB8, 8, 3, 1, 0 }, + { &MFVideoFormat_L8, 8, 3, 1, 0 }, + { &MFVideoFormat_AYUV, 32, 3, 0, 1 }, + { &MFVideoFormat_I420, 12, 0, 0, 1 }, + { &MFVideoFormat_IMC1, 16, 3, 0, 1 }, + { &MFVideoFormat_IMC2, 12, 0, 0, 1 }, + { &MFVideoFormat_IMC3, 16, 3, 0, 1 }, + { &MFVideoFormat_IMC4, 12, 0, 0, 1 }, + { &MFVideoFormat_IYUV, 12, 0, 0, 1 }, + { &MFVideoFormat_NV11, 12, 0, 0, 1 }, + { &MFVideoFormat_NV12, 12, 0, 0, 1 }, + { &MFVideoFormat_D16, 16, 3, 0, 0 }, + { &MFVideoFormat_L16, 16, 3, 0, 0 }, + { &MFVideoFormat_UYVY, 16, 0, 0, 1 }, + { &MFVideoFormat_YUY2, 16, 0, 0, 1 }, + { &MFVideoFormat_YV12, 12, 0, 0, 1 }, + { &MFVideoFormat_YVYU, 16, 0, 0, 1 }, + { &MFVideoFormat_A16B16G16R16F, 64, 3, 1, 0 }, + { &MEDIASUBTYPE_RGB8, 8, 3, 1, 0 }, + { &MEDIASUBTYPE_RGB565, 16, 3, 1, 0 }, + { &MEDIASUBTYPE_RGB555, 16, 3, 1, 0 }, + { &MEDIASUBTYPE_RGB24, 24, 3, 1, 0 }, + { &MEDIASUBTYPE_RGB32, 32, 3, 1, 0 }, }; static struct uncompressed_video_format *mf_get_video_format(const GUID *subtype) @@ -2680,7 +2680,7 @@ static struct uncompressed_video_format *mf_get_video_format(const GUID *subtype static unsigned int mf_get_stride_for_format(const struct uncompressed_video_format *format, unsigned int width) { - return (width * format->bytes_per_pixel + format->alignment) & ~format->alignment; + return (width * (format->bpp / 8) + format->alignment) & ~format->alignment; } unsigned int mf_format_get_stride(const GUID *subtype, unsigned int width, BOOL *is_yuv) @@ -2755,7 +2755,7 @@ HRESULT WINAPI MFCalculateImageSize(REFGUID subtype, UINT32 width, UINT32 height case D3DFMT_L8: case D3DFMT_L16: case D3DFMT_D16: - *size = width * format->bytes_per_pixel * height; + *size = width * (format->bpp / 8) * height; break; default: stride = mf_get_stride_for_format(format, width);
1
0
0
0
Rémi Bernon : mfplat: Only convert MEDIASUBTYPE for the formats which need it.
by Alexandre Julliard
22 Nov '23
22 Nov '23
Module: wine Branch: master Commit: 13cdc8af5fca46deb0d9c160c6087ad70c3f3339 URL:
https://gitlab.winehq.org/wine/wine/-/commit/13cdc8af5fca46deb0d9c160c6087a…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Nov 20 21:17:43 2023 +0100 mfplat: Only convert MEDIASUBTYPE for the formats which need it. --- dlls/mfplat/mediatype.c | 48 ++++++++++++++++++++++-------------------- dlls/mfplat/tests/mfplat.c | 52 +++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 77 insertions(+), 23 deletions(-) diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index fabc36dcc3c..1707df87f6d 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -31,6 +31,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(mfplat); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_RGB1, D3DFMT_A1); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_RGB4, MAKEFOURCC('4','P','x','x')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_ARGB1555, D3DFMT_A1R5G5B5); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_ARGB4444, D3DFMT_A4R4G4B4); /* SDK MFVideoFormat_A2R10G10B10 uses D3DFMT_A2B10G10R10, let's name it the other way */ DEFINE_MEDIATYPE_GUID(MFVideoFormat_A2B10G10R10, D3DFMT_A2R10G10B10); @@ -3605,31 +3609,31 @@ static HRESULT mf_get_stride_for_bitmap_info_header(DWORD fourcc, const BITMAPIN static const GUID * get_mf_subtype_for_am_subtype(const GUID *subtype) { - static const GUID null; - + if (IsEqualGUID(subtype, &MEDIASUBTYPE_RGB1)) + return &MFVideoFormat_RGB1; + if (IsEqualGUID(subtype, &MEDIASUBTYPE_RGB4)) + return &MFVideoFormat_RGB4; + if (IsEqualGUID(subtype, &MEDIASUBTYPE_RGB8)) + return &MFVideoFormat_RGB8; + if (IsEqualGUID(subtype, &MEDIASUBTYPE_RGB555)) + return &MFVideoFormat_RGB555; + if (IsEqualGUID(subtype, &MEDIASUBTYPE_RGB565)) + return &MFVideoFormat_RGB565; + if (IsEqualGUID(subtype, &MEDIASUBTYPE_RGB24)) + return &MFVideoFormat_RGB24; if (IsEqualGUID(subtype, &MEDIASUBTYPE_RGB32)) return &MFVideoFormat_RGB32; - else if (IsEqualGUID(subtype, &MEDIASUBTYPE_ARGB32)) + if (IsEqualGUID(subtype, &MEDIASUBTYPE_ARGB1555)) + return &MFVideoFormat_ARGB1555; + if (IsEqualGUID(subtype, &MEDIASUBTYPE_ARGB4444)) + return &MFVideoFormat_ARGB4444; + if (IsEqualGUID(subtype, &MEDIASUBTYPE_ARGB32)) return &MFVideoFormat_ARGB32; - else if (IsEqualGUID(subtype, &MEDIASUBTYPE_I420)) - return &MFVideoFormat_I420; - else if (IsEqualGUID(subtype, &MEDIASUBTYPE_AYUV)) - return &MFVideoFormat_AYUV; - else if (IsEqualGUID(subtype, &MEDIASUBTYPE_YV12)) - return &MFVideoFormat_YV12; - else if (IsEqualGUID(subtype, &MEDIASUBTYPE_YUY2)) - return &MFVideoFormat_YUY2; - else if (IsEqualGUID(subtype, &MEDIASUBTYPE_UYVY)) - return &MFVideoFormat_UYVY; - else if (IsEqualGUID(subtype, &MEDIASUBTYPE_YVYU)) - return &MFVideoFormat_YVYU; - else if (IsEqualGUID(subtype, &MEDIASUBTYPE_NV12)) - return &MFVideoFormat_NV12; - else - { - FIXME("Unknown subtype %s.\n", debugstr_guid(subtype)); - return &null; - } + if (IsEqualGUID(subtype, &MEDIASUBTYPE_A2R10G10B10)) + return &MFVideoFormat_A2B10G10R10; + if (IsEqualGUID(subtype, &MEDIASUBTYPE_A2B10G10R10)) + return &MFVideoFormat_A2R10G10B10; + return subtype; } /*********************************************************************** diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 36f2d76401a..51ec8f6653b 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -66,14 +66,38 @@ DEFINE_GUID(DUMMY_GUID3, 0x12345678,0x1234,0x1234,0x23,0x23,0x23,0x23,0x23,0x23, extern const CLSID CLSID_FileSchemePlugin; +DEFINE_MEDIATYPE_GUID(MEDIASUBTYPE_Base,0); + +DEFINE_MEDIATYPE_GUID(MFVideoFormat_RGB1, D3DFMT_A1); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_RGB4, MAKEFOURCC('4','P','x','x')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_ARGB1555, D3DFMT_A1R5G5B5); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_ARGB4444, D3DFMT_A4R4G4B4); /* SDK MFVideoFormat_A2R10G10B10 uses D3DFMT_A2B10G10R10, let's name it the other way */ DEFINE_MEDIATYPE_GUID(MFVideoFormat_A2B10G10R10, D3DFMT_A2R10G10B10); +DEFINE_MEDIATYPE_GUID(MEDIASUBTYPE_h264,MAKEFOURCC('h','2','6','4')); +DEFINE_MEDIATYPE_GUID(MEDIASUBTYPE_MP3,WAVE_FORMAT_MPEGLAYER3); + DEFINE_MEDIATYPE_GUID(MFVideoFormat_IMC1, MAKEFOURCC('I','M','C','1')); DEFINE_MEDIATYPE_GUID(MFVideoFormat_IMC2, MAKEFOURCC('I','M','C','2')); DEFINE_MEDIATYPE_GUID(MFVideoFormat_IMC3, MAKEFOURCC('I','M','C','3')); DEFINE_MEDIATYPE_GUID(MFVideoFormat_IMC4, MAKEFOURCC('I','M','C','4')); +DEFINE_MEDIATYPE_GUID(MEDIASUBTYPE_AVC1,MAKEFOURCC('A','V','C','1')); +DEFINE_MEDIATYPE_GUID(MEDIASUBTYPE_MP42,MAKEFOURCC('M','P','4','2')); +DEFINE_MEDIATYPE_GUID(MEDIASUBTYPE_mp42,MAKEFOURCC('m','p','4','2')); +DEFINE_MEDIATYPE_GUID(MEDIASUBTYPE_MPG4,MAKEFOURCC('M','P','G','4')); +DEFINE_MEDIATYPE_GUID(MEDIASUBTYPE_mpg4,MAKEFOURCC('m','p','g','4')); +DEFINE_MEDIATYPE_GUID(MEDIASUBTYPE_P422,MAKEFOURCC('P','4','2','2')); +DEFINE_MEDIATYPE_GUID(MEDIASUBTYPE_wmva,MAKEFOURCC('w','m','v','a')); +DEFINE_MEDIATYPE_GUID(MEDIASUBTYPE_WMVB,MAKEFOURCC('W','M','V','B')); +DEFINE_MEDIATYPE_GUID(MEDIASUBTYPE_wmvb,MAKEFOURCC('w','m','v','b')); +DEFINE_MEDIATYPE_GUID(MEDIASUBTYPE_wmvp,MAKEFOURCC('w','m','v','p')); +DEFINE_MEDIATYPE_GUID(MEDIASUBTYPE_wmvr,MAKEFOURCC('w','m','v','r')); +DEFINE_MEDIATYPE_GUID(MEDIASUBTYPE_wvp2,MAKEFOURCC('w','v','p','2')); +DEFINE_MEDIATYPE_GUID(MEDIASUBTYPE_X264,MAKEFOURCC('X','2','6','4')); +DEFINE_MEDIATYPE_GUID(MEDIASUBTYPE_x264,MAKEFOURCC('x','2','6','4')); + static BOOL is_win8_plus; #define EXPECT_REF(obj,ref) _expect_ref((IUnknown*)obj, ref, __LINE__) @@ -9868,6 +9892,22 @@ static void test_MFInitMediaTypeFromAMMediaType(void) const GUID *mf_type; } guid_types[] = { + /* these RGB formats are converted, MEDIASUBTYPE variant isn't + * defined using DEFINE_MEDIATYPE_GUID */ + { &MEDIASUBTYPE_RGB1, &MFVideoFormat_RGB1 }, + { &MEDIASUBTYPE_RGB4, &MFVideoFormat_RGB4 }, + { &MEDIASUBTYPE_RGB8, &MFVideoFormat_RGB8 }, + { &MEDIASUBTYPE_RGB555, &MFVideoFormat_RGB555 }, + { &MEDIASUBTYPE_RGB565, &MFVideoFormat_RGB565 }, + { &MEDIASUBTYPE_RGB24, &MFVideoFormat_RGB24 }, + { &MEDIASUBTYPE_RGB32, &MFVideoFormat_RGB32 }, + { &MEDIASUBTYPE_ARGB1555, &MFVideoFormat_ARGB1555 }, + { &MEDIASUBTYPE_ARGB4444, &MFVideoFormat_ARGB4444 }, + { &MEDIASUBTYPE_ARGB32, &MFVideoFormat_ARGB32 }, + { &MEDIASUBTYPE_A2R10G10B10, &MFVideoFormat_A2B10G10R10 }, + { &MEDIASUBTYPE_A2B10G10R10, &MFVideoFormat_A2R10G10B10 }, + + /* any other GUID is passed through */ { &MEDIASUBTYPE_I420, &MFVideoFormat_I420 }, { &MEDIASUBTYPE_AYUV, &MFVideoFormat_AYUV }, { &MEDIASUBTYPE_YV12, &MFVideoFormat_YV12 }, @@ -9875,7 +9915,15 @@ static void test_MFInitMediaTypeFromAMMediaType(void) { &MEDIASUBTYPE_UYVY, &MFVideoFormat_UYVY }, { &MEDIASUBTYPE_YVYU, &MFVideoFormat_YVYU }, { &MEDIASUBTYPE_NV12, &MFVideoFormat_NV12 }, - { &MEDIASUBTYPE_ARGB32, &MFVideoFormat_ARGB32 }, + + /* even formats that don't exist in MF */ + { &DUMMY_GUID3, &DUMMY_GUID3 }, + { &MEDIASUBTYPE_NV24, &MEDIASUBTYPE_NV24 }, + { &MEDIASUBTYPE_P208, &MEDIASUBTYPE_P208 }, + + /* if the mapping is ambiguous, it is not corrected */ + { &MEDIASUBTYPE_h264, &MEDIASUBTYPE_h264 }, + { &MEDIASUBTYPE_H264, &MFVideoFormat_H264 }, }; unsigned int i; @@ -9999,6 +10047,7 @@ static void test_MFInitMediaTypeFromAMMediaType(void) vih.bmiHeader.biHeight = 24; for (i = 0; i < ARRAY_SIZE(guid_types); ++i) { + winetest_push_context("%s", debugstr_guid(guid_types[i].am_type)); memcpy(&mt.subtype, guid_types[i].am_type, sizeof(GUID)); hr = MFInitMediaTypeFromAMMediaType(media_type, &mt); @@ -10010,6 +10059,7 @@ static void test_MFInitMediaTypeFromAMMediaType(void) hr = IMFMediaType_GetGUID(media_type, &MF_MT_SUBTYPE, &guid); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(IsEqualGUID(&guid, guid_types[i].mf_type), "Unexpected guid %s.\n", debugstr_guid(&guid)); + winetest_pop_context(); } IMFMediaType_Release(media_type);
1
0
0
0
Rémi Bernon : mfplat/tests: Add IMFMediaType_GetRepresentation tests.
by Alexandre Julliard
22 Nov '23
22 Nov '23
Module: wine Branch: master Commit: 947d7af00ccd2300eba7df7140b654539e94d5cd URL:
https://gitlab.winehq.org/wine/wine/-/commit/947d7af00ccd2300eba7df7140b654…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Nov 20 10:35:05 2023 +0100 mfplat/tests: Add IMFMediaType_GetRepresentation tests. --- dlls/mfplat/tests/mfplat.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index f5cfe9cb4ee..36f2d76401a 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -7572,6 +7572,81 @@ skip_tests: IMFMediaType_Release(media_type); } +static void test_IMFMediaType_GetRepresentation(void) +{ + WAVEFORMATEX wfx = {.wFormatTag = WAVE_FORMAT_PCM}; + IMFMediaType *media_type; + AM_MEDIA_TYPE *am_type; + HRESULT hr; + + hr = MFCreateMediaType(&media_type); + ok(hr == S_OK, "Failed to create media type, hr %#lx.\n", hr); + + hr = IMFMediaType_GetRepresentation(media_type, GUID_NULL, (void **)&am_type); + todo_wine ok(hr == MF_E_UNSUPPORTED_REPRESENTATION, "Unexpected hr %#lx.\n", hr); + hr = IMFMediaType_GetRepresentation(media_type, AM_MEDIA_TYPE_REPRESENTATION, (void **)&am_type); + todo_wine ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#lx.\n", hr); + hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = IMFMediaType_GetRepresentation(media_type, AM_MEDIA_TYPE_REPRESENTATION, (void **)&am_type); + todo_wine ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#lx.\n", hr); + hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Video); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = IMFMediaType_GetRepresentation(media_type, AM_MEDIA_TYPE_REPRESENTATION, (void **)&am_type); + todo_wine ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#lx.\n", hr); + + hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, &MFAudioFormat_PCM); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = IMFMediaType_GetRepresentation(media_type, FORMAT_VideoInfo, (void **)&am_type); + todo_wine ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); + hr = IMFMediaType_GetRepresentation(media_type, AM_MEDIA_TYPE_REPRESENTATION, (void **)&am_type); + todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (hr != S_OK) goto skip_tests; + ok(IsEqualGUID(&am_type->majortype, &MFMediaType_Audio), "got %s.\n", debugstr_guid(&am_type->majortype)); + ok(IsEqualGUID(&am_type->subtype, &MFAudioFormat_PCM), "got %s.\n", debugstr_guid(&am_type->subtype)); + ok(IsEqualGUID(&am_type->formattype, &FORMAT_WaveFormatEx), "got %s.\n", debugstr_guid(&am_type->formattype)); + ok(am_type->cbFormat == sizeof(WAVEFORMATEX), "got %lu\n", am_type->cbFormat); + hr = IMFMediaType_FreeRepresentation(media_type, IID_IUnknown /* invalid format */, am_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + IMFMediaType_Release(media_type); + + hr = MFCreateAudioMediaType(&wfx, (IMFAudioMediaType **)&media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = IMFMediaType_GetRepresentation(media_type, GUID_NULL, (void **)&am_type); + ok(hr == MF_E_UNSUPPORTED_REPRESENTATION, "Unexpected hr %#lx.\n", hr); + hr = IMFMediaType_GetRepresentation(media_type, FORMAT_VideoInfo, (void **)&am_type); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); + hr = IMFMediaType_GetRepresentation(media_type, AM_MEDIA_TYPE_REPRESENTATION, (void **)&am_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(IsEqualGUID(&am_type->majortype, &MFMediaType_Audio), "got %s.\n", debugstr_guid(&am_type->majortype)); + ok(IsEqualGUID(&am_type->subtype, &MFAudioFormat_PCM), "got %s.\n", debugstr_guid(&am_type->subtype)); + ok(IsEqualGUID(&am_type->formattype, &FORMAT_WaveFormatEx), "got %s.\n", debugstr_guid(&am_type->formattype)); + ok(am_type->cbFormat == sizeof(WAVEFORMATEX), "got %lu\n", am_type->cbFormat); + hr = IMFMediaType_FreeRepresentation(media_type, AM_MEDIA_TYPE_REPRESENTATION, am_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + IMFMediaType_Release(media_type); + + hr = MFCreateVideoMediaTypeFromSubtype(&MFVideoFormat_RGB32, (IMFVideoMediaType **)&media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = IMFMediaType_GetRepresentation(media_type, GUID_NULL, (void **)&am_type); + ok(hr == MF_E_UNSUPPORTED_REPRESENTATION, "Unexpected hr %#lx.\n", hr); + hr = IMFMediaType_GetRepresentation(media_type, FORMAT_WaveFormatEx, (void **)&am_type); + ok(hr == MF_E_UNSUPPORTED_REPRESENTATION, "Unexpected hr %#lx.\n", hr); + hr = IMFMediaType_GetRepresentation(media_type, AM_MEDIA_TYPE_REPRESENTATION, (void **)&am_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(IsEqualGUID(&am_type->majortype, &MFMediaType_Video), "got %s.\n", debugstr_guid(&am_type->majortype)); + ok(IsEqualGUID(&am_type->subtype, &MEDIASUBTYPE_RGB32), "got %s.\n", debugstr_guid(&am_type->subtype)); + ok(IsEqualGUID(&am_type->formattype, &FORMAT_VideoInfo), "got %s.\n", debugstr_guid(&am_type->formattype)); + ok(am_type->cbFormat == sizeof(VIDEOINFOHEADER), "got %lu\n", am_type->cbFormat); + hr = IMFMediaType_FreeRepresentation(media_type, AM_MEDIA_TYPE_REPRESENTATION, am_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + +skip_tests: + IMFMediaType_Release(media_type); +} + static void test_MFCreateDXSurfaceBuffer(void) { IDirect3DSurface9 *backbuffer = NULL, *surface; @@ -10318,6 +10393,7 @@ START_TEST(mfplat) test_MFCreateMFVideoFormatFromMFMediaType(); test_MFInitAMMediaTypeFromMFMediaType(); test_MFCreateAMMediaTypeFromMFMediaType(); + test_IMFMediaType_GetRepresentation(); test_MFCreateDXSurfaceBuffer(); test_MFCreateTrackedSample(); test_MFFrameRateToAverageTimePerFrame();
1
0
0
0
Rémi Bernon : mfplat/tests: Add tests for MFCreateAMMediaTypeFromMFMediaType.
by Alexandre Julliard
22 Nov '23
22 Nov '23
Module: wine Branch: master Commit: 486e6967b3c11104608818e89876759567ad89d9 URL:
https://gitlab.winehq.org/wine/wine/-/commit/486e6967b3c11104608818e8987675…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Nov 20 10:36:49 2023 +0100 mfplat/tests: Add tests for MFCreateAMMediaTypeFromMFMediaType. --- dlls/mfplat/tests/mfplat.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 5a399f39608..f5cfe9cb4ee 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -7534,6 +7534,44 @@ skip_tests: IMFMediaType_Release(media_type); } +static void test_MFCreateAMMediaTypeFromMFMediaType(void) +{ + IMFMediaType *media_type; + AM_MEDIA_TYPE *am_type; + HRESULT hr; + + hr = MFCreateMediaType(&media_type); + ok(hr == S_OK, "Failed to create media type, hr %#lx.\n", hr); + + hr = MFCreateAMMediaTypeFromMFMediaType(media_type, GUID_NULL, &am_type); + todo_wine ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#lx.\n", hr); + hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = MFCreateAMMediaTypeFromMFMediaType(media_type, GUID_NULL, &am_type); + todo_wine ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#lx.\n", hr); + hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Video); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = MFCreateAMMediaTypeFromMFMediaType(media_type, GUID_NULL, &am_type); + todo_wine ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#lx.\n", hr); + + hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, &MFAudioFormat_PCM); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = MFCreateAMMediaTypeFromMFMediaType(media_type, GUID_NULL, &am_type); + todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (hr != S_OK) goto skip_tests; + ok(IsEqualGUID(&am_type->majortype, &MFMediaType_Audio), "got %s.\n", debugstr_guid(&am_type->majortype)); + ok(IsEqualGUID(&am_type->subtype, &MFAudioFormat_PCM), "got %s.\n", debugstr_guid(&am_type->subtype)); + ok(IsEqualGUID(&am_type->formattype, &FORMAT_WaveFormatEx), "got %s.\n", debugstr_guid(&am_type->formattype)); + ok(am_type->cbFormat == sizeof(WAVEFORMATEX), "got %lu\n", am_type->cbFormat); + CoTaskMemFree(am_type->pbFormat); + CoTaskMemFree(am_type); + +skip_tests: + IMFMediaType_Release(media_type); +} + static void test_MFCreateDXSurfaceBuffer(void) { IDirect3DSurface9 *backbuffer = NULL, *surface; @@ -10279,6 +10317,7 @@ START_TEST(mfplat) test_MFInitMediaTypeFromWaveFormatEx(); test_MFCreateMFVideoFormatFromMFMediaType(); test_MFInitAMMediaTypeFromMFMediaType(); + test_MFCreateAMMediaTypeFromMFMediaType(); test_MFCreateDXSurfaceBuffer(); test_MFCreateTrackedSample(); test_MFFrameRateToAverageTimePerFrame();
1
0
0
0
← Newer
1
...
23
24
25
26
27
28
29
...
99
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
Results per page:
10
25
50
100
200