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
7e765f96
Commit
7e765f96
authored
Jul 05, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf: Return clock rate as session rate.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
787ed808
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
11 deletions
+52
-11
session.c
dlls/mf/session.c
+13
-2
mf.c
dlls/mf/tests/mf.c
+39
-9
No files found.
dlls/mf/session.c
View file @
7e765f96
...
...
@@ -68,6 +68,7 @@ struct media_session
LONG
refcount
;
IMFMediaEventQueue
*
event_queue
;
IMFPresentationClock
*
clock
;
IMFRateControl
*
clock_rate_control
;
struct
list
topologies
;
enum
session_state
state
;
CRITICAL_SECTION
cs
;
...
...
@@ -315,6 +316,8 @@ static ULONG WINAPI mfsession_Release(IMFMediaSession *iface)
IMFMediaEventQueue_Release
(
session
->
event_queue
);
if
(
session
->
clock
)
IMFPresentationClock_Release
(
session
->
clock
);
if
(
session
->
clock_rate_control
)
IMFRateControl_Release
(
session
->
clock_rate_control
);
DeleteCriticalSection
(
&
session
->
cs
);
heap_free
(
session
);
}
...
...
@@ -723,9 +726,11 @@ static HRESULT WINAPI session_rate_control_SetRate(IMFRateControl *iface, BOOL t
static
HRESULT
WINAPI
session_rate_control_GetRate
(
IMFRateControl
*
iface
,
BOOL
*
thin
,
float
*
rate
)
{
FIXME
(
"%p, %p, %p.
\n
"
,
iface
,
thin
,
rat
e
);
struct
media_session
*
session
=
impl_session_from_IMFRateControl
(
ifac
e
);
return
E_NOTIMPL
;
TRACE
(
"%p, %p, %p.
\n
"
,
iface
,
thin
,
rate
);
return
IMFRateControl_GetRate
(
session
->
clock_rate_control
,
thin
,
rate
);
}
static
const
IMFRateControlVtbl
session_rate_control_vtbl
=
...
...
@@ -769,6 +774,12 @@ HRESULT WINAPI MFCreateMediaSession(IMFAttributes *config, IMFMediaSession **ses
if
(
FAILED
(
hr
=
MFCreatePresentationClock
(
&
object
->
clock
)))
goto
failed
;
if
(
FAILED
(
hr
=
IMFPresentationClock_QueryInterface
(
object
->
clock
,
&
IID_IMFRateControl
,
(
void
**
)
&
object
->
clock_rate_control
)))
{
goto
failed
;
}
*
session
=
&
object
->
IMFMediaSession_iface
;
return
S_OK
;
...
...
dlls/mf/tests/mf.c
View file @
7e765f96
...
...
@@ -951,14 +951,16 @@ static void test_session_events(IMFMediaSession *session)
static
void
test_media_session
(
void
)
{
IMFRateControl
*
rate_control
,
*
rate_control2
;
MFCLOCK_PROPERTIES
clock_props
;
IMFRateSupport
*
rate_support
;
IMFMediaSession
*
session
;
IMFRateControl
*
rc
,
*
rc2
;
IMFRateSupport
*
rs
;
IMFGetService
*
gs
;
IMFClock
*
clock
;
IUnknown
*
unk
;
HRESULT
hr
;
float
rate
;
BOOL
thin
;
hr
=
MFStartup
(
MF_VERSION
,
MFSTARTUP_FULL
);
ok
(
hr
==
S_OK
,
"Startup failure, hr %#x.
\n
"
,
hr
);
...
...
@@ -972,29 +974,57 @@ static void test_media_session(void)
hr
=
IMFMediaSession_QueryInterface
(
session
,
&
IID_IMFGetService
,
(
void
**
)
&
gs
);
ok
(
hr
==
S_OK
,
"Failed to get interface, hr %#x.
\n
"
,
hr
);
hr
=
IMFGetService_GetService
(
gs
,
&
MF_RATE_CONTROL_SERVICE
,
&
IID_IMFRateSupport
,
(
void
**
)
&
r
s
);
hr
=
IMFGetService_GetService
(
gs
,
&
MF_RATE_CONTROL_SERVICE
,
&
IID_IMFRateSupport
,
(
void
**
)
&
r
ate_support
);
ok
(
hr
==
S_OK
,
"Failed to get rate support interface, hr %#x.
\n
"
,
hr
);
hr
=
IMFGetService_GetService
(
gs
,
&
MF_RATE_CONTROL_SERVICE
,
&
IID_IMFRateControl
,
(
void
**
)
&
r
c
);
hr
=
IMFGetService_GetService
(
gs
,
&
MF_RATE_CONTROL_SERVICE
,
&
IID_IMFRateControl
,
(
void
**
)
&
r
ate_control
);
ok
(
hr
==
S_OK
,
"Failed to get rate control interface, hr %#x.
\n
"
,
hr
);
hr
=
IMFRateSupport_QueryInterface
(
r
s
,
&
IID_IMFMediaSession
,
(
void
**
)
&
unk
);
hr
=
IMFRateSupport_QueryInterface
(
r
ate_support
,
&
IID_IMFMediaSession
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"Failed to get session interface, hr %#x.
\n
"
,
hr
);
ok
(
unk
==
(
IUnknown
*
)
session
,
"Unexpected pointer.
\n
"
);
IUnknown_Release
(
unk
);
hr
=
IMFRateControl_GetRate
(
rate_control
,
NULL
,
NULL
);
ok
(
FAILED
(
hr
),
"Unexpected hr %#x.
\n
"
,
hr
);
rate
=
0
.
0
f
;
hr
=
IMFRateControl_GetRate
(
rate_control
,
NULL
,
&
rate
);
ok
(
hr
==
S_OK
,
"Failed to get playback rate, hr %#x.
\n
"
,
hr
);
ok
(
rate
==
1
.
0
f
,
"Unexpected rate %f.
\n
"
,
rate
);
hr
=
IMFRateControl_GetRate
(
rate_control
,
&
thin
,
NULL
);
ok
(
FAILED
(
hr
),
"Unexpected hr %#x.
\n
"
,
hr
);
thin
=
TRUE
;
rate
=
0
.
0
f
;
hr
=
IMFRateControl_GetRate
(
rate_control
,
&
thin
,
&
rate
);
ok
(
hr
==
S_OK
,
"Failed to get playback rate, hr %#x.
\n
"
,
hr
);
ok
(
!
thin
,
"Unexpected thinning.
\n
"
);
ok
(
rate
==
1
.
0
f
,
"Unexpected rate %f.
\n
"
,
rate
);
hr
=
IMFMediaSession_GetClock
(
session
,
&
clock
);
ok
(
hr
==
S_OK
,
"Failed to get clock, hr %#x.
\n
"
,
hr
);
hr
=
IMFClock_QueryInterface
(
clock
,
&
IID_IMFRateControl
,
(
void
**
)
&
r
c
2
);
hr
=
IMFClock_QueryInterface
(
clock
,
&
IID_IMFRateControl
,
(
void
**
)
&
r
ate_control
2
);
ok
(
hr
==
S_OK
,
"Failed to get rate control, hr %#x.
\n
"
,
hr
);
IMFRateControl_Release
(
rc2
);
rate
=
0
.
0
f
;
hr
=
IMFRateControl_GetRate
(
rate_control2
,
NULL
,
&
rate
);
ok
(
hr
==
S_OK
,
"Failed to get clock rate, hr %#x.
\n
"
,
hr
);
ok
(
rate
==
1
.
0
f
,
"Unexpected rate %f.
\n
"
,
rate
);
hr
=
IMFRateControl_SetRate
(
rate_control
,
FALSE
,
1
.
5
f
);
todo_wine
ok
(
hr
==
S_OK
,
"Failed to set rate, hr %#x.
\n
"
,
hr
);
IMFRateControl_Release
(
rate_control2
);
hr
=
IMFClock_GetProperties
(
clock
,
&
clock_props
);
ok
(
hr
==
MF_E_CLOCK_NO_TIME_SOURCE
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMFRateControl_Release
(
r
c
);
IMFRateSupport_Release
(
r
s
);
IMFRateControl_Release
(
r
ate_control
);
IMFRateSupport_Release
(
r
ate_support
);
IMFGetService_Release
(
gs
);
...
...
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