Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
4f5913e0
Commit
4f5913e0
authored
May 16, 2023
by
Davide Beatrici
Committed by
Alexandre Julliard
May 16, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winepulse: Move AudioRenderClient into mmdevapi.
parent
cbbb88f2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
90 deletions
+94
-90
client.c
dlls/mmdevapi/client.c
+93
-0
mmdevdrv.c
dlls/winepulse.drv/mmdevdrv.c
+1
-90
No files found.
dlls/mmdevapi/client.c
View file @
4f5913e0
...
...
@@ -63,6 +63,11 @@ static inline struct audio_client *impl_from_IAudioClock2(IAudioClock2 *iface)
return
CONTAINING_RECORD
(
iface
,
struct
audio_client
,
IAudioClock2_iface
);
}
static
inline
struct
audio_client
*
impl_from_IAudioRenderClient
(
IAudioRenderClient
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
audio_client
,
IAudioRenderClient_iface
);
}
static
inline
struct
audio_client
*
impl_from_IAudioStreamVolume
(
IAudioStreamVolume
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
audio_client
,
IAudioStreamVolume_iface
);
...
...
@@ -336,6 +341,94 @@ const IAudioClock2Vtbl AudioClock2_Vtbl =
clock2_GetDevicePosition
};
static
HRESULT
WINAPI
render_QueryInterface
(
IAudioRenderClient
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
struct
audio_client
*
This
=
impl_from_IAudioRenderClient
(
iface
);
TRACE
(
"(%p)->(%s, %p)
\n
"
,
iface
,
debugstr_guid
(
riid
),
ppv
);
if
(
!
ppv
)
return
E_POINTER
;
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
IsEqualIID
(
riid
,
&
IID_IAudioRenderClient
))
*
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
render_AddRef
(
IAudioRenderClient
*
iface
)
{
struct
audio_client
*
This
=
impl_from_IAudioRenderClient
(
iface
);
return
IAudioClient3_AddRef
(
&
This
->
IAudioClient3_iface
);
}
static
ULONG
WINAPI
render_Release
(
IAudioRenderClient
*
iface
)
{
struct
audio_client
*
This
=
impl_from_IAudioRenderClient
(
iface
);
return
IAudioClient3_Release
(
&
This
->
IAudioClient3_iface
);
}
static
HRESULT
WINAPI
render_GetBuffer
(
IAudioRenderClient
*
iface
,
UINT32
frames
,
BYTE
**
data
)
{
struct
audio_client
*
This
=
impl_from_IAudioRenderClient
(
iface
);
struct
get_render_buffer_params
params
;
TRACE
(
"(%p)->(%u, %p)
\n
"
,
This
,
frames
,
data
);
if
(
!
data
)
return
E_POINTER
;
if
(
!
This
->
stream
)
return
AUDCLNT_E_NOT_INITIALIZED
;
*
data
=
NULL
;
params
.
stream
=
This
->
stream
;
params
.
frames
=
frames
;
params
.
data
=
data
;
WINE_UNIX_CALL
(
get_render_buffer
,
&
params
);
return
params
.
result
;
}
static
HRESULT
WINAPI
render_ReleaseBuffer
(
IAudioRenderClient
*
iface
,
UINT32
written_frames
,
DWORD
flags
)
{
struct
audio_client
*
This
=
impl_from_IAudioRenderClient
(
iface
);
struct
release_render_buffer_params
params
;
TRACE
(
"(%p)->(%u, %lx)
\n
"
,
This
,
written_frames
,
flags
);
if
(
!
This
->
stream
)
return
AUDCLNT_E_NOT_INITIALIZED
;
params
.
stream
=
This
->
stream
;
params
.
written_frames
=
written_frames
;
params
.
flags
=
flags
;
WINE_UNIX_CALL
(
release_render_buffer
,
&
params
);
return
params
.
result
;
}
const
IAudioRenderClientVtbl
AudioRenderClient_Vtbl
=
{
render_QueryInterface
,
render_AddRef
,
render_Release
,
render_GetBuffer
,
render_ReleaseBuffer
};
static
HRESULT
WINAPI
streamvolume_QueryInterface
(
IAudioStreamVolume
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
...
...
dlls/winepulse.drv/mmdevdrv.c
View file @
4f5913e0
...
...
@@ -125,7 +125,7 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved)
}
static
const
IAudioClient3Vtbl
AudioClient3_Vtbl
;
static
const
IAudioRenderClientVtbl
AudioRenderClient_Vtbl
;
extern
const
IAudioRenderClientVtbl
AudioRenderClient_Vtbl
;
extern
const
IAudioCaptureClientVtbl
AudioCaptureClient_Vtbl
;
extern
const
IAudioSessionControl2Vtbl
AudioSessionControl2_Vtbl
;
extern
const
ISimpleAudioVolumeVtbl
SimpleAudioVolume_Vtbl
;
...
...
@@ -141,11 +141,6 @@ static inline ACImpl *impl_from_IAudioClient3(IAudioClient3 *iface)
return
CONTAINING_RECORD
(
iface
,
ACImpl
,
IAudioClient3_iface
);
}
static
inline
ACImpl
*
impl_from_IAudioRenderClient
(
IAudioRenderClient
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
ACImpl
,
IAudioRenderClient_iface
);
}
static
void
pulse_call
(
enum
unix_funcs
code
,
void
*
params
)
{
NTSTATUS
status
;
...
...
@@ -1332,90 +1327,6 @@ static const IAudioClient3Vtbl AudioClient3_Vtbl =
AudioClient_InitializeSharedAudioStream
,
};
static
HRESULT
WINAPI
AudioRenderClient_QueryInterface
(
IAudioRenderClient
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
ACImpl
*
This
=
impl_from_IAudioRenderClient
(
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_IAudioRenderClient
))
*
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
AudioRenderClient_AddRef
(
IAudioRenderClient
*
iface
)
{
ACImpl
*
This
=
impl_from_IAudioRenderClient
(
iface
);
return
IAudioClient3_AddRef
(
&
This
->
IAudioClient3_iface
);
}
static
ULONG
WINAPI
AudioRenderClient_Release
(
IAudioRenderClient
*
iface
)
{
ACImpl
*
This
=
impl_from_IAudioRenderClient
(
iface
);
return
IAudioClient3_Release
(
&
This
->
IAudioClient3_iface
);
}
static
HRESULT
WINAPI
AudioRenderClient_GetBuffer
(
IAudioRenderClient
*
iface
,
UINT32
frames
,
BYTE
**
data
)
{
ACImpl
*
This
=
impl_from_IAudioRenderClient
(
iface
);
struct
get_render_buffer_params
params
;
TRACE
(
"(%p)->(%u, %p)
\n
"
,
This
,
frames
,
data
);
if
(
!
data
)
return
E_POINTER
;
if
(
!
This
->
stream
)
return
AUDCLNT_E_NOT_INITIALIZED
;
*
data
=
NULL
;
params
.
stream
=
This
->
stream
;
params
.
frames
=
frames
;
params
.
data
=
data
;
pulse_call
(
get_render_buffer
,
&
params
);
return
params
.
result
;
}
static
HRESULT
WINAPI
AudioRenderClient_ReleaseBuffer
(
IAudioRenderClient
*
iface
,
UINT32
written_frames
,
DWORD
flags
)
{
ACImpl
*
This
=
impl_from_IAudioRenderClient
(
iface
);
struct
release_render_buffer_params
params
;
TRACE
(
"(%p)->(%u, %lx)
\n
"
,
This
,
written_frames
,
flags
);
if
(
!
This
->
stream
)
return
AUDCLNT_E_NOT_INITIALIZED
;
params
.
stream
=
This
->
stream
;
params
.
written_frames
=
written_frames
;
params
.
flags
=
flags
;
pulse_call
(
release_render_buffer
,
&
params
);
return
params
.
result
;
}
static
const
IAudioRenderClientVtbl
AudioRenderClient_Vtbl
=
{
AudioRenderClient_QueryInterface
,
AudioRenderClient_AddRef
,
AudioRenderClient_Release
,
AudioRenderClient_GetBuffer
,
AudioRenderClient_ReleaseBuffer
};
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