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
b8ba4909
Commit
b8ba4909
authored
Oct 03, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf: Keep media source state based on raised events.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9681e8ca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
session.c
dlls/mf/session.c
+37
-0
No files found.
dlls/mf/session.c
View file @
b8ba4909
...
@@ -81,10 +81,18 @@ struct media_stream
...
@@ -81,10 +81,18 @@ struct media_stream
IMFMediaStream
*
stream
;
IMFMediaStream
*
stream
;
};
};
enum
source_state
{
SOURCE_STATE_STOPPED
=
0
,
SOURCE_STATE_STARTED
,
SOURCE_STATE_PAUSED
,
};
struct
media_source
struct
media_source
{
{
struct
list
entry
;
struct
list
entry
;
IMFMediaSource
*
source
;
IMFMediaSource
*
source
;
enum
source_state
state
;
struct
list
streams
;
struct
list
streams
;
};
};
...
@@ -1075,10 +1083,25 @@ static HRESULT session_add_media_stream(struct media_source *source, IMFMediaStr
...
@@ -1075,10 +1083,25 @@ static HRESULT session_add_media_stream(struct media_source *source, IMFMediaStr
return
S_OK
;
return
S_OK
;
}
}
static
void
session_set_source_state
(
struct
media_session
*
session
,
IMFMediaSource
*
source
,
enum
source_state
state
)
{
struct
media_source
*
cur
;
LIST_FOR_EACH_ENTRY
(
cur
,
&
session
->
presentation
.
sources
,
struct
media_source
,
entry
)
{
if
(
source
==
cur
->
source
)
{
cur
->
state
=
state
;
break
;
}
}
}
static
HRESULT
WINAPI
session_events_callback_Invoke
(
IMFAsyncCallback
*
iface
,
IMFAsyncResult
*
result
)
static
HRESULT
WINAPI
session_events_callback_Invoke
(
IMFAsyncCallback
*
iface
,
IMFAsyncResult
*
result
)
{
{
struct
media_session
*
session
=
impl_from_events_callback_IMFAsyncCallback
(
iface
);
struct
media_session
*
session
=
impl_from_events_callback_IMFAsyncCallback
(
iface
);
IMFMediaEventGenerator
*
event_source
;
IMFMediaEventGenerator
*
event_source
;
enum
source_state
source_state
;
IMFMediaEvent
*
event
=
NULL
;
IMFMediaEvent
*
event
=
NULL
;
MediaEventType
event_type
;
MediaEventType
event_type
;
struct
media_source
*
cur
;
struct
media_source
*
cur
;
...
@@ -1111,6 +1134,20 @@ static HRESULT WINAPI session_events_callback_Invoke(IMFAsyncCallback *iface, IM
...
@@ -1111,6 +1134,20 @@ static HRESULT WINAPI session_events_callback_Invoke(IMFAsyncCallback *iface, IM
switch
(
event_type
)
switch
(
event_type
)
{
{
case
MESourceStarted
:
case
MESourcePaused
:
case
MESourceStopped
:
if
(
event_type
==
MESourceStarted
)
source_state
=
SOURCE_STATE_STARTED
;
else
if
(
event_type
==
MESourcePaused
)
source_state
=
SOURCE_STATE_PAUSED
;
else
source_state
=
SOURCE_STATE_STOPPED
;
EnterCriticalSection
(
&
session
->
cs
);
session_set_source_state
(
session
,
(
IMFMediaSource
*
)
event_source
,
source_state
);
LeaveCriticalSection
(
&
session
->
cs
);
break
;
case
MENewStream
:
case
MENewStream
:
stream
=
(
IMFMediaStream
*
)
value
.
punkVal
;
stream
=
(
IMFMediaStream
*
)
value
.
punkVal
;
...
...
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