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
dd1a603a
Commit
dd1a603a
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: Implement GetPosition().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9d6fc061
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
3 deletions
+61
-3
player.c
dlls/mfplay/player.c
+37
-3
mfplay.c
dlls/mfplay/tests/mfplay.c
+24
-0
No files found.
dlls/mfplay/player.c
View file @
dd1a603a
...
...
@@ -904,9 +904,40 @@ static HRESULT WINAPI media_player_SetPosition(IMFPMediaPlayer *iface, REFGUID p
static
HRESULT
WINAPI
media_player_GetPosition
(
IMFPMediaPlayer
*
iface
,
REFGUID
postype
,
PROPVARIANT
*
position
)
{
FIXME
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
postype
),
position
);
struct
media_player
*
player
=
impl_from_IMFPMediaPlayer
(
iface
);
IMFPresentationClock
*
presentation_clock
;
IMFClock
*
clock
;
HRESULT
hr
;
return
E_NOTIMPL
;
TRACE
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
postype
),
position
);
if
(
!
position
)
return
E_POINTER
;
if
(
!
IsEqualGUID
(
postype
,
&
MFP_POSITIONTYPE_100NS
))
return
E_INVALIDARG
;
EnterCriticalSection
(
&
player
->
cs
);
if
(
player
->
state
==
MFP_MEDIAPLAYER_STATE_SHUTDOWN
)
hr
=
MF_E_SHUTDOWN
;
else
if
(
!
player
->
item
)
hr
=
MF_E_INVALIDREQUEST
;
else
{
if
(
SUCCEEDED
(
hr
=
IMFMediaSession_GetClock
(
player
->
session
,
&
clock
)))
{
if
(
SUCCEEDED
(
hr
=
IMFClock_QueryInterface
(
clock
,
&
IID_IMFPresentationClock
,
(
void
**
)
&
presentation_clock
)))
{
position
->
vt
=
VT_UI8
;
hr
=
IMFPresentationClock_GetTime
(
presentation_clock
,
(
MFTIME
*
)
&
position
->
uhVal
.
QuadPart
);
IMFPresentationClock_Release
(
presentation_clock
);
}
IMFClock_Release
(
clock
);
}
}
LeaveCriticalSection
(
&
player
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
media_player_GetDuration
(
IMFPMediaPlayer
*
iface
,
REFGUID
postype
,
PROPVARIANT
*
duration
)
...
...
@@ -916,9 +947,12 @@ static HRESULT WINAPI media_player_GetDuration(IMFPMediaPlayer *iface, REFGUID p
TRACE
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
postype
),
duration
);
if
(
!
postype
||
!
duration
)
if
(
!
duration
)
return
E_POINTER
;
if
(
!
IsEqualGUID
(
postype
,
&
MFP_POSITIONTYPE_100NS
))
return
E_INVALIDARG
;
EnterCriticalSection
(
&
player
->
cs
);
if
(
player
->
state
==
MFP_MEDIAPLAYER_STATE_SHUTDOWN
)
hr
=
MF_E_SHUTDOWN
;
...
...
dlls/mfplay/tests/mfplay.c
View file @
dd1a603a
...
...
@@ -227,6 +227,15 @@ todo_wine
hr
=
IMFPMediaPlayer_GetDuration
(
player
,
&
MFP_POSITIONTYPE_100NS
,
&
propvar
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFPMediaPlayer_GetPosition
(
player
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFPMediaPlayer_GetPosition
(
player
,
&
MFP_POSITIONTYPE_100NS
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFPMediaPlayer_GetPosition
(
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
);
...
...
@@ -371,9 +380,24 @@ static void test_duration(void)
hr
=
IMFPMediaPlayer_GetDuration
(
player
,
&
MFP_POSITIONTYPE_100NS
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFPMediaPlayer_GetDuration
(
player
,
&
IID_IUnknown
,
&
propvar
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFPMediaPlayer_GetDuration
(
player
,
&
MFP_POSITIONTYPE_100NS
,
&
propvar
);
ok
(
hr
==
MF_E_INVALIDREQUEST
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFPMediaPlayer_GetPosition
(
player
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFPMediaPlayer_GetPosition
(
player
,
&
MFP_POSITIONTYPE_100NS
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFPMediaPlayer_GetPosition
(
player
,
&
IID_IUnknown
,
&
propvar
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFPMediaPlayer_GetPosition
(
player
,
&
MFP_POSITIONTYPE_100NS
,
&
propvar
);
ok
(
hr
==
MF_E_INVALIDREQUEST
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMFPMediaPlayer_Release
(
player
);
}
...
...
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