mf: Forward GetTime() calls to time source.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
bd2e2141b0
commit
f8537c5acd
|
@ -842,15 +842,13 @@ static ULONG WINAPI present_clock_Release(IMFPresentationClock *iface)
|
||||||
static HRESULT WINAPI present_clock_GetClockCharacteristics(IMFPresentationClock *iface, DWORD *flags)
|
static HRESULT WINAPI present_clock_GetClockCharacteristics(IMFPresentationClock *iface, DWORD *flags)
|
||||||
{
|
{
|
||||||
struct presentation_clock *clock = impl_from_IMFPresentationClock(iface);
|
struct presentation_clock *clock = impl_from_IMFPresentationClock(iface);
|
||||||
HRESULT hr;
|
HRESULT hr = MF_E_CLOCK_NO_TIME_SOURCE;
|
||||||
|
|
||||||
TRACE("%p, %p.\n", iface, flags);
|
TRACE("%p, %p.\n", iface, flags);
|
||||||
|
|
||||||
EnterCriticalSection(&clock->cs);
|
EnterCriticalSection(&clock->cs);
|
||||||
if (clock->time_source)
|
if (clock->time_source)
|
||||||
hr = IMFPresentationTimeSource_GetClockCharacteristics(clock->time_source, flags);
|
hr = IMFPresentationTimeSource_GetClockCharacteristics(clock->time_source, flags);
|
||||||
else
|
|
||||||
hr = MF_E_CLOCK_NO_TIME_SOURCE;
|
|
||||||
LeaveCriticalSection(&clock->cs);
|
LeaveCriticalSection(&clock->cs);
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
|
@ -889,15 +887,13 @@ static HRESULT WINAPI present_clock_GetState(IMFPresentationClock *iface, DWORD
|
||||||
static HRESULT WINAPI present_clock_GetProperties(IMFPresentationClock *iface, MFCLOCK_PROPERTIES *props)
|
static HRESULT WINAPI present_clock_GetProperties(IMFPresentationClock *iface, MFCLOCK_PROPERTIES *props)
|
||||||
{
|
{
|
||||||
struct presentation_clock *clock = impl_from_IMFPresentationClock(iface);
|
struct presentation_clock *clock = impl_from_IMFPresentationClock(iface);
|
||||||
HRESULT hr;
|
HRESULT hr = MF_E_CLOCK_NO_TIME_SOURCE;
|
||||||
|
|
||||||
TRACE("%p, %p.\n", iface, props);
|
TRACE("%p, %p.\n", iface, props);
|
||||||
|
|
||||||
EnterCriticalSection(&clock->cs);
|
EnterCriticalSection(&clock->cs);
|
||||||
if (clock->time_source)
|
if (clock->time_source)
|
||||||
hr = IMFPresentationTimeSource_GetProperties(clock->time_source, props);
|
hr = IMFPresentationTimeSource_GetProperties(clock->time_source, props);
|
||||||
else
|
|
||||||
hr = MF_E_CLOCK_NO_TIME_SOURCE;
|
|
||||||
LeaveCriticalSection(&clock->cs);
|
LeaveCriticalSection(&clock->cs);
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
|
@ -939,6 +935,9 @@ static HRESULT WINAPI present_clock_GetTimeSource(IMFPresentationClock *iface,
|
||||||
|
|
||||||
TRACE("%p, %p.\n", iface, time_source);
|
TRACE("%p, %p.\n", iface, time_source);
|
||||||
|
|
||||||
|
if (!time_source)
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
EnterCriticalSection(&clock->cs);
|
EnterCriticalSection(&clock->cs);
|
||||||
if (clock->time_source)
|
if (clock->time_source)
|
||||||
{
|
{
|
||||||
|
@ -954,9 +953,21 @@ static HRESULT WINAPI present_clock_GetTimeSource(IMFPresentationClock *iface,
|
||||||
|
|
||||||
static HRESULT WINAPI present_clock_GetTime(IMFPresentationClock *iface, MFTIME *time)
|
static HRESULT WINAPI present_clock_GetTime(IMFPresentationClock *iface, MFTIME *time)
|
||||||
{
|
{
|
||||||
FIXME("%p, %p.\n", iface, time);
|
struct presentation_clock *clock = impl_from_IMFPresentationClock(iface);
|
||||||
|
HRESULT hr = MF_E_CLOCK_NO_TIME_SOURCE;
|
||||||
|
MFTIME systime;
|
||||||
|
|
||||||
return E_NOTIMPL;
|
TRACE("%p, %p.\n", iface, time);
|
||||||
|
|
||||||
|
if (!time)
|
||||||
|
return E_POINTER;
|
||||||
|
|
||||||
|
EnterCriticalSection(&clock->cs);
|
||||||
|
if (clock->time_source)
|
||||||
|
hr = IMFPresentationTimeSource_GetCorrelatedTime(clock->time_source, 0, time, &systime);
|
||||||
|
LeaveCriticalSection(&clock->cs);
|
||||||
|
|
||||||
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI present_clock_AddClockStateSink(IMFPresentationClock *iface, IMFClockStateSink *state_sink)
|
static HRESULT WINAPI present_clock_AddClockStateSink(IMFPresentationClock *iface, IMFClockStateSink *state_sink)
|
||||||
|
|
|
@ -1431,10 +1431,10 @@ static void test_presentation_clock(void)
|
||||||
IMFRateControl *rate_control;
|
IMFRateControl *rate_control;
|
||||||
IMFPresentationClock *clock;
|
IMFPresentationClock *clock;
|
||||||
IMFShutdown *shutdown;
|
IMFShutdown *shutdown;
|
||||||
|
MFTIME systime, time;
|
||||||
LONGLONG clock_time;
|
LONGLONG clock_time;
|
||||||
MFCLOCK_STATE state;
|
MFCLOCK_STATE state;
|
||||||
IMFTimer *timer;
|
IMFTimer *timer;
|
||||||
MFTIME systime;
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
DWORD value;
|
DWORD value;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
@ -1448,9 +1448,21 @@ static void test_presentation_clock(void)
|
||||||
hr = IMFPresentationClock_GetTimeSource(clock, &time_source);
|
hr = IMFPresentationClock_GetTimeSource(clock, &time_source);
|
||||||
ok(hr == MF_E_CLOCK_NO_TIME_SOURCE, "Unexpected hr %#x.\n", hr);
|
ok(hr == MF_E_CLOCK_NO_TIME_SOURCE, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
|
hr = IMFPresentationClock_GetTimeSource(clock, NULL);
|
||||||
|
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
hr = IMFPresentationClock_GetClockCharacteristics(clock, &value);
|
hr = IMFPresentationClock_GetClockCharacteristics(clock, &value);
|
||||||
ok(hr == MF_E_CLOCK_NO_TIME_SOURCE, "Unexpected hr %#x.\n", hr);
|
ok(hr == MF_E_CLOCK_NO_TIME_SOURCE, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
|
hr = IMFPresentationClock_GetClockCharacteristics(clock, NULL);
|
||||||
|
ok(hr == MF_E_CLOCK_NO_TIME_SOURCE, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
|
hr = IMFPresentationClock_GetTime(clock, &time);
|
||||||
|
ok(hr == MF_E_CLOCK_NO_TIME_SOURCE, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
|
hr = IMFPresentationClock_GetTime(clock, NULL);
|
||||||
|
ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
value = 1;
|
value = 1;
|
||||||
hr = IMFPresentationClock_GetContinuityKey(clock, &value);
|
hr = IMFPresentationClock_GetContinuityKey(clock, &value);
|
||||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||||
|
@ -1538,6 +1550,20 @@ todo_wine
|
||||||
ok(state == clock_state_change[i].clock_state, "%u: unexpected state %d.\n", i, state);
|
ok(state == clock_state_change[i].clock_state, "%u: unexpected state %d.\n", i, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Clock time stamps. */
|
||||||
|
hr = IMFPresentationClock_Start(clock, 10);
|
||||||
|
ok(hr == S_OK, "Failed to start presentation clock, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
hr = IMFPresentationClock_Pause(clock);
|
||||||
|
ok(hr == S_OK, "Failed to pause presentation clock, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
hr = IMFPresentationClock_GetTime(clock, &time);
|
||||||
|
ok(hr == S_OK, "Failed to get clock time, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
hr = IMFPresentationTimeSource_GetCorrelatedTime(time_source, 0, &clock_time, &systime);
|
||||||
|
ok(hr == S_OK, "Failed to get time source time, hr %#x.\n", hr);
|
||||||
|
ok(time == clock_time, "Unexpected clock time.\n");
|
||||||
|
|
||||||
IMFPresentationTimeSource_Release(time_source);
|
IMFPresentationTimeSource_Release(time_source);
|
||||||
|
|
||||||
hr = IMFPresentationClock_QueryInterface(clock, &IID_IMFRateControl, (void **)&rate_control);
|
hr = IMFPresentationClock_QueryInterface(clock, &IID_IMFRateControl, (void **)&rate_control);
|
||||||
|
|
Loading…
Reference in New Issue