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
ac09b5b4
Commit
ac09b5b4
authored
Apr 22, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf: Implement IMFAudioStreamVolume for SAR stream.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
983a6cc4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
86 additions
and
17 deletions
+86
-17
sar.c
dlls/mf/sar.c
+86
-17
No files found.
dlls/mf/sar.c
View file @
ac09b5b4
...
...
@@ -58,6 +58,7 @@ struct audio_renderer
IMFMediaType
*
current_media_type
;
IMMDevice
*
device
;
IAudioClient
*
audio_client
;
IAudioStreamVolume
*
stream_volume
;
HANDLE
buffer_ready_event
;
enum
stream_state
state
;
BOOL
is_shut_down
;
...
...
@@ -161,6 +162,16 @@ static ULONG WINAPI audio_renderer_sink_AddRef(IMFMediaSink *iface)
return
refcount
;
}
static
void
audio_renderer_release_audio_client
(
struct
audio_renderer
*
renderer
)
{
if
(
renderer
->
audio_client
)
IAudioClient_Release
(
renderer
->
audio_client
);
renderer
->
audio_client
=
NULL
;
if
(
renderer
->
stream_volume
)
IAudioStreamVolume_Release
(
renderer
->
stream_volume
);
renderer
->
stream_volume
=
NULL
;
}
static
ULONG
WINAPI
audio_renderer_sink_Release
(
IMFMediaSink
*
iface
)
{
struct
audio_renderer
*
renderer
=
impl_from_IMFMediaSink
(
iface
);
...
...
@@ -183,8 +194,7 @@ static ULONG WINAPI audio_renderer_sink_Release(IMFMediaSink *iface)
if
(
renderer
->
current_media_type
)
IMFMediaType_Release
(
renderer
->
current_media_type
);
CloseHandle
(
renderer
->
buffer_ready_event
);
if
(
renderer
->
audio_client
)
IAudioClient_Release
(
renderer
->
audio_client
);
audio_renderer_release_audio_client
(
renderer
);
DeleteCriticalSection
(
&
renderer
->
cs
);
heap_free
(
renderer
);
}
...
...
@@ -812,38 +822,94 @@ static ULONG WINAPI audio_renderer_stream_volume_Release(IMFAudioStreamVolume *i
static
HRESULT
WINAPI
audio_renderer_stream_volume_GetChannelCount
(
IMFAudioStreamVolume
*
iface
,
UINT32
*
count
)
{
FIXME
(
"%p, %p.
\n
"
,
iface
,
count
);
struct
audio_renderer
*
renderer
=
impl_from_IMFAudioStreamVolume
(
iface
);
HRESULT
hr
=
S_OK
;
return
E_NOTIMPL
;
TRACE
(
"%p, %p.
\n
"
,
iface
,
count
);
if
(
!
count
)
return
E_POINTER
;
*
count
=
0
;
EnterCriticalSection
(
&
renderer
->
cs
);
if
(
renderer
->
stream_volume
)
hr
=
IAudioStreamVolume_GetChannelCount
(
renderer
->
stream_volume
,
count
);
LeaveCriticalSection
(
&
renderer
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
audio_renderer_stream_volume_SetChannelVolume
(
IMFAudioStreamVolume
*
iface
,
UINT32
index
,
float
level
)
{
FIXME
(
"%p, %u, %f.
\n
"
,
iface
,
index
,
level
);
struct
audio_renderer
*
renderer
=
impl_from_IMFAudioStreamVolume
(
iface
);
HRESULT
hr
=
S_OK
;
return
E_NOTIMPL
;
TRACE
(
"%p, %u, %f.
\n
"
,
iface
,
index
,
level
);
EnterCriticalSection
(
&
renderer
->
cs
);
if
(
renderer
->
stream_volume
)
hr
=
IAudioStreamVolume_SetChannelVolume
(
renderer
->
stream_volume
,
index
,
level
);
LeaveCriticalSection
(
&
renderer
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
audio_renderer_stream_volume_GetChannelVolume
(
IMFAudioStreamVolume
*
iface
,
UINT32
index
,
float
*
level
)
{
FIXME
(
"%p, %u, %p.
\n
"
,
iface
,
index
,
level
);
struct
audio_renderer
*
renderer
=
impl_from_IMFAudioStreamVolume
(
iface
);
HRESULT
hr
=
S_OK
;
return
E_NOTIMPL
;
TRACE
(
"%p, %u, %p.
\n
"
,
iface
,
index
,
level
);
if
(
!
level
)
return
E_POINTER
;
*
level
=
0
.
0
f
;
EnterCriticalSection
(
&
renderer
->
cs
);
if
(
renderer
->
stream_volume
)
hr
=
IAudioStreamVolume_GetChannelVolume
(
renderer
->
stream_volume
,
index
,
level
);
LeaveCriticalSection
(
&
renderer
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
audio_renderer_stream_volume_SetAllVolumes
(
IMFAudioStreamVolume
*
iface
,
UINT32
count
,
const
float
*
volumes
)
{
FIXME
(
"%p, %u, %p.
\n
"
,
iface
,
count
,
volumes
);
struct
audio_renderer
*
renderer
=
impl_from_IMFAudioStreamVolume
(
iface
);
HRESULT
hr
=
S_OK
;
return
E_NOTIMPL
;
TRACE
(
"%p, %u, %p.
\n
"
,
iface
,
count
,
volumes
);
EnterCriticalSection
(
&
renderer
->
cs
);
if
(
renderer
->
stream_volume
)
hr
=
IAudioStreamVolume_SetAllVolumes
(
renderer
->
stream_volume
,
count
,
volumes
);
LeaveCriticalSection
(
&
renderer
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
audio_renderer_stream_volume_GetAllVolumes
(
IMFAudioStreamVolume
*
iface
,
UINT32
count
,
float
*
volumes
)
{
FIXME
(
"%p, %u, %p.
\n
"
,
iface
,
count
,
volumes
);
struct
audio_renderer
*
renderer
=
impl_from_IMFAudioStreamVolume
(
iface
);
HRESULT
hr
=
S_OK
;
return
E_NOTIMPL
;
TRACE
(
"%p, %u, %p.
\n
"
,
iface
,
count
,
volumes
);
if
(
!
volumes
)
return
E_POINTER
;
if
(
count
)
memset
(
volumes
,
0
,
sizeof
(
*
volumes
)
*
count
);
EnterCriticalSection
(
&
renderer
->
cs
);
if
(
renderer
->
stream_volume
)
hr
=
IAudioStreamVolume_GetAllVolumes
(
renderer
->
stream_volume
,
count
,
volumes
);
LeaveCriticalSection
(
&
renderer
->
cs
);
return
hr
;
}
static
const
IMFAudioStreamVolumeVtbl
audio_renderer_stream_volume_vtbl
=
...
...
@@ -1229,11 +1295,7 @@ static HRESULT audio_renderer_create_audio_client(struct audio_renderer *rendere
WAVEFORMATEX
*
wfx
;
HRESULT
hr
;
if
(
renderer
->
audio_client
)
{
IAudioClient_Release
(
renderer
->
audio_client
);
renderer
->
audio_client
=
NULL
;
}
audio_renderer_release_audio_client
(
renderer
);
hr
=
IMMDevice_Activate
(
renderer
->
device
,
&
IID_IAudioClient
,
CLSCTX_INPROC_SERVER
,
NULL
,
(
void
**
)
&
renderer
->
audio_client
);
...
...
@@ -1261,6 +1323,13 @@ static HRESULT audio_renderer_create_audio_client(struct audio_renderer *rendere
return
hr
;
}
if
(
FAILED
(
hr
=
IAudioClient_GetService
(
renderer
->
audio_client
,
&
IID_IAudioStreamVolume
,
(
void
**
)
&
renderer
->
stream_volume
)))
{
WARN
(
"Failed to get stream volume control, hr %#x.
\n
"
,
hr
);
return
hr
;
}
if
(
FAILED
(
hr
=
IAudioClient_SetEventHandle
(
renderer
->
audio_client
,
renderer
->
buffer_ready_event
)))
{
WARN
(
"Failed to set event handle, hr %#x.
\n
"
,
hr
);
...
...
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