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
March 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
775 discussions
Start a n
N
ew thread
Rémi Bernon : mfplat/mediatype: Use MFCreateWaveFormatExFromMFMediaType in init_am_media_type_audio_format.
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: 552cec94772a077065be9001e2df5db2245dec0a URL:
https://gitlab.winehq.org/wine/wine/-/commit/552cec94772a077065be9001e2df5d…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Mar 11 15:00:30 2024 +0100 mfplat/mediatype: Use MFCreateWaveFormatExFromMFMediaType in init_am_media_type_audio_format. --- dlls/mfplat/mediatype.c | 60 +++++-------------------------------------------- 1 file changed, 6 insertions(+), 54 deletions(-) diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index f584e1aae26..df1334d51ff 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -3992,7 +3992,7 @@ HRESULT WINAPI MFInitMediaTypeFromVideoInfoHeader(IMFMediaType *media_type, cons static HRESULT init_am_media_type_audio_format(AM_MEDIA_TYPE *am_type, UINT32 user_size, IMFMediaType *media_type) { - UINT32 num_channels, value; + UINT32 num_channels; HRESULT hr; if (IsEqualGUID(&am_type->formattype, &FORMAT_VideoInfo) @@ -4003,7 +4003,7 @@ static HRESULT init_am_media_type_audio_format(AM_MEDIA_TYPE *am_type, UINT32 us if (IsEqualGUID(&am_type->formattype, &FORMAT_WaveFormatEx) || IsEqualGUID(&am_type->formattype, &GUID_NULL)) { - WAVEFORMATEX *format; + UINT32 flags = 0; if (FAILED(IMFMediaType_GetUINT32(media_type, &MF_MT_AUDIO_NUM_CHANNELS, &num_channels))) num_channels = 0; @@ -4012,59 +4012,11 @@ static HRESULT init_am_media_type_audio_format(AM_MEDIA_TYPE *am_type, UINT32 us || SUCCEEDED(IMFMediaType_GetItem(media_type, &MF_MT_AUDIO_VALID_BITS_PER_SAMPLE, NULL)) || SUCCEEDED(IMFMediaType_GetItem(media_type, &MF_MT_AUDIO_SAMPLES_PER_BLOCK, NULL)) || num_channels > 2) - { - WAVEFORMATEXTENSIBLE *format_ext; - - am_type->cbFormat = sizeof(*format_ext) + user_size; - if (!(am_type->pbFormat = CoTaskMemAlloc(am_type->cbFormat))) - return E_OUTOFMEMORY; - format_ext = (WAVEFORMATEXTENSIBLE *)am_type->pbFormat; - memset(format_ext, 0, sizeof(*format_ext)); - - if (SUCCEEDED(IMFMediaType_GetUINT32(media_type, &MF_MT_AUDIO_CHANNEL_MASK, &value))) - format_ext->dwChannelMask = value; - else if (num_channels < ARRAY_SIZE(default_channel_mask)) - format_ext->dwChannelMask = default_channel_mask[num_channels]; - - if (SUCCEEDED(IMFMediaType_GetUINT32(media_type, &MF_MT_AUDIO_VALID_BITS_PER_SAMPLE, &value))) - format_ext->Samples.wValidBitsPerSample = value; - if (SUCCEEDED(IMFMediaType_GetUINT32(media_type, &MF_MT_AUDIO_SAMPLES_PER_BLOCK, &value))) - format_ext->Samples.wSamplesPerBlock = value; - format_ext->SubFormat = am_type->subtype; - - format = &format_ext->Format; - format->wFormatTag = WAVE_FORMAT_EXTENSIBLE; - format->cbSize = sizeof(*format_ext) - sizeof(*format) + user_size; - - if (user_size && FAILED(hr = IMFMediaType_GetBlob(media_type, &MF_MT_USER_DATA, - (BYTE *)(format_ext + 1), user_size, NULL))) - return hr; - } - else - { - am_type->cbFormat = sizeof(*format) + user_size; - if (!(am_type->pbFormat = CoTaskMemAlloc(am_type->cbFormat))) - return E_OUTOFMEMORY; - format = (WAVEFORMATEX *)am_type->pbFormat; - memset(format, 0, sizeof(*format)); - - format->wFormatTag = am_type->subtype.Data1; - format->cbSize = user_size; - - if (user_size && FAILED(hr = IMFMediaType_GetBlob(media_type, &MF_MT_USER_DATA, - (BYTE *)(format + 1), user_size, NULL))) - return hr; - } + flags = MFWaveFormatExConvertFlag_ForceExtensible; - format->nChannels = num_channels; - if (SUCCEEDED(IMFMediaType_GetUINT32(media_type, &MF_MT_AUDIO_SAMPLES_PER_SECOND, &value))) - format->nSamplesPerSec = value; - if (SUCCEEDED(IMFMediaType_GetUINT32(media_type, &MF_MT_AUDIO_AVG_BYTES_PER_SECOND, &value))) - format->nAvgBytesPerSec = value; - if (SUCCEEDED(IMFMediaType_GetUINT32(media_type, &MF_MT_AUDIO_BLOCK_ALIGNMENT, &value))) - format->nBlockAlign = value; - if (SUCCEEDED(IMFMediaType_GetUINT32(media_type, &MF_MT_AUDIO_BITS_PER_SAMPLE, &value))) - format->wBitsPerSample = value; + if (FAILED(hr = MFCreateWaveFormatExFromMFMediaType(media_type, (WAVEFORMATEX **)&am_type->pbFormat, + (UINT32 *)&am_type->cbFormat, flags))) + return hr; am_type->subtype = get_am_subtype_for_mf_subtype(am_type->subtype); am_type->formattype = FORMAT_WaveFormatEx;
1
0
0
0
Rémi Bernon : mfplat/mediatype: Implement MFCreateMediaTypeFromRepresentation.
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: 1e053810f3fec90bf20eb536d1e7dd063e3a581d URL:
https://gitlab.winehq.org/wine/wine/-/commit/1e053810f3fec90bf20eb536d1e7dd…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Mar 5 23:03:31 2024 +0100 mfplat/mediatype: Implement MFCreateMediaTypeFromRepresentation. --- dlls/mfplat/mediatype.c | 26 +++++++++++++++++++++++ dlls/mfplat/mfplat.spec | 2 +- dlls/mfplat/tests/mfplat.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++ include/mfapi.h | 2 ++ 4 files changed, 80 insertions(+), 1 deletion(-) diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index 9c4b9877e02..f584e1aae26 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -4334,3 +4334,29 @@ HRESULT WINAPI MFInitMediaTypeFromAMMediaType(IMFMediaType *media_type, const AM return hr; } + +/*********************************************************************** + * MFCreateMediaTypeFromRepresentation (mfplat.@) + */ +HRESULT WINAPI MFCreateMediaTypeFromRepresentation(GUID guid_representation, void *representation, + IMFMediaType **media_type) +{ + HRESULT hr; + + TRACE("%s, %p, %p\n", debugstr_guid(&guid_representation), representation, media_type); + + if (!IsEqualGUID(&guid_representation, &AM_MEDIA_TYPE_REPRESENTATION)) + return MF_E_UNSUPPORTED_REPRESENTATION; + if (!representation || !media_type) + return E_INVALIDARG; + + if (FAILED(hr = MFCreateMediaType(media_type))) + return hr; + if (FAILED(hr = MFInitMediaTypeFromAMMediaType(*media_type, representation))) + { + IMFMediaType_Release(*media_type); + *media_type = NULL; + } + + return hr; +} diff --git a/dlls/mfplat/mfplat.spec b/dlls/mfplat/mfplat.spec index d8a6eb5ce83..57db3cdf9f6 100644 --- a/dlls/mfplat/mfplat.spec +++ b/dlls/mfplat/mfplat.spec @@ -59,7 +59,7 @@ @ stub MFCreateMediaBufferWrapper @ stdcall MFCreateMediaEvent(long ptr long ptr ptr) @ stdcall MFCreateMediaType(ptr) -@ stub MFCreateMediaTypeFromRepresentation +@ stdcall MFCreateMediaTypeFromRepresentation(int128 ptr ptr) @ stdcall MFCreateMemoryBuffer(long ptr) @ stub MFCreateMemoryStream @ stdcall MFCreatePathFromURL(wstr ptr) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 0cfe296b260..2ff78a2b05a 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -8524,6 +8524,56 @@ static void test_IMFMediaType_GetRepresentation(void) IMFMediaType_Release(media_type); } +static void test_MFCreateMediaTypeFromRepresentation(void) +{ + IMFMediaType *media_type; + AM_MEDIA_TYPE amt = {0}; + WAVEFORMATEX wfx = {0}; + HRESULT hr; + GUID guid; + + hr = MFCreateMediaTypeFromRepresentation(GUID_NULL, &amt, &media_type); + ok(hr == MF_E_UNSUPPORTED_REPRESENTATION, "Unexpected hr %#lx.\n", hr); + hr = MFCreateMediaTypeFromRepresentation(AM_MEDIA_TYPE_REPRESENTATION, NULL, &media_type); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); + hr = MFCreateMediaTypeFromRepresentation(AM_MEDIA_TYPE_REPRESENTATION, &amt, NULL); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); + + hr = MFCreateMediaTypeFromRepresentation(AM_MEDIA_TYPE_REPRESENTATION, &amt, &media_type); + todo_wine + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + memset(&guid, 0xcd, sizeof(guid)); + hr = IMFMediaType_GetGUID(media_type, &MF_MT_MAJOR_TYPE, &guid); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(IsEqualGUID(&guid, &GUID_NULL), "got %s.\n", debugstr_guid(&guid)); + memset(&guid, 0xcd, sizeof(guid)); + hr = IMFMediaType_GetGUID(media_type, &MF_MT_SUBTYPE, &guid); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(IsEqualGUID(&guid, &GUID_NULL), "got %s.\n", debugstr_guid(&guid)); + IMFMediaType_Release(media_type); + } + + amt.formattype = FORMAT_WaveFormatEx; + amt.majortype = MFMediaType_Audio; + amt.subtype = MFAudioFormat_PCM; + amt.pbFormat = (BYTE *)&wfx; + amt.cbFormat = sizeof(wfx); + hr = MFCreateMediaTypeFromRepresentation(AM_MEDIA_TYPE_REPRESENTATION, &amt, &media_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + memset(&guid, 0xcd, sizeof(guid)); + hr = IMFMediaType_GetGUID(media_type, &MF_MT_MAJOR_TYPE, &guid); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(IsEqualGUID(&guid, &MFMediaType_Audio), "got %s.\n", debugstr_guid(&guid)); + memset(&guid, 0xcd, sizeof(guid)); + hr = IMFMediaType_GetGUID(media_type, &MF_MT_SUBTYPE, &guid); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + todo_wine + ok(IsEqualGUID(&guid, &MFAudioFormat_PCM), "got %s.\n", debugstr_guid(&guid)); + IMFMediaType_Release(media_type); +} + static void test_MFCreateDXSurfaceBuffer(void) { IDirect3DSurface9 *backbuffer = NULL, *surface; @@ -11798,6 +11848,7 @@ START_TEST(mfplat) test_MFCreateAMMediaTypeFromMFMediaType(); test_MFInitMediaTypeFromMFVideoFormat(); test_IMFMediaType_GetRepresentation(); + test_MFCreateMediaTypeFromRepresentation(); test_MFCreateDXSurfaceBuffer(); test_MFCreateTrackedSample(); test_MFFrameRateToAverageTimePerFrame(); diff --git a/include/mfapi.h b/include/mfapi.h index f986edd0d5a..0a9f7c6f415 100644 --- a/include/mfapi.h +++ b/include/mfapi.h @@ -549,6 +549,8 @@ HRESULT WINAPI MFCreateMediaEvent(MediaEventType type, REFGUID extended_type, HR HRESULT WINAPI MFCreateMediaType(IMFMediaType **type); HRESULT WINAPI MFCreateAMMediaTypeFromMFMediaType(IMFMediaType *media_type, GUID format_type, AM_MEDIA_TYPE **am_type); HRESULT WINAPI MFCreateMFVideoFormatFromMFMediaType(IMFMediaType *media_type, MFVIDEOFORMAT **video_format, UINT32 *size); +HRESULT WINAPI MFCreateMediaTypeFromRepresentation(GUID guid_representation, void *representation, + IMFMediaType **media_type); HRESULT WINAPI MFCreateSample(IMFSample **sample); HRESULT WINAPI MFCreateTempFile(MF_FILE_ACCESSMODE accessmode, MF_FILE_OPENMODE openmode, MF_FILE_FLAGS flags, IMFByteStream **bytestream);
1
0
0
0
Rémi Bernon : mfplat/mediatype: Force WAVEFORMATEXTENSIBLE in MFCreateWaveFormatExFromMFMediaType in some cases.
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: a4fb357c89723328ba95c46fbc2c1271c329784e URL:
https://gitlab.winehq.org/wine/wine/-/commit/a4fb357c89723328ba95c46fbc2c12…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Mar 12 19:44:22 2024 +0100 mfplat/mediatype: Force WAVEFORMATEXTENSIBLE in MFCreateWaveFormatExFromMFMediaType in some cases. --- dlls/mfplat/mediatype.c | 28 +++++++++++++++++++++++++--- dlls/mfplat/tests/mfplat.c | 6 ------ dlls/winegstreamer/aac_decoder.c | 1 + 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index b5ed16e41f1..9c4b9877e02 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -2980,7 +2980,7 @@ HRESULT WINAPI MFCreateWaveFormatExFromMFMediaType(IMFMediaType *mediatype, WAVE { UINT32 value, extra_size = 0, user_size; WAVEFORMATEX *format; - GUID major, subtype; + GUID major, subtype, basetype = MFAudioFormat_Base; void *user_data; HRESULT hr; @@ -3002,6 +3002,19 @@ HRESULT WINAPI MFCreateWaveFormatExFromMFMediaType(IMFMediaType *mediatype, WAVE user_size = 0; } + if (SUCCEEDED(IMFMediaType_GetUINT32(mediatype, &MF_MT_AUDIO_NUM_CHANNELS, &value)) && value > 2 + && SUCCEEDED(IMFMediaType_GetItem(mediatype, &MF_MT_AUDIO_CHANNEL_MASK, NULL))) + { + if (SUCCEEDED(IMFMediaType_GetItem(mediatype, &MF_MT_AUDIO_VALID_BITS_PER_SAMPLE, NULL))) + flags = MFWaveFormatExConvertFlag_ForceExtensible; + if (SUCCEEDED(IMFMediaType_GetItem(mediatype, &MF_MT_AUDIO_SAMPLES_PER_BLOCK, NULL))) + flags = MFWaveFormatExConvertFlag_ForceExtensible; + } + + basetype.Data1 = subtype.Data1; + if (subtype.Data1 >> 16 || !IsEqualGUID(&subtype, &basetype)) + flags = MFWaveFormatExConvertFlag_ForceExtensible; + if (flags == MFWaveFormatExConvertFlag_ForceExtensible) extra_size = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(*format); @@ -3034,6 +3047,8 @@ HRESULT WINAPI MFCreateWaveFormatExFromMFMediaType(IMFMediaType *mediatype, WAVE user_data = format_ext + 1; if (SUCCEEDED(IMFMediaType_GetUINT32(mediatype, &MF_MT_AUDIO_VALID_BITS_PER_SAMPLE, &value))) + format_ext->Samples.wValidBitsPerSample = value; + if (SUCCEEDED(IMFMediaType_GetUINT32(mediatype, &MF_MT_AUDIO_SAMPLES_PER_BLOCK, &value))) format_ext->Samples.wSamplesPerBlock = value; if (SUCCEEDED(IMFMediaType_GetUINT32(mediatype, &MF_MT_AUDIO_CHANNEL_MASK, &value))) @@ -3080,6 +3095,8 @@ static void mediatype_set_blob(IMFMediaType *mediatype, const GUID *attr, const HRESULT WINAPI MFInitMediaTypeFromWaveFormatEx(IMFMediaType *mediatype, const WAVEFORMATEX *format, UINT32 size) { const WAVEFORMATEXTENSIBLE *wfex = (const WAVEFORMATEXTENSIBLE *)format; + const void *user_data; + int user_data_size; GUID subtype; HRESULT hr; @@ -3104,6 +3121,9 @@ HRESULT WINAPI MFInitMediaTypeFromWaveFormatEx(IMFMediaType *mediatype, const WA if (format->wBitsPerSample && wfex->Samples.wValidBitsPerSample) mediatype_set_uint32(mediatype, &MF_MT_AUDIO_VALID_BITS_PER_SAMPLE, wfex->Samples.wValidBitsPerSample, &hr); + + user_data_size = format->cbSize - sizeof(WAVEFORMATEXTENSIBLE) + sizeof(WAVEFORMATEX); + user_data = wfex + 1; } else { @@ -3111,6 +3131,8 @@ HRESULT WINAPI MFInitMediaTypeFromWaveFormatEx(IMFMediaType *mediatype, const WA subtype.Data1 = format->wFormatTag; mediatype_set_uint32(mediatype, &MF_MT_AUDIO_PREFER_WAVEFORMATEX, 1, &hr); + user_data_size = format->cbSize; + user_data = format + 1; } mediatype_set_guid(mediatype, &MF_MT_SUBTYPE, &subtype, &hr); @@ -3144,8 +3166,8 @@ HRESULT WINAPI MFInitMediaTypeFromWaveFormatEx(IMFMediaType *mediatype, const WA mediatype_set_uint32(mediatype, &MF_MT_AAC_PAYLOAD_TYPE, info->wPayloadType, &hr); } - if (format->cbSize && format->wFormatTag != WAVE_FORMAT_EXTENSIBLE) - mediatype_set_blob(mediatype, &MF_MT_USER_DATA, (const UINT8 *)(format + 1), format->cbSize, &hr); + if (user_data_size > 0) + mediatype_set_blob(mediatype, &MF_MT_USER_DATA, user_data, user_data_size, &hr); return hr; } diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index e4989e4bcea..0cfe296b260 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -7135,18 +7135,12 @@ static void test_MFInitMediaTypeFromWaveFormatEx(void) ok(hr == S_OK, "Failed to get attribute, hr %#lx.\n", hr); hr = MFCreateWaveFormatExFromMFMediaType(mediatype, (WAVEFORMATEX **)&format, &size, 0); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - todo_wine ok(format->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE, "got wFormatTag %#x\n", format->Format.wFormatTag); - todo_wine ok(format->Format.cbSize == aacformat.wfInfo.wfx.cbSize + sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX), "got cbSize %u\n", format->Format.cbSize); - todo_wine ok(IsEqualGUID(&format->SubFormat, &MFAudioFormat_AAC), "got SubFormat %s\n", debugstr_guid(&format->SubFormat)); - todo_wine ok(format->dwChannelMask == 63, "got dwChannelMask %#lx\n", format->dwChannelMask); - todo_wine ok(format->Samples.wSamplesPerBlock == 4, "got wSamplesPerBlock %u\n", format->Samples.wSamplesPerBlock); - todo_wine ok(!memcmp(format + 1, &aacformat.wfInfo.wfx + 1, aacformat.wfInfo.wfx.cbSize), "Unexpected user data.\n"); /* test initializing media type from an WAVE_FORMAT_EXTENSIBLE AAC format */ diff --git a/dlls/winegstreamer/aac_decoder.c b/dlls/winegstreamer/aac_decoder.c index c0bc57f278e..5844de33ceb 100644 --- a/dlls/winegstreamer/aac_decoder.c +++ b/dlls/winegstreamer/aac_decoder.c @@ -292,6 +292,7 @@ static HRESULT WINAPI transform_GetOutputAvailableType(IMFTransform *iface, DWOR wfx.SubFormat = MFAudioFormat_Base; wfx.SubFormat.Data1 = wfx.Format.wFormatTag; wfx.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; + wfx.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX); wfx.dwChannelMask = default_channel_mask[wfx.Format.nChannels]; }
1
0
0
0
Rémi Bernon : mfplat/mediatype: Support audio major type in MFInitMediaTypeFromAMMediaType.
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: 689868cd501a7855dc0535531dd57cf494e11c12 URL:
https://gitlab.winehq.org/wine/wine/-/commit/689868cd501a7855dc0535531dd57c…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Mar 11 17:21:22 2024 +0100 mfplat/mediatype: Support audio major type in MFInitMediaTypeFromAMMediaType. --- dlls/mfplat/mediatype.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index d8f39678278..b5ed16e41f1 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -4283,13 +4283,19 @@ HRESULT WINAPI MFInitMediaTypeFromAMMediaType(IMFMediaType *media_type, const AM FIXME("Unsupported format type %s / size %ld.\n", debugstr_guid(&am_type->formattype), am_type->cbFormat); return E_NOTIMPL; } - - if (!am_type->bTemporalCompression && FAILED(IMFMediaType_GetItem(media_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, NULL))) - mediatype_set_uint32(media_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, 1, &hr); - if (am_type->bFixedSizeSamples && FAILED(IMFMediaType_GetItem(media_type, &MF_MT_FIXED_SIZE_SAMPLES, NULL))) - mediatype_set_uint32(media_type, &MF_MT_FIXED_SIZE_SAMPLES, 1, &hr); - if (am_type->lSampleSize && FAILED(IMFMediaType_GetItem(media_type, &MF_MT_SAMPLE_SIZE, NULL))) - mediatype_set_uint32(media_type, &MF_MT_SAMPLE_SIZE, am_type->lSampleSize, &hr); + } + else if (IsEqualGUID(&am_type->majortype, &MEDIATYPE_Audio)) + { + if (am_type->cbFormat && !am_type->pbFormat) + hr = E_INVALIDARG; + else if (IsEqualGUID(&am_type->formattype, &FORMAT_WaveFormatEx) + && am_type->cbFormat >= sizeof(WAVEFORMATEX)) + hr = MFInitMediaTypeFromWaveFormatEx(media_type, (WAVEFORMATEX *)am_type->pbFormat, am_type->cbFormat); + else + { + FIXME("Unsupported format type %s / size %ld.\n", debugstr_guid(&am_type->formattype), am_type->cbFormat); + return E_NOTIMPL; + } } else { @@ -4297,5 +4303,12 @@ HRESULT WINAPI MFInitMediaTypeFromAMMediaType(IMFMediaType *media_type, const AM return E_NOTIMPL; } + if (!am_type->bTemporalCompression && FAILED(IMFMediaType_GetItem(media_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, NULL))) + mediatype_set_uint32(media_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, 1, &hr); + if (am_type->bFixedSizeSamples && FAILED(IMFMediaType_GetItem(media_type, &MF_MT_FIXED_SIZE_SAMPLES, NULL))) + mediatype_set_uint32(media_type, &MF_MT_FIXED_SIZE_SAMPLES, 1, &hr); + if (am_type->lSampleSize && FAILED(IMFMediaType_GetItem(media_type, &MF_MT_SAMPLE_SIZE, NULL))) + mediatype_set_uint32(media_type, &MF_MT_SAMPLE_SIZE, am_type->lSampleSize, &hr); + return hr; }
1
0
0
0
Rémi Bernon : mfplat/mediatype: Check format pointers and sizes in MFInitMediaTypeFromAMMediaType.
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: 45d4aa9f606e6c41ea78e10e205883bcc4e33a15 URL:
https://gitlab.winehq.org/wine/wine/-/commit/45d4aa9f606e6c41ea78e10e205883…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Mar 12 19:58:36 2024 +0100 mfplat/mediatype: Check format pointers and sizes in MFInitMediaTypeFromAMMediaType. --- dlls/mfplat/mediatype.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index e07cc2339c1..d8f39678278 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -4270,13 +4270,17 @@ HRESULT WINAPI MFInitMediaTypeFromAMMediaType(IMFMediaType *media_type, const AM { const GUID *subtype = get_mf_subtype_for_am_subtype(&am_type->subtype); - if (IsEqualGUID(&am_type->formattype, &FORMAT_VideoInfo)) + if (am_type->cbFormat && !am_type->pbFormat) + hr = E_INVALIDARG; + else if (IsEqualGUID(&am_type->formattype, &FORMAT_VideoInfo) + && am_type->cbFormat >= sizeof(VIDEOINFOHEADER)) hr = MFInitMediaTypeFromVideoInfoHeader(media_type, (VIDEOINFOHEADER *)am_type->pbFormat, am_type->cbFormat, subtype); - else if (IsEqualGUID(&am_type->formattype, &FORMAT_VideoInfo2)) + else if (IsEqualGUID(&am_type->formattype, &FORMAT_VideoInfo2) + && am_type->cbFormat >= sizeof(VIDEOINFOHEADER2)) hr = MFInitMediaTypeFromVideoInfoHeader2(media_type, (VIDEOINFOHEADER2 *)am_type->pbFormat, am_type->cbFormat, subtype); else { - FIXME("Unsupported format type %s.\n", debugstr_guid(&am_type->formattype)); + FIXME("Unsupported format type %s / size %ld.\n", debugstr_guid(&am_type->formattype), am_type->cbFormat); return E_NOTIMPL; }
1
0
0
0
Rémi Bernon : mfplat/tests: Check how AAC attributes are copied from user data.
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: 9ee0720d98f89bb840332f21e4b79119fe78a73a URL:
https://gitlab.winehq.org/wine/wine/-/commit/9ee0720d98f89bb840332f21e4b791…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Mar 20 09:46:36 2024 +0100 mfplat/tests: Check how AAC attributes are copied from user data. --- dlls/mfplat/tests/mfplat.c | 88 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index beb3f83432f..e4989e4bcea 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -74,6 +74,7 @@ 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(MFAudioFormat_RAW_AAC,WAVE_FORMAT_RAW_AAC1); DEFINE_MEDIATYPE_GUID(MEDIASUBTYPE_h264,MAKEFOURCC('h','2','6','4')); DEFINE_MEDIATYPE_GUID(MEDIASUBTYPE_MP3,WAVE_FORMAT_MPEGLAYER3); @@ -6991,6 +6992,15 @@ static void test_MFInitMediaTypeFromWaveFormatEx(void) { WAVE_FORMAT_WMASPDIF }, }; + static const BYTE aac_codec_data[] = + { + 0x12, 0x00, + 0x34, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x12, 0x08, + }; UINT8 buff[1024]; WAVEFORMATEXTENSIBLE waveformatext; MPEGLAYER3WAVEFORMAT mp3format; @@ -7180,6 +7190,84 @@ static void test_MFInitMediaTypeFromWaveFormatEx(void) ok(!memcmp(format + 1, &aacformat.wfInfo.wfx + 1, aacformat.wfInfo.wfx.cbSize), "Unexpected user data.\n"); CoTaskMemFree(format); + IMFMediaType_DeleteAllItems(mediatype); + + + /* check that HEAACWAVEFORMAT extra fields are copied directly from MF_MT_USER_DATA */ + aacformat.wfInfo.wfx.cbSize = sizeof(aacformat) - sizeof(WAVEFORMATEX); + hr = MFInitMediaTypeFromWaveFormatEx(mediatype, (WAVEFORMATEX *)&aacformat, sizeof(aacformat)); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IMFMediaType_DeleteItem(mediatype, &MF_MT_USER_DATA); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = MFCreateWaveFormatExFromMFMediaType(mediatype, (WAVEFORMATEX **)&wfx, &size, 0); + todo_wine + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + ok(wfx->wFormatTag == WAVE_FORMAT_MPEG_HEAAC, "got wFormatTag %#x\n", wfx->wFormatTag); + ok(wfx->cbSize == 0, "got cbSize %u\n", wfx->cbSize); + CoTaskMemFree(wfx); + } + + hr = IMFMediaType_DeleteItem(mediatype, &MF_MT_AAC_AUDIO_PROFILE_LEVEL_INDICATION); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = IMFMediaType_DeleteItem(mediatype, &MF_MT_AAC_PAYLOAD_TYPE); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = IMFMediaType_SetBlob(mediatype, &MF_MT_USER_DATA, aac_codec_data, sizeof(aac_codec_data)); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = MFCreateWaveFormatExFromMFMediaType(mediatype, (WAVEFORMATEX **)&wfx, &size, 0); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(wfx->wFormatTag == WAVE_FORMAT_MPEG_HEAAC, "got wFormatTag %#x\n", wfx->wFormatTag); + ok(wfx->cbSize == sizeof(aac_codec_data), "got cbSize %u\n", wfx->cbSize); + memcpy(&aacformat, wfx, sizeof(aacformat)); + ok(aacformat.wfInfo.wPayloadType == 0x12, "got %u\n", aacformat.wfInfo.wPayloadType); + ok(aacformat.wfInfo.wAudioProfileLevelIndication == 0x34, "got %u\n", aacformat.wfInfo.wAudioProfileLevelIndication); + + hr = MFInitMediaTypeFromWaveFormatEx(mediatype, wfx, sizeof(*wfx) + wfx->cbSize); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + value = 0xdeadbeef; + hr = IMFMediaType_GetUINT32(mediatype, &MF_MT_AAC_PAYLOAD_TYPE, &value); + ok(hr == S_OK, "Failed to get attribute, hr %#lx.\n", hr); + ok(value == 0x12, "Unexpected AAC_PAYLOAD_TYPE %u.\n", value); + value = 0xdeadbeef; + hr = IMFMediaType_GetUINT32(mediatype, &MF_MT_AAC_AUDIO_PROFILE_LEVEL_INDICATION, &value); + ok(hr == S_OK, "Failed to get attribute, hr %#lx.\n", hr); + ok(value == 0x34, "Unexpected AAC_AUDIO_PROFILE_LEVEL_INDICATION %u.\n", value); + + CoTaskMemFree(wfx); + + + /* check that RAW AAC doesn't have MF_MT_AAC_* attributes */ + aacformat.wfInfo.wfx.cbSize = sizeof(aacformat) - sizeof(WAVEFORMATEX); + hr = MFInitMediaTypeFromWaveFormatEx(mediatype, (WAVEFORMATEX *)&aacformat, sizeof(aacformat)); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = IMFMediaType_SetGUID(mediatype, &MF_MT_SUBTYPE, &MFAudioFormat_RAW_AAC); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IMFMediaType_DeleteItem(mediatype, &MF_MT_AAC_AUDIO_PROFILE_LEVEL_INDICATION); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = IMFMediaType_DeleteItem(mediatype, &MF_MT_AAC_PAYLOAD_TYPE); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = IMFMediaType_SetBlob(mediatype, &MF_MT_USER_DATA, aac_codec_data, sizeof(aac_codec_data)); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = MFCreateWaveFormatExFromMFMediaType(mediatype, (WAVEFORMATEX **)&wfx, &size, 0); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(wfx->wFormatTag == WAVE_FORMAT_RAW_AAC1, "got wFormatTag %#x\n", wfx->wFormatTag); + ok(wfx->cbSize == sizeof(aac_codec_data), "got cbSize %u\n", wfx->cbSize); + + hr = MFInitMediaTypeFromWaveFormatEx(mediatype, wfx, sizeof(*wfx) + wfx->cbSize); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = IMFMediaType_GetUINT32(mediatype, &MF_MT_AAC_PAYLOAD_TYPE, &value); + ok(hr == MF_E_ATTRIBUTENOTFOUND, "Failed to get attribute, hr %#lx.\n", hr); + hr = IMFMediaType_GetUINT32(mediatype, &MF_MT_AAC_AUDIO_PROFILE_LEVEL_INDICATION, &value); + ok(hr == MF_E_ATTRIBUTENOTFOUND, "Failed to get attribute, hr %#lx.\n", hr); + + CoTaskMemFree(wfx); + + IMFMediaType_Release(mediatype); }
1
0
0
0
Rémi Bernon : mfplat/tests: Test initializing mediatype from AAC WAVEFORMATEXTENSIBLE.
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: 3593ce002fe68a44d729eee47ce139b2e933a971 URL:
https://gitlab.winehq.org/wine/wine/-/commit/3593ce002fe68a44d729eee47ce139…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Mar 7 21:22:08 2024 +0100 mfplat/tests: Test initializing mediatype from AAC WAVEFORMATEXTENSIBLE. --- dlls/mfplat/tests/mfplat.c | 71 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 69 insertions(+), 2 deletions(-) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 1c45014f32f..beb3f83432f 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -6998,6 +6998,7 @@ static void test_MFInitMediaTypeFromWaveFormatEx(void) HEAACWAVEFORMAT aacformat; IMFMediaType *mediatype; unsigned int i, size; + WAVEFORMATEX *wfx; UINT32 value; HRESULT hr; @@ -7087,6 +7088,15 @@ static void test_MFInitMediaTypeFromWaveFormatEx(void) ok(size == aacformat.wfInfo.wfx.cbSize, "Unexpected size %u.\n", size); ok(!memcmp(buff, (WAVEFORMATEX *)&aacformat + 1, size), "Unexpected user data.\n"); + /* check that we get an HEAACWAVEFORMAT by default */ + hr = MFCreateWaveFormatExFromMFMediaType(mediatype, (WAVEFORMATEX **)&wfx, &size, 0); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(wfx->wFormatTag == WAVE_FORMAT_MPEG_HEAAC, "got wFormatTag %#x\n", wfx->wFormatTag); + ok(wfx->cbSize == sizeof(HEAACWAVEFORMAT) - sizeof(WAVEFORMATEX), "got cbSize %u\n", wfx->cbSize); + ok(!memcmp(wfx + 1, &aacformat.wfInfo.wfx + 1, aacformat.wfInfo.wfx.cbSize), "Unexpected user data.\n"); + CoTaskMemFree(wfx); + + /* MFWaveFormatExConvertFlag_ForceExtensible can force a WAVEFORMATEXTENSIBLE */ hr = MFCreateWaveFormatExFromMFMediaType(mediatype, (WAVEFORMATEX **)&format, &size, MFWaveFormatExConvertFlag_ForceExtensible); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(format->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE, "got wFormatTag %#x\n", format->Format.wFormatTag); @@ -7098,6 +7108,62 @@ static void test_MFInitMediaTypeFromWaveFormatEx(void) ok(!memcmp(format + 1, &aacformat.wfInfo.wfx + 1, aacformat.wfInfo.wfx.cbSize), "Unexpected user data.\n"); CoTaskMemFree(format); + /* adding more channels has no immediate effect */ + hr = IMFMediaType_SetUINT32(mediatype, &MF_MT_AUDIO_NUM_CHANNELS, 6); + ok(hr == S_OK, "Failed to get attribute, hr %#lx.\n", hr); + hr = IMFMediaType_SetUINT32(mediatype, &MF_MT_AUDIO_CHANNEL_MASK, 63); + ok(hr == S_OK, "Failed to get attribute, hr %#lx.\n", hr); + hr = MFCreateWaveFormatExFromMFMediaType(mediatype, (WAVEFORMATEX **)&wfx, &size, 0); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(wfx->wFormatTag == WAVE_FORMAT_MPEG_HEAAC, "got wFormatTag %#x\n", wfx->wFormatTag); + ok(wfx->cbSize == sizeof(HEAACWAVEFORMAT) - sizeof(WAVEFORMATEX), "got cbSize %u\n", wfx->cbSize); + ok(!memcmp(wfx + 1, &aacformat.wfInfo.wfx + 1, aacformat.wfInfo.wfx.cbSize), "Unexpected user data.\n"); + CoTaskMemFree(wfx); + + /* but adding MF_MT_AUDIO_SAMPLES_PER_BLOCK as well forces the WAVEFORMATEXTENSIBLE format */ + hr = IMFMediaType_SetUINT32(mediatype, &MF_MT_AUDIO_SAMPLES_PER_BLOCK, 4); + ok(hr == S_OK, "Failed to get attribute, hr %#lx.\n", hr); + hr = MFCreateWaveFormatExFromMFMediaType(mediatype, (WAVEFORMATEX **)&format, &size, 0); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + todo_wine + ok(format->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE, "got wFormatTag %#x\n", format->Format.wFormatTag); + todo_wine + ok(format->Format.cbSize == aacformat.wfInfo.wfx.cbSize + sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX), + "got cbSize %u\n", format->Format.cbSize); + todo_wine + ok(IsEqualGUID(&format->SubFormat, &MFAudioFormat_AAC), "got SubFormat %s\n", debugstr_guid(&format->SubFormat)); + todo_wine + ok(format->dwChannelMask == 63, "got dwChannelMask %#lx\n", format->dwChannelMask); + todo_wine + ok(format->Samples.wSamplesPerBlock == 4, "got wSamplesPerBlock %u\n", format->Samples.wSamplesPerBlock); + todo_wine + ok(!memcmp(format + 1, &aacformat.wfInfo.wfx + 1, aacformat.wfInfo.wfx.cbSize), "Unexpected user data.\n"); + + /* test initializing media type from an WAVE_FORMAT_EXTENSIBLE AAC format */ + IMFMediaType_DeleteAllItems(mediatype); + hr = MFInitMediaTypeFromWaveFormatEx(mediatype, (WAVEFORMATEX *)format, sizeof(WAVEFORMATEX) + format->Format.cbSize); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + CoTaskMemFree(format); + + value = 0xdeadbeef; + hr = IMFMediaType_GetUINT32(mediatype, &MF_MT_AAC_AUDIO_PROFILE_LEVEL_INDICATION, &value); + todo_wine + ok(hr == MF_E_ATTRIBUTENOTFOUND, "Failed to get attribute, hr %#lx.\n", hr); + todo_wine + ok(value == 0xdeadbeef, "Unexpected AAC_AUDIO_PROFILE_LEVEL_INDICATION %u.\n", value); + value = 0xdeadbeef; + hr = IMFMediaType_GetUINT32(mediatype, &MF_MT_AAC_PAYLOAD_TYPE, &value); + todo_wine + ok(hr == MF_E_ATTRIBUTENOTFOUND, "Failed to get attribute, hr %#lx.\n", hr); + todo_wine + ok(value == 0xdeadbeef, "Unexpected AAC_PAYLOAD_TYPE %u.\n", value); + + hr = IMFMediaType_GetBlob(mediatype, &MF_MT_USER_DATA, buff, sizeof(buff), &size); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(size == aacformat.wfInfo.wfx.cbSize, "Unexpected size %u.\n", size); + ok(!memcmp(buff, (WAVEFORMATEX *)&aacformat + 1, size), "Unexpected user data.\n"); + + /* test with invalid format size */ aacformat.wfInfo.wfx.cbSize = 1; hr = IMFMediaType_SetBlob(mediatype, &MF_MT_USER_DATA, buff, aacformat.wfInfo.wfx.cbSize); @@ -7108,8 +7174,9 @@ static void test_MFInitMediaTypeFromWaveFormatEx(void) ok(format->Format.cbSize == aacformat.wfInfo.wfx.cbSize + sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX), "got cbSize %u\n", format->Format.cbSize); ok(IsEqualGUID(&format->SubFormat, &MFAudioFormat_AAC), "got SubFormat %s\n", debugstr_guid(&format->SubFormat)); - ok(format->dwChannelMask == 3, "got dwChannelMask %#lx\n", format->dwChannelMask); - ok(format->Samples.wSamplesPerBlock == 0, "got wSamplesPerBlock %u\n", format->Samples.wSamplesPerBlock); + ok(format->dwChannelMask == 63, "got dwChannelMask %#lx\n", format->dwChannelMask); + todo_wine + ok(format->Samples.wSamplesPerBlock == 4, "got wSamplesPerBlock %u\n", format->Samples.wSamplesPerBlock); ok(!memcmp(format + 1, &aacformat.wfInfo.wfx + 1, aacformat.wfInfo.wfx.cbSize), "Unexpected user data.\n"); CoTaskMemFree(format);
1
0
0
0
Rémi Bernon : mfplat/tests: Add some broken results for Win7.
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: 2734b266de6562a6693d5b8b8219222911d9ffb5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/2734b266de6562a6693d5b8b821922…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Mar 20 09:55:00 2024 +0100 mfplat/tests: Add some broken results for Win7. --- dlls/mfplat/tests/mfplat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 97f5dafef86..1c45014f32f 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -10868,7 +10868,9 @@ static void test_MFInitMediaTypeFromVideoInfoHeader2(void) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IMFMediaType_GetUINT32(media_type, &MF_MT_INTERLACE_MODE, &value32); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - ok(value32 == MFVideoInterlace_MixedInterlaceOrProgressive, "Unexpected value %#x.\n", value32); + ok(value32 == MFVideoInterlace_MixedInterlaceOrProgressive + || broken(value32 == MFVideoInterlace_FieldInterleavedLowerFirst) /* Win7 */, + "Unexpected value %#x.\n", value32); vih.dwPictAspectRatioX = 123; hr = MFInitMediaTypeFromVideoInfoHeader2(media_type, &vih, sizeof(vih), &GUID_NULL);
1
0
0
0
Dmitry Timoshkov : widl: Add initial implementation of SLTG typelib generator.
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: 0bffa3222611015a3b3596c679be53c557daae1b URL:
https://gitlab.winehq.org/wine/wine/-/commit/0bffa3222611015a3b3596c679be53…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Wed Dec 23 19:37:37 2015 +0800 widl: Add initial implementation of SLTG typelib generator. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> --- tools/widl/Makefile.in | 3 +- tools/widl/register.c | 7 +- tools/widl/typelib.h | 1 + tools/widl/widl.c | 8 + tools/widl/widl.h | 1 + tools/widl/widl.man.in | 2 + tools/widl/write_sltg.c | 543 ++++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 563 insertions(+), 2 deletions(-)
1
0
0
0
Yuxuan Shui : shell32: Rely solely on SHELL_FindExecutable for ShellExecute.
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: 85d029e3b01f6dd35a86cc07796af982d66e4a03 URL:
https://gitlab.winehq.org/wine/wine/-/commit/85d029e3b01f6dd35a86cc07796af9…
Author: Yuxuan Shui <yshui(a)codeweavers.com> Date: Mon Mar 18 18:32:00 2024 +0000 shell32: Rely solely on SHELL_FindExecutable for ShellExecute. This does two things: 1. ShellExecute no longer searches in the directory where the current executable is in. 2. We always CreateProcess with a fully qualified path, so we CreateProcess won't do its own path resolution. Serendipitously this also fixes some existing todos in tests. --- dlls/shell32/shlexec.c | 24 +----------------------- dlls/shell32/tests/shlexec.c | 8 +++----- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c index 9aa7963b71c..f09b6d4daf3 100644 --- a/dlls/shell32/shlexec.c +++ b/dlls/shell32/shlexec.c @@ -1823,30 +1823,8 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) wcmd = malloc(len * sizeof(WCHAR)); wcmdLen = len; } - lstrcpyW(wcmd, wszApplicationName); - if (sei_tmp.lpDirectory) - { - LPCWSTR searchPath[] = { - sei_tmp.lpDirectory, - NULL - }; - PathFindOnPathW(wcmd, searchPath); - } - retval = SHELL_quote_and_execute( wcmd, wszParameters, L"", - wszApplicationName, NULL, &sei_tmp, - sei, execfunc ); - if (retval > 32) { - free(wszApplicationName); - if (wszParameters != parametersBuffer) - free(wszParameters); - if (wszDir != dirBuffer) - free(wszDir); - if (wcmd != wcmdBuffer) - free(wcmd); - return TRUE; - } - /* Else, try to find the executable */ + /* try to find the executable */ wcmd[0] = '\0'; retval = SHELL_FindExecutable(sei_tmp.lpDirectory, lpFile, sei_tmp.lpVerb, wcmd, wcmdLen, wszKeyname, &env, sei_tmp.lpIDList, sei_tmp.lpParameters); if (retval > 32) /* Found */ diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c index 2f95ff2e15d..0f537d829f4 100644 --- a/dlls/shell32/tests/shlexec.c +++ b/dlls/shell32/tests/shlexec.c @@ -2331,9 +2331,7 @@ static void test_exes(void) if (CopyFileA(argv0, filename, FALSE)) { rc=shell_execute(NULL, filename, params, NULL); - todo_wine { - okShell(rc==SE_ERR_NOASSOC, "returned %Iu\n", rc); - } + okShell(rc==SE_ERR_NOASSOC, "returned %Iu\n", rc); } } else @@ -2359,7 +2357,7 @@ static void test_exes(void) GetCurrentDirectoryA(MAX_PATH, curdir); SetCurrentDirectoryA(tmpdir); rc = shell_execute(NULL, basename, params, NULL); - todo_wine okShell(rc == SE_ERR_FNF, "returned %Iu\n", rc); + okShell(rc == SE_ERR_FNF, "returned %Iu\n", rc); SetCurrentDirectoryA(curdir); if (!skip_shlexec_tests) @@ -2956,7 +2954,7 @@ static void test_directory(void) NULL, "test2.exe", params, NULL, NULL); okShell(rc > 32, "returned %Iu\n", rc); okChildInt("argcA", 4); - todo_wine okChildString("argvA0", path); + okChildString("argvA0", path); okChildString("argvA3", "Exec"); okChildPath("longPath", path); SetCurrentDirectoryA(curdir);
1
0
0
0
← Newer
1
...
17
18
19
20
21
22
23
...
78
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
Results per page:
10
25
50
100
200