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
2407a0f5
Commit
2407a0f5
authored
May 28, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf: Implement presentation clock methods for sample grabber.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9157129f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
10 deletions
+59
-10
samplegrabber.c
dlls/mf/samplegrabber.c
+47
-4
mf.c
dlls/mf/tests/mf.c
+12
-6
No files found.
dlls/mf/samplegrabber.c
View file @
2407a0f5
...
...
@@ -50,6 +50,7 @@ struct sample_grabber
BOOL
is_shut_down
;
IMFStreamSink
*
stream
;
IMFMediaEventQueue
*
event_queue
;
IMFPresentationClock
*
clock
;
CRITICAL_SECTION
cs
;
};
...
...
@@ -430,6 +431,8 @@ static ULONG WINAPI sample_grabber_sink_Release(IMFMediaSink *iface)
IMFMediaEventQueue_Shutdown
(
grabber
->
event_queue
);
IMFMediaEventQueue_Release
(
grabber
->
event_queue
);
}
if
(
grabber
->
clock
)
IMFPresentationClock_Release
(
grabber
->
clock
);
DeleteCriticalSection
(
&
grabber
->
cs
);
heap_free
(
grabber
);
}
...
...
@@ -539,16 +542,56 @@ static HRESULT WINAPI sample_grabber_sink_GetStreamSinkById(IMFMediaSink *iface,
static
HRESULT
WINAPI
sample_grabber_sink_SetPresentationClock
(
IMFMediaSink
*
iface
,
IMFPresentationClock
*
clock
)
{
FIXME
(
"%p, %p.
\n
"
,
iface
,
clock
);
struct
sample_grabber
*
grabber
=
impl_from_IMFMediaSink
(
iface
);
HRESULT
hr
;
return
E_NOTIMPL
;
TRACE
(
"%p, %p.
\n
"
,
iface
,
clock
);
EnterCriticalSection
(
&
grabber
->
cs
);
if
(
SUCCEEDED
(
hr
=
IMFSampleGrabberSinkCallback_OnSetPresentationClock
(
grabber
->
callback
,
clock
)))
{
if
(
grabber
->
clock
)
{
IMFPresentationClock_RemoveClockStateSink
(
grabber
->
clock
,
&
grabber
->
IMFClockStateSink_iface
);
IMFPresentationClock_Release
(
grabber
->
clock
);
}
grabber
->
clock
=
clock
;
if
(
grabber
->
clock
)
{
IMFPresentationClock_AddRef
(
grabber
->
clock
);
IMFPresentationClock_AddClockStateSink
(
grabber
->
clock
,
&
grabber
->
IMFClockStateSink_iface
);
}
}
LeaveCriticalSection
(
&
grabber
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
sample_grabber_sink_GetPresentationClock
(
IMFMediaSink
*
iface
,
IMFPresentationClock
**
clock
)
{
FIXME
(
"%p, %p.
\n
"
,
iface
,
clock
);
struct
sample_grabber
*
grabber
=
impl_from_IMFMediaSink
(
iface
);
HRESULT
hr
=
S_OK
;
return
E_NOTIMPL
;
TRACE
(
"%p, %p.
\n
"
,
iface
,
clock
);
if
(
!
clock
)
return
E_POINTER
;
EnterCriticalSection
(
&
grabber
->
cs
);
if
(
grabber
->
clock
)
{
*
clock
=
grabber
->
clock
;
IMFPresentationClock_AddRef
(
*
clock
);
}
else
hr
=
MF_E_NO_CLOCK
;
LeaveCriticalSection
(
&
grabber
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
sample_grabber_sink_Shutdown
(
IMFMediaSink
*
iface
)
...
...
dlls/mf/tests/mf.c
View file @
2407a0f5
...
...
@@ -1605,7 +1605,7 @@ static HRESULT WINAPI grabber_callback_OnClockSetRate(IMFSampleGrabberSinkCallba
static
HRESULT
WINAPI
grabber_callback_OnSetPresentationClock
(
IMFSampleGrabberSinkCallback
*
iface
,
IMFPresentationClock
*
clock
)
{
return
E_NOTIMPL
;
return
S_OK
;
}
static
HRESULT
WINAPI
grabber_callback_OnProcessSample
(
IMFSampleGrabberSinkCallback
*
iface
,
REFGUID
major_type
,
...
...
@@ -1641,9 +1641,9 @@ static void test_sample_grabber(void)
IMFMediaType
*
media_type
,
*
media_type2
,
*
media_type3
;
IMFMediaTypeHandler
*
handler
,
*
handler2
;
IMFPresentationTimeSource
*
time_source
;
IMFPresentationClock
*
clock
,
*
clock2
;
IMFStreamSink
*
stream
,
*
stream2
;
IMFClockStateSink
*
clocksink
;
IMFPresentationClock
*
clock
;
IMFMediaEventGenerator
*
eg
;
IMFMediaSink
*
sink
,
*
sink2
;
DWORD
flags
,
count
,
id
;
...
...
@@ -1742,8 +1742,17 @@ static void test_sample_grabber(void)
hr
=
MFCreatePresentationClock
(
&
clock
);
ok
(
hr
==
S_OK
,
"Failed to create clock object, hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaSink_GetPresentationClock
(
sink
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaSink_GetPresentationClock
(
sink
,
&
clock2
);
ok
(
hr
==
MF_E_NO_CLOCK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaSink_SetPresentationClock
(
sink
,
NULL
);
ok
(
hr
==
S_OK
,
"Failed to set presentation clock, hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaSink_SetPresentationClock
(
sink
,
clock
);
ok
(
hr
==
E_NOTIMPL
,
"Unexpected
hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to set presentation clock,
hr %#x.
\n
"
,
hr
);
hr
=
MFCreateSystemTimeSource
(
&
time_source
);
ok
(
hr
==
S_OK
,
"Failed to create time source, hr %#x.
\n
"
,
hr
);
...
...
@@ -1752,9 +1761,6 @@ static void test_sample_grabber(void)
ok
(
hr
==
S_OK
,
"Failed to set time source, hr %#x.
\n
"
,
hr
);
IMFPresentationTimeSource_Release
(
time_source
);
hr
=
IMFMediaSink_SetPresentationClock
(
sink
,
clock
);
ok
(
hr
==
E_NOTIMPL
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMFPresentationClock_Release
(
clock
);
hr
=
IMFActivate_ShutdownObject
(
activate
);
...
...
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