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
a587a15b
Commit
a587a15b
authored
Jun 06, 2023
by
Davide Beatrici
Committed by
Alexandre Julliard
Jun 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winepulse: Move AudioClient's GetService into mmdevapi.
parent
aa9a69f8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
75 deletions
+80
-75
client.c
dlls/mmdevapi/client.c
+77
-0
mmdevdrv.c
dlls/winepulse.drv/mmdevdrv.c
+3
-75
No files found.
dlls/mmdevapi/client.c
View file @
a587a15b
...
@@ -36,6 +36,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(mmdevapi);
...
@@ -36,6 +36,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(mmdevapi);
extern
void
sessions_lock
(
void
)
DECLSPEC_HIDDEN
;
extern
void
sessions_lock
(
void
)
DECLSPEC_HIDDEN
;
extern
void
sessions_unlock
(
void
)
DECLSPEC_HIDDEN
;
extern
void
sessions_unlock
(
void
)
DECLSPEC_HIDDEN
;
extern
struct
audio_session_wrapper
*
session_wrapper_create
(
struct
audio_client
*
client
)
DECLSPEC_HIDDEN
;
void
set_stream_volumes
(
struct
audio_client
*
This
)
void
set_stream_volumes
(
struct
audio_client
*
This
)
{
{
struct
set_volumes_params
params
;
struct
set_volumes_params
params
;
...
@@ -194,6 +196,81 @@ const IAudioCaptureClientVtbl AudioCaptureClient_Vtbl =
...
@@ -194,6 +196,81 @@ const IAudioCaptureClientVtbl AudioCaptureClient_Vtbl =
capture_GetNextPacketSize
capture_GetNextPacketSize
};
};
HRESULT
WINAPI
client_GetService
(
IAudioClient3
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
struct
audio_client
*
This
=
impl_from_IAudioClient3
(
iface
);
HRESULT
hr
;
TRACE
(
"(%p)->(%s, %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppv
);
if
(
!
ppv
)
return
E_POINTER
;
*
ppv
=
NULL
;
sessions_lock
();
if
(
!
This
->
stream
)
{
hr
=
AUDCLNT_E_NOT_INITIALIZED
;
goto
exit
;
}
if
(
IsEqualIID
(
riid
,
&
IID_IAudioRenderClient
))
{
if
(
This
->
dataflow
!=
eRender
)
{
hr
=
AUDCLNT_E_WRONG_ENDPOINT_TYPE
;
goto
exit
;
}
IAudioRenderClient_AddRef
(
&
This
->
IAudioRenderClient_iface
);
*
ppv
=
&
This
->
IAudioRenderClient_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IAudioCaptureClient
))
{
if
(
This
->
dataflow
!=
eCapture
)
{
hr
=
AUDCLNT_E_WRONG_ENDPOINT_TYPE
;
goto
exit
;
}
IAudioCaptureClient_AddRef
(
&
This
->
IAudioCaptureClient_iface
);
*
ppv
=
&
This
->
IAudioCaptureClient_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IAudioClock
))
{
IAudioClock_AddRef
(
&
This
->
IAudioClock_iface
);
*
ppv
=
&
This
->
IAudioClock_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IAudioStreamVolume
))
{
IAudioStreamVolume_AddRef
(
&
This
->
IAudioStreamVolume_iface
);
*
ppv
=
&
This
->
IAudioStreamVolume_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IAudioSessionControl
)
||
IsEqualIID
(
riid
,
&
IID_IChannelAudioVolume
)
||
IsEqualIID
(
riid
,
&
IID_ISimpleAudioVolume
))
{
const
BOOLEAN
new_session
=
!
This
->
session_wrapper
;
if
(
new_session
)
{
This
->
session_wrapper
=
session_wrapper_create
(
This
);
if
(
!
This
->
session_wrapper
)
{
hr
=
E_OUTOFMEMORY
;
goto
exit
;
}
}
if
(
IsEqualIID
(
riid
,
&
IID_IAudioSessionControl
))
*
ppv
=
&
This
->
session_wrapper
->
IAudioSessionControl2_iface
;
else
if
(
IsEqualIID
(
riid
,
&
IID_IChannelAudioVolume
))
*
ppv
=
&
This
->
session_wrapper
->
IChannelAudioVolume_iface
;
else
if
(
IsEqualIID
(
riid
,
&
IID_ISimpleAudioVolume
))
*
ppv
=
&
This
->
session_wrapper
->
ISimpleAudioVolume_iface
;
if
(
!
new_session
)
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
}
else
{
FIXME
(
"stub %s
\n
"
,
debugstr_guid
(
riid
));
hr
=
E_NOINTERFACE
;
goto
exit
;
}
hr
=
S_OK
;
exit:
sessions_unlock
();
return
hr
;
}
HRESULT
WINAPI
client_IsOffloadCapable
(
IAudioClient3
*
iface
,
AUDIO_STREAM_CATEGORY
category
,
HRESULT
WINAPI
client_IsOffloadCapable
(
IAudioClient3
*
iface
,
AUDIO_STREAM_CATEGORY
category
,
BOOL
*
offload_capable
)
BOOL
*
offload_capable
)
{
{
...
...
dlls/winepulse.drv/mmdevdrv.c
View file @
a587a15b
...
@@ -1021,80 +1021,8 @@ static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient3 *iface,
...
@@ -1021,80 +1021,8 @@ static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient3 *iface,
return
params
.
result
;
return
params
.
result
;
}
}
static
HRESULT
WINAPI
AudioClient_GetService
(
IAudioClient3
*
iface
,
REFIID
riid
,
extern
HRESULT
WINAPI
client_GetService
(
IAudioClient3
*
iface
,
REFIID
riid
,
void
**
ppv
)
void
**
ppv
);
{
ACImpl
*
This
=
impl_from_IAudioClient3
(
iface
);
HRESULT
hr
;
TRACE
(
"(%p)->(%s, %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppv
);
if
(
!
ppv
)
return
E_POINTER
;
*
ppv
=
NULL
;
sessions_lock
();
if
(
!
This
->
stream
)
{
hr
=
AUDCLNT_E_NOT_INITIALIZED
;
goto
exit
;
}
if
(
IsEqualIID
(
riid
,
&
IID_IAudioRenderClient
))
{
if
(
This
->
dataflow
!=
eRender
)
{
hr
=
AUDCLNT_E_WRONG_ENDPOINT_TYPE
;
goto
exit
;
}
IAudioRenderClient_AddRef
(
&
This
->
IAudioRenderClient_iface
);
*
ppv
=
&
This
->
IAudioRenderClient_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IAudioCaptureClient
))
{
if
(
This
->
dataflow
!=
eCapture
)
{
hr
=
AUDCLNT_E_WRONG_ENDPOINT_TYPE
;
goto
exit
;
}
IAudioCaptureClient_AddRef
(
&
This
->
IAudioCaptureClient_iface
);
*
ppv
=
&
This
->
IAudioCaptureClient_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IAudioClock
))
{
IAudioClock_AddRef
(
&
This
->
IAudioClock_iface
);
*
ppv
=
&
This
->
IAudioClock_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IAudioStreamVolume
))
{
IAudioStreamVolume_AddRef
(
&
This
->
IAudioStreamVolume_iface
);
*
ppv
=
&
This
->
IAudioStreamVolume_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IAudioSessionControl
)
||
IsEqualIID
(
riid
,
&
IID_IChannelAudioVolume
)
||
IsEqualIID
(
riid
,
&
IID_ISimpleAudioVolume
))
{
const
BOOLEAN
new_session
=
!
This
->
session_wrapper
;
if
(
new_session
)
{
This
->
session_wrapper
=
session_wrapper_create
(
This
);
if
(
!
This
->
session_wrapper
)
{
hr
=
E_OUTOFMEMORY
;
goto
exit
;
}
}
if
(
IsEqualIID
(
riid
,
&
IID_IAudioSessionControl
))
*
ppv
=
&
This
->
session_wrapper
->
IAudioSessionControl2_iface
;
else
if
(
IsEqualIID
(
riid
,
&
IID_IChannelAudioVolume
))
*
ppv
=
&
This
->
session_wrapper
->
IChannelAudioVolume_iface
;
else
if
(
IsEqualIID
(
riid
,
&
IID_ISimpleAudioVolume
))
*
ppv
=
&
This
->
session_wrapper
->
ISimpleAudioVolume_iface
;
if
(
!
new_session
)
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
}
else
{
FIXME
(
"stub %s
\n
"
,
debugstr_guid
(
riid
));
hr
=
E_NOINTERFACE
;
goto
exit
;
}
hr
=
S_OK
;
exit:
sessions_unlock
();
return
hr
;
}
extern
HRESULT
WINAPI
client_IsOffloadCapable
(
IAudioClient3
*
iface
,
extern
HRESULT
WINAPI
client_IsOffloadCapable
(
IAudioClient3
*
iface
,
AUDIO_STREAM_CATEGORY
category
,
BOOL
*
offload_capable
);
AUDIO_STREAM_CATEGORY
category
,
BOOL
*
offload_capable
);
...
@@ -1133,7 +1061,7 @@ static const IAudioClient3Vtbl AudioClient3_Vtbl =
...
@@ -1133,7 +1061,7 @@ static const IAudioClient3Vtbl AudioClient3_Vtbl =
AudioClient_Stop
,
AudioClient_Stop
,
AudioClient_Reset
,
AudioClient_Reset
,
AudioClient_SetEventHandle
,
AudioClient_SetEventHandle
,
AudioC
lient_GetService
,
c
lient_GetService
,
client_IsOffloadCapable
,
client_IsOffloadCapable
,
client_SetClientProperties
,
client_SetClientProperties
,
client_GetBufferSizeLimits
,
client_GetBufferSizeLimits
,
...
...
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