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
bdabe6a4
Commit
bdabe6a4
authored
Apr 11, 2023
by
Davide Beatrici
Committed by
Alexandre Julliard
Apr 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineoss: Use mmdevdrv structs from mmdevapi.
parent
854066a5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
76 deletions
+13
-76
mmdevdrv.c
dlls/wineoss.drv/mmdevdrv.c
+13
-76
No files found.
dlls/wineoss.drv/mmdevdrv.c
View file @
bdabe6a4
...
...
@@ -44,6 +44,8 @@
#include "unixlib.h"
#include "../mmdevapi/mmdevdrv.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
oss
);
#define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER)
...
...
@@ -51,71 +53,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(oss);
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
;
float
*
vols
;
UINT32
channel_count
;
stream_handle
stream
;
HANDLE
timer_thread
;
AudioSession
*
session
;
AudioSessionWrapper
*
session_wrapper
;
struct
list
entry
;
/* Keep at end */
char
devnode
[
0
];
};
typedef
struct
_SessionMgr
{
IAudioSessionManager2
IAudioSessionManager2_iface
;
LONG
ref
;
IMMDevice
*
device
;
}
SessionMgr
;
typedef
struct
_OSSDevice
{
struct
list
entry
;
EDataFlow
flow
;
...
...
@@ -252,7 +189,7 @@ static HRESULT stream_release(stream_handle stream, HANDLE timer_thread)
static
DWORD
WINAPI
timer_thread
(
void
*
user
)
{
struct
timer_loop_params
params
;
struct
ACImpl
*
This
=
user
;
ACImpl
*
This
=
user
;
params
.
stream
=
This
->
stream
;
OSS_CALL
(
timer_loop
,
&
params
);
...
...
@@ -447,18 +384,18 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev,
return
AUDCLNT_E_DEVICE_INVALIDATED
;
}
len
=
strlen
(
oss_dev
->
devnode
);
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
offsetof
(
ACImpl
,
dev
nod
e
[
len
+
1
]));
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
offsetof
(
ACImpl
,
dev
ice_nam
e
[
len
+
1
]));
if
(
!
This
)
return
E_OUTOFMEMORY
;
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
;
}
This
->
dataflow
=
oss_dev
->
flow
;
strcpy
(
This
->
dev
nod
e
,
oss_dev
->
devnode
);
strcpy
(
This
->
dev
ice_nam
e
,
oss_dev
->
devnode
);
This
->
IAudioClient3_iface
.
lpVtbl
=
&
AudioClient3_Vtbl
;
This
->
IAudioRenderClient_iface
.
lpVtbl
=
&
AudioRenderClient_Vtbl
;
...
...
@@ -491,7 +428,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
);
return
S_OK
;
...
...
@@ -519,7 +456,7 @@ static ULONG WINAPI AudioClient_Release(IAudioClient3 *iface)
if
(
!
ref
){
IAudioClient3_Stop
(
iface
);
IMMDevice_Release
(
This
->
parent
);
IUnknown_Release
(
This
->
pUnkFTM
arshal
);
IUnknown_Release
(
This
->
m
arshal
);
if
(
This
->
session
){
EnterCriticalSection
(
&
g_sessions_lock
);
list_remove
(
&
This
->
entry
);
...
...
@@ -711,7 +648,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface,
}
params
.
name
=
NULL
;
params
.
device
=
This
->
dev
nod
e
;
params
.
device
=
This
->
dev
ice_nam
e
;
params
.
flow
=
This
->
dataflow
;
params
.
share
=
mode
;
params
.
flags
=
flags
;
...
...
@@ -831,7 +768,7 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient3 *iface,
TRACE
(
"(%p)->(%x, %p, %p)
\n
"
,
This
,
mode
,
fmt
,
out
);
if
(
fmt
)
dump_fmt
(
fmt
);
params
.
device
=
This
->
dev
nod
e
;
params
.
device
=
This
->
dev
ice_nam
e
;
params
.
flow
=
This
->
dataflow
;
params
.
share
=
mode
;
params
.
fmt_in
=
fmt
;
...
...
@@ -864,7 +801,7 @@ static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient3 *iface,
return
E_POINTER
;
*
pwfx
=
NULL
;
params
.
device
=
This
->
dev
nod
e
;
params
.
device
=
This
->
dev
ice_nam
e
;
params
.
flow
=
This
->
dataflow
;
params
.
fmt
=
CoTaskMemAlloc
(
sizeof
(
WAVEFORMATEXTENSIBLE
));
if
(
!
params
.
fmt
)
...
...
@@ -1193,7 +1130,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
);
return
S_OK
;
...
...
@@ -1274,7 +1211,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
);
return
S_OK
;
...
...
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