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
9d6fc061
Commit
9d6fc061
authored
Oct 25, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplay: Partially implement GetDuration().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4f923996
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
3 deletions
+52
-3
player.c
dlls/mfplay/player.c
+19
-3
mfplay.c
dlls/mfplay/tests/mfplay.c
+33
-0
No files found.
dlls/mfplay/player.c
View file @
9d6fc061
...
...
@@ -909,11 +909,27 @@ static HRESULT WINAPI media_player_GetPosition(IMFPMediaPlayer *iface, REFGUID p
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
media_player_GetDuration
(
IMFPMediaPlayer
*
iface
,
REFGUID
postype
,
PROPVARIANT
*
posi
tion
)
static
HRESULT
WINAPI
media_player_GetDuration
(
IMFPMediaPlayer
*
iface
,
REFGUID
postype
,
PROPVARIANT
*
dura
tion
)
{
FIXME
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
postype
),
position
);
struct
media_player
*
player
=
impl_from_IMFPMediaPlayer
(
iface
);
HRESULT
hr
;
return
E_NOTIMPL
;
TRACE
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
postype
),
duration
);
if
(
!
postype
||
!
duration
)
return
E_POINTER
;
EnterCriticalSection
(
&
player
->
cs
);
if
(
player
->
state
==
MFP_MEDIAPLAYER_STATE_SHUTDOWN
)
hr
=
MF_E_SHUTDOWN
;
else
if
(
!
player
->
item
)
hr
=
MF_E_INVALIDREQUEST
;
else
/* FIXME: use start/stop markers for resulting duration */
hr
=
IMFPMediaItem_GetDuration
(
player
->
item
,
postype
,
duration
);
LeaveCriticalSection
(
&
player
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
media_player_SetRate
(
IMFPMediaPlayer
*
iface
,
float
rate
)
...
...
dlls/mfplay/tests/mfplay.c
View file @
9d6fc061
...
...
@@ -148,6 +148,7 @@ static void test_shutdown(void)
IMFPMediaPlayer
*
player
;
float
slowest
,
fastest
;
IMFPMediaItem
*
item
;
PROPVARIANT
propvar
;
COLORREF
color
;
HWND
window
;
DWORD
mode
;
...
...
@@ -217,6 +218,15 @@ todo_wine
hr
=
IMFPMediaPlayer_GetVideoWindow
(
player
,
&
window
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFPMediaPlayer_GetDuration
(
player
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFPMediaPlayer_GetDuration
(
player
,
&
MFP_POSITIONTYPE_100NS
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFPMediaPlayer_GetDuration
(
player
,
&
MFP_POSITIONTYPE_100NS
,
&
propvar
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFPMediaPlayer_Shutdown
(
player
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
...
...
@@ -345,10 +355,33 @@ todo_wine
DestroyWindow
(
window
);
}
static
void
test_duration
(
void
)
{
IMFPMediaPlayer
*
player
;
PROPVARIANT
propvar
;
HRESULT
hr
;
hr
=
MFPCreateMediaPlayer
(
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
player
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
/* No media item. */
hr
=
IMFPMediaPlayer_GetDuration
(
player
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFPMediaPlayer_GetDuration
(
player
,
&
MFP_POSITIONTYPE_100NS
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFPMediaPlayer_GetDuration
(
player
,
&
MFP_POSITIONTYPE_100NS
,
&
propvar
);
ok
(
hr
==
MF_E_INVALIDREQUEST
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMFPMediaPlayer_Release
(
player
);
}
START_TEST
(
mfplay
)
{
test_create_player
();
test_shutdown
();
test_media_item
();
test_video_control
();
test_duration
();
}
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