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
41af1d1e
Commit
41af1d1e
authored
May 29, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfmediaengine: Send "play" event on Play().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f465187f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
6 deletions
+68
-6
main.c
dlls/mfmediaengine/main.c
+36
-5
mfmediaengine.c
dlls/mfmediaengine/tests/mfmediaengine.c
+32
-1
No files found.
dlls/mfmediaengine/main.c
View file @
41af1d1e
...
...
@@ -61,6 +61,8 @@ enum media_engine_flags
FLAGS_ENGINE_SHUT_DOWN
=
0x20
,
FLAGS_ENGINE_AUTO_PLAY
=
0x40
,
FLAGS_ENGINE_LOOP
=
0x80
,
FLAGS_ENGINE_PAUSED
=
0x100
,
FLAGS_ENGINE_WAITING
=
0x200
,
};
struct
media_engine
...
...
@@ -328,9 +330,16 @@ static double WINAPI media_engine_GetDuration(IMFMediaEngine *iface)
static
BOOL
WINAPI
media_engine_IsPaused
(
IMFMediaEngine
*
iface
)
{
FIXME
(
"(%p): stub.
\n
"
,
iface
);
struct
media_engine
*
engine
=
impl_from_IMFMediaEngine
(
iface
);
BOOL
value
;
return
FALSE
;
TRACE
(
"%p.
\n
"
,
iface
);
EnterCriticalSection
(
&
engine
->
cs
);
value
=
!!
(
engine
->
flags
&
FLAGS_ENGINE_PAUSED
);
LeaveCriticalSection
(
&
engine
->
cs
);
return
value
;
}
static
double
WINAPI
media_engine_GetDefaultPlaybackRate
(
IMFMediaEngine
*
iface
)
...
...
@@ -438,9 +447,31 @@ static HRESULT WINAPI media_engine_SetLoop(IMFMediaEngine *iface, BOOL loop)
static
HRESULT
WINAPI
media_engine_Play
(
IMFMediaEngine
*
iface
)
{
FIXME
(
"(%p): stub.
\n
"
,
iface
);
struct
media_engine
*
engine
=
impl_from_IMFMediaEngine
(
iface
);
PROPVARIANT
var
;
return
E_NOTIMPL
;
TRACE
(
"%p.
\n
"
,
iface
);
EnterCriticalSection
(
&
engine
->
cs
);
IMFMediaEngineNotify_EventNotify
(
engine
->
callback
,
MF_MEDIA_ENGINE_EVENT_PURGEQUEUEDEVENTS
,
0
,
0
);
if
(
!
(
engine
->
flags
&
FLAGS_ENGINE_WAITING
))
{
engine
->
flags
&=
~
FLAGS_ENGINE_PAUSED
;
IMFMediaEngineNotify_EventNotify
(
engine
->
callback
,
MF_MEDIA_ENGINE_EVENT_PLAY
,
0
,
0
);
var
.
vt
=
VT_EMPTY
;
IMFMediaSession_Start
(
engine
->
session
,
&
GUID_NULL
,
&
var
);
engine
->
flags
|=
FLAGS_ENGINE_WAITING
;
}
IMFMediaEngineNotify_EventNotify
(
engine
->
callback
,
MF_MEDIA_ENGINE_EVENT_WAITING
,
0
,
0
);
LeaveCriticalSection
(
&
engine
->
cs
);
return
S_OK
;
}
static
HRESULT
WINAPI
media_engine_Pause
(
IMFMediaEngine
*
iface
)
...
...
@@ -623,7 +654,7 @@ static HRESULT init_media_engine(DWORD flags, IMFAttributes *attributes, struct
engine
->
IMFMediaEngine_iface
.
lpVtbl
=
&
media_engine_vtbl
;
engine
->
session_events
.
lpVtbl
=
&
media_engine_session_events_vtbl
;
engine
->
refcount
=
1
;
engine
->
flags
=
flags
&
MF_MEDIA_ENGINE_CREATEFLAGS_MASK
;
engine
->
flags
=
(
flags
&
MF_MEDIA_ENGINE_CREATEFLAGS_MASK
)
|
FLAGS_ENGINE_PAUSED
;
InitializeCriticalSection
(
&
engine
->
cs
);
hr
=
IMFAttributes_GetUnknown
(
attributes
,
&
MF_MEDIA_ENGINE_CALLBACK
,
&
IID_IMFMediaEngineNotify
,
...
...
dlls/mfmediaengine/tests/mfmediaengine.c
View file @
41af1d1e
...
...
@@ -307,7 +307,6 @@ todo_wine
ok
(
val
==
0
.
0
,
"Unexpected time %f.
\n
"
,
val
);
state
=
IMFMediaEngine_IsPaused
(
media_engine
);
todo_wine
ok
(
!!
state
,
"Unexpected state %d.
\n
"
,
state
);
val
=
IMFMediaEngine_GetDefaultPlaybackRate
(
media_engine
);
...
...
@@ -393,6 +392,37 @@ todo_wine
IMFMediaEngine_Release
(
media_engine
);
}
static
void
test_Play
(
void
)
{
struct
media_engine_notify
notify_impl
=
{{
&
media_engine_notify_vtbl
},
1
};
IMFMediaEngineNotify
*
callback
=
&
notify_impl
.
IMFMediaEngineNotify_iface
;
IMFMediaEngine
*
media_engine
;
HRESULT
hr
;
BOOL
ret
;
media_engine
=
create_media_engine
(
callback
);
ret
=
IMFMediaEngine_IsPaused
(
media_engine
);
ok
(
ret
,
"Unexpected state %d.
\n
"
,
ret
);
hr
=
IMFMediaEngine_Play
(
media_engine
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ret
=
IMFMediaEngine_IsPaused
(
media_engine
);
ok
(
!
ret
,
"Unexpected state %d.
\n
"
,
ret
);
hr
=
IMFMediaEngine_Play
(
media_engine
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaEngine_Shutdown
(
media_engine
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ret
=
IMFMediaEngine_IsPaused
(
media_engine
);
ok
(
!
ret
,
"Unexpected state %d.
\n
"
,
ret
);
IMFMediaEngine_Release
(
media_engine
);
}
START_TEST
(
mfmediaengine
)
{
HRESULT
hr
;
...
...
@@ -416,6 +446,7 @@ START_TEST(mfmediaengine)
test_factory
();
test_CreateInstance
();
test_Shutdown
();
test_Play
();
IMFMediaEngineClassFactory_Release
(
factory
);
...
...
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