winegstreamer: Implement IWMSyncReader::SetRange().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
04d94e3c09
commit
74c2e9020f
|
@ -166,6 +166,7 @@ HRESULT wm_reader_get_stream_sample(struct wm_stream *stream,
|
|||
INSSBuffer **sample, QWORD *pts, QWORD *duration, DWORD *flags);
|
||||
void wm_reader_init(struct wm_reader *reader, const struct wm_reader_ops *ops);
|
||||
HRESULT wm_reader_open_stream(struct wm_reader *reader, IStream *stream);
|
||||
void wm_reader_seek(struct wm_reader *reader, QWORD start, LONGLONG duration);
|
||||
HRESULT wm_reader_set_output_props(struct wm_reader *reader, DWORD output,
|
||||
IWMOutputMediaProps *props);
|
||||
|
||||
|
|
|
@ -1637,6 +1637,21 @@ HRESULT wm_reader_get_stream_sample(struct wm_stream *stream,
|
|||
}
|
||||
}
|
||||
|
||||
void wm_reader_seek(struct wm_reader *reader, QWORD start, LONGLONG duration)
|
||||
{
|
||||
WORD i;
|
||||
|
||||
EnterCriticalSection(&reader->cs);
|
||||
|
||||
wg_parser_stream_seek(reader->streams[0].wg_stream, 1.0, start, start + duration,
|
||||
AM_SEEKING_AbsolutePositioning, duration ? AM_SEEKING_AbsolutePositioning : AM_SEEKING_NoPositioning);
|
||||
|
||||
for (i = 0; i < reader->stream_count; ++i)
|
||||
reader->streams[i].eos = false;
|
||||
|
||||
LeaveCriticalSection(&reader->cs);
|
||||
}
|
||||
|
||||
void wm_reader_init(struct wm_reader *reader, const struct wm_reader_ops *ops)
|
||||
{
|
||||
reader->IWMHeaderInfo3_iface.lpVtbl = &header_info_vtbl;
|
||||
|
|
|
@ -259,9 +259,12 @@ static HRESULT WINAPI WMSyncReader_SetOutputSetting(IWMSyncReader2 *iface, DWORD
|
|||
|
||||
static HRESULT WINAPI WMSyncReader_SetRange(IWMSyncReader2 *iface, QWORD start, LONGLONG duration)
|
||||
{
|
||||
struct sync_reader *This = impl_from_IWMSyncReader2(iface);
|
||||
FIXME("(%p)->(%s %s): stub!\n", This, wine_dbgstr_longlong(start), wine_dbgstr_longlong(duration));
|
||||
return E_NOTIMPL;
|
||||
struct sync_reader *reader = impl_from_IWMSyncReader2(iface);
|
||||
|
||||
TRACE("reader %p, start %I64u, duration %I64d.\n", reader, start, duration);
|
||||
|
||||
wm_reader_seek(&reader->reader, start, duration);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI WMSyncReader_SetRangeByFrame(IWMSyncReader2 *iface, WORD stream_num, QWORD frame_num,
|
||||
|
|
|
@ -542,24 +542,21 @@ static void test_sync_reader_streaming(void)
|
|||
ok(hr == NS_E_NO_MORE_SAMPLES, "Got hr %#x.\n", hr);
|
||||
|
||||
hr = IWMSyncReader_SetRange(reader, 0, 0);
|
||||
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
|
||||
hr = IWMSyncReader_GetNextSample(reader, stream_numbers[0], &sample, &pts, &duration, &flags, NULL, NULL);
|
||||
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
if (hr == S_OK)
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
INSSBuffer_Release(sample);
|
||||
|
||||
hr = IWMSyncReader_GetNextSample(reader, 0, &sample, &pts, &duration, &flags, NULL, NULL);
|
||||
ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
|
||||
|
||||
hr = IWMSyncReader_GetNextSample(reader, 0, &sample, &pts, &duration, &flags, &output_number, NULL);
|
||||
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
if (hr == S_OK)
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
INSSBuffer_Release(sample);
|
||||
|
||||
hr = IWMSyncReader_GetNextSample(reader, 0, &sample, &pts, &duration, &flags, NULL, &stream_number);
|
||||
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
if (hr == S_OK)
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
INSSBuffer_Release(sample);
|
||||
|
||||
for (;;)
|
||||
|
|
Loading…
Reference in New Issue