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
cca12c50
Commit
cca12c50
authored
May 13, 2023
by
Davide Beatrici
Committed by
Alexandre Julliard
May 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winepulse: Move AudioCaptureClient into mmdevapi.
parent
5662d85e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
122 additions
and
127 deletions
+122
-127
client.c
dlls/mmdevapi/client.c
+121
-0
mmdevdrv.c
dlls/winepulse.drv/mmdevdrv.c
+1
-127
No files found.
dlls/mmdevapi/client.c
View file @
cca12c50
...
...
@@ -48,6 +48,11 @@ void set_stream_volumes(struct audio_client *This)
WINE_UNIX_CALL
(
set_volumes
,
&
params
);
}
static
inline
struct
audio_client
*
impl_from_IAudioCaptureClient
(
IAudioCaptureClient
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
audio_client
,
IAudioCaptureClient_iface
);
}
static
inline
struct
audio_client
*
impl_from_IAudioClock
(
IAudioClock
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
audio_client
,
IAudioClock_iface
);
...
...
@@ -63,6 +68,122 @@ static inline struct audio_client *impl_from_IAudioStreamVolume(IAudioStreamVolu
return
CONTAINING_RECORD
(
iface
,
struct
audio_client
,
IAudioStreamVolume_iface
);
}
static
HRESULT
WINAPI
capture_QueryInterface
(
IAudioCaptureClient
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
struct
audio_client
*
This
=
impl_from_IAudioCaptureClient
(
iface
);
TRACE
(
"(%p)->(%s, %p)
\n
"
,
iface
,
debugstr_guid
(
riid
),
ppv
);
if
(
!
ppv
)
return
E_POINTER
;
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
IsEqualIID
(
riid
,
&
IID_IAudioCaptureClient
))
*
ppv
=
iface
;
else
if
(
IsEqualIID
(
riid
,
&
IID_IMarshal
))
{
return
IUnknown_QueryInterface
(
This
->
marshal
,
riid
,
ppv
);
}
else
{
*
ppv
=
NULL
;
return
E_NOINTERFACE
;
}
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
return
S_OK
;
}
static
ULONG
WINAPI
capture_AddRef
(
IAudioCaptureClient
*
iface
)
{
struct
audio_client
*
This
=
impl_from_IAudioCaptureClient
(
iface
);
return
IAudioClient3_AddRef
(
&
This
->
IAudioClient3_iface
);
}
static
ULONG
WINAPI
capture_Release
(
IAudioCaptureClient
*
iface
)
{
struct
audio_client
*
This
=
impl_from_IAudioCaptureClient
(
iface
);
return
IAudioClient3_Release
(
&
This
->
IAudioClient3_iface
);
}
static
HRESULT
WINAPI
capture_GetBuffer
(
IAudioCaptureClient
*
iface
,
BYTE
**
data
,
UINT32
*
frames
,
DWORD
*
flags
,
UINT64
*
devpos
,
UINT64
*
qpcpos
)
{
struct
audio_client
*
This
=
impl_from_IAudioCaptureClient
(
iface
);
struct
get_capture_buffer_params
params
;
TRACE
(
"(%p)->(%p, %p, %p, %p, %p)
\n
"
,
This
,
data
,
frames
,
flags
,
devpos
,
qpcpos
);
if
(
!
data
)
return
E_POINTER
;
*
data
=
NULL
;
if
(
!
frames
||
!
flags
)
return
E_POINTER
;
if
(
!
This
->
stream
)
return
AUDCLNT_E_NOT_INITIALIZED
;
params
.
stream
=
This
->
stream
;
params
.
data
=
data
;
params
.
frames
=
frames
;
params
.
flags
=
(
UINT
*
)
flags
;
params
.
devpos
=
devpos
;
params
.
qpcpos
=
qpcpos
;
WINE_UNIX_CALL
(
get_capture_buffer
,
&
params
);
return
params
.
result
;
}
static
HRESULT
WINAPI
capture_ReleaseBuffer
(
IAudioCaptureClient
*
iface
,
UINT32
done
)
{
struct
audio_client
*
This
=
impl_from_IAudioCaptureClient
(
iface
);
struct
release_capture_buffer_params
params
;
TRACE
(
"(%p)->(%u)
\n
"
,
This
,
done
);
if
(
!
This
->
stream
)
return
AUDCLNT_E_NOT_INITIALIZED
;
params
.
stream
=
This
->
stream
;
params
.
done
=
done
;
WINE_UNIX_CALL
(
release_capture_buffer
,
&
params
);
return
params
.
result
;
}
static
HRESULT
WINAPI
capture_GetNextPacketSize
(
IAudioCaptureClient
*
iface
,
UINT32
*
frames
)
{
struct
audio_client
*
This
=
impl_from_IAudioCaptureClient
(
iface
);
struct
get_next_packet_size_params
params
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
frames
);
if
(
!
frames
)
return
E_POINTER
;
if
(
!
This
->
stream
)
return
AUDCLNT_E_NOT_INITIALIZED
;
params
.
stream
=
This
->
stream
;
params
.
frames
=
frames
;
WINE_UNIX_CALL
(
get_next_packet_size
,
&
params
);
return
params
.
result
;
}
const
IAudioCaptureClientVtbl
AudioCaptureClient_Vtbl
=
{
capture_QueryInterface
,
capture_AddRef
,
capture_Release
,
capture_GetBuffer
,
capture_ReleaseBuffer
,
capture_GetNextPacketSize
};
static
HRESULT
WINAPI
clock_QueryInterface
(
IAudioClock
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
struct
audio_client
*
This
=
impl_from_IAudioClock
(
iface
);
...
...
dlls/winepulse.drv/mmdevdrv.c
View file @
cca12c50
...
...
@@ -126,7 +126,7 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved)
static
const
IAudioClient3Vtbl
AudioClient3_Vtbl
;
static
const
IAudioRenderClientVtbl
AudioRenderClient_Vtbl
;
static
const
IAudioCaptureClientVtbl
AudioCaptureClient_Vtbl
;
extern
const
IAudioCaptureClientVtbl
AudioCaptureClient_Vtbl
;
extern
const
IAudioSessionControl2Vtbl
AudioSessionControl2_Vtbl
;
extern
const
ISimpleAudioVolumeVtbl
SimpleAudioVolume_Vtbl
;
extern
const
IChannelAudioVolumeVtbl
ChannelAudioVolume_Vtbl
;
...
...
@@ -146,21 +146,6 @@ static inline ACImpl *impl_from_IAudioRenderClient(IAudioRenderClient *iface)
return
CONTAINING_RECORD
(
iface
,
ACImpl
,
IAudioRenderClient_iface
);
}
static
inline
ACImpl
*
impl_from_IAudioCaptureClient
(
IAudioCaptureClient
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
ACImpl
,
IAudioCaptureClient_iface
);
}
static
inline
ACImpl
*
impl_from_IAudioClock
(
IAudioClock
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
ACImpl
,
IAudioClock_iface
);
}
static
inline
ACImpl
*
impl_from_IAudioClock2
(
IAudioClock2
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
ACImpl
,
IAudioClock2_iface
);
}
static
void
pulse_call
(
enum
unix_funcs
code
,
void
*
params
)
{
NTSTATUS
status
;
...
...
@@ -1431,117 +1416,6 @@ static const IAudioRenderClientVtbl AudioRenderClient_Vtbl = {
AudioRenderClient_ReleaseBuffer
};
static
HRESULT
WINAPI
AudioCaptureClient_QueryInterface
(
IAudioCaptureClient
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
ACImpl
*
This
=
impl_from_IAudioCaptureClient
(
iface
);
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_IAudioCaptureClient
))
*
ppv
=
iface
;
if
(
*
ppv
)
{
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
return
S_OK
;
}
if
(
IsEqualIID
(
riid
,
&
IID_IMarshal
))
return
IUnknown_QueryInterface
(
This
->
marshal
,
riid
,
ppv
);
WARN
(
"Unknown interface %s
\n
"
,
debugstr_guid
(
riid
));
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
AudioCaptureClient_AddRef
(
IAudioCaptureClient
*
iface
)
{
ACImpl
*
This
=
impl_from_IAudioCaptureClient
(
iface
);
return
IAudioClient3_AddRef
(
&
This
->
IAudioClient3_iface
);
}
static
ULONG
WINAPI
AudioCaptureClient_Release
(
IAudioCaptureClient
*
iface
)
{
ACImpl
*
This
=
impl_from_IAudioCaptureClient
(
iface
);
return
IAudioClient3_Release
(
&
This
->
IAudioClient3_iface
);
}
static
HRESULT
WINAPI
AudioCaptureClient_GetBuffer
(
IAudioCaptureClient
*
iface
,
BYTE
**
data
,
UINT32
*
frames
,
DWORD
*
flags
,
UINT64
*
devpos
,
UINT64
*
qpcpos
)
{
ACImpl
*
This
=
impl_from_IAudioCaptureClient
(
iface
);
struct
get_capture_buffer_params
params
;
TRACE
(
"(%p)->(%p, %p, %p, %p, %p)
\n
"
,
This
,
data
,
frames
,
flags
,
devpos
,
qpcpos
);
if
(
!
data
)
return
E_POINTER
;
*
data
=
NULL
;
if
(
!
frames
||
!
flags
)
return
E_POINTER
;
if
(
!
This
->
stream
)
return
AUDCLNT_E_NOT_INITIALIZED
;
params
.
stream
=
This
->
stream
;
params
.
data
=
data
;
params
.
frames
=
frames
;
params
.
flags
=
(
UINT
*
)
flags
;
params
.
devpos
=
devpos
;
params
.
qpcpos
=
qpcpos
;
pulse_call
(
get_capture_buffer
,
&
params
);
return
params
.
result
;
}
static
HRESULT
WINAPI
AudioCaptureClient_ReleaseBuffer
(
IAudioCaptureClient
*
iface
,
UINT32
done
)
{
ACImpl
*
This
=
impl_from_IAudioCaptureClient
(
iface
);
struct
release_capture_buffer_params
params
;
TRACE
(
"(%p)->(%u)
\n
"
,
This
,
done
);
if
(
!
This
->
stream
)
return
AUDCLNT_E_NOT_INITIALIZED
;
params
.
stream
=
This
->
stream
;
params
.
done
=
done
;
pulse_call
(
release_capture_buffer
,
&
params
);
return
params
.
result
;
}
static
HRESULT
WINAPI
AudioCaptureClient_GetNextPacketSize
(
IAudioCaptureClient
*
iface
,
UINT32
*
frames
)
{
ACImpl
*
This
=
impl_from_IAudioCaptureClient
(
iface
);
struct
get_next_packet_size_params
params
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
frames
);
if
(
!
frames
)
return
E_POINTER
;
if
(
!
This
->
stream
)
return
AUDCLNT_E_NOT_INITIALIZED
;
params
.
stream
=
This
->
stream
;
params
.
frames
=
frames
;
pulse_call
(
get_next_packet_size
,
&
params
);
return
params
.
result
;
}
static
const
IAudioCaptureClientVtbl
AudioCaptureClient_Vtbl
=
{
AudioCaptureClient_QueryInterface
,
AudioCaptureClient_AddRef
,
AudioCaptureClient_Release
,
AudioCaptureClient_GetBuffer
,
AudioCaptureClient_ReleaseBuffer
,
AudioCaptureClient_GetNextPacketSize
};
static
AudioSessionWrapper
*
AudioSessionWrapper_Create
(
ACImpl
*
client
)
{
AudioSessionWrapper
*
ret
;
...
...
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