winegstreamer: Implement IWMSyncReader::GetStreamSelected().

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-11-10 10:41:11 -06:00 committed by Alexandre Julliard
parent 3e0a9877ea
commit a1a51f54dc
3 changed files with 28 additions and 4 deletions

View File

@ -168,6 +168,8 @@ struct wm_stream *wm_reader_get_stream_by_stream_number(struct wm_reader *reader
WORD stream_number);
HRESULT wm_reader_get_stream_sample(struct wm_stream *stream,
INSSBuffer **sample, QWORD *pts, QWORD *duration, DWORD *flags);
HRESULT wm_reader_get_stream_selection(struct wm_reader *reader,
WORD stream_number, WMT_STREAM_SELECTION *selection);
void wm_reader_init(struct wm_reader *reader, const struct wm_reader_ops *ops);
HRESULT wm_reader_open_file(struct wm_reader *reader, const WCHAR *filename);
HRESULT wm_reader_open_stream(struct wm_reader *reader, IStream *stream);

View File

@ -1872,6 +1872,25 @@ HRESULT wm_reader_set_streams_selected(struct wm_reader *reader, WORD count,
return S_OK;
}
HRESULT wm_reader_get_stream_selection(struct wm_reader *reader,
WORD stream_number, WMT_STREAM_SELECTION *selection)
{
struct wm_stream *stream;
EnterCriticalSection(&reader->cs);
if (!(stream = wm_reader_get_stream_by_stream_number(reader, stream_number)))
{
LeaveCriticalSection(&reader->cs);
return E_INVALIDARG;
}
*selection = stream->selection;
LeaveCriticalSection(&reader->cs);
return S_OK;
}
void wm_reader_init(struct wm_reader *reader, const struct wm_reader_ops *ops)
{
reader->IWMHeaderInfo3_iface.lpVtbl = &header_info_vtbl;

View File

@ -221,11 +221,14 @@ static HRESULT WINAPI WMSyncReader_GetStreamNumberForOutput(IWMSyncReader2 *ifac
return S_OK;
}
static HRESULT WINAPI WMSyncReader_GetStreamSelected(IWMSyncReader2 *iface, WORD stream_num, WMT_STREAM_SELECTION *selection)
static HRESULT WINAPI WMSyncReader_GetStreamSelected(IWMSyncReader2 *iface,
WORD stream_number, WMT_STREAM_SELECTION *selection)
{
struct sync_reader *This = impl_from_IWMSyncReader2(iface);
FIXME("(%p)->(%d %p): stub!\n", This, stream_num, selection);
return E_NOTIMPL;
struct sync_reader *reader = impl_from_IWMSyncReader2(iface);
TRACE("reader %p, stream_number %u, selection %p.\n", reader, stream_number, selection);
return wm_reader_get_stream_selection(&reader->reader, stream_number, selection);
}
static HRESULT WINAPI WMSyncReader_Open(IWMSyncReader2 *iface, const WCHAR *filename)