Commit 98a28d14 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mf: Add a stub for default presentation clock.

parent 1bd7dbfb
......@@ -45,7 +45,7 @@
@ stub MFCreatePMPHost
@ stub MFCreatePMPMediaSession
@ stub MFCreatePMPServer
@ stub MFCreatePresentationClock
@ stdcall MFCreatePresentationClock(ptr)
@ stub MFCreatePresentationDescriptorFromASFProfile
@ stub MFCreateProxyLocator
@ stub MFCreateRemoteDesktopPlugin
......
......@@ -735,6 +735,68 @@ static void test_MFShutdownObject(void)
ok(hr == S_OK, "Failed to shut down, hr %#x.\n", hr);
}
static void test_presentation_clock(void)
{
IMFPresentationTimeSource *time_source;
IMFRateControl *rate_control;
IMFPresentationClock *clock;
MFCLOCK_PROPERTIES props;
IMFShutdown *shutdown;
LONGLONG clock_time;
MFCLOCK_STATE state;
IMFTimer *timer;
MFTIME systime;
DWORD value;
HRESULT hr;
hr = MFStartup(MF_VERSION, MFSTARTUP_FULL);
ok(hr == S_OK, "Failed to start up, hr %#x.\n", hr);
hr = MFCreatePresentationClock(&clock);
ok(hr == S_OK, "Failed to create presentation clock, hr %#x.\n", hr);
hr = IMFPresentationClock_GetTimeSource(clock, &time_source);
ok(hr == MF_E_CLOCK_NO_TIME_SOURCE, "Unexpected hr %#x.\n", hr);
hr = IMFPresentationClock_GetClockCharacteristics(clock, &value);
todo_wine
ok(hr == MF_E_CLOCK_NO_TIME_SOURCE, "Unexpected hr %#x.\n", hr);
value = 1;
hr = IMFPresentationClock_GetContinuityKey(clock, &value);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(value == 0, "Unexpected value %u.\n", value);
hr = IMFPresentationClock_GetProperties(clock, &props);
todo_wine
ok(hr == MF_E_CLOCK_NO_TIME_SOURCE, "Unexpected hr %#x.\n", hr);
hr = IMFPresentationClock_GetState(clock, 0, &state);
ok(hr == S_OK, "Failed to get state, hr %#x.\n", hr);
ok(state == MFCLOCK_STATE_INVALID, "Unexpected state %d.\n", state);
hr = IMFPresentationClock_GetCorrelatedTime(clock, 0, &clock_time, &systime);
todo_wine
ok(hr == MF_E_CLOCK_NO_TIME_SOURCE, "Unexpected hr %#x.\n", hr);
hr = IMFPresentationClock_QueryInterface(clock, &IID_IMFRateControl, (void **)&rate_control);
ok(hr == S_OK, "Failed to get rate control interface, hr %#x.\n", hr);
IMFRateControl_Release(rate_control);
hr = IMFPresentationClock_QueryInterface(clock, &IID_IMFTimer, (void **)&timer);
ok(hr == S_OK, "Failed to get timer interface, hr %#x.\n", hr);
IMFTimer_Release(timer);
hr = IMFPresentationClock_QueryInterface(clock, &IID_IMFShutdown, (void **)&shutdown);
ok(hr == S_OK, "Failed to get shutdown interface, hr %#x.\n", hr);
IMFShutdown_Release(shutdown);
IMFPresentationClock_Release(clock);
hr = MFShutdown();
ok(hr == S_OK, "Failed to shut down, hr %#x.\n", hr);
}
START_TEST(mf)
{
test_topology();
......@@ -743,4 +805,5 @@ START_TEST(mf)
test_MFCreateSequencerSource();
test_media_session();
test_MFShutdownObject();
test_presentation_clock();
}
......@@ -82,4 +82,6 @@
#define MF_E_TOPO_MISSING_SOURCE _HRESULT_TYPEDEF_(0xc00d521a)
#define MF_E_TOPO_SINK_ACTIVATES_UNSUPPORTED _HRESULT_TYPEDEF_(0xc00d521b)
#define MF_E_CLOCK_NO_TIME_SOURCE _HRESULT_TYPEDEF_(0xc00d9c41)
#endif /* __WINE_MFERROR_H */
......@@ -72,6 +72,37 @@ interface IMFClock : IUnknown
[
object,
uuid(88ddcd21-03c3-4275-91ed-55ee3929328f)
]
interface IMFRateControl : IUnknown
{
HRESULT SetRate(
[in] BOOL thin,
[in] float rate);
HRESULT GetRate(
[in, out, unique] BOOL *thin,
[in, out, unique] float *rate);
}
[
object,
uuid(e56e4cbd-8f70-49d8-a0f8-edb3d6ab9bf2),
local
]
interface IMFTimer : IUnknown
{
HRESULT SetTimer(
[in] DWORD flags,
[in] LONGLONG time,
[in] IMFAsyncCallback *callback,
[in] IUnknown *state,
[out] IUnknown **key);
HRESULT CancelTimer(
[in] IUnknown *key);
}
[
object,
uuid(83cf873a-f6da-4bc8-823f-bacfd55dc430),
]
interface IMFTopologyNode : IMFAttributes
......@@ -319,6 +350,7 @@ interface IMFSequencerSource : IUnknown
cpp_quote("HRESULT WINAPI MFCreateMediaSession(IMFAttributes *config, IMFMediaSession **session);")
cpp_quote("HRESULT WINAPI MFCreateMFByteStreamOnStream(IStream *stream, IMFByteStream **bytestream);" )
cpp_quote("HRESULT WINAPI MFCreateMFByteStreamOnStreamEx(IUnknown *stream, IMFByteStream **bytestream);")
cpp_quote("HRESULT WINAPI MFCreatePresentationClock(IMFPresentationClock **clock);")
cpp_quote("HRESULT WINAPI MFCreateSequencerSource(IUnknown *reserved, IMFSequencerSource **seq_source);" )
cpp_quote("HRESULT WINAPI MFCreateSourceResolver(IMFSourceResolver **resolver);")
cpp_quote("HRESULT WINAPI MFCreateStreamDescriptor(DWORD identifier, DWORD cMediaTypes,")
......@@ -360,7 +392,31 @@ interface IMFMediaSource : IMFMediaEventGenerator
}
interface IMFStreamSink;
interface IMFPresentationClock;
[
object,
uuid(7ff12cce-f76f-41c2-863b-1666c8e5e139)
]
interface IMFPresentationTimeSource : IMFClock
{
HRESULT GetUnderlyingClock([out] IMFClock **clock);
}
[
object,
uuid(868ce85c-8ea9-4f55-ab82-b009a910a805)
]
interface IMFPresentationClock : IMFClock
{
HRESULT SetTimeSource([in] IMFPresentationTimeSource *time_source);
HRESULT GetTimeSource([out] IMFPresentationTimeSource **time_source);
HRESULT GetTime([out] MFTIME *time);
HRESULT AddClockStateSink([in] IMFClockStateSink *state_sink);
HRESULT RemoveClockStateSink([in] IMFClockStateSink *state_sink);
HRESULT Start([in] LONGLONG start_offset);
HRESULT Stop();
HRESULT Pause();
}
[
object,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment