winegstreamer: Return the seeking start time from IMediaSeeking::GetCurrentPosition().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b04c0a56e3
commit
1bb7ef1c1a
|
@ -931,8 +931,7 @@ static HRESULT WINAPI testsink_Receive(struct strmbase_sink *iface, IMediaSample
|
||||||
IPin_QueryInterface(iface->pin.peer, &IID_IMediaSeeking, (void **)&seeking);
|
IPin_QueryInterface(iface->pin.peer, &IID_IMediaSeeking, (void **)&seeking);
|
||||||
hr = IMediaSeeking_GetPositions(seeking, &start, &end);
|
hr = IMediaSeeking_GetPositions(seeking, &start, &end);
|
||||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||||
todo_wine_if (start != filter->seek_start)
|
ok(start == filter->seek_start, "Expected start position %I64u, got %I64u.\n", filter->seek_start, start);
|
||||||
ok(start == filter->seek_start, "Expected start position %I64u, got %I64u.\n", filter->seek_start, start);
|
|
||||||
ok(end == filter->seek_end, "Expected end position %I64u, got %I64u.\n", filter->seek_end, end);
|
ok(end == filter->seek_end, "Expected end position %I64u, got %I64u.\n", filter->seek_end, end);
|
||||||
IMediaSeeking_Release(seeking);
|
IMediaSeeking_Release(seeking);
|
||||||
|
|
||||||
|
@ -1696,7 +1695,7 @@ static void test_streaming(void)
|
||||||
start = end = 0xdeadbeef;
|
start = end = 0xdeadbeef;
|
||||||
hr = IMediaSeeking_GetPositions(seeking, &start, &end);
|
hr = IMediaSeeking_GetPositions(seeking, &start, &end);
|
||||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||||
todo_wine ok(start == testsink.seek_start, "Expected start position %I64u, got %I64u.\n", testsink.seek_start, start);
|
ok(start == testsink.seek_start, "Expected start position %I64u, got %I64u.\n", testsink.seek_start, start);
|
||||||
ok(end == testsink.seek_end, "Expected end position %I64u, got %I64u.\n", testsink.seek_end, end);
|
ok(end == testsink.seek_end, "Expected end position %I64u, got %I64u.\n", testsink.seek_end, end);
|
||||||
|
|
||||||
testsink.sample_count = testsink.eos_count = 0;
|
testsink.sample_count = testsink.eos_count = 0;
|
||||||
|
@ -1712,7 +1711,7 @@ static void test_streaming(void)
|
||||||
start = end = 0xdeadbeef;
|
start = end = 0xdeadbeef;
|
||||||
hr = IMediaSeeking_GetPositions(seeking, &start, &end);
|
hr = IMediaSeeking_GetPositions(seeking, &start, &end);
|
||||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||||
todo_wine ok(start == testsink.seek_start, "Expected start position %I64u, got %I64u.\n", testsink.seek_start, start);
|
ok(start == testsink.seek_start, "Expected start position %I64u, got %I64u.\n", testsink.seek_start, start);
|
||||||
ok(end == testsink.seek_end, "Expected end position %I64u, got %I64u.\n", testsink.seek_end, end);
|
ok(end == testsink.seek_end, "Expected end position %I64u, got %I64u.\n", testsink.seek_end, end);
|
||||||
|
|
||||||
IMediaSeeking_Release(seeking);
|
IMediaSeeking_Release(seeking);
|
||||||
|
|
|
@ -1220,8 +1220,7 @@ static HRESULT WINAPI testsink_Receive(struct strmbase_sink *iface, IMediaSample
|
||||||
IPin_QueryInterface(iface->pin.peer, &IID_IMediaSeeking, (void **)&seeking);
|
IPin_QueryInterface(iface->pin.peer, &IID_IMediaSeeking, (void **)&seeking);
|
||||||
hr = IMediaSeeking_GetPositions(seeking, &start, &end);
|
hr = IMediaSeeking_GetPositions(seeking, &start, &end);
|
||||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||||
todo_wine_if (start != filter->seek_start)
|
ok(start == filter->seek_start, "Expected start position %I64u, got %I64u.\n", filter->seek_start, start);
|
||||||
ok(start == filter->seek_start, "Expected start position %I64u, got %I64u.\n", filter->seek_start, start);
|
|
||||||
ok(end == filter->seek_end, "Expected end position %I64u, got %I64u.\n", filter->seek_end, end);
|
ok(end == filter->seek_end, "Expected end position %I64u, got %I64u.\n", filter->seek_end, end);
|
||||||
IMediaSeeking_Release(seeking);
|
IMediaSeeking_Release(seeking);
|
||||||
|
|
||||||
|
@ -1863,7 +1862,7 @@ static void test_streaming(void)
|
||||||
start = end = 0xdeadbeef;
|
start = end = 0xdeadbeef;
|
||||||
hr = IMediaSeeking_GetPositions(seeking, &start, &end);
|
hr = IMediaSeeking_GetPositions(seeking, &start, &end);
|
||||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||||
todo_wine ok(start == testsink.seek_start, "Expected start position %I64u, got %I64u.\n", testsink.seek_start, start);
|
ok(start == testsink.seek_start, "Expected start position %I64u, got %I64u.\n", testsink.seek_start, start);
|
||||||
ok(end == testsink.seek_end, "Expected end position %I64u, got %I64u.\n", testsink.seek_end, end);
|
ok(end == testsink.seek_end, "Expected end position %I64u, got %I64u.\n", testsink.seek_end, end);
|
||||||
|
|
||||||
testsink.sample_count = testsink.eos_count = 0;
|
testsink.sample_count = testsink.eos_count = 0;
|
||||||
|
@ -1879,7 +1878,7 @@ static void test_streaming(void)
|
||||||
start = end = 0xdeadbeef;
|
start = end = 0xdeadbeef;
|
||||||
hr = IMediaSeeking_GetPositions(seeking, &start, &end);
|
hr = IMediaSeeking_GetPositions(seeking, &start, &end);
|
||||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||||
todo_wine ok(start == testsink.seek_start, "Expected start position %I64u, got %I64u.\n", testsink.seek_start, start);
|
ok(start == testsink.seek_start, "Expected start position %I64u, got %I64u.\n", testsink.seek_start, start);
|
||||||
ok(end == testsink.seek_end, "Expected end position %I64u, got %I64u.\n", testsink.seek_end, end);
|
ok(end == testsink.seek_end, "Expected end position %I64u, got %I64u.\n", testsink.seek_end, end);
|
||||||
|
|
||||||
IMediaSeeking_Release(seeking);
|
IMediaSeeking_Release(seeking);
|
||||||
|
|
|
@ -1897,33 +1897,6 @@ static ULONG WINAPI GST_Seeking_Release(IMediaSeeking *iface)
|
||||||
return IPin_Release(&This->pin.pin.IPin_iface);
|
return IPin_Release(&This->pin.pin.IPin_iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI GST_Seeking_GetCurrentPosition(IMediaSeeking *iface, REFERENCE_TIME *pos)
|
|
||||||
{
|
|
||||||
struct gstdemux_source *This = impl_from_IMediaSeeking(iface);
|
|
||||||
|
|
||||||
TRACE("(%p)->(%p)\n", This, pos);
|
|
||||||
|
|
||||||
if (!pos)
|
|
||||||
return E_POINTER;
|
|
||||||
|
|
||||||
mark_wine_thread();
|
|
||||||
|
|
||||||
if (This->pin.pin.filter->state == State_Stopped)
|
|
||||||
{
|
|
||||||
*pos = This->seek.llCurrent;
|
|
||||||
TRACE("Cached value\n");
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!gst_pad_query_position(This->their_src, GST_FORMAT_TIME, pos)) {
|
|
||||||
WARN("Could not query position\n");
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
*pos /= 100;
|
|
||||||
This->seek.llCurrent = *pos;
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GstSeekType type_from_flags(DWORD flags)
|
static GstSeekType type_from_flags(DWORD flags)
|
||||||
{
|
{
|
||||||
switch (flags & AM_SEEKING_PositioningBitsMask) {
|
switch (flags & AM_SEEKING_PositioningBitsMask) {
|
||||||
|
@ -1997,7 +1970,7 @@ static const IMediaSeekingVtbl GST_Seeking_Vtbl =
|
||||||
SourceSeekingImpl_SetTimeFormat,
|
SourceSeekingImpl_SetTimeFormat,
|
||||||
SourceSeekingImpl_GetDuration,
|
SourceSeekingImpl_GetDuration,
|
||||||
SourceSeekingImpl_GetStopPosition,
|
SourceSeekingImpl_GetStopPosition,
|
||||||
GST_Seeking_GetCurrentPosition,
|
SourceSeekingImpl_GetCurrentPosition,
|
||||||
SourceSeekingImpl_ConvertTimeFormat,
|
SourceSeekingImpl_ConvertTimeFormat,
|
||||||
GST_Seeking_SetPositions,
|
GST_Seeking_SetPositions,
|
||||||
SourceSeekingImpl_GetPositions,
|
SourceSeekingImpl_GetPositions,
|
||||||
|
|
Loading…
Reference in New Issue