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
92d6a8bf
Commit
92d6a8bf
authored
Mar 18, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf: Set presentation clock for all node types.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
69885afb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
3 deletions
+30
-3
session.c
dlls/mf/session.c
+30
-3
No files found.
dlls/mf/session.c
View file @
92d6a8bf
...
...
@@ -164,7 +164,7 @@ struct topo_node
enum
presentation_flags
{
SESSION_FLAG_SOURCES_SUBSCRIBED
=
0x1
,
SESSION_FLAG_
SINKS_SUBSCRIBED
=
0x2
,
SESSION_FLAG_
PRESENTATION_CLOCK_SET
=
0x2
,
SESSION_FLAG_FINALIZE_SINKS
=
0x4
,
};
...
...
@@ -1911,9 +1911,21 @@ static enum object_state session_get_object_state_for_event(MediaEventType event
}
}
static
void
session_set_consumed_clock
(
IUnknown
*
object
,
IMFPresentationClock
*
clock
)
{
IMFClockConsumer
*
consumer
;
if
(
SUCCEEDED
(
IUnknown_QueryInterface
(
object
,
&
IID_IMFClockConsumer
,
(
void
**
)
&
consumer
)))
{
IMFClockConsumer_SetPresentationClock
(
consumer
,
clock
);
IMFClockConsumer_Release
(
consumer
);
}
}
static
HRESULT
session_start_clock
(
struct
media_session
*
session
)
{
IMFPresentationTimeSource
*
time_source
=
NULL
;
struct
media_source
*
source
;
LONGLONG
start_offset
=
0
;
struct
media_sink
*
sink
;
struct
topo_node
*
node
;
...
...
@@ -1925,8 +1937,9 @@ static HRESULT session_start_clock(struct media_session *session)
IMFTransform_ProcessMessage
(
node
->
object
.
transform
,
MFT_MESSAGE_NOTIFY_START_OF_STREAM
,
0
);
}
if
(
!
(
session
->
presentation
.
flags
&
SESSION_FLAG_
SINKS_SUBSCRIBED
))
if
(
!
(
session
->
presentation
.
flags
&
SESSION_FLAG_
PRESENTATION_CLOCK_SET
))
{
/* Attempt to get time source from the sinks. */
LIST_FOR_EACH_ENTRY
(
sink
,
&
session
->
presentation
.
sinks
,
struct
media_sink
,
entry
)
{
if
(
SUCCEEDED
(
IMFMediaSink_QueryInterface
(
sink
->
sink
,
&
IID_IMFPresentationTimeSource
,
...
...
@@ -1957,6 +1970,12 @@ static HRESULT session_start_clock(struct media_session *session)
}
}
/* Set clock for all topology nodes. */
LIST_FOR_EACH_ENTRY
(
source
,
&
session
->
presentation
.
sources
,
struct
media_source
,
entry
)
{
session_set_consumed_clock
((
IUnknown
*
)
source
->
source
,
session
->
clock
);
}
LIST_FOR_EACH_ENTRY
(
sink
,
&
session
->
presentation
.
sinks
,
struct
media_sink
,
entry
)
{
if
(
sink
->
event_generator
&&
FAILED
(
hr
=
IMFMediaEventGenerator_BeginGetEvent
(
sink
->
event_generator
,
...
...
@@ -1969,7 +1988,15 @@ static HRESULT session_start_clock(struct media_session *session)
WARN
(
"Failed to set presentation clock for the sink, hr %#x.
\n
"
,
hr
);
}
session
->
presentation
.
flags
|=
SESSION_FLAG_SINKS_SUBSCRIBED
;
LIST_FOR_EACH_ENTRY
(
node
,
&
session
->
presentation
.
nodes
,
struct
topo_node
,
entry
)
{
if
(
node
->
type
!=
MF_TOPOLOGY_TRANSFORM_NODE
)
continue
;
session_set_consumed_clock
(
node
->
object
.
object
,
session
->
clock
);
}
session
->
presentation
.
flags
|=
SESSION_FLAG_PRESENTATION_CLOCK_SET
;
}
if
(
IsEqualGUID
(
&
session
->
presentation
.
time_format
,
&
GUID_NULL
))
...
...
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