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
May 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
775 discussions
Start a n
N
ew thread
Piotr Caban : wineps: Use designated initializers to initialize gdi_dc_funcs structure.
by Alexandre Julliard
08 May '23
08 May '23
Module: wine Branch: master Commit: bcb5fabc8c377ee432ce849648cc4c6c44cb2d07 URL:
https://gitlab.winehq.org/wine/wine/-/commit/bcb5fabc8c377ee432ce849648cc4c…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Mon May 1 14:56:43 2023 +0200 wineps: Use designated initializers to initialize gdi_dc_funcs structure. --- dlls/wineps.drv/init.c | 107 ++++++------------------------------------------- 1 file changed, 12 insertions(+), 95 deletions(-) diff --git a/dlls/wineps.drv/init.c b/dlls/wineps.drv/init.c index 80b6a8e8036..afcf4321b11 100644 --- a/dlls/wineps.drv/init.c +++ b/dlls/wineps.drv/init.c @@ -761,101 +761,18 @@ fail: static const struct gdi_dc_funcs psdrv_funcs = { - NULL, /* pAbortDoc */ - NULL, /* pAbortPath */ - NULL, /* pAlphaBlend */ - NULL, /* pAngleArc */ - NULL, /* pArc */ - NULL, /* pArcTo */ - NULL, /* pBeginPath */ - NULL, /* pBlendImage */ - NULL, /* pChord */ - NULL, /* pCloseFigure */ - PSDRV_CreateCompatibleDC, /* pCreateCompatibleDC */ - PSDRV_CreateDC, /* pCreateDC */ - PSDRV_DeleteDC, /* pDeleteDC */ - NULL, /* pDeleteObject */ - NULL, /* pEllipse */ - NULL, /* pEndDoc */ - NULL, /* pEndPage */ - NULL, /* pEndPath */ - PSDRV_EnumFonts, /* pEnumFonts */ - PSDRV_ExtEscape, /* pExtEscape */ - NULL, /* pExtFloodFill */ - NULL, /* pExtTextOut */ - NULL, /* pFillPath */ - NULL, /* pFillRgn */ - NULL, /* pFontIsLinked */ - NULL, /* pFrameRgn */ - NULL, /* pGetBoundsRect */ - NULL, /* pGetCharABCWidths */ - NULL, /* pGetCharABCWidthsI */ - PSDRV_GetCharWidth, /* pGetCharWidth */ - NULL, /* pGetCharWidthInfo */ - PSDRV_GetDeviceCaps, /* pGetDeviceCaps */ - NULL, /* pGetDeviceGammaRamp */ - NULL, /* pGetFontData */ - NULL, /* pGetFontRealizationInfo */ - NULL, /* pGetFontUnicodeRanges */ - NULL, /* pGetGlyphIndices */ - NULL, /* pGetGlyphOutline */ - NULL, /* pGetICMProfile */ - NULL, /* pGetImage */ - NULL, /* pGetKerningPairs */ - NULL, /* pGetNearestColor */ - NULL, /* pGetOutlineTextMetrics */ - NULL, /* pGetPixel */ - NULL, /* pGetSystemPaletteEntries */ - NULL, /* pGetTextCharsetInfo */ - PSDRV_GetTextExtentExPoint, /* pGetTextExtentExPoint */ - NULL, /* pGetTextExtentExPointI */ - NULL, /* pGetTextFace */ - PSDRV_GetTextMetrics, /* pGetTextMetrics */ - NULL, /* pGradientFill */ - NULL, /* pInvertRgn */ - NULL, /* pLineTo */ - NULL, /* pMoveTo */ - NULL, /* pPaintRgn */ - NULL, /* pPatBlt */ - NULL, /* pPie */ - NULL, /* pPolyBezier */ - NULL, /* pPolyBezierTo */ - NULL, /* pPolyDraw */ - NULL, /* pPolyPolygon */ - NULL, /* pPolyPolyline */ - NULL, /* pPolylineTo */ - NULL, /* pPutImage */ - NULL, /* pRealizeDefaultPalette */ - NULL, /* pRealizePalette */ - NULL, /* pRectangle */ - PSDRV_ResetDC, /* pResetDC */ - NULL, /* pRoundRect */ - NULL, /* pSelectBitmap */ - NULL, /* pSelectBrush */ - PSDRV_SelectFont, /* pSelectFont */ - NULL, /* pSelectPen */ - NULL, /* pSetBkColor */ - NULL, /* pSetBoundsRect */ - NULL, /* pSetDCBrushColor */ - NULL, /* pSetDCPenColor */ - NULL, /* pSetDIBitsToDevice */ - NULL, /* pSetDeviceClipping */ - NULL, /* pSetDeviceGammaRamp */ - NULL, /* pSetPixel */ - NULL, /* pSetTextColor */ - NULL, /* pStartDoc */ - NULL, /* pStartPage */ - NULL, /* pStretchBlt */ - NULL, /* pStretchDIBits */ - NULL, /* pStrokeAndFillPath */ - NULL, /* pStrokePath */ - NULL, /* pUnrealizePalette */ - NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */ - NULL, /* pD3DKMTCloseAdapter */ - NULL, /* pD3DKMTOpenAdapterFromLuid */ - NULL, /* pD3DKMTQueryVideoMemoryInfo */ - NULL, /* pD3DKMTSetVidPnSourceOwner */ - GDI_PRIORITY_GRAPHICS_DRV /* priority */ + .pCreateCompatibleDC = PSDRV_CreateCompatibleDC, + .pCreateDC = PSDRV_CreateDC, + .pDeleteDC = PSDRV_DeleteDC, + .pEnumFonts = PSDRV_EnumFonts, + .pExtEscape = PSDRV_ExtEscape, + .pGetCharWidth = PSDRV_GetCharWidth, + .pGetDeviceCaps = PSDRV_GetDeviceCaps, + .pGetTextExtentExPoint = PSDRV_GetTextExtentExPoint, + .pGetTextMetrics = PSDRV_GetTextMetrics, + .pResetDC = PSDRV_ResetDC, + .pSelectFont = PSDRV_SelectFont, + .priority = GDI_PRIORITY_GRAPHICS_DRV };
1
0
0
0
Davide Beatrici : winepulse: Use mmdevapi's ChannelAudioVolume.
by Alexandre Julliard
08 May '23
08 May '23
Module: wine Branch: master Commit: 7e8aa1d9ef1f268e568c2dc425e300bc44001c64 URL:
https://gitlab.winehq.org/wine/wine/-/commit/7e8aa1d9ef1f268e568c2dc425e300…
Author: Davide Beatrici <git(a)davidebeatrici.dev> Date: Tue May 2 01:36:41 2023 +0200 winepulse: Use mmdevapi's ChannelAudioVolume. --- dlls/winepulse.drv/mmdevdrv.c | 171 +----------------------------------------- 1 file changed, 1 insertion(+), 170 deletions(-) diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c index 54d81b4b7e8..84ac537701b 100644 --- a/dlls/winepulse.drv/mmdevdrv.c +++ b/dlls/winepulse.drv/mmdevdrv.c @@ -129,7 +129,7 @@ static const IAudioRenderClientVtbl AudioRenderClient_Vtbl; static const IAudioCaptureClientVtbl AudioCaptureClient_Vtbl; extern const IAudioSessionControl2Vtbl AudioSessionControl2_Vtbl; extern const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl; -static const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl; +extern const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl; static const IAudioClockVtbl AudioClock_Vtbl; static const IAudioClock2Vtbl AudioClock2_Vtbl; static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl; @@ -151,11 +151,6 @@ static inline ACImpl *impl_from_IAudioCaptureClient(IAudioCaptureClient *iface) return CONTAINING_RECORD(iface, ACImpl, IAudioCaptureClient_iface); } -static inline AudioSessionWrapper *impl_from_IChannelAudioVolume(IChannelAudioVolume *iface) -{ - return CONTAINING_RECORD(iface, AudioSessionWrapper, IChannelAudioVolume_iface); -} - static inline ACImpl *impl_from_IAudioClock(IAudioClock *iface) { return CONTAINING_RECORD(iface, ACImpl, IAudioClock_iface); @@ -1886,170 +1881,6 @@ static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client) return ret; } -static HRESULT WINAPI ChannelAudioVolume_QueryInterface( - IChannelAudioVolume *iface, REFIID riid, void **ppv) -{ - TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); - - if (!ppv) - return E_POINTER; - *ppv = NULL; - - if (IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IChannelAudioVolume)) - *ppv = iface; - if (*ppv) { - IUnknown_AddRef((IUnknown*)*ppv); - return S_OK; - } - - WARN("Unknown interface %s\n", debugstr_guid(riid)); - return E_NOINTERFACE; -} - -static ULONG WINAPI ChannelAudioVolume_AddRef(IChannelAudioVolume *iface) -{ - AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); - return IAudioSessionControl2_AddRef(&This->IAudioSessionControl2_iface); -} - -static ULONG WINAPI ChannelAudioVolume_Release(IChannelAudioVolume *iface) -{ - AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); - return IAudioSessionControl2_Release(&This->IAudioSessionControl2_iface); -} - -static HRESULT WINAPI ChannelAudioVolume_GetChannelCount( - IChannelAudioVolume *iface, UINT32 *out) -{ - AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); - AudioSession *session = This->session; - - TRACE("(%p)->(%p)\n", session, out); - - if (!out) - return NULL_PTR_ERR; - - *out = session->channel_count; - - return S_OK; -} - -static HRESULT WINAPI ChannelAudioVolume_SetChannelVolume( - IChannelAudioVolume *iface, UINT32 index, float level, - const GUID *context) -{ - AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); - AudioSession *session = This->session; - ACImpl *client; - - TRACE("(%p)->(%d, %f, %s)\n", session, index, level, - wine_dbgstr_guid(context)); - - if (level < 0.f || level > 1.f) - return E_INVALIDARG; - - if (index >= session->channel_count) - return E_INVALIDARG; - - if (context) - FIXME("Notifications not supported yet\n"); - - TRACE("PulseAudio does not support session volume control\n"); - - sessions_lock(); - session->channel_vols[index] = level; - LIST_FOR_EACH_ENTRY(client, &This->session->clients, ACImpl, entry) - set_stream_volumes(client); - sessions_unlock(); - - return S_OK; -} - -static HRESULT WINAPI ChannelAudioVolume_GetChannelVolume( - IChannelAudioVolume *iface, UINT32 index, float *level) -{ - AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); - AudioSession *session = This->session; - - TRACE("(%p)->(%d, %p)\n", session, index, level); - - if (!level) - return NULL_PTR_ERR; - - if (index >= session->channel_count) - return E_INVALIDARG; - - *level = session->channel_vols[index]; - - return S_OK; -} - -static HRESULT WINAPI ChannelAudioVolume_SetAllVolumes( - IChannelAudioVolume *iface, UINT32 count, const float *levels, - const GUID *context) -{ - AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); - AudioSession *session = This->session; - ACImpl *client; - int i; - - TRACE("(%p)->(%d, %p, %s)\n", session, count, levels, - wine_dbgstr_guid(context)); - - if (!levels) - return NULL_PTR_ERR; - - if (count != session->channel_count) - return E_INVALIDARG; - - if (context) - FIXME("Notifications not supported yet\n"); - - TRACE("PulseAudio does not support session volume control\n"); - - sessions_lock(); - for(i = 0; i < count; ++i) - session->channel_vols[i] = levels[i]; - LIST_FOR_EACH_ENTRY(client, &This->session->clients, ACImpl, entry) - set_stream_volumes(client); - sessions_unlock(); - return S_OK; -} - -static HRESULT WINAPI ChannelAudioVolume_GetAllVolumes( - IChannelAudioVolume *iface, UINT32 count, float *levels) -{ - AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); - AudioSession *session = This->session; - int i; - - TRACE("(%p)->(%d, %p)\n", session, count, levels); - - if (!levels) - return NULL_PTR_ERR; - - if (count != session->channel_count) - return E_INVALIDARG; - - for(i = 0; i < count; ++i) - levels[i] = session->channel_vols[i]; - - return S_OK; -} - -static const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl = -{ - ChannelAudioVolume_QueryInterface, - ChannelAudioVolume_AddRef, - ChannelAudioVolume_Release, - ChannelAudioVolume_GetChannelCount, - ChannelAudioVolume_SetChannelVolume, - ChannelAudioVolume_GetChannelVolume, - ChannelAudioVolume_SetAllVolumes, - ChannelAudioVolume_GetAllVolumes -}; - HRESULT WINAPI AUDDRV_GetAudioSessionWrapper(const GUID *guid, IMMDevice *device, AudioSessionWrapper **out) {
1
0
0
0
Davide Beatrici : wineoss: Use mmdevapi's ChannelAudioVolume.
by Alexandre Julliard
08 May '23
08 May '23
Module: wine Branch: master Commit: 0f8f0717b17eeaf3818edb11d39d7e8e2963beb1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/0f8f0717b17eeaf3818edb11d39d7e…
Author: Davide Beatrici <git(a)davidebeatrici.dev> Date: Tue May 2 01:36:27 2023 +0200 wineoss: Use mmdevapi's ChannelAudioVolume. --- dlls/wineoss.drv/mmdevdrv.c | 176 +------------------------------------------- 1 file changed, 1 insertion(+), 175 deletions(-) diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c index d41d0597721..ae9d879cb02 100644 --- a/dlls/wineoss.drv/mmdevdrv.c +++ b/dlls/wineoss.drv/mmdevdrv.c @@ -85,7 +85,7 @@ extern const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl; static const IAudioClockVtbl AudioClock_Vtbl; static const IAudioClock2Vtbl AudioClock2_Vtbl; static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl; -static const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl; +extern const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl; void DECLSPEC_HIDDEN sessions_lock(void) { @@ -112,11 +112,6 @@ static inline ACImpl *impl_from_IAudioCaptureClient(IAudioCaptureClient *iface) return CONTAINING_RECORD(iface, ACImpl, IAudioCaptureClient_iface); } -static inline AudioSessionWrapper *impl_from_IChannelAudioVolume(IChannelAudioVolume *iface) -{ - return CONTAINING_RECORD(iface, AudioSessionWrapper, IChannelAudioVolume_iface); -} - static inline ACImpl *impl_from_IAudioClock(IAudioClock *iface) { return CONTAINING_RECORD(iface, ACImpl, IAudioClock_iface); @@ -1608,175 +1603,6 @@ static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl = AudioStreamVolume_GetAllVolumes }; -static HRESULT WINAPI ChannelAudioVolume_QueryInterface( - IChannelAudioVolume *iface, REFIID riid, void **ppv) -{ - TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); - - if(!ppv) - return E_POINTER; - *ppv = NULL; - - if(IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IChannelAudioVolume)) - *ppv = iface; - if(*ppv){ - IUnknown_AddRef((IUnknown*)*ppv); - return S_OK; - } - - WARN("Unknown interface %s\n", debugstr_guid(riid)); - return E_NOINTERFACE; -} - -static ULONG WINAPI ChannelAudioVolume_AddRef(IChannelAudioVolume *iface) -{ - AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); - return IAudioSessionControl2_AddRef(&This->IAudioSessionControl2_iface); -} - -static ULONG WINAPI ChannelAudioVolume_Release(IChannelAudioVolume *iface) -{ - AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); - return IAudioSessionControl2_Release(&This->IAudioSessionControl2_iface); -} - -static HRESULT WINAPI ChannelAudioVolume_GetChannelCount( - IChannelAudioVolume *iface, UINT32 *out) -{ - AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); - AudioSession *session = This->session; - - TRACE("(%p)->(%p)\n", session, out); - - if(!out) - return NULL_PTR_ERR; - - *out = session->channel_count; - - return S_OK; -} - -static HRESULT WINAPI ChannelAudioVolume_SetChannelVolume( - IChannelAudioVolume *iface, UINT32 index, float level, - const GUID *context) -{ - AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); - AudioSession *session = This->session; - ACImpl *client; - - TRACE("(%p)->(%d, %f, %s)\n", session, index, level, - wine_dbgstr_guid(context)); - - if(level < 0.f || level > 1.f) - return E_INVALIDARG; - - if(index >= session->channel_count) - return E_INVALIDARG; - - if(context) - FIXME("Notifications not supported yet\n"); - - sessions_lock(); - - session->channel_vols[index] = level; - - TRACE("OSS doesn't support setting volume\n"); - LIST_FOR_EACH_ENTRY(client, &session->clients, ACImpl, entry) - set_stream_volumes(client); - - sessions_unlock(); - - return S_OK; -} - -static HRESULT WINAPI ChannelAudioVolume_GetChannelVolume( - IChannelAudioVolume *iface, UINT32 index, float *level) -{ - AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); - AudioSession *session = This->session; - - TRACE("(%p)->(%d, %p)\n", session, index, level); - - if(!level) - return NULL_PTR_ERR; - - if(index >= session->channel_count) - return E_INVALIDARG; - - *level = session->channel_vols[index]; - - return S_OK; -} - -static HRESULT WINAPI ChannelAudioVolume_SetAllVolumes( - IChannelAudioVolume *iface, UINT32 count, const float *levels, - const GUID *context) -{ - AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); - AudioSession *session = This->session; - ACImpl *client; - int i; - - TRACE("(%p)->(%d, %p, %s)\n", session, count, levels, - wine_dbgstr_guid(context)); - - if(!levels) - return NULL_PTR_ERR; - - if(count != session->channel_count) - return E_INVALIDARG; - - if(context) - FIXME("Notifications not supported yet\n"); - - sessions_lock(); - - for(i = 0; i < count; ++i) - session->channel_vols[i] = levels[i]; - - TRACE("OSS doesn't support setting volume\n"); - LIST_FOR_EACH_ENTRY(client, &session->clients, ACImpl, entry) - set_stream_volumes(client); - - sessions_unlock(); - - return S_OK; -} - -static HRESULT WINAPI ChannelAudioVolume_GetAllVolumes( - IChannelAudioVolume *iface, UINT32 count, float *levels) -{ - AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); - AudioSession *session = This->session; - int i; - - TRACE("(%p)->(%d, %p)\n", session, count, levels); - - if(!levels) - return NULL_PTR_ERR; - - if(count != session->channel_count) - return E_INVALIDARG; - - for(i = 0; i < count; ++i) - levels[i] = session->channel_vols[i]; - - return S_OK; -} - -static const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl = -{ - ChannelAudioVolume_QueryInterface, - ChannelAudioVolume_AddRef, - ChannelAudioVolume_Release, - ChannelAudioVolume_GetChannelCount, - ChannelAudioVolume_SetChannelVolume, - ChannelAudioVolume_GetChannelVolume, - ChannelAudioVolume_SetAllVolumes, - ChannelAudioVolume_GetAllVolumes -}; - HRESULT WINAPI AUDDRV_GetAudioSessionWrapper(const GUID *guid, IMMDevice *device, AudioSessionWrapper **out) {
1
0
0
0
Davide Beatrici : winecoreaudio: Use mmdevapi's ChannelAudioVolume.
by Alexandre Julliard
08 May '23
08 May '23
Module: wine Branch: master Commit: 9da395d019f416a44d31949a7fa424ab26e7db8f URL:
https://gitlab.winehq.org/wine/wine/-/commit/9da395d019f416a44d31949a7fa424…
Author: Davide Beatrici <git(a)davidebeatrici.dev> Date: Tue May 2 01:36:09 2023 +0200 winecoreaudio: Use mmdevapi's ChannelAudioVolume. --- dlls/winecoreaudio.drv/mmdevdrv.c | 174 +------------------------------------- 1 file changed, 1 insertion(+), 173 deletions(-) diff --git a/dlls/winecoreaudio.drv/mmdevdrv.c b/dlls/winecoreaudio.drv/mmdevdrv.c index f387e9f71ab..835bfc6978e 100644 --- a/dlls/winecoreaudio.drv/mmdevdrv.c +++ b/dlls/winecoreaudio.drv/mmdevdrv.c @@ -59,7 +59,7 @@ extern const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl; static const IAudioClockVtbl AudioClock_Vtbl; static const IAudioClock2Vtbl AudioClock2_Vtbl; static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl; -static const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl; +extern const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl; static WCHAR drv_key_devicesW[256]; @@ -100,11 +100,6 @@ static inline ACImpl *impl_from_IAudioCaptureClient(IAudioCaptureClient *iface) return CONTAINING_RECORD(iface, ACImpl, IAudioCaptureClient_iface); } -static inline AudioSessionWrapper *impl_from_IChannelAudioVolume(IChannelAudioVolume *iface) -{ - return CONTAINING_RECORD(iface, AudioSessionWrapper, IChannelAudioVolume_iface); -} - static inline ACImpl *impl_from_IAudioClock(IAudioClock *iface) { return CONTAINING_RECORD(iface, ACImpl, IAudioClock_iface); @@ -1607,173 +1602,6 @@ static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl = AudioStreamVolume_GetAllVolumes }; -static HRESULT WINAPI ChannelAudioVolume_QueryInterface( - IChannelAudioVolume *iface, REFIID riid, void **ppv) -{ - TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); - - if(!ppv) - return E_POINTER; - *ppv = NULL; - - if(IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IChannelAudioVolume)) - *ppv = iface; - if(*ppv){ - IUnknown_AddRef((IUnknown*)*ppv); - return S_OK; - } - - WARN("Unknown interface %s\n", debugstr_guid(riid)); - return E_NOINTERFACE; -} - -static ULONG WINAPI ChannelAudioVolume_AddRef(IChannelAudioVolume *iface) -{ - AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); - return IAudioSessionControl2_AddRef(&This->IAudioSessionControl2_iface); -} - -static ULONG WINAPI ChannelAudioVolume_Release(IChannelAudioVolume *iface) -{ - AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); - return IAudioSessionControl2_Release(&This->IAudioSessionControl2_iface); -} - -static HRESULT WINAPI ChannelAudioVolume_GetChannelCount( - IChannelAudioVolume *iface, UINT32 *out) -{ - AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); - AudioSession *session = This->session; - - TRACE("(%p)->(%p)\n", session, out); - - if(!out) - return NULL_PTR_ERR; - - *out = session->channel_count; - - return S_OK; -} - -static HRESULT WINAPI ChannelAudioVolume_SetChannelVolume( - IChannelAudioVolume *iface, UINT32 index, float level, - const GUID *context) -{ - AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); - AudioSession *session = This->session; - ACImpl *client; - - TRACE("(%p)->(%d, %f, %s)\n", session, index, level, - wine_dbgstr_guid(context)); - - if(level < 0.f || level > 1.f) - return E_INVALIDARG; - - if(index >= session->channel_count) - return E_INVALIDARG; - - if(context) - FIXME("Notifications not supported yet\n"); - - sessions_lock(); - - session->channel_vols[index] = level; - - LIST_FOR_EACH_ENTRY(client, &session->clients, ACImpl, entry) - set_stream_volumes(client); - - sessions_unlock(); - - return S_OK; -} - -static HRESULT WINAPI ChannelAudioVolume_GetChannelVolume( - IChannelAudioVolume *iface, UINT32 index, float *level) -{ - AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); - AudioSession *session = This->session; - - TRACE("(%p)->(%d, %p)\n", session, index, level); - - if(!level) - return NULL_PTR_ERR; - - if(index >= session->channel_count) - return E_INVALIDARG; - - *level = session->channel_vols[index]; - - return S_OK; -} - -static HRESULT WINAPI ChannelAudioVolume_SetAllVolumes( - IChannelAudioVolume *iface, UINT32 count, const float *levels, - const GUID *context) -{ - AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); - AudioSession *session = This->session; - ACImpl *client; - UINT32 i; - - TRACE("(%p)->(%d, %p, %s)\n", session, count, levels, - wine_dbgstr_guid(context)); - - if(!levels) - return NULL_PTR_ERR; - - if(count != session->channel_count) - return E_INVALIDARG; - - if(context) - FIXME("Notifications not supported yet\n"); - - sessions_lock(); - - for(i = 0; i < count; ++i) - session->channel_vols[i] = levels[i]; - - LIST_FOR_EACH_ENTRY(client, &session->clients, ACImpl, entry) - set_stream_volumes(client); - - sessions_unlock(); - - return S_OK; -} - -static HRESULT WINAPI ChannelAudioVolume_GetAllVolumes( - IChannelAudioVolume *iface, UINT32 count, float *levels) -{ - AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); - AudioSession *session = This->session; - int i; - - TRACE("(%p)->(%d, %p)\n", session, count, levels); - - if(!levels) - return NULL_PTR_ERR; - - if(count != session->channel_count) - return E_INVALIDARG; - - for(i = 0; i < count; ++i) - levels[i] = session->channel_vols[i]; - - return S_OK; -} - -static const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl = -{ - ChannelAudioVolume_QueryInterface, - ChannelAudioVolume_AddRef, - ChannelAudioVolume_Release, - ChannelAudioVolume_GetChannelCount, - ChannelAudioVolume_SetChannelVolume, - ChannelAudioVolume_GetChannelVolume, - ChannelAudioVolume_SetAllVolumes, - ChannelAudioVolume_GetAllVolumes -}; - HRESULT WINAPI AUDDRV_GetAudioSessionWrapper(const GUID *guid, IMMDevice *device, AudioSessionWrapper **out) {
1
0
0
0
Davide Beatrici : winealsa: Move ChannelAudioVolume into mmdevapi.
by Alexandre Julliard
08 May '23
08 May '23
Module: wine Branch: master Commit: 9a9a86ea84c63815256a977b0761fe5533feb6e3 URL:
https://gitlab.winehq.org/wine/wine/-/commit/9a9a86ea84c63815256a977b0761fe…
Author: Davide Beatrici <git(a)davidebeatrici.dev> Date: Tue May 2 01:35:21 2023 +0200 winealsa: Move ChannelAudioVolume into mmdevapi. --- dlls/mmdevapi/session.c | 167 ++++++++++++++++++++++++++++++++++++++++ dlls/winealsa.drv/mmdevdrv.c | 178 +------------------------------------------ 2 files changed, 168 insertions(+), 177 deletions(-)
1
0
0
0
David Kahurani : shlwapi: Implement StrFormatByteSizeEx.
by Alexandre Julliard
08 May '23
08 May '23
Module: wine Branch: master Commit: 49baaf133e042865300daa6e7a468f49df30604c URL:
https://gitlab.winehq.org/wine/wine/-/commit/49baaf133e042865300daa6e7a468f…
Author: David Kahurani <k.kahurani(a)gmail.com> Date: Mon Apr 3 16:10:27 2023 +0300 shlwapi: Implement StrFormatByteSizeEx. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=54733
Signed-off-by: David Kahurani <k.kahurani(a)gmail.com> --- dlls/shlwapi/shlwapi.spec | 1 + dlls/shlwapi/string.c | 49 ++++++++++++++++++++++++++++++++++++++------- dlls/shlwapi/tests/string.c | 35 ++++++++++++++++++++++++++++++++ include/shlwapi.h | 7 +++++++ 4 files changed, 85 insertions(+), 7 deletions(-) diff --git a/dlls/shlwapi/shlwapi.spec b/dlls/shlwapi/shlwapi.spec index 801b2c9a890..7f3062a2819 100644 --- a/dlls/shlwapi/shlwapi.spec +++ b/dlls/shlwapi/shlwapi.spec @@ -781,6 +781,7 @@ @ stdcall -import StrDupW (wstr) @ stdcall StrFormatByteSize64A(int64 ptr long) @ stdcall StrFormatByteSizeA(long ptr long) +@ stdcall StrFormatByteSizeEx(int64 long ptr long) @ stdcall StrFormatByteSizeW(int64 ptr long) @ stdcall StrFormatKBSizeA(int64 str long) @ stdcall StrFormatKBSizeW(int64 wstr long) diff --git a/dlls/shlwapi/string.c b/dlls/shlwapi/string.c index 77e3b978cee..2c894198239 100644 --- a/dlls/shlwapi/string.c +++ b/dlls/shlwapi/string.c @@ -840,6 +840,30 @@ typedef struct tagSHLWAPI_BYTEFORMATS * There is no StrFormatByteSize64W function, it is called StrFormatByteSizeW(). */ LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax) +{ + HRESULT hr; + + TRACE("(0x%s,%p,%d)\n", wine_dbgstr_longlong(llBytes), lpszDest, cchMax); + + if (!lpszDest || !cchMax) + return lpszDest; + + hr = StrFormatByteSizeEx(llBytes, SFBS_FLAGS_TRUNCATE_UNDISPLAYED_DECIMAL_DIGITS, + lpszDest, cchMax); + + if (FAILED(hr)) + return NULL; + + return lpszDest; +} + +/************************************************************************* + * StrFormatByteSizeEx [SHLWAPI.@] + * + */ + +HRESULT WINAPI StrFormatByteSizeEx(LONGLONG llBytes, SFBS_FLAGS flags, LPWSTR lpszDest, + UINT cchMax) { #define KB ((ULONGLONG)1024) #define MB (KB*KB) @@ -870,17 +894,17 @@ LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax) double dBytes; UINT i = 0; - TRACE("(0x%s,%p,%d)\n", wine_dbgstr_longlong(llBytes), lpszDest, cchMax); + TRACE("(0x%s,%d,%p,%d)\n", wine_dbgstr_longlong(llBytes), flags, lpszDest, cchMax); - if (!lpszDest || !cchMax) - return lpszDest; + if (!cchMax) + return E_INVALIDARG; if (llBytes < 1024) /* 1K */ { WCHAR wszBytesFormat[64]; LoadStringW(shlwapi_hInstance, IDS_BYTES_FORMAT, wszBytesFormat, 64); swprintf(lpszDest, cchMax, wszBytesFormat, (int)llBytes); - return lpszDest; + return S_OK; } /* Note that if this loop completes without finding a match, i will be @@ -903,13 +927,24 @@ LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax) else dBytes = (double)llBytes + 0.00001; - dBytes = floor(dBytes / bfFormats[i].dDivisor) / bfFormats[i].dNormaliser; + switch(flags) + { + case SFBS_FLAGS_ROUND_TO_NEAREST_DISPLAYED_DIGIT: + dBytes = round(dBytes / bfFormats[i].dDivisor) / bfFormats[i].dNormaliser; + break; + case SFBS_FLAGS_TRUNCATE_UNDISPLAYED_DECIMAL_DIGITS: + dBytes = floor(dBytes / bfFormats[i].dDivisor) / bfFormats[i].dNormaliser; + break; + default: + return E_INVALIDARG; + } if (!FormatDouble(dBytes, bfFormats[i].nDecimals, lpszDest, cchMax)) - return NULL; + return E_FAIL; + wszAdd[1] = bfFormats[i].wPrefix; StrCatBuffW(lpszDest, wszAdd, cchMax); - return lpszDest; + return S_OK; } /************************************************************************* diff --git a/dlls/shlwapi/tests/string.c b/dlls/shlwapi/tests/string.c index d988e26acb4..6939063a306 100644 --- a/dlls/shlwapi/tests/string.c +++ b/dlls/shlwapi/tests/string.c @@ -52,6 +52,7 @@ static DWORD (WINAPI *pStrCatChainW)(LPWSTR,DWORD,DWORD,LPCWSTR); static LPSTR (WINAPI *pStrCpyNXA)(LPSTR,LPCSTR,int); static LPWSTR (WINAPI *pStrCpyNXW)(LPWSTR,LPCWSTR,int); static LPSTR (WINAPI *pStrFormatByteSize64A)(LONGLONG,LPSTR,UINT); +static HRESULT (WINAPI *pStrFormatByteSizeEx)(LONGLONG,SFBS_FLAGS,LPWSTR,UINT); static LPSTR (WINAPI *pStrFormatKBSizeA)(LONGLONG,LPSTR,UINT); static LPWSTR (WINAPI *pStrFormatKBSizeW)(LONGLONG,LPWSTR,UINT); static BOOL (WINAPI *pStrIsIntlEqualA)(BOOL,LPCSTR,LPCSTR,int); @@ -715,6 +716,38 @@ static void test_StrFormatByteSize64A(void) } } +static void test_StrFormatByteSizeEx(void) +{ + WCHAR szBuff[256]; + HRESULT hr; + LONGLONG test_value = 2147483647; + + if (!pStrFormatByteSizeEx) + { + win_skip("StrFormatByteSizeEx is not available \n"); + return; + } + + hr = pStrFormatByteSizeEx(0xdeadbeef, + SFBS_FLAGS_TRUNCATE_UNDISPLAYED_DECIMAL_DIGITS, szBuff, 0); + ok(hr == E_INVALIDARG, "Unexpected hr: %#lx expected: %#lx\n", hr, E_INVALIDARG); + + hr = pStrFormatByteSizeEx(0xdeadbeef, 10, szBuff, 256); + ok(hr == E_INVALIDARG, "Unexpected hr: %#lx expected: %#lx\n", hr, E_INVALIDARG); + + hr = pStrFormatByteSizeEx(test_value, SFBS_FLAGS_ROUND_TO_NEAREST_DISPLAYED_DIGIT, + szBuff, 256); + ok(hr == S_OK, "Invalid arguments \n"); + ok(!wcscmp(szBuff, L"2.00 GB"), "Formatted %s wrong: got %ls, expected 2.00 GB\n", + wine_dbgstr_longlong(test_value), szBuff); + + hr = pStrFormatByteSizeEx(test_value, SFBS_FLAGS_TRUNCATE_UNDISPLAYED_DECIMAL_DIGITS, + szBuff, 256); + ok(hr == S_OK, "Invalid arguments \n"); + ok(!wcscmp(szBuff, L"1.99 GB"), "Formatted %s wrong: got %ls, expected 1.99 GB\n", + wine_dbgstr_longlong(test_value), szBuff); +} + static void test_StrFormatKBSizeW(void) { WCHAR szBuffW[256]; @@ -1680,6 +1713,7 @@ START_TEST(string) pStrCpyNXW = (void *)GetProcAddress(hShlwapi, (LPSTR)400); pStrChrNW = (void *)GetProcAddress(hShlwapi, "StrChrNW"); pStrFormatByteSize64A = (void *)GetProcAddress(hShlwapi, "StrFormatByteSize64A"); + pStrFormatByteSizeEx = (void *)GetProcAddress(hShlwapi, "StrFormatByteSizeEx"); pStrFormatKBSizeA = (void *)GetProcAddress(hShlwapi, "StrFormatKBSizeA"); pStrFormatKBSizeW = (void *)GetProcAddress(hShlwapi, "StrFormatKBSizeW"); pStrIsIntlEqualA = (void *)GetProcAddress(hShlwapi, "StrIsIntlEqualA"); @@ -1716,6 +1750,7 @@ START_TEST(string) if (is_lang_english() && is_locale_english()) { test_StrFormatByteSize64A(); + test_StrFormatByteSizeEx(); test_StrFormatKBSizeA(); test_StrFormatKBSizeW(); } diff --git a/include/shlwapi.h b/include/shlwapi.h index eee41abf0dc..e81e9f0e1ec 100644 --- a/include/shlwapi.h +++ b/include/shlwapi.h @@ -856,6 +856,13 @@ WINSHLWAPI HRESULT WINAPI SHStrDupW(LPCWSTR,WCHAR**); WINSHLWAPI LPSTR WINAPI StrFormatByteSizeA (DWORD,LPSTR,UINT); +typedef enum { + SFBS_FLAGS_ROUND_TO_NEAREST_DISPLAYED_DIGIT = 0x1, + SFBS_FLAGS_TRUNCATE_UNDISPLAYED_DECIMAL_DIGITS = 0x2, +} SFBS_FLAGS; + +WINSHLWAPI HRESULT WINAPI StrFormatByteSizeEx(LONGLONG,SFBS_FLAGS,LPWSTR,UINT); + /* A/W Pairing is broken for this function */ WINSHLWAPI LPSTR WINAPI StrFormatByteSize64A (LONGLONG,LPSTR,UINT); WINSHLWAPI LPWSTR WINAPI StrFormatByteSizeW (LONGLONG,LPWSTR,UINT);
1
0
0
0
Giovanni Mascellani : mfplat/buffer: Implement IMF2DBuffer::ContiguousCopyTo().
by Alexandre Julliard
08 May '23
08 May '23
Module: wine Branch: master Commit: 885d8dfab221e1b1a9deeb09c61b69e125380984 URL:
https://gitlab.winehq.org/wine/wine/-/commit/885d8dfab221e1b1a9deeb09c61b69…
Author: Giovanni Mascellani <gmascellani(a)codeweavers.com> Date: Mon Jul 11 13:17:30 2022 +0200 mfplat/buffer: Implement IMF2DBuffer::ContiguousCopyTo(). --- dlls/mfplat/buffer.c | 23 +++++++++++++++++++++-- dlls/mfplat/tests/mfplat.c | 10 +++++----- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/dlls/mfplat/buffer.c b/dlls/mfplat/buffer.c index 63647c33ece..cb1b3176a08 100644 --- a/dlls/mfplat/buffer.c +++ b/dlls/mfplat/buffer.c @@ -601,9 +601,28 @@ static HRESULT WINAPI memory_2d_buffer_GetContiguousLength(IMF2DBuffer2 *iface, static HRESULT WINAPI memory_2d_buffer_ContiguousCopyTo(IMF2DBuffer2 *iface, BYTE *dest_buffer, DWORD dest_length) { - FIXME("%p, %p, %lu.\n", iface, dest_buffer, dest_length); + struct buffer *buffer = impl_from_IMF2DBuffer2(iface); + BYTE *src_scanline0, *src_buffer_start; + DWORD src_length; + LONG src_pitch; + HRESULT hr; - return E_NOTIMPL; + TRACE("%p, %p, %lu.\n", iface, dest_buffer, dest_length); + + if (dest_length < buffer->_2d.plane_size) + return E_INVALIDARG; + + hr = IMF2DBuffer2_Lock2DSize(iface, MF2DBuffer_LockFlags_Read, &src_scanline0, &src_pitch, &src_buffer_start, &src_length); + + if (SUCCEEDED(hr)) + { + copy_image(buffer, dest_buffer, buffer->_2d.width, src_scanline0, src_pitch, buffer->_2d.width, buffer->_2d.height); + + if (FAILED(IMF2DBuffer2_Unlock2D(iface))) + WARN("Couldn't unlock source buffer %p, hr %#lx.\n", iface, hr); + } + + return S_OK; } static HRESULT WINAPI memory_2d_buffer_ContiguousCopyFrom(IMF2DBuffer2 *iface, const BYTE *src_buffer, DWORD src_length) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 6fc84f37e7d..c5026ce2cf1 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -6259,12 +6259,12 @@ static void test_MFCreate2DMediaBuffer(void) ok(hr == S_OK, "Failed to unlock buffer, hr %#lx.\n", hr); hr = IMF2DBuffer2_ContiguousCopyTo(_2dbuffer2, data2, ptr->contiguous_length - 1); - todo_wine ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); memset(data2, 0xff, ptr->contiguous_length + 16); hr = IMF2DBuffer2_ContiguousCopyTo(_2dbuffer2, data2, ptr->contiguous_length + 16); - todo_wine ok(hr == S_OK, "Failed to copy to contiguous buffer, hr %#lx.\n", hr); + ok(hr == S_OK, "Failed to copy to contiguous buffer, hr %#lx.\n", hr); for (j = 0; j < ptr->contiguous_length; j++) { @@ -6278,12 +6278,12 @@ static void test_MFCreate2DMediaBuffer(void) if (data2[j] != (j & 0x7f)) break; } - todo_wine ok(j == ptr->contiguous_length, "Unexpected byte %02x instead of %02x at position %u.\n", data2[j], j & 0x7f, j); + ok(j == ptr->contiguous_length, "Unexpected byte %02x instead of %02x at position %u.\n", data2[j], j & 0x7f, j); memset(data2, 0xff, ptr->contiguous_length + 16); hr = IMF2DBuffer2_ContiguousCopyTo(_2dbuffer2, data2, ptr->contiguous_length); - todo_wine ok(hr == S_OK, "Failed to copy to contiguous buffer, hr %#lx.\n", hr); + ok(hr == S_OK, "Failed to copy to contiguous buffer, hr %#lx.\n", hr); for (j = 0; j < ptr->contiguous_length; j++) { @@ -6297,7 +6297,7 @@ static void test_MFCreate2DMediaBuffer(void) if (data2[j] != (j & 0x7f)) break; } - todo_wine ok(j == ptr->contiguous_length, "Unexpected byte %02x instead of %02x at position %u.\n", data2[j], j & 0x7f, j); + ok(j == ptr->contiguous_length, "Unexpected byte %02x instead of %02x at position %u.\n", data2[j], j & 0x7f, j); free(data2);
1
0
0
0
Giovanni Mascellani : mfplat/tests: Test IMF2DBuffer::ContiguousCopyTo().
by Alexandre Julliard
08 May '23
08 May '23
Module: wine Branch: master Commit: 8c0a1dfb6388f46559bdeb4d8f096326adde3c07 URL:
https://gitlab.winehq.org/wine/wine/-/commit/8c0a1dfb6388f46559bdeb4d8f0963…
Author: Giovanni Mascellani <gmascellani(a)codeweavers.com> Date: Mon Jul 11 13:07:25 2022 +0200 mfplat/tests: Test IMF2DBuffer::ContiguousCopyTo(). --- dlls/mfplat/tests/mfplat.c | 53 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 56861ce377a..6fc84f37e7d 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -6236,8 +6236,6 @@ static void test_MFCreate2DMediaBuffer(void) hr = IMF2DBuffer2_ContiguousCopyFrom(_2dbuffer2, data2, ptr->contiguous_length); ok(hr == S_OK, "Failed to copy from contiguous buffer, hr %#lx.\n", hr); - free(data2); - hr = IMFMediaBuffer_Lock(buffer, &data, &length2, NULL); ok(hr == S_OK, "Failed to lock buffer, hr %#lx.\n", hr); ok(length2 == ptr->contiguous_length, "%d: unexpected linear buffer length %lu for %u x %u, format %s.\n", @@ -6257,6 +6255,57 @@ static void test_MFCreate2DMediaBuffer(void) } ok(j == ptr->contiguous_length, "Unexpected byte %02x instead of %02x at position %u.\n", data[j], j & 0x7f, j); + hr = IMFMediaBuffer_Unlock(buffer); + ok(hr == S_OK, "Failed to unlock buffer, hr %#lx.\n", hr); + + hr = IMF2DBuffer2_ContiguousCopyTo(_2dbuffer2, data2, ptr->contiguous_length - 1); + todo_wine ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); + + memset(data2, 0xff, ptr->contiguous_length + 16); + + hr = IMF2DBuffer2_ContiguousCopyTo(_2dbuffer2, data2, ptr->contiguous_length + 16); + todo_wine ok(hr == S_OK, "Failed to copy to contiguous buffer, hr %#lx.\n", hr); + + for (j = 0; j < ptr->contiguous_length; j++) + { + if (IsEqualGUID(ptr->subtype, &MFVideoFormat_IMC1) || IsEqualGUID(ptr->subtype, &MFVideoFormat_IMC3)) + { + if (j < ptr->height * ptr->pitch && j % ptr->pitch >= ptr->width) + continue; + if (j >= ptr->height * ptr->pitch && j % ptr->pitch >= ptr->width / 2) + continue; + } + if (data2[j] != (j & 0x7f)) + break; + } + todo_wine ok(j == ptr->contiguous_length, "Unexpected byte %02x instead of %02x at position %u.\n", data2[j], j & 0x7f, j); + + memset(data2, 0xff, ptr->contiguous_length + 16); + + hr = IMF2DBuffer2_ContiguousCopyTo(_2dbuffer2, data2, ptr->contiguous_length); + todo_wine ok(hr == S_OK, "Failed to copy to contiguous buffer, hr %#lx.\n", hr); + + for (j = 0; j < ptr->contiguous_length; j++) + { + if (IsEqualGUID(ptr->subtype, &MFVideoFormat_IMC1) || IsEqualGUID(ptr->subtype, &MFVideoFormat_IMC3)) + { + if (j < ptr->height * ptr->pitch && j % ptr->pitch >= ptr->width) + continue; + if (j >= ptr->height * ptr->pitch && j % ptr->pitch >= ptr->width / 2) + continue; + } + if (data2[j] != (j & 0x7f)) + break; + } + todo_wine ok(j == ptr->contiguous_length, "Unexpected byte %02x instead of %02x at position %u.\n", data2[j], j & 0x7f, j); + + free(data2); + + hr = IMFMediaBuffer_Lock(buffer, &data, &length2, NULL); + ok(hr == S_OK, "Failed to lock buffer, hr %#lx.\n", hr); + ok(length2 == ptr->contiguous_length, "%d: unexpected linear buffer length %lu for %u x %u, format %s.\n", + i, length2, ptr->width, ptr->height, wine_dbgstr_guid(ptr->subtype)); + hr = pMFGetStrideForBitmapInfoHeader(ptr->subtype->Data1, ptr->width, &stride); ok(hr == S_OK, "Failed to get stride, hr %#lx.\n", hr); stride = abs(stride);
1
0
0
0
Giovanni Mascellani : mfplat/buffer: Implement IMF2DBuffer::ContiguousCopyFrom().
by Alexandre Julliard
08 May '23
08 May '23
Module: wine Branch: master Commit: da1885ce230ed7097b7513e7cb8abc7b7158e41e URL:
https://gitlab.winehq.org/wine/wine/-/commit/da1885ce230ed7097b7513e7cb8abc…
Author: Giovanni Mascellani <gmascellani(a)codeweavers.com> Date: Mon Jul 11 12:54:25 2022 +0200 mfplat/buffer: Implement IMF2DBuffer::ContiguousCopyFrom(). This is a generic implementation, which is probably fine for buffers backed by system memory. The implementation for buffers backed by GPU memory can probably be optimized. --- dlls/mfplat/buffer.c | 23 +++++++++++++++++++++-- dlls/mfplat/tests/mfplat.c | 10 +++++----- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/dlls/mfplat/buffer.c b/dlls/mfplat/buffer.c index f090dd13417..63647c33ece 100644 --- a/dlls/mfplat/buffer.c +++ b/dlls/mfplat/buffer.c @@ -608,9 +608,28 @@ static HRESULT WINAPI memory_2d_buffer_ContiguousCopyTo(IMF2DBuffer2 *iface, BYT static HRESULT WINAPI memory_2d_buffer_ContiguousCopyFrom(IMF2DBuffer2 *iface, const BYTE *src_buffer, DWORD src_length) { - FIXME("%p, %p, %lu.\n", iface, src_buffer, src_length); + struct buffer *buffer = impl_from_IMF2DBuffer2(iface); + BYTE *dst_scanline0, *dst_buffer_start; + DWORD dst_length; + LONG dst_pitch; + HRESULT hr; - return E_NOTIMPL; + TRACE("%p, %p, %lu.\n", iface, src_buffer, src_length); + + if (src_length < buffer->_2d.plane_size) + return E_INVALIDARG; + + hr = IMF2DBuffer2_Lock2DSize(iface, MF2DBuffer_LockFlags_Write, &dst_scanline0, &dst_pitch, &dst_buffer_start, &dst_length); + + if (SUCCEEDED(hr)) + { + copy_image(buffer, dst_scanline0, dst_pitch, src_buffer, buffer->_2d.width, buffer->_2d.width, buffer->_2d.height); + + if (FAILED(IMF2DBuffer2_Unlock2D(iface))) + WARN("Couldn't unlock destination buffer %p, hr %#lx.\n", iface, hr); + } + + return hr; } static HRESULT WINAPI memory_2d_buffer_Lock2DSize(IMF2DBuffer2 *iface, MF2DBuffer_LockFlags flags, BYTE **scanline0, diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 9b4c51ef4b8..56861ce377a 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -6195,7 +6195,7 @@ static void test_MFCreate2DMediaBuffer(void) data2[j] = j & 0x7f; hr = IMF2DBuffer2_ContiguousCopyFrom(_2dbuffer2, data2, ptr->contiguous_length - 1); - todo_wine ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); hr = IMFMediaBuffer_Lock(buffer, &data, &length2, NULL); ok(hr == S_OK, "Failed to lock buffer, hr %#lx.\n", hr); @@ -6207,7 +6207,7 @@ static void test_MFCreate2DMediaBuffer(void) ok(hr == S_OK, "Failed to unlock buffer, hr %#lx.\n", hr); hr = IMF2DBuffer2_ContiguousCopyFrom(_2dbuffer2, data2, ptr->contiguous_length + 16); - todo_wine ok(hr == S_OK, "Failed to copy from contiguous buffer, hr %#lx.\n", hr); + ok(hr == S_OK, "Failed to copy from contiguous buffer, hr %#lx.\n", hr); hr = IMFMediaBuffer_Lock(buffer, &data, &length2, NULL); ok(hr == S_OK, "Failed to lock buffer, hr %#lx.\n", hr); @@ -6226,7 +6226,7 @@ static void test_MFCreate2DMediaBuffer(void) if (data[j] != (j & 0x7f)) break; } - todo_wine ok(j == ptr->contiguous_length, "Unexpected byte %02x instead of %02x at position %u.\n", data[j], j & 0x7f, j); + ok(j == ptr->contiguous_length, "Unexpected byte %02x instead of %02x at position %u.\n", data[j], j & 0x7f, j); memset(data, 0xff, length2); @@ -6234,7 +6234,7 @@ static void test_MFCreate2DMediaBuffer(void) ok(hr == S_OK, "Failed to unlock buffer, hr %#lx.\n", hr); hr = IMF2DBuffer2_ContiguousCopyFrom(_2dbuffer2, data2, ptr->contiguous_length); - todo_wine ok(hr == S_OK, "Failed to copy from contiguous buffer, hr %#lx.\n", hr); + ok(hr == S_OK, "Failed to copy from contiguous buffer, hr %#lx.\n", hr); free(data2); @@ -6255,7 +6255,7 @@ static void test_MFCreate2DMediaBuffer(void) if (data[j] != (j & 0x7f)) break; } - todo_wine ok(j == ptr->contiguous_length, "Unexpected byte %02x instead of %02x at position %u.\n", data[j], j & 0x7f, j); + ok(j == ptr->contiguous_length, "Unexpected byte %02x instead of %02x at position %u.\n", data[j], j & 0x7f, j); hr = pMFGetStrideForBitmapInfoHeader(ptr->subtype->Data1, ptr->width, &stride); ok(hr == S_OK, "Failed to get stride, hr %#lx.\n", hr);
1
0
0
0
Giovanni Mascellani : mfplat/tests: Test IMF2DBuffer::ContiguousCopyFrom().
by Alexandre Julliard
08 May '23
08 May '23
Module: wine Branch: master Commit: cd719c7c44e51ea592a60d6c31e26e9eb78cdd3a URL:
https://gitlab.winehq.org/wine/wine/-/commit/cd719c7c44e51ea592a60d6c31e26e…
Author: Giovanni Mascellani <gmascellani(a)codeweavers.com> Date: Mon Jul 11 12:50:15 2022 +0200 mfplat/tests: Test IMF2DBuffer::ContiguousCopyFrom(). --- dlls/mfplat/tests/mfplat.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index f995909e397..9b4c51ef4b8 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -6181,14 +6181,82 @@ static void test_MFCreate2DMediaBuffer(void) hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMF2DBuffer, (void **)&_2dbuffer); ok(hr == S_OK, "Failed to get interface, hr %#lx.\n", hr); + hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMF2DBuffer2, (void **)&_2dbuffer2); + ok(hr == S_OK, "Failed to get interface, hr %#lx.\n", hr); + hr = IMF2DBuffer_GetContiguousLength(_2dbuffer, &length); ok(hr == S_OK, "Failed to get length, hr %#lx.\n", hr); ok(length == ptr->contiguous_length, "Unexpected contiguous length %lu.\n", length); + data2 = malloc(ptr->contiguous_length + 16); + ok(!!data2, "Failed to allocate buffer.\n"); + + for (j = 0; j < ptr->contiguous_length + 16; j++) + data2[j] = j & 0x7f; + + hr = IMF2DBuffer2_ContiguousCopyFrom(_2dbuffer2, data2, ptr->contiguous_length - 1); + todo_wine ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); + hr = IMFMediaBuffer_Lock(buffer, &data, &length2, NULL); ok(hr == S_OK, "Failed to lock buffer, hr %#lx.\n", hr); ok(length2 == ptr->contiguous_length, "Unexpected linear buffer length %lu.\n", length2); + memset(data, 0xff, length2); + + hr = IMFMediaBuffer_Unlock(buffer); + ok(hr == S_OK, "Failed to unlock buffer, hr %#lx.\n", hr); + + hr = IMF2DBuffer2_ContiguousCopyFrom(_2dbuffer2, data2, ptr->contiguous_length + 16); + todo_wine ok(hr == S_OK, "Failed to copy from contiguous buffer, hr %#lx.\n", hr); + + hr = IMFMediaBuffer_Lock(buffer, &data, &length2, NULL); + ok(hr == S_OK, "Failed to lock buffer, hr %#lx.\n", hr); + ok(length2 == ptr->contiguous_length, "%d: unexpected linear buffer length %lu for %u x %u, format %s.\n", + i, length2, ptr->width, ptr->height, wine_dbgstr_guid(ptr->subtype)); + + for (j = 0; j < ptr->contiguous_length; j++) + { + if (IsEqualGUID(ptr->subtype, &MFVideoFormat_IMC1) || IsEqualGUID(ptr->subtype, &MFVideoFormat_IMC3)) + { + if (j < ptr->height * ptr->pitch && j % ptr->pitch >= ptr->width) + continue; + if (j >= ptr->height * ptr->pitch && j % ptr->pitch >= ptr->width / 2) + continue; + } + if (data[j] != (j & 0x7f)) + break; + } + todo_wine ok(j == ptr->contiguous_length, "Unexpected byte %02x instead of %02x at position %u.\n", data[j], j & 0x7f, j); + + memset(data, 0xff, length2); + + hr = IMFMediaBuffer_Unlock(buffer); + ok(hr == S_OK, "Failed to unlock buffer, hr %#lx.\n", hr); + + hr = IMF2DBuffer2_ContiguousCopyFrom(_2dbuffer2, data2, ptr->contiguous_length); + todo_wine ok(hr == S_OK, "Failed to copy from contiguous buffer, hr %#lx.\n", hr); + + free(data2); + + hr = IMFMediaBuffer_Lock(buffer, &data, &length2, NULL); + ok(hr == S_OK, "Failed to lock buffer, hr %#lx.\n", hr); + ok(length2 == ptr->contiguous_length, "%d: unexpected linear buffer length %lu for %u x %u, format %s.\n", + i, length2, ptr->width, ptr->height, wine_dbgstr_guid(ptr->subtype)); + + for (j = 0; j < ptr->contiguous_length; j++) + { + if (IsEqualGUID(ptr->subtype, &MFVideoFormat_IMC1) || IsEqualGUID(ptr->subtype, &MFVideoFormat_IMC3)) + { + if (j < ptr->height * ptr->pitch && j % ptr->pitch >= ptr->width) + continue; + if (j >= ptr->height * ptr->pitch && j % ptr->pitch >= ptr->width / 2) + continue; + } + if (data[j] != (j & 0x7f)) + break; + } + todo_wine ok(j == ptr->contiguous_length, "Unexpected byte %02x instead of %02x at position %u.\n", data[j], j & 0x7f, j); + hr = pMFGetStrideForBitmapInfoHeader(ptr->subtype->Data1, ptr->width, &stride); ok(hr == S_OK, "Failed to get stride, hr %#lx.\n", hr); stride = abs(stride); @@ -6304,6 +6372,7 @@ static void test_MFCreate2DMediaBuffer(void) ok(!ret, "%d: unexpected format flag %d.\n", i, ret); IMF2DBuffer_Release(_2dbuffer); + IMF2DBuffer2_Release(_2dbuffer2); IMFMediaBuffer_Release(buffer);
1
0
0
0
← Newer
1
...
59
60
61
62
63
64
65
...
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