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
43a88a73
Commit
43a88a73
authored
Mar 17, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf: Forward sink invalidation events to application.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bdd9af2c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
1 deletion
+51
-1
session.c
dlls/mf/session.c
+51
-1
No files found.
dlls/mf/session.c
View file @
43a88a73
...
...
@@ -2492,6 +2492,38 @@ static void session_deliver_sample(struct media_session *session, IMFMediaStream
IMFTopologyNode_Release
(
downstream_node
);
}
static
void
session_sink_invalidated
(
struct
media_session
*
session
,
IMFMediaEvent
*
event
,
IMFStreamSink
*
sink
)
{
struct
topo_node
*
node
,
*
sink_node
=
NULL
;
HRESULT
hr
;
LIST_FOR_EACH_ENTRY
(
node
,
&
session
->
presentation
.
nodes
,
struct
topo_node
,
entry
)
{
if
(
node
->
type
==
MF_TOPOLOGY_OUTPUT_NODE
&&
node
->
object
.
sink_stream
==
sink
)
{
sink_node
=
node
;
break
;
}
}
if
(
!
sink_node
)
return
;
if
(
!
event
)
{
if
(
FAILED
(
hr
=
MFCreateMediaEvent
(
MESinkInvalidated
,
&
GUID_NULL
,
S_OK
,
NULL
,
&
event
)))
WARN
(
"Failed to create event, hr %#x.
\n
"
,
hr
);
}
if
(
!
event
)
return
;
IMFMediaEvent_SetUINT64
(
event
,
&
MF_EVENT_OUTPUT_NODE
,
sink_node
->
node_id
);
IMFMediaEventQueue_QueueEvent
(
session
->
event_queue
,
event
);
session_set_topo_status
(
session
,
S_OK
,
MF_TOPOSTATUS_ENDED
);
}
static
HRESULT
WINAPI
session_events_callback_Invoke
(
IMFAsyncCallback
*
iface
,
IMFAsyncResult
*
result
)
{
struct
media_session
*
session
=
impl_from_events_callback_IMFAsyncCallback
(
iface
);
...
...
@@ -2573,13 +2605,31 @@ static HRESULT WINAPI session_events_callback_Invoke(IMFAsyncCallback *iface, IM
EnterCriticalSection
(
&
session
->
cs
);
session_request_sample
(
session
,
(
IMFStreamSink
*
)
event_source
);
LeaveCriticalSection
(
&
session
->
cs
);
break
;
break
;
case
MEMediaSample
:
EnterCriticalSection
(
&
session
->
cs
);
session_deliver_sample
(
session
,
(
IMFMediaStream
*
)
event_source
,
&
value
);
LeaveCriticalSection
(
&
session
->
cs
);
break
;
case
MEAudioSessionDeviceRemoved
:
case
MEAudioSessionDisconnected
:
case
MEAudioSessionExclusiveModeOverride
:
case
MEAudioSessionFormatChanged
:
case
MEAudioSessionServerShutdown
:
IMFMediaEventQueue_QueueEvent
(
session
->
event_queue
,
event
);
/* fallthrough */
case
MESinkInvalidated
:
EnterCriticalSection
(
&
session
->
cs
);
session_sink_invalidated
(
session
,
event_type
==
MESinkInvalidated
?
event
:
NULL
,
(
IMFStreamSink
*
)
event_source
);
LeaveCriticalSection
(
&
session
->
cs
);
break
;
default:
;
}
...
...
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