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
2dba94b2
Commit
2dba94b2
authored
May 30, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf: Maintain sample grabber sink state.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
828ac988
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
8 deletions
+63
-8
samplegrabber.c
dlls/mf/samplegrabber.c
+60
-8
mfidl.idl
include/mfidl.idl
+3
-0
No files found.
dlls/mf/samplegrabber.c
View file @
2dba94b2
...
@@ -28,6 +28,12 @@
...
@@ -28,6 +28,12 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
mfplat
);
WINE_DEFAULT_DEBUG_CHANNEL
(
mfplat
);
enum
sink_state
{
SINK_STATE_STOPPED
=
0
,
SINK_STATE_RUNNING
,
};
struct
sample_grabber
;
struct
sample_grabber
;
struct
sample_grabber_stream
struct
sample_grabber_stream
...
@@ -51,6 +57,7 @@ struct sample_grabber
...
@@ -51,6 +57,7 @@ struct sample_grabber
struct
sample_grabber_stream
*
stream
;
struct
sample_grabber_stream
*
stream
;
IMFMediaEventQueue
*
event_queue
;
IMFMediaEventQueue
*
event_queue
;
IMFPresentationClock
*
clock
;
IMFPresentationClock
*
clock
;
enum
sink_state
state
;
CRITICAL_SECTION
cs
;
CRITICAL_SECTION
cs
;
};
};
...
@@ -685,32 +692,77 @@ static ULONG WINAPI sample_grabber_clock_sink_Release(IMFClockStateSink *iface)
...
@@ -685,32 +692,77 @@ static ULONG WINAPI sample_grabber_clock_sink_Release(IMFClockStateSink *iface)
return
IMFMediaSink_Release
(
&
grabber
->
IMFMediaSink_iface
);
return
IMFMediaSink_Release
(
&
grabber
->
IMFMediaSink_iface
);
}
}
static
void
sample_grabber_set_state
(
struct
sample_grabber
*
grabber
,
enum
sink_state
state
)
{
static
const
DWORD
events
[]
=
{
MEStreamSinkStopped
,
/* SINK_STATE_STOPPED */
MEStreamSinkStarted
,
/* SINK_STATE_RUNNING */
};
BOOL
set_state
=
FALSE
;
EnterCriticalSection
(
&
grabber
->
cs
);
switch
(
grabber
->
state
)
{
case
SINK_STATE_STOPPED
:
set_state
=
state
==
SINK_STATE_RUNNING
;
break
;
case
SINK_STATE_RUNNING
:
set_state
=
state
==
SINK_STATE_STOPPED
;
break
;
default:
;
}
if
(
set_state
)
{
grabber
->
state
=
state
;
if
(
grabber
->
stream
)
IMFStreamSink_QueueEvent
(
&
grabber
->
stream
->
IMFStreamSink_iface
,
events
[
state
],
&
GUID_NULL
,
S_OK
,
NULL
);
}
LeaveCriticalSection
(
&
grabber
->
cs
);
}
static
HRESULT
WINAPI
sample_grabber_clock_sink_OnClockStart
(
IMFClockStateSink
*
iface
,
MFTIME
systime
,
LONGLONG
offset
)
static
HRESULT
WINAPI
sample_grabber_clock_sink_OnClockStart
(
IMFClockStateSink
*
iface
,
MFTIME
systime
,
LONGLONG
offset
)
{
{
FIXME
(
"%p, %s, %s.
\n
"
,
iface
,
wine_dbgstr_longlong
(
systime
),
wine_dbgstr_longlong
(
offset
)
);
struct
sample_grabber
*
grabber
=
impl_from_IMFClockStateSink
(
iface
);
return
E_NOTIMPL
;
TRACE
(
"%p, %s, %s.
\n
"
,
iface
,
wine_dbgstr_longlong
(
systime
),
wine_dbgstr_longlong
(
offset
));
sample_grabber_set_state
(
grabber
,
SINK_STATE_RUNNING
);
return
S_OK
;
}
}
static
HRESULT
WINAPI
sample_grabber_clock_sink_OnClockStop
(
IMFClockStateSink
*
iface
,
MFTIME
systime
)
static
HRESULT
WINAPI
sample_grabber_clock_sink_OnClockStop
(
IMFClockStateSink
*
iface
,
MFTIME
systime
)
{
{
FIXME
(
"%p, %s.
\n
"
,
iface
,
wine_dbgstr_longlong
(
systime
)
);
struct
sample_grabber
*
grabber
=
impl_from_IMFClockStateSink
(
iface
);
return
E_NOTIMPL
;
TRACE
(
"%p, %s.
\n
"
,
iface
,
wine_dbgstr_longlong
(
systime
));
sample_grabber_set_state
(
grabber
,
SINK_STATE_STOPPED
);
return
S_OK
;
}
}
static
HRESULT
WINAPI
sample_grabber_clock_sink_OnClockPause
(
IMFClockStateSink
*
iface
,
MFTIME
systime
)
static
HRESULT
WINAPI
sample_grabber_clock_sink_OnClockPause
(
IMFClockStateSink
*
iface
,
MFTIME
systime
)
{
{
FIXM
E
(
"%p, %s.
\n
"
,
iface
,
wine_dbgstr_longlong
(
systime
));
TRAC
E
(
"%p, %s.
\n
"
,
iface
,
wine_dbgstr_longlong
(
systime
));
return
E_NOTIMPL
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
sample_grabber_clock_sink_OnClockRestart
(
IMFClockStateSink
*
iface
,
MFTIME
systime
)
static
HRESULT
WINAPI
sample_grabber_clock_sink_OnClockRestart
(
IMFClockStateSink
*
iface
,
MFTIME
systime
)
{
{
FIXME
(
"%p, %s.
\n
"
,
iface
,
wine_dbgstr_longlong
(
systime
)
);
struct
sample_grabber
*
grabber
=
impl_from_IMFClockStateSink
(
iface
);
return
E_NOTIMPL
;
TRACE
(
"%p, %s.
\n
"
,
iface
,
wine_dbgstr_longlong
(
systime
));
sample_grabber_set_state
(
grabber
,
SINK_STATE_RUNNING
);
return
S_OK
;
}
}
static
HRESULT
WINAPI
sample_grabber_clock_sink_OnClockSetRate
(
IMFClockStateSink
*
iface
,
MFTIME
systime
,
float
rate
)
static
HRESULT
WINAPI
sample_grabber_clock_sink_OnClockSetRate
(
IMFClockStateSink
*
iface
,
MFTIME
systime
,
float
rate
)
...
...
include/mfidl.idl
View file @
2dba94b2
...
@@ -820,3 +820,6 @@ cpp_quote("EXTERN_GUID(MF_TOPOLOGY_START_TIME_ON_PRESENTATION_SWITCH, 0xc8cc113f
...
@@ -820,3 +820,6 @@ cpp_quote("EXTERN_GUID(MF_TOPOLOGY_START_TIME_ON_PRESENTATION_SWITCH, 0xc8cc113f
cpp_quote
(
"EXTERN_GUID(MF_TOPOLOGY_STATIC_PLAYBACK_OPTIMIZATIONS, 0xb86cac42, 0x41a6, 0x4b79, 0x89, 0x7a, 0x1a, 0xb0, 0xe5, 0x2b, 0x4a, 0x1b);"
)
cpp_quote
(
"EXTERN_GUID(MF_TOPOLOGY_STATIC_PLAYBACK_OPTIMIZATIONS, 0xb86cac42, 0x41a6, 0x4b79, 0x89, 0x7a, 0x1a, 0xb0, 0xe5, 0x2b, 0x4a, 0x1b);"
)
cpp_quote
(
"EXTERN_GUID(MF_RATE_CONTROL_SERVICE, 0x866fa297, 0xb802, 0x4bf8, 0x9d, 0xc9, 0x5e, 0x3b, 0x6a, 0x9f, 0x53, 0xc9);"
)
cpp_quote
(
"EXTERN_GUID(MF_RATE_CONTROL_SERVICE, 0x866fa297, 0xb802, 0x4bf8, 0x9d, 0xc9, 0x5e, 0x3b, 0x6a, 0x9f, 0x53, 0xc9);"
)
cpp_quote
(
"EXTERN_GUID(MF_SAMPLEGRABBERSINK_SAMPLE_TIME_OFFSET, 0x62e3d776, 0x8100, 0x4e03, 0xa6, 0xe8, 0xbd, 0x38, 0x57, 0xac, 0x9c, 0x47);"
)
cpp_quote
(
"EXTERN_GUID(MF_SAMPLEGRABBERSINK_IGNORE_CLOCK, 0x0efda2c0, 0x2b69, 0x4e2e, 0xab, 0x8d, 0x46, 0xdc, 0xbf, 0xf7, 0xd2, 0x5d);"
)
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