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
e9cc1d58
Commit
e9cc1d58
authored
Jun 02, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfmediaengine: Send "volumechange" event on volume change.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
daa11958
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
6 deletions
+26
-6
main.c
dlls/mfmediaengine/main.c
+26
-4
mfmediaengine.c
dlls/mfmediaengine/tests/mfmediaengine.c
+0
-2
No files found.
dlls/mfmediaengine/main.c
View file @
e9cc1d58
...
...
@@ -79,6 +79,7 @@ struct media_engine
unsigned
int
flags
;
double
playback_rate
;
double
default_playback_rate
;
double
volume
;
IMFMediaSession
*
session
;
CRITICAL_SECTION
cs
;
};
...
...
@@ -577,16 +578,36 @@ static HRESULT WINAPI media_engine_SetMuted(IMFMediaEngine *iface, BOOL muted)
static
double
WINAPI
media_engine_GetVolume
(
IMFMediaEngine
*
iface
)
{
FIXME
(
"(%p): stub.
\n
"
,
iface
);
struct
media_engine
*
engine
=
impl_from_IMFMediaEngine
(
iface
);
double
volume
;
return
0
.
0
;
TRACE
(
"%p.
\n
"
,
iface
);
EnterCriticalSection
(
&
engine
->
cs
);
volume
=
engine
->
volume
;
LeaveCriticalSection
(
&
engine
->
cs
);
return
volume
;
}
static
HRESULT
WINAPI
media_engine_SetVolume
(
IMFMediaEngine
*
iface
,
double
volume
)
{
FIXME
(
"(%p, %f): stub.
\n
"
,
iface
,
volume
);
struct
media_engine
*
engine
=
impl_from_IMFMediaEngine
(
iface
);
HRESULT
hr
=
S_OK
;
return
E_NOTIMPL
;
TRACE
(
"%p, %f.
\n
"
,
iface
,
volume
);
EnterCriticalSection
(
&
engine
->
cs
);
if
(
engine
->
flags
&
FLAGS_ENGINE_SHUT_DOWN
)
hr
=
MF_E_SHUTDOWN
;
else
if
(
volume
!=
engine
->
volume
)
{
engine
->
volume
=
volume
;
IMFMediaEngineNotify_EventNotify
(
engine
->
callback
,
MF_MEDIA_ENGINE_EVENT_VOLUMECHANGE
,
0
,
0
);
}
LeaveCriticalSection
(
&
engine
->
cs
);
return
hr
;
}
static
BOOL
WINAPI
media_engine_HasVideo
(
IMFMediaEngine
*
iface
)
...
...
@@ -737,6 +758,7 @@ static HRESULT init_media_engine(DWORD flags, IMFAttributes *attributes, struct
engine
->
flags
=
(
flags
&
MF_MEDIA_ENGINE_CREATEFLAGS_MASK
)
|
FLAGS_ENGINE_PAUSED
;
engine
->
default_playback_rate
=
1
.
0
;
engine
->
playback_rate
=
1
.
0
;
engine
->
volume
=
1
.
0
;
InitializeCriticalSection
(
&
engine
->
cs
);
hr
=
IMFAttributes_GetUnknown
(
attributes
,
&
MF_MEDIA_ENGINE_CALLBACK
,
&
IID_IMFMediaEngineNotify
,
...
...
dlls/mfmediaengine/tests/mfmediaengine.c
View file @
e9cc1d58
...
...
@@ -364,11 +364,9 @@ todo_wine
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
val
=
IMFMediaEngine_GetVolume
(
media_engine
);
todo_wine
ok
(
val
==
1
.
0
,
"Unexpected value %f.
\n
"
,
val
);
hr
=
IMFMediaEngine_SetVolume
(
media_engine
,
2
.
0
);
todo_wine
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
state
=
IMFMediaEngine_HasVideo
(
media_engine
);
...
...
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