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
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
May 2023
----- 2025 -----
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
775 discussions
Start a n
N
ew thread
Piotr Caban : gdi32: Return error in EndPage if it's called before StartPage.
by Alexandre Julliard
01 May '23
01 May '23
Module: wine Branch: master Commit: 33ee9fad7157e98da6d4f34370ad55ff2335fb1b URL:
https://gitlab.winehq.org/wine/wine/-/commit/33ee9fad7157e98da6d4f34370ad55…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Apr 28 18:19:17 2023 +0200 gdi32: Return error in EndPage if it's called before StartPage. --- dlls/gdi32/dc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c index 66832f9012e..0b5e0824d00 100644 --- a/dlls/gdi32/dc.c +++ b/dlls/gdi32/dc.c @@ -2458,6 +2458,7 @@ INT WINAPI EndPage( HDC hdc ) { BOOL write = print->flags & WRITE_DEVMODE; + if (!(print->flags & CALL_END_PAGE)) return SP_ERROR; print->flags = (print->flags & ~(CALL_END_PAGE | WRITE_DEVMODE)) | CALL_START_PAGE; if (dc_attr->emf) return spool_end_page( dc_attr, print->printer, print->devmode, write );
1
0
0
0
Piotr Caban : gdi32: Support saving EMR_EXTESCAPE record in spool file.
by Alexandre Julliard
01 May '23
01 May '23
Module: wine Branch: master Commit: f4d78d5352f23135d04c3f3ca8ce30921a814e5a URL:
https://gitlab.winehq.org/wine/wine/-/commit/f4d78d5352f23135d04c3f3ca8ce30…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Apr 28 18:13:47 2023 +0200 gdi32: Support saving EMR_EXTESCAPE record in spool file. --- dlls/gdi32/dc.c | 9 +++++++++ dlls/gdi32/emfdc.c | 32 ++++++++++++++++++++++++++++++++ dlls/gdi32/gdi_private.h | 2 ++ 3 files changed, 43 insertions(+) diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c index 531fbb1fe85..66832f9012e 100644 --- a/dlls/gdi32/dc.c +++ b/dlls/gdi32/dc.c @@ -655,8 +655,17 @@ INT WINAPI Escape( HDC hdc, INT escape, INT in_count, const char *in_data, void INT WINAPI ExtEscape( HDC hdc, INT escape, INT input_size, const char *input, INT output_size, char *output ) { + struct print *print; + DC_ATTR *dc_attr; + if (is_meta_dc( hdc )) return METADC_ExtEscape( hdc, escape, input_size, input, output_size, output ); + if (!(dc_attr = get_dc_attr( hdc ))) return 0; + if ((print = get_dc_print( dc_attr )) && dc_attr->emf) + { + int ret = EMFDC_ExtEscape( dc_attr, escape, input_size, input, output_size, output ); + if (ret) return ret; + } return NtGdiExtEscape( hdc, NULL, 0, escape, input_size, input, output_size, output ); } diff --git a/dlls/gdi32/emfdc.c b/dlls/gdi32/emfdc.c index ef316fe42a1..5c3d01e43b1 100644 --- a/dlls/gdi32/emfdc.c +++ b/dlls/gdi32/emfdc.c @@ -1167,6 +1167,38 @@ BOOL EMFDC_PolyDraw( DC_ATTR *dc_attr, const POINT *pts, const BYTE *types, DWOR return ret; } +INT EMFDC_ExtEscape( DC_ATTR *dc_attr, INT escape, INT input_size, const char *input, + INT output_size, char *output) +{ + struct EMREXTESCAPE + { + EMR emr; + DWORD escape; + DWORD size; + BYTE data[1]; + } *emr; + size_t size; + + if (escape == QUERYESCSUPPORT) return 0; + + size = FIELD_OFFSET( struct EMREXTESCAPE, data[input_size] ); + size = (size + 3) & ~3; + if (!(emr = HeapAlloc( GetProcessHeap(), 0, size ))) return 0; + + emr->emr.iType = EMR_EXTESCAPE; + emr->emr.nSize = size; + emr->escape = escape; + emr->size = input_size; + memcpy(emr->data, input, input_size); + emfdc_record( get_dc_emf( dc_attr ), &emr->emr ); + HeapFree( GetProcessHeap(), 0, emr ); + if (output_size && output) return 0; + + if (escape == PASSTHROUGH || escape == POSTSCRIPT_PASSTHROUGH) + input_size -= sizeof(WORD); + return input_size ? input_size : 1; +} + BOOL EMFDC_ExtFloodFill( DC_ATTR *dc_attr, INT x, INT y, COLORREF color, UINT fill_type ) { EMREXTFLOODFILL emr; diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index b8f914fe1f4..b78733103f8 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -187,6 +187,8 @@ extern BOOL EMFDC_Ellipse( DC_ATTR *dc_attr, INT left, INT top, INT right, extern BOOL EMFDC_EndPath( DC_ATTR *dc_attr ) DECLSPEC_HIDDEN; extern BOOL EMFDC_ExcludeClipRect( DC_ATTR *dc_attr, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN; +extern INT EMFDC_ExtEscape( DC_ATTR *dc_attr, INT escape, INT input_size, const char *input, + INT output_size, char *output) DECLSPEC_HIDDEN; extern BOOL EMFDC_ExtFloodFill( DC_ATTR *dc_attr, INT x, INT y, COLORREF color, UINT fill_type ) DECLSPEC_HIDDEN; extern BOOL EMFDC_ExtSelectClipRgn( DC_ATTR *dc_attr, HRGN hrgn, INT mode ) DECLSPEC_HIDDEN;
1
0
0
0
Piotr Caban : gdi32: Ignore in_count parameter in Escape() on PASSTHROUGH escape.
by Alexandre Julliard
01 May '23
01 May '23
Module: wine Branch: master Commit: a79c2fd3792eba13fc8d2038e8e9a97906629836 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a79c2fd3792eba13fc8d2038e8e9a9…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Mon May 1 14:19:03 2023 +0200 gdi32: Ignore in_count parameter in Escape() on PASSTHROUGH escape. --- dlls/gdi32/dc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c index b1ca342f8e3..531fbb1fe85 100644 --- a/dlls/gdi32/dc.c +++ b/dlls/gdi32/dc.c @@ -637,6 +637,12 @@ INT WINAPI Escape( HDC hdc, INT escape, INT in_count, const char *in_data, void } break; } + + case PASSTHROUGH: + case POSTSCRIPT_PASSTHROUGH: + in_count = *(const WORD *)in_data + sizeof(WORD); + out_data = NULL; + break; } /* if not handled internally, pass it to the driver */
1
0
0
0
Davide Beatrici : winepulse: Use mmdevapi's SimpleAudioVolume.
by Alexandre Julliard
01 May '23
01 May '23
Module: wine Branch: master Commit: 77428d0295a83d927a5e7b02c39086d661469fb5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/77428d0295a83d927a5e7b02c39086…
Author: Davide Beatrici <git(a)davidebeatrici.dev> Date: Sat Apr 29 08:15:33 2023 +0200 winepulse: Use mmdevapi's SimpleAudioVolume. --- dlls/winepulse.drv/mmdevdrv.c | 130 +----------------------------------------- 1 file changed, 1 insertion(+), 129 deletions(-) diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c index 5f2a8b8609d..59e2d086d0b 100644 --- a/dlls/winepulse.drv/mmdevdrv.c +++ b/dlls/winepulse.drv/mmdevdrv.c @@ -128,7 +128,7 @@ static const IAudioClient3Vtbl AudioClient3_Vtbl; static const IAudioRenderClientVtbl AudioRenderClient_Vtbl; static const IAudioCaptureClientVtbl AudioCaptureClient_Vtbl; extern const IAudioSessionControl2Vtbl AudioSessionControl2_Vtbl; -static const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl; +extern const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl; static const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl; static const IAudioClockVtbl AudioClock_Vtbl; static const IAudioClock2Vtbl AudioClock2_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_ISimpleAudioVolume(ISimpleAudioVolume *iface) -{ - return CONTAINING_RECORD(iface, AudioSessionWrapper, ISimpleAudioVolume_iface); -} - static inline AudioSessionWrapper *impl_from_IChannelAudioVolume(IChannelAudioVolume *iface) { return CONTAINING_RECORD(iface, AudioSessionWrapper, IChannelAudioVolume_iface); @@ -1887,129 +1882,6 @@ static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client) return ret; } -static HRESULT WINAPI SimpleAudioVolume_QueryInterface( - ISimpleAudioVolume *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_ISimpleAudioVolume)) - *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 SimpleAudioVolume_AddRef(ISimpleAudioVolume *iface) -{ - AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); - return IAudioSessionControl2_AddRef(&This->IAudioSessionControl2_iface); -} - -static ULONG WINAPI SimpleAudioVolume_Release(ISimpleAudioVolume *iface) -{ - AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); - return IAudioSessionControl2_Release(&This->IAudioSessionControl2_iface); -} - -static HRESULT WINAPI SimpleAudioVolume_SetMasterVolume( - ISimpleAudioVolume *iface, float level, const GUID *context) -{ - AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); - AudioSession *session = This->session; - ACImpl *client; - - TRACE("(%p)->(%f, %s)\n", session, level, wine_dbgstr_guid(context)); - - if (level < 0.f || level > 1.f) - return E_INVALIDARG; - - if (context) - FIXME("Notifications not supported yet\n"); - - TRACE("PulseAudio does not support session volume control\n"); - - sessions_lock(); - session->master_vol = level; - LIST_FOR_EACH_ENTRY(client, &This->session->clients, ACImpl, entry) - set_stream_volumes(client); - sessions_unlock(); - - return S_OK; -} - -static HRESULT WINAPI SimpleAudioVolume_GetMasterVolume( - ISimpleAudioVolume *iface, float *level) -{ - AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); - AudioSession *session = This->session; - - TRACE("(%p)->(%p)\n", session, level); - - if (!level) - return NULL_PTR_ERR; - - *level = session->master_vol; - - return S_OK; -} - -static HRESULT WINAPI SimpleAudioVolume_SetMute(ISimpleAudioVolume *iface, - BOOL mute, const GUID *context) -{ - AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); - AudioSession *session = This->session; - ACImpl *client; - - TRACE("(%p)->(%u, %s)\n", session, mute, debugstr_guid(context)); - - if (context) - FIXME("Notifications not supported yet\n"); - - sessions_lock(); - session->mute = mute; - LIST_FOR_EACH_ENTRY(client, &This->session->clients, ACImpl, entry) - set_stream_volumes(client); - sessions_unlock(); - - return S_OK; -} - -static HRESULT WINAPI SimpleAudioVolume_GetMute(ISimpleAudioVolume *iface, - BOOL *mute) -{ - AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); - AudioSession *session = This->session; - - TRACE("(%p)->(%p)\n", session, mute); - - if (!mute) - return NULL_PTR_ERR; - - *mute = session->mute; - - return S_OK; -} - -static const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl = -{ - SimpleAudioVolume_QueryInterface, - SimpleAudioVolume_AddRef, - SimpleAudioVolume_Release, - SimpleAudioVolume_SetMasterVolume, - SimpleAudioVolume_GetMasterVolume, - SimpleAudioVolume_SetMute, - SimpleAudioVolume_GetMute -}; - static HRESULT WINAPI ChannelAudioVolume_QueryInterface( IChannelAudioVolume *iface, REFIID riid, void **ppv) {
1
0
0
0
Davide Beatrici : wineoss: Use mmdevapi's SimpleAudioVolume.
by Alexandre Julliard
01 May '23
01 May '23
Module: wine Branch: master Commit: 04c909eae2c25a53961855fa9cc00792afe3a29f URL:
https://gitlab.winehq.org/wine/wine/-/commit/04c909eae2c25a53961855fa9cc007…
Author: Davide Beatrici <git(a)davidebeatrici.dev> Date: Sun Apr 30 01:49:14 2023 +0200 wineoss: Use mmdevapi's SimpleAudioVolume. --- dlls/wineoss.drv/mmdevdrv.c | 132 +------------------------------------------- dlls/wineoss.drv/oss.c | 10 ++++ 2 files changed, 11 insertions(+), 131 deletions(-) diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c index e30787dc7c1..89dbeac62bc 100644 --- a/dlls/wineoss.drv/mmdevdrv.c +++ b/dlls/wineoss.drv/mmdevdrv.c @@ -81,7 +81,7 @@ static const IAudioClient3Vtbl AudioClient3_Vtbl; static const IAudioRenderClientVtbl AudioRenderClient_Vtbl; static const IAudioCaptureClientVtbl AudioCaptureClient_Vtbl; extern const IAudioSessionControl2Vtbl AudioSessionControl2_Vtbl; -static const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl; +extern const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl; static const IAudioClockVtbl AudioClock_Vtbl; static const IAudioClock2Vtbl AudioClock2_Vtbl; static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl; @@ -112,11 +112,6 @@ static inline ACImpl *impl_from_IAudioCaptureClient(IAudioCaptureClient *iface) return CONTAINING_RECORD(iface, ACImpl, IAudioCaptureClient_iface); } -static inline AudioSessionWrapper *impl_from_ISimpleAudioVolume(ISimpleAudioVolume *iface) -{ - return CONTAINING_RECORD(iface, AudioSessionWrapper, ISimpleAudioVolume_iface); -} - static inline AudioSessionWrapper *impl_from_IChannelAudioVolume(IChannelAudioVolume *iface) { return CONTAINING_RECORD(iface, AudioSessionWrapper, IChannelAudioVolume_iface); @@ -1460,131 +1455,6 @@ static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client) return ret; } -static HRESULT WINAPI SimpleAudioVolume_QueryInterface( - ISimpleAudioVolume *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_ISimpleAudioVolume)) - *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 SimpleAudioVolume_AddRef(ISimpleAudioVolume *iface) -{ - AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); - return IAudioSessionControl2_AddRef(&This->IAudioSessionControl2_iface); -} - -static ULONG WINAPI SimpleAudioVolume_Release(ISimpleAudioVolume *iface) -{ - AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); - return IAudioSessionControl2_Release(&This->IAudioSessionControl2_iface); -} - -static HRESULT WINAPI SimpleAudioVolume_SetMasterVolume( - ISimpleAudioVolume *iface, float level, const GUID *context) -{ - AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); - AudioSession *session = This->session; - ACImpl *client; - - TRACE("(%p)->(%f, %s)\n", session, level, wine_dbgstr_guid(context)); - - if(level < 0.f || level > 1.f) - return E_INVALIDARG; - - if(context) - FIXME("Notifications not supported yet\n"); - - sessions_lock(); - - session->master_vol = 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 SimpleAudioVolume_GetMasterVolume( - ISimpleAudioVolume *iface, float *level) -{ - AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); - AudioSession *session = This->session; - - TRACE("(%p)->(%p)\n", session, level); - - if(!level) - return NULL_PTR_ERR; - - *level = session->master_vol; - - return S_OK; -} - -static HRESULT WINAPI SimpleAudioVolume_SetMute(ISimpleAudioVolume *iface, - BOOL mute, const GUID *context) -{ - AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); - AudioSession *session = This->session; - ACImpl *client; - - TRACE("(%p)->(%u, %s)\n", session, mute, debugstr_guid(context)); - - sessions_lock(); - - session->mute = mute; - - LIST_FOR_EACH_ENTRY(client, &session->clients, ACImpl, entry) - set_stream_volumes(client); - - sessions_unlock(); - - return S_OK; -} - -static HRESULT WINAPI SimpleAudioVolume_GetMute(ISimpleAudioVolume *iface, - BOOL *mute) -{ - AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); - AudioSession *session = This->session; - - TRACE("(%p)->(%p)\n", session, mute); - - if(!mute) - return NULL_PTR_ERR; - - *mute = This->session->mute; - - return S_OK; -} - -static const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl = -{ - SimpleAudioVolume_QueryInterface, - SimpleAudioVolume_AddRef, - SimpleAudioVolume_Release, - SimpleAudioVolume_SetMasterVolume, - SimpleAudioVolume_GetMasterVolume, - SimpleAudioVolume_SetMute, - SimpleAudioVolume_GetMute -}; - static HRESULT WINAPI AudioStreamVolume_QueryInterface( IAudioStreamVolume *iface, REFIID riid, void **ppv) { diff --git a/dlls/wineoss.drv/oss.c b/dlls/wineoss.drv/oss.c index 65ca42c3182..96d84a07d00 100644 --- a/dlls/wineoss.drv/oss.c +++ b/dlls/wineoss.drv/oss.c @@ -1360,6 +1360,16 @@ static NTSTATUS oss_set_volumes(void *args) { struct set_volumes_params *params = args; struct oss_stream *stream = handle_get_stream(params->stream); + UINT16 i; + + if (params->master_volume) { + for (i = 0; i < stream->fmt->nChannels; ++i) { + if (params->master_volume * params->volumes[i] * params->session_volumes[i] != 1.0f) { + FIXME("Volume control is not implemented\n"); + break; + } + } + } oss_lock(stream); stream->mute = !params->master_volume;
1
0
0
0
Davide Beatrici : winecoreaudio: Use mmdevapi's SimpleAudioVolume.
by Alexandre Julliard
01 May '23
01 May '23
Module: wine Branch: master Commit: 4ee9c5dd9cc4f397ca87ec088414b2daadd48949 URL:
https://gitlab.winehq.org/wine/wine/-/commit/4ee9c5dd9cc4f397ca87ec088414b2…
Author: Davide Beatrici <git(a)davidebeatrici.dev> Date: Sat Apr 29 08:14:53 2023 +0200 winecoreaudio: Use mmdevapi's SimpleAudioVolume. --- dlls/winecoreaudio.drv/mmdevdrv.c | 134 +------------------------------------- 1 file changed, 1 insertion(+), 133 deletions(-) diff --git a/dlls/winecoreaudio.drv/mmdevdrv.c b/dlls/winecoreaudio.drv/mmdevdrv.c index abcca09039a..5113132f09b 100644 --- a/dlls/winecoreaudio.drv/mmdevdrv.c +++ b/dlls/winecoreaudio.drv/mmdevdrv.c @@ -55,7 +55,7 @@ static const IAudioClient3Vtbl AudioClient3_Vtbl; static const IAudioRenderClientVtbl AudioRenderClient_Vtbl; static const IAudioCaptureClientVtbl AudioCaptureClient_Vtbl; extern const IAudioSessionControl2Vtbl AudioSessionControl2_Vtbl; -static const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl; +extern const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl; static const IAudioClockVtbl AudioClock_Vtbl; static const IAudioClock2Vtbl AudioClock2_Vtbl; static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl; @@ -100,11 +100,6 @@ static inline ACImpl *impl_from_IAudioCaptureClient(IAudioCaptureClient *iface) return CONTAINING_RECORD(iface, ACImpl, IAudioCaptureClient_iface); } -static inline AudioSessionWrapper *impl_from_ISimpleAudioVolume(ISimpleAudioVolume *iface) -{ - return CONTAINING_RECORD(iface, AudioSessionWrapper, ISimpleAudioVolume_iface); -} - static inline AudioSessionWrapper *impl_from_IChannelAudioVolume(IChannelAudioVolume *iface) { return CONTAINING_RECORD(iface, AudioSessionWrapper, IChannelAudioVolume_iface); @@ -1461,133 +1456,6 @@ static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client) return ret; } -static HRESULT WINAPI SimpleAudioVolume_QueryInterface( - ISimpleAudioVolume *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_ISimpleAudioVolume)) - *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 SimpleAudioVolume_AddRef(ISimpleAudioVolume *iface) -{ - AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); - return IAudioSessionControl2_AddRef(&This->IAudioSessionControl2_iface); -} - -static ULONG WINAPI SimpleAudioVolume_Release(ISimpleAudioVolume *iface) -{ - AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); - return IAudioSessionControl2_Release(&This->IAudioSessionControl2_iface); -} - -static HRESULT WINAPI SimpleAudioVolume_SetMasterVolume( - ISimpleAudioVolume *iface, float level, const GUID *context) -{ - AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); - AudioSession *session = This->session; - ACImpl *client; - - TRACE("(%p)->(%f, %s)\n", session, level, wine_dbgstr_guid(context)); - - if(level < 0.f || level > 1.f) - return E_INVALIDARG; - - if(context) - FIXME("Notifications not supported yet\n"); - - sessions_lock(); - - session->master_vol = level; - - LIST_FOR_EACH_ENTRY(client, &session->clients, ACImpl, entry) - set_stream_volumes(client, -1); - - sessions_unlock(); - - return S_OK; -} - -static HRESULT WINAPI SimpleAudioVolume_GetMasterVolume( - ISimpleAudioVolume *iface, float *level) -{ - AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); - AudioSession *session = This->session; - - TRACE("(%p)->(%p)\n", session, level); - - if(!level) - return NULL_PTR_ERR; - - *level = session->master_vol; - - return S_OK; -} - -static HRESULT WINAPI SimpleAudioVolume_SetMute(ISimpleAudioVolume *iface, - BOOL mute, const GUID *context) -{ - AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); - AudioSession *session = This->session; - ACImpl *client; - - TRACE("(%p)->(%u, %s)\n", session, mute, debugstr_guid(context)); - - if(context) - FIXME("Notifications not supported yet\n"); - - sessions_lock(); - - session->mute = mute; - - LIST_FOR_EACH_ENTRY(client, &session->clients, ACImpl, entry) - set_stream_volumes(client, -1); - - sessions_unlock(); - - return S_OK; -} - -static HRESULT WINAPI SimpleAudioVolume_GetMute(ISimpleAudioVolume *iface, - BOOL *mute) -{ - AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); - AudioSession *session = This->session; - - TRACE("(%p)->(%p)\n", session, mute); - - if(!mute) - return NULL_PTR_ERR; - - *mute = session->mute; - - return S_OK; -} - -static const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl = -{ - SimpleAudioVolume_QueryInterface, - SimpleAudioVolume_AddRef, - SimpleAudioVolume_Release, - SimpleAudioVolume_SetMasterVolume, - SimpleAudioVolume_GetMasterVolume, - SimpleAudioVolume_SetMute, - SimpleAudioVolume_GetMute -}; - static HRESULT WINAPI AudioStreamVolume_QueryInterface( IAudioStreamVolume *iface, REFIID riid, void **ppv) {
1
0
0
0
Davide Beatrici : winealsa: Move SimpleAudioVolume into mmdevapi.
by Alexandre Julliard
01 May '23
01 May '23
Module: wine Branch: master Commit: 668f95168b95b83b2245f8019de2ebf1243f8a33 URL:
https://gitlab.winehq.org/wine/wine/-/commit/668f95168b95b83b2245f8019de2eb…
Author: Davide Beatrici <git(a)davidebeatrici.dev> Date: Sat Apr 29 08:14:14 2023 +0200 winealsa: Move SimpleAudioVolume into mmdevapi. --- dlls/mmdevapi/session.c | 143 +++++++++++++++++++++++++++++++++++++++++++ dlls/winealsa.drv/mmdevdrv.c | 135 +--------------------------------------- 2 files changed, 144 insertions(+), 134 deletions(-) diff --git a/dlls/mmdevapi/session.c b/dlls/mmdevapi/session.c index 8ba8bed5fc4..825fd44d4cf 100644 --- a/dlls/mmdevapi/session.c +++ b/dlls/mmdevapi/session.c @@ -39,6 +39,24 @@ static inline struct audio_session_wrapper *impl_from_IAudioSessionControl2(IAud return CONTAINING_RECORD(iface, struct audio_session_wrapper, IAudioSessionControl2_iface); } +static inline struct audio_session_wrapper *impl_from_ISimpleAudioVolume(ISimpleAudioVolume *iface) +{ + return CONTAINING_RECORD(iface, struct audio_session_wrapper, ISimpleAudioVolume_iface); +} + +static void set_stream_volumes(struct audio_client *This) +{ + struct set_volumes_params params; + + params.stream = This->stream; + params.master_volume = (This->session->mute ? 0.0f : This->session->master_vol); + params.volumes = This->vols; + params.session_volumes = This->session->channel_vols; + params.channel = 0; + + WINE_UNIX_CALL(set_volumes, ¶ms); +} + static HRESULT WINAPI control_QueryInterface(IAudioSessionControl2 *iface, REFIID riid, void **ppv) { TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); @@ -247,3 +265,128 @@ const IAudioSessionControl2Vtbl AudioSessionControl2_Vtbl = control_IsSystemSoundsSession, control_SetDuckingPreference }; + +static HRESULT WINAPI simplevolume_QueryInterface(ISimpleAudioVolume *iface, REFIID riid, + void **ppv) +{ + TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); + + if (!ppv) + return E_POINTER; + + if (IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_ISimpleAudioVolume)) + *ppv = iface; + else { + *ppv = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown *)*ppv); + + return S_OK; +} + +static ULONG WINAPI simplevolume_AddRef(ISimpleAudioVolume *iface) +{ + struct audio_session_wrapper *This = impl_from_ISimpleAudioVolume(iface); + return IAudioSessionControl2_AddRef(&This->IAudioSessionControl2_iface); +} + +static ULONG WINAPI simplevolume_Release(ISimpleAudioVolume *iface) +{ + struct audio_session_wrapper *This = impl_from_ISimpleAudioVolume(iface); + return IAudioSessionControl2_Release(&This->IAudioSessionControl2_iface); +} + +static HRESULT WINAPI simplevolume_SetMasterVolume(ISimpleAudioVolume *iface, float level, + const GUID *context) +{ + struct audio_session_wrapper *This = impl_from_ISimpleAudioVolume(iface); + struct audio_session *session = This->session; + struct audio_client *client; + + TRACE("(%p)->(%f, %s)\n", session, level, wine_dbgstr_guid(context)); + + if (level < 0.f || level > 1.f) + return E_INVALIDARG; + + if (context) + FIXME("Notifications not supported yet\n"); + + sessions_lock(); + + session->master_vol = level; + + LIST_FOR_EACH_ENTRY(client, &session->clients, struct audio_client, entry) + set_stream_volumes(client); + + sessions_unlock(); + + return S_OK; +} + +static HRESULT WINAPI simplevolume_GetMasterVolume(ISimpleAudioVolume *iface, float *level) +{ + struct audio_session_wrapper *This = impl_from_ISimpleAudioVolume(iface); + struct audio_session *session = This->session; + + TRACE("(%p)->(%p)\n", session, level); + + if (!level) + return NULL_PTR_ERR; + + *level = session->master_vol; + + return S_OK; +} + +static HRESULT WINAPI simplevolume_SetMute(ISimpleAudioVolume *iface, BOOL mute, + const GUID *context) +{ + struct audio_session_wrapper *This = impl_from_ISimpleAudioVolume(iface); + struct audio_session *session = This->session; + struct audio_client *client; + + TRACE("(%p)->(%u, %s)\n", session, mute, debugstr_guid(context)); + + if (context) + FIXME("Notifications not supported yet\n"); + + sessions_lock(); + + session->mute = mute; + + LIST_FOR_EACH_ENTRY(client, &session->clients, struct audio_client, entry) + set_stream_volumes(client); + + sessions_unlock(); + + return S_OK; +} + +static HRESULT WINAPI simplevolume_GetMute(ISimpleAudioVolume *iface, BOOL *mute) +{ + struct audio_session_wrapper *This = impl_from_ISimpleAudioVolume(iface); + struct audio_session *session = This->session; + + TRACE("(%p)->(%p)\n", session, mute); + + if (!mute) + return NULL_PTR_ERR; + + *mute = session->mute; + + return S_OK; +} + +const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl = +{ + simplevolume_QueryInterface, + simplevolume_AddRef, + simplevolume_Release, + simplevolume_SetMasterVolume, + simplevolume_GetMasterVolume, + simplevolume_SetMute, + simplevolume_GetMute +}; diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c index 3af83d94eae..6ea8882de59 100644 --- a/dlls/winealsa.drv/mmdevdrv.c +++ b/dlls/winealsa.drv/mmdevdrv.c @@ -73,7 +73,7 @@ static const IAudioClient3Vtbl AudioClient3_Vtbl; static const IAudioRenderClientVtbl AudioRenderClient_Vtbl; static const IAudioCaptureClientVtbl AudioCaptureClient_Vtbl; extern const IAudioSessionControl2Vtbl AudioSessionControl2_Vtbl; -static const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl; +extern const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl; static const IAudioClockVtbl AudioClock_Vtbl; static const IAudioClock2Vtbl AudioClock2_Vtbl; static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl; @@ -106,11 +106,6 @@ static inline ACImpl *impl_from_IAudioCaptureClient(IAudioCaptureClient *iface) return CONTAINING_RECORD(iface, ACImpl, IAudioCaptureClient_iface); } -static inline AudioSessionWrapper *impl_from_ISimpleAudioVolume(ISimpleAudioVolume *iface) -{ - return CONTAINING_RECORD(iface, AudioSessionWrapper, ISimpleAudioVolume_iface); -} - static inline AudioSessionWrapper *impl_from_IChannelAudioVolume(IChannelAudioVolume *iface) { return CONTAINING_RECORD(iface, AudioSessionWrapper, IChannelAudioVolume_iface); @@ -1511,134 +1506,6 @@ static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client) return ret; } -static HRESULT WINAPI SimpleAudioVolume_QueryInterface( - ISimpleAudioVolume *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_ISimpleAudioVolume)) - *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 SimpleAudioVolume_AddRef(ISimpleAudioVolume *iface) -{ - AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); - return IAudioSessionControl2_AddRef(&This->IAudioSessionControl2_iface); -} - -static ULONG WINAPI SimpleAudioVolume_Release(ISimpleAudioVolume *iface) -{ - AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); - return IAudioSessionControl2_Release(&This->IAudioSessionControl2_iface); -} - -static HRESULT WINAPI SimpleAudioVolume_SetMasterVolume( - ISimpleAudioVolume *iface, float level, const GUID *context) -{ - AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); - AudioSession *session = This->session; - ACImpl *client; - - TRACE("(%p)->(%f, %s)\n", session, level, wine_dbgstr_guid(context)); - - if(level < 0.f || level > 1.f) - return E_INVALIDARG; - - if(context) - FIXME("Notifications not supported yet\n"); - - TRACE("ALSA does not support volume control\n"); - - sessions_lock(); - - session->master_vol = level; - - LIST_FOR_EACH_ENTRY(client, &session->clients, ACImpl, entry) - set_stream_volumes(client); - - sessions_unlock(); - - return S_OK; -} - -static HRESULT WINAPI SimpleAudioVolume_GetMasterVolume( - ISimpleAudioVolume *iface, float *level) -{ - AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); - AudioSession *session = This->session; - - TRACE("(%p)->(%p)\n", session, level); - - if(!level) - return NULL_PTR_ERR; - - *level = session->master_vol; - - return S_OK; -} - -static HRESULT WINAPI SimpleAudioVolume_SetMute(ISimpleAudioVolume *iface, - BOOL mute, const GUID *context) -{ - AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); - AudioSession *session = This->session; - ACImpl *client; - - TRACE("(%p)->(%u, %s)\n", session, mute, debugstr_guid(context)); - - if(context) - FIXME("Notifications not supported yet\n"); - - sessions_lock(); - - session->mute = mute; - LIST_FOR_EACH_ENTRY(client, &session->clients, ACImpl, entry) - set_stream_volumes(client); - - sessions_unlock(); - - return S_OK; -} - -static HRESULT WINAPI SimpleAudioVolume_GetMute(ISimpleAudioVolume *iface, - BOOL *mute) -{ - AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); - AudioSession *session = This->session; - - TRACE("(%p)->(%p)\n", session, mute); - - if(!mute) - return NULL_PTR_ERR; - - *mute = session->mute; - - return S_OK; -} - -static const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl = -{ - SimpleAudioVolume_QueryInterface, - SimpleAudioVolume_AddRef, - SimpleAudioVolume_Release, - SimpleAudioVolume_SetMasterVolume, - SimpleAudioVolume_GetMasterVolume, - SimpleAudioVolume_SetMute, - SimpleAudioVolume_GetMute -}; - static HRESULT WINAPI AudioStreamVolume_QueryInterface( IAudioStreamVolume *iface, REFIID riid, void **ppv) {
1
0
0
0
Ziqing Hui : winegstreamer: Use codec format in stream_props_GetMediaType.
by Alexandre Julliard
01 May '23
01 May '23
Module: wine Branch: master Commit: 96c8be003159ae1018b46d911a0c5563e4712e82 URL:
https://gitlab.winehq.org/wine/wine/-/commit/96c8be003159ae1018b46d911a0c55…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Mon Mar 13 12:38:41 2023 +0800 winegstreamer: Use codec format in stream_props_GetMediaType. --- dlls/winegstreamer/wm_reader.c | 6 +++++- dlls/wmvcore/tests/wmvcore.c | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index 764774d505b..a6a5a81663e 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -544,12 +544,16 @@ static HRESULT WINAPI stream_props_GetType(IWMMediaProps *iface, GUID *major_typ static HRESULT WINAPI stream_props_GetMediaType(IWMMediaProps *iface, WM_MEDIA_TYPE *mt, DWORD *size) { struct stream_config *config = impl_from_IWMMediaProps(iface); + const struct wg_format *format; + struct wg_format codec_format; const DWORD req_size = *size; AM_MEDIA_TYPE stream_mt; TRACE("iface %p, mt %p, size %p.\n", iface, mt, size); - if (!amt_from_wg_format(&stream_mt, &config->stream->format, true)) + wg_parser_stream_get_codec_format(config->stream->wg_stream, &codec_format); + format = (codec_format.major_type != WG_MAJOR_TYPE_UNKNOWN) ? &codec_format : &config->stream->format; + if (!amt_from_wg_format(&stream_mt, format, true)) return E_OUTOFMEMORY; *size = sizeof(stream_mt) + stream_mt.cbFormat; diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index a116d8a1d69..9f755859481 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -1549,7 +1549,7 @@ static void test_sync_reader_types(void) if (IsEqualGUID(&majortype, &MEDIATYPE_Audio)) test_stream_media_props(config, &MEDIATYPE_Audio, &MEDIASUBTYPE_MSAUDIO1, &FORMAT_WaveFormatEx, TRUE); else - test_stream_media_props(config, &MEDIATYPE_Video, &MEDIASUBTYPE_WMV1, &FORMAT_VideoInfo, TRUE); + test_stream_media_props(config, &MEDIATYPE_Video, &MEDIASUBTYPE_WMV1, &FORMAT_VideoInfo, FALSE); ref = IWMStreamConfig_Release(config); ok(!ref, "Got outstanding refcount %ld.\n", ref); @@ -3429,7 +3429,7 @@ static void test_async_reader_types(void) if (IsEqualGUID(&majortype, &MEDIATYPE_Audio)) test_stream_media_props(config, &MEDIATYPE_Audio, &MEDIASUBTYPE_MSAUDIO1, &FORMAT_WaveFormatEx, TRUE); else - test_stream_media_props(config, &MEDIATYPE_Video, &MEDIASUBTYPE_WMV1, &FORMAT_VideoInfo, TRUE); + test_stream_media_props(config, &MEDIATYPE_Video, &MEDIASUBTYPE_WMV1, &FORMAT_VideoInfo, FALSE); ref = IWMStreamConfig_Release(config); ok(!ref, "Got outstanding refcount %ld.\n", ref);
1
0
0
0
Ziqing Hui : winegstreamer: Implement amt_from_wg_format_video_wmv.
by Alexandre Julliard
01 May '23
01 May '23
Module: wine Branch: master Commit: 6c424b7ed245a5606eee0cc26d5f92f393517de4 URL:
https://gitlab.winehq.org/wine/wine/-/commit/6c424b7ed245a5606eee0cc26d5f92…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Mon Mar 13 12:47:02 2023 +0800 winegstreamer: Implement amt_from_wg_format_video_wmv. --- dlls/winegstreamer/quartz_parser.c | 58 +++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c index de62187cd7d..0e5bdeca713 100644 --- a/dlls/winegstreamer/quartz_parser.c +++ b/dlls/winegstreamer/quartz_parser.c @@ -541,6 +541,60 @@ static bool amt_from_wg_format_video_cinepak(AM_MEDIA_TYPE *mt, const struct wg_ return true; } +static bool amt_from_wg_format_video_wmv(AM_MEDIA_TYPE *mt, const struct wg_format *format) +{ + VIDEOINFO *video_format; + uint32_t frame_time; + const GUID *subtype; + + if (!(video_format = CoTaskMemAlloc(sizeof(*video_format)))) + return false; + + switch (format->u.video_wmv.format) + { + case WG_WMV_VIDEO_FORMAT_WMV1: + subtype = &MEDIASUBTYPE_WMV1; + break; + case WG_WMV_VIDEO_FORMAT_WMV2: + subtype = &MEDIASUBTYPE_WMV2; + break; + case WG_WMV_VIDEO_FORMAT_WMV3: + subtype = &MEDIASUBTYPE_WMV3; + break; + case WG_WMV_VIDEO_FORMAT_WMVA: + subtype = &MEDIASUBTYPE_WMVA; + break; + case WG_WMV_VIDEO_FORMAT_WVC1: + subtype = &MEDIASUBTYPE_WVC1; + break; + default: + WARN("Invalid WMV format %u.\n", format->u.video_wmv.format); + return false; + } + + mt->majortype = MEDIATYPE_Video; + mt->subtype = *subtype; + mt->bFixedSizeSamples = FALSE; + mt->bTemporalCompression = TRUE; + mt->lSampleSize = 0; + mt->formattype = FORMAT_VideoInfo; + mt->cbFormat = sizeof(VIDEOINFOHEADER); + mt->pbFormat = (BYTE *)video_format; + + memset(video_format, 0, sizeof(*video_format)); + SetRect(&video_format->rcSource, 0, 0, format->u.video_wmv.width, format->u.video_wmv.height); + video_format->rcTarget = video_format->rcSource; + if ((frame_time = MulDiv(10000000, format->u.video_wmv.fps_d, format->u.video_wmv.fps_n)) != -1) + video_format->AvgTimePerFrame = frame_time; + video_format->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + video_format->bmiHeader.biWidth = format->u.video_wmv.width; + video_format->bmiHeader.biHeight = format->u.video_wmv.height; + video_format->bmiHeader.biPlanes = 1; + video_format->bmiHeader.biCompression = mt->subtype.Data1; + + return true; +} + bool amt_from_wg_format(AM_MEDIA_TYPE *mt, const struct wg_format *format, bool wm) { memset(mt, 0, sizeof(*mt)); @@ -550,7 +604,6 @@ bool amt_from_wg_format(AM_MEDIA_TYPE *mt, const struct wg_format *format, bool case WG_MAJOR_TYPE_AUDIO_MPEG4: case WG_MAJOR_TYPE_AUDIO_WMA: case WG_MAJOR_TYPE_VIDEO_H264: - case WG_MAJOR_TYPE_VIDEO_WMV: case WG_MAJOR_TYPE_VIDEO_INDEO: FIXME("Format %u not implemented!\n", format->major_type); /* fallthrough */ @@ -568,6 +621,9 @@ bool amt_from_wg_format(AM_MEDIA_TYPE *mt, const struct wg_format *format, bool case WG_MAJOR_TYPE_VIDEO_CINEPAK: return amt_from_wg_format_video_cinepak(mt, format); + + case WG_MAJOR_TYPE_VIDEO_WMV: + return amt_from_wg_format_video_wmv(mt, format); } assert(0);
1
0
0
0
Ziqing Hui : winegstreamer: Implement wg_parser_stream_get_codec_format.
by Alexandre Julliard
01 May '23
01 May '23
Module: wine Branch: master Commit: 13188bb14bec6052fa108f42a96d1e4964e507b4 URL:
https://gitlab.winehq.org/wine/wine/-/commit/13188bb14bec6052fa108f42a96d1e…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Mon Mar 13 12:13:52 2023 +0800 winegstreamer: Implement wg_parser_stream_get_codec_format. --- dlls/winegstreamer/gst_private.h | 1 + dlls/winegstreamer/main.c | 13 +++++++++++++ dlls/winegstreamer/unixlib.h | 7 +++++++ dlls/winegstreamer/wg_parser.c | 17 ++++++++++++++--- 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index 04ec84c7936..54f59aa708a 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -82,6 +82,7 @@ uint32_t wg_parser_get_stream_count(struct wg_parser *parser); struct wg_parser_stream *wg_parser_get_stream(struct wg_parser *parser, uint32_t index); void wg_parser_stream_get_preferred_format(struct wg_parser_stream *stream, struct wg_format *format); +void wg_parser_stream_get_codec_format(struct wg_parser_stream *stream, struct wg_format *format); void wg_parser_stream_enable(struct wg_parser_stream *stream, const struct wg_format *format); void wg_parser_stream_disable(struct wg_parser_stream *stream); diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c index 1e54edb2015..2e7763872d0 100644 --- a/dlls/winegstreamer/main.c +++ b/dlls/winegstreamer/main.c @@ -185,6 +185,19 @@ void wg_parser_stream_get_preferred_format(struct wg_parser_stream *stream, stru WINE_UNIX_CALL(unix_wg_parser_stream_get_preferred_format, ¶ms); } +void wg_parser_stream_get_codec_format(struct wg_parser_stream *stream, struct wg_format *format) +{ + struct wg_parser_stream_get_codec_format_params params = + { + .stream = stream, + .format = format, + }; + + TRACE("stream %p, format %p.\n", stream, format); + + WINE_UNIX_CALL(unix_wg_parser_stream_get_codec_format, ¶ms); +} + void wg_parser_stream_enable(struct wg_parser_stream *stream, const struct wg_format *format) { struct wg_parser_stream_enable_params params = diff --git a/dlls/winegstreamer/unixlib.h b/dlls/winegstreamer/unixlib.h index a01efb934f8..e20fdd7256b 100644 --- a/dlls/winegstreamer/unixlib.h +++ b/dlls/winegstreamer/unixlib.h @@ -240,6 +240,12 @@ struct wg_parser_stream_get_preferred_format_params struct wg_format *format; }; +struct wg_parser_stream_get_codec_format_params +{ + struct wg_parser_stream *stream; + struct wg_format *format; +}; + struct wg_parser_stream_enable_params { struct wg_parser_stream *stream; @@ -350,6 +356,7 @@ enum unix_funcs unix_wg_parser_get_stream, unix_wg_parser_stream_get_preferred_format, + unix_wg_parser_stream_get_codec_format, unix_wg_parser_stream_enable, unix_wg_parser_stream_disable, diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index 16867c0da7d..e80d7501f2c 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -107,7 +107,7 @@ struct wg_parser_stream GstPad *their_src, *my_sink; GstElement *flip, *decodebin; GstSegment segment; - struct wg_format preferred_format, current_format, stream_format; + struct wg_format preferred_format, current_format, codec_format; pthread_cond_t event_cond, event_empty_cond; GstBuffer *buffer; @@ -216,6 +216,16 @@ static NTSTATUS wg_parser_stream_get_preferred_format(void *args) return S_OK; } +static NTSTATUS wg_parser_stream_get_codec_format(void *args) +{ + struct wg_parser_stream_get_codec_format_params *params = args; + + *params->format = format_is_compressed(¶ms->stream->codec_format) ? + params->stream->codec_format : + params->stream->preferred_format; + return S_OK; +} + static NTSTATUS wg_parser_stream_enable(void *args) { const struct wg_parser_stream_enable_params *params = args; @@ -950,11 +960,11 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user) return; caps = gst_pad_query_caps(pad, NULL); - wg_format_from_caps(&stream->stream_format, caps); + wg_format_from_caps(&stream->codec_format, caps); gst_caps_unref(caps); /* For compressed stream, create an extra decodebin to decode it. */ - if (format_is_compressed(&stream->stream_format)) + if (format_is_compressed(&stream->codec_format)) { if (!stream_decodebin_create(stream)) { @@ -1945,6 +1955,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] = X(wg_parser_get_stream), X(wg_parser_stream_get_preferred_format), + X(wg_parser_stream_get_codec_format), X(wg_parser_stream_enable), X(wg_parser_stream_disable),
1
0
0
0
← Newer
1
...
73
74
75
76
77
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