winegstreamer: Implement IWMOutputMediaProps::GetType().

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-08 15:24:33 -06:00 committed by Alexandre Julliard
parent fca2f6c12b
commit 3864d23554
2 changed files with 33 additions and 5 deletions

View File

@ -85,8 +85,12 @@ static ULONG WINAPI output_props_Release(IWMOutputMediaProps *iface)
static HRESULT WINAPI output_props_GetType(IWMOutputMediaProps *iface, GUID *major_type)
{
FIXME("iface %p, major_type %p, stub!\n", iface, major_type);
return E_NOTIMPL;
const struct output_props *props = impl_from_IWMOutputMediaProps(iface);
TRACE("iface %p, major_type %p.\n", iface, major_type);
*major_type = props->mt.majortype;
return S_OK;
}
static HRESULT WINAPI output_props_GetMediaType(IWMOutputMediaProps *iface, WM_MEDIA_TYPE *mt, DWORD *size)

View File

@ -861,12 +861,12 @@ static void test_sync_reader_types(void)
bool got_video = false, got_audio = false;
DWORD size, ret_size, output_number;
WORD stream_number, stream_number2;
GUID majortype, majortype2;
struct teststream stream;
IWMStreamConfig *config;
ULONG count, ref, i, j;
IWMSyncReader *reader;
IWMProfile *profile;
GUID majortype;
HANDLE file;
HRESULT hr;
BOOL ret;
@ -923,6 +923,12 @@ static void test_sync_reader_types(void)
hr = IWMOutputMediaProps_GetMediaType(output_props, mt, &ret_size);
ok(hr == S_OK, "Got hr %#x.\n", hr);
memset(&majortype2, 0xcc, sizeof(majortype2));
hr = IWMOutputMediaProps_GetType(output_props, &majortype2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(IsEqualGUID(&majortype2, &majortype), "Expected major type %s, got %s.\n",
debugstr_guid(&majortype), debugstr_guid(&majortype2));
ref = IWMOutputMediaProps_Release(output_props);
ok(!ref, "Got outstanding refcount %d.\n", ref);
@ -981,6 +987,12 @@ static void test_sync_reader_types(void)
else
check_video_type(mt);
memset(&majortype2, 0xcc, sizeof(majortype2));
hr = IWMOutputMediaProps_GetType(output_props, &majortype2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(IsEqualGUID(&majortype2, &majortype), "Expected major type %s, got %s.\n",
debugstr_guid(&majortype), debugstr_guid(&majortype2));
hr = IWMSyncReader_SetOutputProps(reader, output_number, output_props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IWMSyncReader_SetOutputProps(reader, 1 - output_number, output_props);
@ -1398,13 +1410,13 @@ static void test_async_reader_types(void)
bool got_video = false, got_audio = false;
DWORD size, ret_size, output_number;
IWMReaderAdvanced2 *advanced;
GUID majortype, majortype2;
struct teststream stream;
struct callback callback;
IWMStreamConfig *config;
ULONG count, ref, i, j;
IWMProfile *profile;
IWMReader *reader;
GUID majortype;
HANDLE file;
HRESULT hr;
BOOL ret;
@ -1458,11 +1470,17 @@ static void test_async_reader_types(void)
ret_size = sizeof(mt_buffer);
hr = IWMOutputMediaProps_GetMediaType(output_props, mt, &ret_size);
ok(hr == S_OK, "Got hr %#x.\n", hr);
majortype = mt->majortype;
memset(&majortype2, 0xcc, sizeof(majortype2));
hr = IWMOutputMediaProps_GetType(output_props, &majortype2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(IsEqualGUID(&majortype2, &majortype), "Expected major type %s, got %s.\n",
debugstr_guid(&majortype), debugstr_guid(&majortype2));
ref = IWMOutputMediaProps_Release(output_props);
ok(!ref, "Got outstanding refcount %d.\n", ref);
majortype = mt->majortype;
if (IsEqualGUID(&majortype, &MEDIATYPE_Audio))
{
got_audio = true;
@ -1538,6 +1556,12 @@ static void test_async_reader_types(void)
else
check_video_type(mt);
memset(&majortype2, 0xcc, sizeof(majortype2));
hr = IWMOutputMediaProps_GetType(output_props, &majortype2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(IsEqualGUID(&majortype2, &majortype), "Expected major type %s, got %s.\n",
debugstr_guid(&majortype), debugstr_guid(&majortype2));
hr = IWMReader_SetOutputProps(reader, output_number, output_props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IWMReader_SetOutputProps(reader, 1 - output_number, output_props);