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
854066a5
Commit
854066a5
authored
Apr 11, 2023
by
Davide Beatrici
Committed by
Alexandre Julliard
Apr 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winecoreaudio: Use mmdevdrv structs from mmdevapi.
parent
d67a211c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
73 deletions
+11
-73
mmdevdrv.c
dlls/winecoreaudio.drv/mmdevdrv.c
+11
-73
No files found.
dlls/winecoreaudio.drv/mmdevdrv.c
View file @
854066a5
...
...
@@ -42,6 +42,8 @@
#include "audiopolicy.h"
#include "unixlib.h"
#include "../mmdevapi/mmdevdrv.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
coreaudio
);
#define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER)
...
...
@@ -49,62 +51,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(coreaudio);
static
const
REFERENCE_TIME
DefaultPeriod
=
100000
;
static
const
REFERENCE_TIME
MinimumPeriod
=
50000
;
struct
ACImpl
;
typedef
struct
ACImpl
ACImpl
;
typedef
struct
_AudioSession
{
GUID
guid
;
struct
list
clients
;
IMMDevice
*
device
;
float
master_vol
;
UINT32
channel_count
;
float
*
channel_vols
;
BOOL
mute
;
struct
list
entry
;
}
AudioSession
;
typedef
struct
_AudioSessionWrapper
{
IAudioSessionControl2
IAudioSessionControl2_iface
;
IChannelAudioVolume
IChannelAudioVolume_iface
;
ISimpleAudioVolume
ISimpleAudioVolume_iface
;
LONG
ref
;
ACImpl
*
client
;
AudioSession
*
session
;
}
AudioSessionWrapper
;
struct
ACImpl
{
IAudioClient3
IAudioClient3_iface
;
IAudioRenderClient
IAudioRenderClient_iface
;
IAudioCaptureClient
IAudioCaptureClient_iface
;
IAudioClock
IAudioClock_iface
;
IAudioClock2
IAudioClock2_iface
;
IAudioStreamVolume
IAudioStreamVolume_iface
;
LONG
ref
;
IMMDevice
*
parent
;
IUnknown
*
pUnkFTMarshal
;
EDataFlow
dataflow
;
UINT32
channel_count
;
float
*
vols
;
HANDLE
timer
;
AudioSession
*
session
;
AudioSessionWrapper
*
session_wrapper
;
stream_handle
stream
;
struct
list
entry
;
char
device_name
[
1
];
};
static
const
IAudioClient3Vtbl
AudioClient3_Vtbl
;
static
const
IAudioRenderClientVtbl
AudioRenderClient_Vtbl
;
static
const
IAudioCaptureClientVtbl
AudioCaptureClient_Vtbl
;
...
...
@@ -116,14 +62,6 @@ static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl;
static
const
IChannelAudioVolumeVtbl
ChannelAudioVolume_Vtbl
;
static
const
IAudioSessionManager2Vtbl
AudioSessionManager2_Vtbl
;
typedef
struct
_SessionMgr
{
IAudioSessionManager2
IAudioSessionManager2_iface
;
LONG
ref
;
IMMDevice
*
device
;
}
SessionMgr
;
static
WCHAR
drv_key_devicesW
[
256
];
static
CRITICAL_SECTION
g_sessions_lock
;
...
...
@@ -457,7 +395,7 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev, IAudioClient
This
->
dataflow
=
dataflow
;
memcpy
(
This
->
device_name
,
name
,
name_len
+
1
);
hr
=
CoCreateFreeThreadedMarshaler
((
IUnknown
*
)
&
This
->
IAudioClient3_iface
,
&
This
->
pUnkFTM
arshal
);
hr
=
CoCreateFreeThreadedMarshaler
((
IUnknown
*
)
&
This
->
IAudioClient3_iface
,
&
This
->
m
arshal
);
if
(
FAILED
(
hr
))
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
hr
;
...
...
@@ -487,7 +425,7 @@ static HRESULT WINAPI AudioClient_QueryInterface(IAudioClient3 *iface,
IsEqualIID
(
riid
,
&
IID_IAudioClient3
))
*
ppv
=
iface
;
else
if
(
IsEqualIID
(
riid
,
&
IID_IMarshal
))
return
IUnknown_QueryInterface
(
This
->
pUnkFTM
arshal
,
riid
,
ppv
);
return
IUnknown_QueryInterface
(
This
->
m
arshal
,
riid
,
ppv
);
if
(
*
ppv
){
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
...
...
@@ -516,7 +454,7 @@ static ULONG WINAPI AudioClient_Release(IAudioClient3 *iface)
if
(
This
->
stream
){
struct
release_stream_params
params
;
params
.
stream
=
This
->
stream
;
params
.
timer_thread
=
This
->
timer
;
params
.
timer_thread
=
This
->
timer
_thread
;
UNIX_CALL
(
release_stream
,
&
params
);
This
->
stream
=
0
;
...
...
@@ -526,7 +464,7 @@ static ULONG WINAPI AudioClient_Release(IAudioClient3 *iface)
}
HeapFree
(
GetProcessHeap
(),
0
,
This
->
vols
);
IMMDevice_Release
(
This
->
parent
);
IUnknown_Release
(
This
->
pUnkFTM
arshal
);
IUnknown_Release
(
This
->
m
arshal
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
ref
;
...
...
@@ -929,9 +867,9 @@ static HRESULT WINAPI AudioClient_Start(IAudioClient3 *iface)
if
(
FAILED
(
hr
=
params
.
result
))
return
hr
;
if
(
!
This
->
timer
)
{
This
->
timer
=
CreateThread
(
NULL
,
0
,
ca_timer_thread
,
This
,
0
,
NULL
);
SetThreadPriority
(
This
->
timer
,
THREAD_PRIORITY_TIME_CRITICAL
);
if
(
!
This
->
timer
_thread
)
{
This
->
timer
_thread
=
CreateThread
(
NULL
,
0
,
ca_timer_thread
,
This
,
0
,
NULL
);
SetThreadPriority
(
This
->
timer
_thread
,
THREAD_PRIORITY_TIME_CRITICAL
);
}
return
S_OK
;
...
...
@@ -1200,7 +1138,7 @@ static HRESULT WINAPI AudioRenderClient_QueryInterface(
IsEqualIID
(
riid
,
&
IID_IAudioRenderClient
))
*
ppv
=
iface
;
else
if
(
IsEqualIID
(
riid
,
&
IID_IMarshal
))
return
IUnknown_QueryInterface
(
This
->
pUnkFTM
arshal
,
riid
,
ppv
);
return
IUnknown_QueryInterface
(
This
->
m
arshal
,
riid
,
ppv
);
if
(
*
ppv
){
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
...
...
@@ -1279,7 +1217,7 @@ static HRESULT WINAPI AudioCaptureClient_QueryInterface(
IsEqualIID
(
riid
,
&
IID_IAudioCaptureClient
))
*
ppv
=
iface
;
else
if
(
IsEqualIID
(
riid
,
&
IID_IMarshal
))
return
IUnknown_QueryInterface
(
This
->
pUnkFTM
arshal
,
riid
,
ppv
);
return
IUnknown_QueryInterface
(
This
->
m
arshal
,
riid
,
ppv
);
if
(
*
ppv
){
IUnknown_AddRef
((
IUnknown
*
)
*
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