winegstreamer: Use IWMSyncReader2_GetOutputProps in the async reader.

This commit is contained in:
Rémi Bernon 2022-08-22 13:31:34 +02:00 committed by Alexandre Julliard
parent 64ee5529e1
commit 6070192528
3 changed files with 13 additions and 21 deletions

View file

@ -192,8 +192,6 @@ struct wm_reader *wm_reader_from_sync_reader_inner(IUnknown *inner);
HRESULT wm_reader_get_output_format(struct wm_reader *reader, DWORD output,
DWORD index, IWMOutputMediaProps **props);
HRESULT wm_reader_get_output_format_count(struct wm_reader *reader, DWORD output, DWORD *count);
HRESULT wm_reader_get_output_props(struct wm_reader *reader, DWORD output,
IWMOutputMediaProps **props);
HRESULT wm_reader_get_stream_sample(struct wm_reader *reader, IWMReaderCallbackAdvanced *callback_advanced, WORD stream_number,
INSSBuffer **ret_sample, QWORD *pts, QWORD *duration, DWORD *flags, WORD *ret_stream_number);
HRESULT wm_reader_get_stream_selection(struct wm_reader *reader,

View file

@ -508,7 +508,7 @@ static HRESULT WINAPI WMReader_GetOutputProps(IWMReader *iface, DWORD output, IW
TRACE("reader %p, output %lu, props %p.\n", reader, output, props);
return wm_reader_get_output_props(reader->wm_reader, output, props);
return IWMSyncReader2_GetOutputProps(reader->reader, output, props);
}
static HRESULT WINAPI WMReader_SetOutputProps(IWMReader *iface, DWORD output, IWMOutputMediaProps *props)

View file

@ -1487,23 +1487,6 @@ static struct wm_stream *wm_reader_get_stream_by_stream_number(struct wm_reader
return NULL;
}
HRESULT wm_reader_get_output_props(struct wm_reader *reader, DWORD output, IWMOutputMediaProps **props)
{
struct wm_stream *stream;
EnterCriticalSection(&reader->cs);
if (!(stream = get_stream_by_output_number(reader, output)))
{
LeaveCriticalSection(&reader->cs);
return E_INVALIDARG;
}
*props = output_props_create(&stream->format);
LeaveCriticalSection(&reader->cs);
return *props ? S_OK : E_OUTOFMEMORY;
}
static const enum wg_video_format video_formats[] =
{
/* Try to prefer YUV formats over RGB ones. Most decoders output in the
@ -2220,10 +2203,21 @@ static HRESULT WINAPI reader_GetOutputProps(IWMSyncReader2 *iface,
DWORD output, IWMOutputMediaProps **props)
{
struct wm_reader *reader = impl_from_IWMSyncReader2(iface);
struct wm_stream *stream;
TRACE("reader %p, output %lu, props %p.\n", reader, output, props);
return wm_reader_get_output_props(reader, output, props);
EnterCriticalSection(&reader->cs);
if (!(stream = get_stream_by_output_number(reader, output)))
{
LeaveCriticalSection(&reader->cs);
return E_INVALIDARG;
}
*props = output_props_create(&stream->format);
LeaveCriticalSection(&reader->cs);
return *props ? S_OK : E_OUTOFMEMORY;
}
static HRESULT WINAPI reader_GetOutputSetting(IWMSyncReader2 *iface, DWORD output_num, const WCHAR *name,