Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
cbd47ebc
Commit
cbd47ebc
authored
Apr 27, 2023
by
Davide Beatrici
Committed by
Alexandre Julliard
Apr 28, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winepulse: Use mmdevapi's AudioSessionControl.
parent
99ff19a5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
249 deletions
+6
-249
Makefile.in
dlls/winepulse.drv/Makefile.in
+3
-1
mmdevdrv.c
dlls/winepulse.drv/mmdevdrv.c
+3
-248
No files found.
dlls/winepulse.drv/Makefile.in
View file @
cbd47ebc
MODULE
=
winepulse.drv
MODULE
=
winepulse.drv
UNIXLIB
=
winepulse.so
UNIXLIB
=
winepulse.so
IMPORTS
=
dxguid uuid winmm user32 advapi32 ole32 version
IMPORTS
=
dxguid uuid winmm user32 advapi32 ole32 version
PARENTSRC
=
../mmdevapi
UNIX_LIBS
=
$(PULSE_LIBS)
$(PTHREAD_LIBS)
-lm
UNIX_LIBS
=
$(PULSE_LIBS)
$(PTHREAD_LIBS)
-lm
UNIX_CFLAGS
=
$(PULSE_CFLAGS)
UNIX_CFLAGS
=
$(PULSE_CFLAGS)
C_SRCS
=
\
C_SRCS
=
\
mmdevdrv.c
\
mmdevdrv.c
\
pulse.c
pulse.c
\
session.c
dlls/winepulse.drv/mmdevdrv.c
View file @
cbd47ebc
...
@@ -83,12 +83,12 @@ static CRITICAL_SECTION_DEBUG session_cs_debug = {
...
@@ -83,12 +83,12 @@ static CRITICAL_SECTION_DEBUG session_cs_debug = {
};
};
static
CRITICAL_SECTION
session_cs
=
{
&
session_cs_debug
,
-
1
,
0
,
0
,
0
,
0
};
static
CRITICAL_SECTION
session_cs
=
{
&
session_cs_debug
,
-
1
,
0
,
0
,
0
,
0
};
static
void
sessions_lock
(
void
)
void
DECLSPEC_HIDDEN
sessions_lock
(
void
)
{
{
EnterCriticalSection
(
&
session_cs
);
EnterCriticalSection
(
&
session_cs
);
}
}
static
void
sessions_unlock
(
void
)
void
DECLSPEC_HIDDEN
sessions_unlock
(
void
)
{
{
LeaveCriticalSection
(
&
session_cs
);
LeaveCriticalSection
(
&
session_cs
);
}
}
...
@@ -127,7 +127,7 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved)
...
@@ -127,7 +127,7 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved)
static
const
IAudioClient3Vtbl
AudioClient3_Vtbl
;
static
const
IAudioClient3Vtbl
AudioClient3_Vtbl
;
static
const
IAudioRenderClientVtbl
AudioRenderClient_Vtbl
;
static
const
IAudioRenderClientVtbl
AudioRenderClient_Vtbl
;
static
const
IAudioCaptureClientVtbl
AudioCaptureClient_Vtbl
;
static
const
IAudioCaptureClientVtbl
AudioCaptureClient_Vtbl
;
static
const
IAudioSessionControl2Vtbl
AudioSessionControl2_Vtbl
;
extern
const
IAudioSessionControl2Vtbl
AudioSessionControl2_Vtbl
;
static
const
ISimpleAudioVolumeVtbl
SimpleAudioVolume_Vtbl
;
static
const
ISimpleAudioVolumeVtbl
SimpleAudioVolume_Vtbl
;
static
const
IChannelAudioVolumeVtbl
ChannelAudioVolume_Vtbl
;
static
const
IChannelAudioVolumeVtbl
ChannelAudioVolume_Vtbl
;
static
const
IAudioClockVtbl
AudioClock_Vtbl
;
static
const
IAudioClockVtbl
AudioClock_Vtbl
;
...
@@ -151,11 +151,6 @@ static inline ACImpl *impl_from_IAudioCaptureClient(IAudioCaptureClient *iface)
...
@@ -151,11 +151,6 @@ static inline ACImpl *impl_from_IAudioCaptureClient(IAudioCaptureClient *iface)
return
CONTAINING_RECORD
(
iface
,
ACImpl
,
IAudioCaptureClient_iface
);
return
CONTAINING_RECORD
(
iface
,
ACImpl
,
IAudioCaptureClient_iface
);
}
}
static
inline
AudioSessionWrapper
*
impl_from_IAudioSessionControl2
(
IAudioSessionControl2
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
AudioSessionWrapper
,
IAudioSessionControl2_iface
);
}
static
inline
AudioSessionWrapper
*
impl_from_ISimpleAudioVolume
(
ISimpleAudioVolume
*
iface
)
static
inline
AudioSessionWrapper
*
impl_from_ISimpleAudioVolume
(
ISimpleAudioVolume
*
iface
)
{
{
return
CONTAINING_RECORD
(
iface
,
AudioSessionWrapper
,
ISimpleAudioVolume_iface
);
return
CONTAINING_RECORD
(
iface
,
AudioSessionWrapper
,
ISimpleAudioVolume_iface
);
...
@@ -1892,246 +1887,6 @@ static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client)
...
@@ -1892,246 +1887,6 @@ static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client)
return
ret
;
return
ret
;
}
}
static
HRESULT
WINAPI
AudioSessionControl_QueryInterface
(
IAudioSessionControl2
*
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_IAudioSessionControl
)
||
IsEqualIID
(
riid
,
&
IID_IAudioSessionControl2
))
*
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
AudioSessionControl_AddRef
(
IAudioSessionControl2
*
iface
)
{
AudioSessionWrapper
*
This
=
impl_from_IAudioSessionControl2
(
iface
);
ULONG
ref
;
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) Refcount now %lu
\n
"
,
This
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
AudioSessionControl_Release
(
IAudioSessionControl2
*
iface
)
{
AudioSessionWrapper
*
This
=
impl_from_IAudioSessionControl2
(
iface
);
ULONG
ref
;
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) Refcount now %lu
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
if
(
This
->
client
)
{
This
->
client
->
session_wrapper
=
NULL
;
IAudioClient3_Release
(
&
This
->
client
->
IAudioClient3_iface
);
}
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
ref
;
}
static
HRESULT
WINAPI
AudioSessionControl_GetState
(
IAudioSessionControl2
*
iface
,
AudioSessionState
*
state
)
{
AudioSessionWrapper
*
This
=
impl_from_IAudioSessionControl2
(
iface
);
ACImpl
*
client
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
state
);
if
(
!
state
)
return
NULL_PTR_ERR
;
sessions_lock
();
if
(
list_empty
(
&
This
->
session
->
clients
))
{
*
state
=
AudioSessionStateExpired
;
goto
out
;
}
LIST_FOR_EACH_ENTRY
(
client
,
&
This
->
session
->
clients
,
ACImpl
,
entry
)
{
struct
is_started_params
params
;
if
(
!
client
->
stream
)
continue
;
params
.
stream
=
client
->
stream
;
pulse_call
(
is_started
,
&
params
);
if
(
params
.
result
==
S_OK
)
{
*
state
=
AudioSessionStateActive
;
goto
out
;
}
}
*
state
=
AudioSessionStateInactive
;
out:
sessions_unlock
();
return
S_OK
;
}
static
HRESULT
WINAPI
AudioSessionControl_GetDisplayName
(
IAudioSessionControl2
*
iface
,
WCHAR
**
name
)
{
AudioSessionWrapper
*
This
=
impl_from_IAudioSessionControl2
(
iface
);
FIXME
(
"(%p)->(%p) - stub
\n
"
,
This
,
name
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
AudioSessionControl_SetDisplayName
(
IAudioSessionControl2
*
iface
,
const
WCHAR
*
name
,
const
GUID
*
session
)
{
AudioSessionWrapper
*
This
=
impl_from_IAudioSessionControl2
(
iface
);
FIXME
(
"(%p)->(%p, %s) - stub
\n
"
,
This
,
name
,
debugstr_guid
(
session
));
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
AudioSessionControl_GetIconPath
(
IAudioSessionControl2
*
iface
,
WCHAR
**
path
)
{
AudioSessionWrapper
*
This
=
impl_from_IAudioSessionControl2
(
iface
);
FIXME
(
"(%p)->(%p) - stub
\n
"
,
This
,
path
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
AudioSessionControl_SetIconPath
(
IAudioSessionControl2
*
iface
,
const
WCHAR
*
path
,
const
GUID
*
session
)
{
AudioSessionWrapper
*
This
=
impl_from_IAudioSessionControl2
(
iface
);
FIXME
(
"(%p)->(%p, %s) - stub
\n
"
,
This
,
path
,
debugstr_guid
(
session
));
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
AudioSessionControl_GetGroupingParam
(
IAudioSessionControl2
*
iface
,
GUID
*
group
)
{
AudioSessionWrapper
*
This
=
impl_from_IAudioSessionControl2
(
iface
);
FIXME
(
"(%p)->(%p) - stub
\n
"
,
This
,
group
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
AudioSessionControl_SetGroupingParam
(
IAudioSessionControl2
*
iface
,
const
GUID
*
group
,
const
GUID
*
session
)
{
AudioSessionWrapper
*
This
=
impl_from_IAudioSessionControl2
(
iface
);
FIXME
(
"(%p)->(%s, %s) - stub
\n
"
,
This
,
debugstr_guid
(
group
),
debugstr_guid
(
session
));
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
AudioSessionControl_RegisterAudioSessionNotification
(
IAudioSessionControl2
*
iface
,
IAudioSessionEvents
*
events
)
{
AudioSessionWrapper
*
This
=
impl_from_IAudioSessionControl2
(
iface
);
FIXME
(
"(%p)->(%p) - stub
\n
"
,
This
,
events
);
return
S_OK
;
}
static
HRESULT
WINAPI
AudioSessionControl_UnregisterAudioSessionNotification
(
IAudioSessionControl2
*
iface
,
IAudioSessionEvents
*
events
)
{
AudioSessionWrapper
*
This
=
impl_from_IAudioSessionControl2
(
iface
);
FIXME
(
"(%p)->(%p) - stub
\n
"
,
This
,
events
);
return
S_OK
;
}
static
HRESULT
WINAPI
AudioSessionControl_GetSessionIdentifier
(
IAudioSessionControl2
*
iface
,
WCHAR
**
id
)
{
AudioSessionWrapper
*
This
=
impl_from_IAudioSessionControl2
(
iface
);
FIXME
(
"(%p)->(%p) - stub
\n
"
,
This
,
id
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
AudioSessionControl_GetSessionInstanceIdentifier
(
IAudioSessionControl2
*
iface
,
WCHAR
**
id
)
{
AudioSessionWrapper
*
This
=
impl_from_IAudioSessionControl2
(
iface
);
FIXME
(
"(%p)->(%p) - stub
\n
"
,
This
,
id
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
AudioSessionControl_GetProcessId
(
IAudioSessionControl2
*
iface
,
DWORD
*
pid
)
{
AudioSessionWrapper
*
This
=
impl_from_IAudioSessionControl2
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pid
);
if
(
!
pid
)
return
E_POINTER
;
*
pid
=
GetCurrentProcessId
();
return
S_OK
;
}
static
HRESULT
WINAPI
AudioSessionControl_IsSystemSoundsSession
(
IAudioSessionControl2
*
iface
)
{
AudioSessionWrapper
*
This
=
impl_from_IAudioSessionControl2
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
S_FALSE
;
}
static
HRESULT
WINAPI
AudioSessionControl_SetDuckingPreference
(
IAudioSessionControl2
*
iface
,
BOOL
optout
)
{
AudioSessionWrapper
*
This
=
impl_from_IAudioSessionControl2
(
iface
);
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
optout
);
return
S_OK
;
}
static
const
IAudioSessionControl2Vtbl
AudioSessionControl2_Vtbl
=
{
AudioSessionControl_QueryInterface
,
AudioSessionControl_AddRef
,
AudioSessionControl_Release
,
AudioSessionControl_GetState
,
AudioSessionControl_GetDisplayName
,
AudioSessionControl_SetDisplayName
,
AudioSessionControl_GetIconPath
,
AudioSessionControl_SetIconPath
,
AudioSessionControl_GetGroupingParam
,
AudioSessionControl_SetGroupingParam
,
AudioSessionControl_RegisterAudioSessionNotification
,
AudioSessionControl_UnregisterAudioSessionNotification
,
AudioSessionControl_GetSessionIdentifier
,
AudioSessionControl_GetSessionInstanceIdentifier
,
AudioSessionControl_GetProcessId
,
AudioSessionControl_IsSystemSoundsSession
,
AudioSessionControl_SetDuckingPreference
};
static
HRESULT
WINAPI
SimpleAudioVolume_QueryInterface
(
static
HRESULT
WINAPI
SimpleAudioVolume_QueryInterface
(
ISimpleAudioVolume
*
iface
,
REFIID
riid
,
void
**
ppv
)
ISimpleAudioVolume
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment