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
b26bad57
Commit
b26bad57
authored
Jul 25, 2023
by
Davide Beatrici
Committed by
Alexandre Julliard
Jul 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmdevapi: Implement AudioClient_Create.
parent
55b6cded
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
98 additions
and
335 deletions
+98
-335
audiosessionmanager.c
dlls/mmdevapi/audiosessionmanager.c
+5
-2
client.c
dlls/mmdevapi/client.c
+55
-2
devenum.c
dlls/mmdevapi/devenum.c
+2
-2
main.c
dlls/mmdevapi/main.c
+0
-2
mmdevapi_private.h
dlls/mmdevapi/mmdevapi_private.h
+9
-5
mmdevdrv.h
dlls/mmdevapi/mmdevdrv.h
+0
-9
session.c
dlls/mmdevapi/session.c
+19
-2
Makefile.in
dlls/winealsa.drv/Makefile.in
+1
-4
mmdevdrv.c
dlls/winealsa.drv/mmdevdrv.c
+1
-72
winealsa.drv.spec
dlls/winealsa.drv/winealsa.drv.spec
+0
-1
Makefile.in
dlls/winecoreaudio.drv/Makefile.in
+1
-4
mmdevdrv.c
dlls/winecoreaudio.drv/mmdevdrv.c
+1
-72
winecoreaudio.drv.spec
dlls/winecoreaudio.drv/winecoreaudio.drv.spec
+0
-1
Makefile.in
dlls/wineoss.drv/Makefile.in
+1
-4
mmdevdrv.c
dlls/wineoss.drv/mmdevdrv.c
+1
-75
wineoss.drv.spec
dlls/wineoss.drv/wineoss.drv.spec
+0
-1
Makefile.in
dlls/winepulse.drv/Makefile.in
+1
-4
mmdevdrv.c
dlls/winepulse.drv/mmdevdrv.c
+1
-72
winepulse.drv.spec
dlls/winepulse.drv/winepulse.drv.spec
+0
-1
No files found.
dlls/mmdevapi/audiosessionmanager.c
View file @
b26bad57
...
...
@@ -26,6 +26,9 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
mmdevapi
);
extern
HRESULT
get_audio_session_wrapper
(
const
GUID
*
guid
,
IMMDevice
*
device
,
struct
audio_session_wrapper
**
out
);
static
CRITICAL_SECTION
g_sessions_lock
;
static
CRITICAL_SECTION_DEBUG
g_sessions_lock_debug
=
{
...
...
@@ -102,7 +105,7 @@ static HRESULT WINAPI ASM_GetAudioSessionControl(IAudioSessionManager2 *iface,
TRACE
(
"(%p)->(%s, %lx, %p)
\n
"
,
This
,
debugstr_guid
(
guid
),
flags
,
out
);
hr
=
drvs
.
pGetAudioSessionW
rapper
(
guid
,
This
->
device
,
&
wrapper
);
hr
=
get_audio_session_w
rapper
(
guid
,
This
->
device
,
&
wrapper
);
if
(
FAILED
(
hr
))
return
hr
;
...
...
@@ -121,7 +124,7 @@ static HRESULT WINAPI ASM_GetSimpleAudioVolume(IAudioSessionManager2 *iface,
TRACE
(
"(%p)->(%s, %lx, %p)
\n
"
,
This
,
debugstr_guid
(
guid
),
flags
,
out
);
hr
=
drvs
.
pGetAudioSessionW
rapper
(
guid
,
This
->
device
,
&
wrapper
);
hr
=
get_audio_session_w
rapper
(
guid
,
This
->
device
,
&
wrapper
);
if
(
FAILED
(
hr
))
return
hr
;
...
...
dlls/mmdevapi/client.c
View file @
b26bad57
...
...
@@ -30,8 +30,7 @@
#include <wine/debug.h>
#include <wine/unixlib.h>
#include "unixlib.h"
#include "mmdevdrv.h"
#include "mmdevapi_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
mmdevapi
);
...
...
@@ -1383,3 +1382,57 @@ const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl =
streamvolume_SetAllVolumes
,
streamvolume_GetAllVolumes
};
HRESULT
AudioClient_Create
(
GUID
*
guid
,
IMMDevice
*
device
,
IAudioClient
**
out
)
{
struct
audio_client
*
This
;
char
*
name
;
EDataFlow
dataflow
;
size_t
size
;
HRESULT
hr
;
TRACE
(
"%s %p %p
\n
"
,
debugstr_guid
(
guid
),
device
,
out
);
*
out
=
NULL
;
if
(
!
drvs
.
pget_device_name_from_guid
(
guid
,
&
name
,
&
dataflow
))
return
AUDCLNT_E_DEVICE_INVALIDATED
;
if
(
dataflow
!=
eRender
&&
dataflow
!=
eCapture
)
{
free
(
name
);
return
E_UNEXPECTED
;
}
size
=
strlen
(
name
)
+
1
;
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
FIELD_OFFSET
(
struct
audio_client
,
device_name
[
size
]));
if
(
!
This
)
{
free
(
name
);
return
E_OUTOFMEMORY
;
}
memcpy
(
This
->
device_name
,
name
,
size
);
free
(
name
);
This
->
IAudioCaptureClient_iface
.
lpVtbl
=
&
AudioCaptureClient_Vtbl
;
This
->
IAudioClient3_iface
.
lpVtbl
=
&
AudioClient3_Vtbl
;
This
->
IAudioClock_iface
.
lpVtbl
=
&
AudioClock_Vtbl
;
This
->
IAudioClock2_iface
.
lpVtbl
=
&
AudioClock2_Vtbl
;
This
->
IAudioRenderClient_iface
.
lpVtbl
=
&
AudioRenderClient_Vtbl
;
This
->
IAudioStreamVolume_iface
.
lpVtbl
=
&
AudioStreamVolume_Vtbl
;
This
->
dataflow
=
dataflow
;
This
->
parent
=
device
;
hr
=
CoCreateFreeThreadedMarshaler
((
IUnknown
*
)
&
This
->
IAudioClient3_iface
,
&
This
->
marshal
);
if
(
FAILED
(
hr
))
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
hr
;
}
IMMDevice_AddRef
(
This
->
parent
);
*
out
=
(
IAudioClient
*
)
&
This
->
IAudioClient3_iface
;
IAudioClient3_AddRef
(
&
This
->
IAudioClient3_iface
);
return
S_OK
;
}
dlls/mmdevapi/devenum.c
View file @
b26bad57
...
...
@@ -474,7 +474,7 @@ static HRESULT set_format(MMDevice *dev)
WAVEFORMATEX
*
fmt
;
PROPVARIANT
pv
=
{
VT_EMPTY
};
hr
=
drvs
.
pGetAudioEndpoint
(
&
dev
->
devguid
,
&
dev
->
IMMDevice_iface
,
&
client
);
hr
=
AudioClient_Create
(
&
dev
->
devguid
,
&
dev
->
IMMDevice_iface
,
&
client
);
if
(
FAILED
(
hr
))
return
hr
;
...
...
@@ -595,7 +595,7 @@ static HRESULT WINAPI MMDevice_Activate(IMMDevice *iface, REFIID riid, DWORD cls
if
(
IsEqualIID
(
riid
,
&
IID_IAudioClient
)
||
IsEqualIID
(
riid
,
&
IID_IAudioClient2
)
||
IsEqualIID
(
riid
,
&
IID_IAudioClient3
)){
hr
=
drvs
.
pGetAudioEndpoint
(
&
This
->
devguid
,
iface
,
(
IAudioClient
**
)
ppv
);
hr
=
AudioClient_Create
(
&
This
->
devguid
,
iface
,
(
IAudioClient
**
)
ppv
);
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IAudioEndpointVolume
)
||
IsEqualIID
(
riid
,
&
IID_IAudioEndpointVolumeEx
))
hr
=
AudioEndpointVolume_Create
(
This
,
(
IAudioEndpointVolumeEx
**
)
ppv
);
...
...
dlls/mmdevapi/main.c
View file @
b26bad57
...
...
@@ -100,8 +100,6 @@ static BOOL load_driver(const WCHAR *name, DriverFuncs *driver)
if(!driver->p##n) { goto fail; } } while(0)
LDFC
(
get_device_name_from_guid
);
LDFC
(
GetEndpointIDs
);
LDFC
(
GetAudioEndpoint
);
LDFC
(
GetAudioSessionWrapper
);
#undef LDFC
/* optional - do not fail if not found */
...
...
dlls/mmdevapi/mmdevapi_private.h
View file @
b26bad57
...
...
@@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <assert.h>
#include <endpointvolume.h>
#include <spatialaudioclient.h>
#include <winternl.h>
...
...
@@ -48,10 +50,6 @@ typedef struct _DriverFuncs {
* all of the elements in both arrays with HeapFree() */
HRESULT
(
WINAPI
*
pGetEndpointIDs
)(
EDataFlow
flow
,
WCHAR
***
ids
,
GUID
**
guids
,
UINT
*
num
,
UINT
*
default_index
);
HRESULT
(
WINAPI
*
pGetAudioEndpoint
)(
void
*
key
,
IMMDevice
*
dev
,
IAudioClient
**
out
);
HRESULT
(
WINAPI
*
pGetAudioSessionWrapper
)(
const
GUID
*
guid
,
IMMDevice
*
device
,
struct
audio_session_wrapper
**
out
);
HRESULT
(
WINAPI
*
pGetPropValue
)(
GUID
*
guid
,
const
PROPERTYKEY
*
prop
,
PROPVARIANT
*
out
);
}
DriverFuncs
;
...
...
@@ -73,7 +71,13 @@ typedef struct MMDevice {
struct
list
entry
;
}
MMDevice
;
extern
HRESULT
AudioClient_Create
(
MMDevice
*
parent
,
IAudioClient
**
ppv
)
DECLSPEC_HIDDEN
;
static
inline
void
wine_unix_call
(
const
unsigned
int
code
,
void
*
args
)
{
const
NTSTATUS
status
=
__wine_unix_call
(
drvs
.
module_unixlib
,
code
,
args
);
assert
(
!
status
);
}
extern
HRESULT
AudioClient_Create
(
GUID
*
guid
,
IMMDevice
*
device
,
IAudioClient
**
out
)
DECLSPEC_HIDDEN
;
extern
HRESULT
AudioEndpointVolume_Create
(
MMDevice
*
parent
,
IAudioEndpointVolumeEx
**
ppv
)
DECLSPEC_HIDDEN
;
extern
HRESULT
AudioSessionManager_Create
(
IMMDevice
*
device
,
IAudioSessionManager2
**
ppv
)
DECLSPEC_HIDDEN
;
extern
HRESULT
SpatialAudioClient_Create
(
IMMDevice
*
device
,
ISpatialAudioClient
**
out
)
DECLSPEC_HIDDEN
;
...
...
dlls/mmdevapi/mmdevdrv.h
View file @
b26bad57
...
...
@@ -14,13 +14,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <assert.h>
#include <audiopolicy.h>
#include <mmdeviceapi.h>
#include <wine/list.h>
#include <wine/unixlib.h>
typedef
struct
audio_client
ACImpl
;
...
...
@@ -85,9 +82,3 @@ struct audio_client {
/* Keep at end */
char
device_name
[
0
];
};
static
inline
void
wine_unix_call
(
const
unsigned
int
code
,
void
*
args
)
{
const
NTSTATUS
status
=
WINE_UNIX_CALL
(
code
,
args
);
assert
(
!
status
);
}
dlls/mmdevapi/session.c
View file @
b26bad57
...
...
@@ -28,8 +28,7 @@
#include <wine/debug.h>
#include <wine/unixlib.h>
#include "unixlib.h"
#include "mmdevdrv.h"
#include "mmdevapi_private.h"
#define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER)
...
...
@@ -653,3 +652,21 @@ HRESULT get_audio_session(const GUID *guid, IMMDevice *device, UINT channels,
return
S_OK
;
}
HRESULT
get_audio_session_wrapper
(
const
GUID
*
guid
,
IMMDevice
*
device
,
struct
audio_session_wrapper
**
out
)
{
struct
audio_session
*
session
;
const
HRESULT
hr
=
get_audio_session
(
guid
,
device
,
0
,
&
session
);
if
(
FAILED
(
hr
))
return
hr
;
*
out
=
session_wrapper_create
(
NULL
);
if
(
!*
out
)
return
E_OUTOFMEMORY
;
(
*
out
)
->
session
=
session
;
return
S_OK
;
}
dlls/winealsa.drv/Makefile.in
View file @
b26bad57
MODULE
=
winealsa.drv
UNIXLIB
=
winealsa.so
IMPORTS
=
uuid ole32 advapi32 version
PARENTSRC
=
../mmdevapi
DELAYIMPORTS
=
winmm
UNIX_LIBS
=
$(ALSA_LIBS)
$(PTHREAD_LIBS)
C_SRCS
=
\
alsa.c
\
alsamidi.c
\
client.c
\
midi.c
\
mmdevdrv.c
\
session.c
mmdevdrv.c
dlls/winealsa.drv/mmdevdrv.c
View file @
b26bad57
...
...
@@ -65,13 +65,6 @@ static CRITICAL_SECTION g_sessions_lock = { &g_sessions_lock_debug, -1, 0, 0, 0,
static
WCHAR
drv_key_devicesW
[
256
];
static
const
WCHAR
guidW
[]
=
{
'g'
,
'u'
,
'i'
,
'd'
,
0
};
extern
const
IAudioClient3Vtbl
AudioClient3_Vtbl
;
extern
const
IAudioRenderClientVtbl
AudioRenderClient_Vtbl
;
extern
const
IAudioCaptureClientVtbl
AudioCaptureClient_Vtbl
;
extern
const
IAudioClockVtbl
AudioClock_Vtbl
;
extern
const
IAudioClock2Vtbl
AudioClock2_Vtbl
;
extern
const
IAudioStreamVolumeVtbl
AudioStreamVolume_Vtbl
;
extern
struct
audio_session_wrapper
*
session_wrapper_create
(
struct
audio_client
*
client
)
DECLSPEC_HIDDEN
;
...
...
@@ -319,58 +312,6 @@ BOOL WINAPI get_device_name_from_guid(GUID *guid, char **name, EDataFlow *flow)
return
FALSE
;
}
HRESULT
WINAPI
AUDDRV_GetAudioEndpoint
(
GUID
*
guid
,
IMMDevice
*
dev
,
IAudioClient
**
out
)
{
ACImpl
*
This
;
char
*
alsa_name
;
EDataFlow
dataflow
;
HRESULT
hr
;
int
len
;
TRACE
(
"%s %p %p
\n
"
,
debugstr_guid
(
guid
),
dev
,
out
);
if
(
!
get_device_name_from_guid
(
guid
,
&
alsa_name
,
&
dataflow
))
return
AUDCLNT_E_DEVICE_INVALIDATED
;
if
(
dataflow
!=
eRender
&&
dataflow
!=
eCapture
){
free
(
alsa_name
);
return
E_UNEXPECTED
;
}
len
=
strlen
(
alsa_name
);
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
offsetof
(
ACImpl
,
device_name
[
len
+
1
]));
if
(
!
This
){
free
(
alsa_name
);
return
E_OUTOFMEMORY
;
}
memcpy
(
This
->
device_name
,
alsa_name
,
len
+
1
);
free
(
alsa_name
);
This
->
IAudioClient3_iface
.
lpVtbl
=
&
AudioClient3_Vtbl
;
This
->
IAudioRenderClient_iface
.
lpVtbl
=
&
AudioRenderClient_Vtbl
;
This
->
IAudioCaptureClient_iface
.
lpVtbl
=
&
AudioCaptureClient_Vtbl
;
This
->
IAudioClock_iface
.
lpVtbl
=
&
AudioClock_Vtbl
;
This
->
IAudioClock2_iface
.
lpVtbl
=
&
AudioClock2_Vtbl
;
This
->
IAudioStreamVolume_iface
.
lpVtbl
=
&
AudioStreamVolume_Vtbl
;
hr
=
CoCreateFreeThreadedMarshaler
((
IUnknown
*
)
&
This
->
IAudioClient3_iface
,
&
This
->
marshal
);
if
(
FAILED
(
hr
))
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
hr
;
}
This
->
dataflow
=
dataflow
;
This
->
parent
=
dev
;
IMMDevice_AddRef
(
This
->
parent
);
*
out
=
(
IAudioClient
*
)
&
This
->
IAudioClient3_iface
;
IAudioClient3_AddRef
(
&
This
->
IAudioClient3_iface
);
return
S_OK
;
}
/* if channels == 0, then this will return or create a session with
* matching dataflow and GUID. otherwise, channels must also match */
extern
HRESULT
get_audio_session
(
const
GUID
*
sessionguid
,
...
...
@@ -379,19 +320,7 @@ extern HRESULT get_audio_session(const GUID *sessionguid,
HRESULT
WINAPI
AUDDRV_GetAudioSessionWrapper
(
const
GUID
*
guid
,
IMMDevice
*
device
,
AudioSessionWrapper
**
out
)
{
AudioSession
*
session
;
HRESULT
hr
=
get_audio_session
(
guid
,
device
,
0
,
&
session
);
if
(
FAILED
(
hr
))
return
hr
;
*
out
=
session_wrapper_create
(
NULL
);
if
(
!*
out
)
return
E_OUTOFMEMORY
;
(
*
out
)
->
session
=
session
;
return
S_OK
;
return
E_NOTIMPL
;
}
HRESULT
WINAPI
AUDDRV_GetPropValue
(
GUID
*
guid
,
const
PROPERTYKEY
*
prop
,
PROPVARIANT
*
out
)
...
...
dlls/winealsa.drv/winealsa.drv.spec
View file @
b26bad57
...
...
@@ -6,6 +6,5 @@
# MMDevAPI driver functions
@ stdcall -private get_device_name_from_guid(ptr ptr ptr) get_device_name_from_guid
@ stdcall -private GetEndpointIDs(long ptr ptr ptr ptr) AUDDRV_GetEndpointIDs
@ stdcall -private GetAudioEndpoint(ptr ptr ptr) AUDDRV_GetAudioEndpoint
@ stdcall -private GetAudioSessionWrapper(ptr ptr ptr) AUDDRV_GetAudioSessionWrapper
@ stdcall -private GetPropValue(ptr ptr ptr) AUDDRV_GetPropValue
dlls/winecoreaudio.drv/Makefile.in
View file @
b26bad57
MODULE
=
winecoreaudio.drv
UNIXLIB
=
winecoreaudio.so
IMPORTS
=
uuid ole32 user32 advapi32 version
PARENTSRC
=
../mmdevapi
DELAYIMPORTS
=
winmm
UNIX_LIBS
=
$(COREAUDIO_LIBS)
C_SRCS
=
\
client.c
\
coreaudio.c
\
coremidi.c
\
midi.c
\
mmdevdrv.c
\
session.c
mmdevdrv.c
dlls/winecoreaudio.drv/mmdevdrv.c
View file @
b26bad57
...
...
@@ -48,13 +48,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(coreaudio);
#define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER)
extern
const
IAudioClient3Vtbl
AudioClient3_Vtbl
;
extern
const
IAudioRenderClientVtbl
AudioRenderClient_Vtbl
;
extern
const
IAudioCaptureClientVtbl
AudioCaptureClient_Vtbl
;
extern
const
IAudioClockVtbl
AudioClock_Vtbl
;
extern
const
IAudioClock2Vtbl
AudioClock2_Vtbl
;
extern
const
IAudioStreamVolumeVtbl
AudioStreamVolume_Vtbl
;
static
WCHAR
drv_key_devicesW
[
256
];
static
CRITICAL_SECTION
g_sessions_lock
;
...
...
@@ -313,58 +306,6 @@ BOOL WINAPI get_device_name_from_guid(const GUID *guid, char **name, EDataFlow *
return
FALSE
;
}
HRESULT
WINAPI
AUDDRV_GetAudioEndpoint
(
GUID
*
guid
,
IMMDevice
*
dev
,
IAudioClient
**
out
)
{
ACImpl
*
This
;
char
*
name
;
SIZE_T
name_len
;
EDataFlow
dataflow
;
HRESULT
hr
;
TRACE
(
"%s %p %p
\n
"
,
debugstr_guid
(
guid
),
dev
,
out
);
if
(
!
get_device_name_from_guid
(
guid
,
&
name
,
&
dataflow
))
return
AUDCLNT_E_DEVICE_INVALIDATED
;
if
(
dataflow
!=
eRender
&&
dataflow
!=
eCapture
){
free
(
name
);
return
E_UNEXPECTED
;
}
name_len
=
strlen
(
name
);
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
offsetof
(
ACImpl
,
device_name
[
name_len
+
1
]));
if
(
!
This
){
free
(
name
);
return
E_OUTOFMEMORY
;
}
memcpy
(
This
->
device_name
,
name
,
name_len
+
1
);
free
(
name
);
This
->
IAudioClient3_iface
.
lpVtbl
=
&
AudioClient3_Vtbl
;
This
->
IAudioRenderClient_iface
.
lpVtbl
=
&
AudioRenderClient_Vtbl
;
This
->
IAudioCaptureClient_iface
.
lpVtbl
=
&
AudioCaptureClient_Vtbl
;
This
->
IAudioClock_iface
.
lpVtbl
=
&
AudioClock_Vtbl
;
This
->
IAudioClock2_iface
.
lpVtbl
=
&
AudioClock2_Vtbl
;
This
->
IAudioStreamVolume_iface
.
lpVtbl
=
&
AudioStreamVolume_Vtbl
;
This
->
dataflow
=
dataflow
;
hr
=
CoCreateFreeThreadedMarshaler
((
IUnknown
*
)
&
This
->
IAudioClient3_iface
,
&
This
->
marshal
);
if
(
FAILED
(
hr
))
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
hr
;
}
This
->
parent
=
dev
;
IMMDevice_AddRef
(
This
->
parent
);
*
out
=
(
IAudioClient
*
)
&
This
->
IAudioClient3_iface
;
IAudioClient3_AddRef
(
&
This
->
IAudioClient3_iface
);
return
S_OK
;
}
/* if channels == 0, then this will return or create a session with
* matching dataflow and GUID. otherwise, channels must also match */
extern
HRESULT
get_audio_session
(
const
GUID
*
sessionguid
,
...
...
@@ -373,17 +314,5 @@ extern HRESULT get_audio_session(const GUID *sessionguid,
HRESULT
WINAPI
AUDDRV_GetAudioSessionWrapper
(
const
GUID
*
guid
,
IMMDevice
*
device
,
AudioSessionWrapper
**
out
)
{
AudioSession
*
session
;
HRESULT
hr
=
get_audio_session
(
guid
,
device
,
0
,
&
session
);
if
(
FAILED
(
hr
))
return
hr
;
*
out
=
session_wrapper_create
(
NULL
);
if
(
!*
out
)
return
E_OUTOFMEMORY
;
(
*
out
)
->
session
=
session
;
return
S_OK
;
return
E_NOTIMPL
;
}
dlls/winecoreaudio.drv/winecoreaudio.drv.spec
View file @
b26bad57
...
...
@@ -6,5 +6,4 @@
# MMDevAPI driver functions
@ stdcall -private get_device_name_from_guid(ptr ptr ptr) get_device_name_from_guid
@ stdcall -private GetEndpointIDs(long ptr ptr ptr ptr) AUDDRV_GetEndpointIDs
@ stdcall -private GetAudioEndpoint(ptr ptr ptr) AUDDRV_GetAudioEndpoint
@ stdcall -private GetAudioSessionWrapper(ptr ptr ptr) AUDDRV_GetAudioSessionWrapper
dlls/wineoss.drv/Makefile.in
View file @
b26bad57
MODULE
=
wineoss.drv
UNIXLIB
=
wineoss.so
IMPORTS
=
uuid ole32 user32 advapi32 version
PARENTSRC
=
../mmdevapi
DELAYIMPORTS
=
winmm
UNIX_LIBS
=
$(OSS4_LIBS)
$(PTHREAD_LIBS)
UNIX_CFLAGS
=
$(OSS4_CFLAGS)
C_SRCS
=
\
client.c
\
midi.c
\
midipatch.c
\
mmaux.c
\
mmdevdrv.c
\
oss.c
\
ossmidi.c
\
session.c
ossmidi.c
dlls/wineoss.drv/mmdevdrv.c
View file @
b26bad57
...
...
@@ -71,13 +71,6 @@ static CRITICAL_SECTION_DEBUG g_sessions_lock_debug =
};
static
CRITICAL_SECTION
g_sessions_lock
=
{
&
g_sessions_lock_debug
,
-
1
,
0
,
0
,
0
,
0
};
extern
const
IAudioClient3Vtbl
AudioClient3_Vtbl
;
extern
const
IAudioRenderClientVtbl
AudioRenderClient_Vtbl
;
extern
const
IAudioCaptureClientVtbl
AudioCaptureClient_Vtbl
;
extern
const
IAudioClockVtbl
AudioClock_Vtbl
;
extern
const
IAudioClock2Vtbl
AudioClock2_Vtbl
;
extern
const
IAudioStreamVolumeVtbl
AudioStreamVolume_Vtbl
;
extern
struct
audio_session_wrapper
*
session_wrapper_create
(
struct
audio_client
*
client
)
DECLSPEC_HIDDEN
;
...
...
@@ -300,61 +293,6 @@ end:
return
params
.
result
;
}
HRESULT
WINAPI
AUDDRV_GetAudioEndpoint
(
GUID
*
guid
,
IMMDevice
*
dev
,
IAudioClient
**
out
)
{
ACImpl
*
This
;
char
*
name
;
int
len
;
EDataFlow
dataflow
;
HRESULT
hr
;
TRACE
(
"%s %p %p
\n
"
,
debugstr_guid
(
guid
),
dev
,
out
);
if
(
!
get_device_name_from_guid
(
guid
,
&
name
,
&
dataflow
)){
WARN
(
"Unknown GUID: %s
\n
"
,
debugstr_guid
(
guid
));
return
AUDCLNT_E_DEVICE_INVALIDATED
;
}
if
(
dataflow
!=
eRender
&&
dataflow
!=
eCapture
){
free
(
name
);
return
E_UNEXPECTED
;
}
len
=
strlen
(
name
);
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
offsetof
(
ACImpl
,
device_name
[
len
+
1
]));
if
(
!
This
){
free
(
name
);
return
E_OUTOFMEMORY
;
}
memcpy
(
This
->
device_name
,
name
,
len
+
1
);
free
(
name
);
hr
=
CoCreateFreeThreadedMarshaler
((
IUnknown
*
)
&
This
->
IAudioClient3_iface
,
&
This
->
marshal
);
if
(
FAILED
(
hr
))
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
hr
;
}
This
->
dataflow
=
dataflow
;
This
->
IAudioClient3_iface
.
lpVtbl
=
&
AudioClient3_Vtbl
;
This
->
IAudioRenderClient_iface
.
lpVtbl
=
&
AudioRenderClient_Vtbl
;
This
->
IAudioCaptureClient_iface
.
lpVtbl
=
&
AudioCaptureClient_Vtbl
;
This
->
IAudioClock_iface
.
lpVtbl
=
&
AudioClock_Vtbl
;
This
->
IAudioClock2_iface
.
lpVtbl
=
&
AudioClock2_Vtbl
;
This
->
IAudioStreamVolume_iface
.
lpVtbl
=
&
AudioStreamVolume_Vtbl
;
This
->
parent
=
dev
;
IMMDevice_AddRef
(
This
->
parent
);
*
out
=
(
IAudioClient
*
)
&
This
->
IAudioClient3_iface
;
IAudioClient3_AddRef
(
&
This
->
IAudioClient3_iface
);
return
S_OK
;
}
/* if channels == 0, then this will return or create a session with
* matching dataflow and GUID. otherwise, channels must also match */
extern
HRESULT
get_audio_session
(
const
GUID
*
sessionguid
,
...
...
@@ -363,17 +301,5 @@ extern HRESULT get_audio_session(const GUID *sessionguid,
HRESULT
WINAPI
AUDDRV_GetAudioSessionWrapper
(
const
GUID
*
guid
,
IMMDevice
*
device
,
AudioSessionWrapper
**
out
)
{
AudioSession
*
session
;
HRESULT
hr
=
get_audio_session
(
guid
,
device
,
0
,
&
session
);
if
(
FAILED
(
hr
))
return
hr
;
*
out
=
session_wrapper_create
(
NULL
);
if
(
!*
out
)
return
E_OUTOFMEMORY
;
(
*
out
)
->
session
=
session
;
return
S_OK
;
return
E_NOTIMPL
;
}
dlls/wineoss.drv/wineoss.drv.spec
View file @
b26bad57
...
...
@@ -7,5 +7,4 @@
# MMDevAPI driver functions
@ stdcall -private get_device_name_from_guid(ptr ptr ptr) get_device_name_from_guid
@ stdcall -private GetEndpointIDs(long ptr ptr ptr ptr) AUDDRV_GetEndpointIDs
@ stdcall -private GetAudioEndpoint(ptr ptr ptr) AUDDRV_GetAudioEndpoint
@ stdcall -private GetAudioSessionWrapper(ptr ptr ptr) AUDDRV_GetAudioSessionWrapper
dlls/winepulse.drv/Makefile.in
View file @
b26bad57
MODULE
=
winepulse.drv
UNIXLIB
=
winepulse.so
IMPORTS
=
dxguid uuid winmm user32 advapi32 ole32 version
PARENTSRC
=
../mmdevapi
UNIX_LIBS
=
$(PULSE_LIBS)
$(PTHREAD_LIBS)
-lm
UNIX_CFLAGS
=
$(PULSE_CFLAGS)
C_SRCS
=
\
client.c
\
mmdevdrv.c
\
pulse.c
\
session.c
pulse.c
dlls/winepulse.drv/mmdevdrv.c
View file @
b26bad57
...
...
@@ -117,13 +117,6 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved)
return
TRUE
;
}
extern
const
IAudioClient3Vtbl
AudioClient3_Vtbl
;
extern
const
IAudioRenderClientVtbl
AudioRenderClient_Vtbl
;
extern
const
IAudioCaptureClientVtbl
AudioCaptureClient_Vtbl
;
extern
const
IAudioClockVtbl
AudioClock_Vtbl
;
extern
const
IAudioClock2Vtbl
AudioClock2_Vtbl
;
extern
const
IAudioStreamVolumeVtbl
AudioStreamVolume_Vtbl
;
extern
struct
audio_session_wrapper
*
session_wrapper_create
(
struct
audio_client
*
client
)
DECLSPEC_HIDDEN
;
...
...
@@ -343,58 +336,6 @@ BOOL WINAPI get_device_name_from_guid(GUID *guid, char **name, EDataFlow *flow)
return
FALSE
;
}
HRESULT
WINAPI
AUDDRV_GetAudioEndpoint
(
GUID
*
guid
,
IMMDevice
*
dev
,
IAudioClient
**
out
)
{
ACImpl
*
This
;
char
*
pulse_name
;
EDataFlow
dataflow
;
unsigned
len
;
HRESULT
hr
;
TRACE
(
"%s %p %p
\n
"
,
debugstr_guid
(
guid
),
dev
,
out
);
if
(
!
get_device_name_from_guid
(
guid
,
&
pulse_name
,
&
dataflow
))
return
AUDCLNT_E_DEVICE_INVALIDATED
;
if
(
dataflow
!=
eRender
&&
dataflow
!=
eCapture
)
{
free
(
pulse_name
);
return
E_UNEXPECTED
;
}
*
out
=
NULL
;
len
=
strlen
(
pulse_name
)
+
1
;
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
FIELD_OFFSET
(
ACImpl
,
device_name
[
len
]));
if
(
!
This
)
{
free
(
pulse_name
);
return
E_OUTOFMEMORY
;
}
memcpy
(
This
->
device_name
,
pulse_name
,
len
);
free
(
pulse_name
);
This
->
IAudioClient3_iface
.
lpVtbl
=
&
AudioClient3_Vtbl
;
This
->
IAudioRenderClient_iface
.
lpVtbl
=
&
AudioRenderClient_Vtbl
;
This
->
IAudioCaptureClient_iface
.
lpVtbl
=
&
AudioCaptureClient_Vtbl
;
This
->
IAudioClock_iface
.
lpVtbl
=
&
AudioClock_Vtbl
;
This
->
IAudioClock2_iface
.
lpVtbl
=
&
AudioClock2_Vtbl
;
This
->
IAudioStreamVolume_iface
.
lpVtbl
=
&
AudioStreamVolume_Vtbl
;
This
->
dataflow
=
dataflow
;
This
->
parent
=
dev
;
hr
=
CoCreateFreeThreadedMarshaler
((
IUnknown
*
)
&
This
->
IAudioClient3_iface
,
&
This
->
marshal
);
if
(
FAILED
(
hr
))
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
hr
;
}
IMMDevice_AddRef
(
This
->
parent
);
*
out
=
(
IAudioClient
*
)
&
This
->
IAudioClient3_iface
;
IAudioClient3_AddRef
(
&
This
->
IAudioClient3_iface
);
return
S_OK
;
}
/* if channels == 0, then this will return or create a session with
* matching dataflow and GUID. otherwise, channels must also match */
extern
HRESULT
get_audio_session
(
const
GUID
*
sessionguid
,
...
...
@@ -403,19 +344,7 @@ extern HRESULT get_audio_session(const GUID *sessionguid,
HRESULT
WINAPI
AUDDRV_GetAudioSessionWrapper
(
const
GUID
*
guid
,
IMMDevice
*
device
,
AudioSessionWrapper
**
out
)
{
AudioSession
*
session
;
HRESULT
hr
=
get_audio_session
(
guid
,
device
,
0
,
&
session
);
if
(
FAILED
(
hr
))
return
hr
;
*
out
=
session_wrapper_create
(
NULL
);
if
(
!*
out
)
return
E_OUTOFMEMORY
;
(
*
out
)
->
session
=
session
;
return
S_OK
;
return
E_NOTIMPL
;
}
HRESULT
WINAPI
AUDDRV_GetPropValue
(
GUID
*
guid
,
const
PROPERTYKEY
*
prop
,
PROPVARIANT
*
out
)
...
...
dlls/winepulse.drv/winepulse.drv.spec
View file @
b26bad57
# MMDevAPI driver functions
@ stdcall -private get_device_name_from_guid(ptr ptr ptr) get_device_name_from_guid
@ stdcall -private GetEndpointIDs(long ptr ptr ptr ptr) AUDDRV_GetEndpointIDs
@ stdcall -private GetAudioEndpoint(ptr ptr ptr) AUDDRV_GetAudioEndpoint
@ stdcall -private GetAudioSessionWrapper(ptr ptr ptr) AUDDRV_GetAudioSessionWrapper
@ stdcall -private GetPropValue(ptr ptr ptr) AUDDRV_GetPropValue
...
...
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