winegstreamer: Implement IWMStreamConfig::GetStreamType().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
232681da96
commit
2594822212
|
@ -101,6 +101,8 @@ HRESULT decodebin_parser_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN
|
|||
HRESULT mpeg_splitter_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
|
||||
HRESULT wave_parser_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
|
||||
|
||||
bool amt_from_wg_format(AM_MEDIA_TYPE *mt, const struct wg_format *format);
|
||||
|
||||
BOOL init_gstreamer(void) DECLSPEC_HIDDEN;
|
||||
|
||||
extern HRESULT mfplat_get_class_object(REFCLSID rclsid, REFIID riid, void **obj) DECLSPEC_HIDDEN;
|
||||
|
@ -118,6 +120,7 @@ struct wm_stream
|
|||
struct wm_reader *reader;
|
||||
struct wg_parser_stream *wg_stream;
|
||||
WORD index;
|
||||
struct wg_format format;
|
||||
};
|
||||
|
||||
struct wm_reader
|
||||
|
|
|
@ -343,7 +343,7 @@ static bool amt_from_wg_format_video(AM_MEDIA_TYPE *mt, const struct wg_format *
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool amt_from_wg_format(AM_MEDIA_TYPE *mt, const struct wg_format *format)
|
||||
bool amt_from_wg_format(AM_MEDIA_TYPE *mt, const struct wg_format *format)
|
||||
{
|
||||
memset(mt, 0, sizeof(*mt));
|
||||
|
||||
|
|
|
@ -80,8 +80,26 @@ static ULONG WINAPI stream_config_Release(IWMStreamConfig *iface)
|
|||
|
||||
static HRESULT WINAPI stream_config_GetStreamType(IWMStreamConfig *iface, GUID *type)
|
||||
{
|
||||
FIXME("iface %p, type %p, stub!\n", iface, type);
|
||||
return E_NOTIMPL;
|
||||
struct stream_config *config = impl_from_IWMStreamConfig(iface);
|
||||
struct wm_reader *reader = config->stream->reader;
|
||||
AM_MEDIA_TYPE mt;
|
||||
|
||||
TRACE("config %p, type %p.\n", config, type);
|
||||
|
||||
EnterCriticalSection(&reader->cs);
|
||||
|
||||
if (!amt_from_wg_format(&mt, &config->stream->format))
|
||||
{
|
||||
LeaveCriticalSection(&reader->cs);
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
*type = mt.majortype;
|
||||
FreeMediaType(&mt);
|
||||
|
||||
LeaveCriticalSection(&reader->cs);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI stream_config_GetStreamNumber(IWMStreamConfig *iface, WORD *number)
|
||||
|
@ -1047,6 +1065,7 @@ HRESULT wm_reader_open_stream(struct wm_reader *reader, IStream *stream)
|
|||
stream->wg_stream = wg_parser_get_stream(reader->wg_parser, i);
|
||||
stream->reader = reader;
|
||||
stream->index = i;
|
||||
wg_parser_stream_get_preferred_format(stream->wg_stream, &stream->format);
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&reader->cs);
|
||||
|
|
|
@ -704,11 +704,11 @@ static void test_sync_reader_types(void)
|
|||
ok(stream_number == i + 1, "Got stream number %u.\n", stream_number);
|
||||
|
||||
hr = IWMStreamConfig_GetStreamType(config, &majortype);
|
||||
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
if (!i)
|
||||
todo_wine ok(IsEqualGUID(&majortype, &MEDIATYPE_Video), "Got major type %s.\n", debugstr_guid(&majortype));
|
||||
ok(IsEqualGUID(&majortype, &MEDIATYPE_Video), "Got major type %s.\n", debugstr_guid(&majortype));
|
||||
else
|
||||
todo_wine ok(IsEqualGUID(&majortype, &MEDIATYPE_Audio), "Got major type %s.\n", debugstr_guid(&majortype));
|
||||
ok(IsEqualGUID(&majortype, &MEDIATYPE_Audio), "Got major type %s.\n", debugstr_guid(&majortype));
|
||||
|
||||
ref = IWMStreamConfig_Release(config);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
|
|
Loading…
Reference in New Issue