Commit 3864d235 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

winegstreamer: Implement IWMOutputMediaProps::GetType().

parent fca2f6c1
...@@ -85,8 +85,12 @@ static ULONG WINAPI output_props_Release(IWMOutputMediaProps *iface) ...@@ -85,8 +85,12 @@ static ULONG WINAPI output_props_Release(IWMOutputMediaProps *iface)
static HRESULT WINAPI output_props_GetType(IWMOutputMediaProps *iface, GUID *major_type) static HRESULT WINAPI output_props_GetType(IWMOutputMediaProps *iface, GUID *major_type)
{ {
FIXME("iface %p, major_type %p, stub!\n", iface, major_type); const struct output_props *props = impl_from_IWMOutputMediaProps(iface);
return E_NOTIMPL;
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) static HRESULT WINAPI output_props_GetMediaType(IWMOutputMediaProps *iface, WM_MEDIA_TYPE *mt, DWORD *size)
......
...@@ -861,12 +861,12 @@ static void test_sync_reader_types(void) ...@@ -861,12 +861,12 @@ static void test_sync_reader_types(void)
bool got_video = false, got_audio = false; bool got_video = false, got_audio = false;
DWORD size, ret_size, output_number; DWORD size, ret_size, output_number;
WORD stream_number, stream_number2; WORD stream_number, stream_number2;
GUID majortype, majortype2;
struct teststream stream; struct teststream stream;
IWMStreamConfig *config; IWMStreamConfig *config;
ULONG count, ref, i, j; ULONG count, ref, i, j;
IWMSyncReader *reader; IWMSyncReader *reader;
IWMProfile *profile; IWMProfile *profile;
GUID majortype;
HANDLE file; HANDLE file;
HRESULT hr; HRESULT hr;
BOOL ret; BOOL ret;
...@@ -923,6 +923,12 @@ static void test_sync_reader_types(void) ...@@ -923,6 +923,12 @@ static void test_sync_reader_types(void)
hr = IWMOutputMediaProps_GetMediaType(output_props, mt, &ret_size); hr = IWMOutputMediaProps_GetMediaType(output_props, mt, &ret_size);
ok(hr == S_OK, "Got hr %#x.\n", hr); 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); ref = IWMOutputMediaProps_Release(output_props);
ok(!ref, "Got outstanding refcount %d.\n", ref); ok(!ref, "Got outstanding refcount %d.\n", ref);
...@@ -981,6 +987,12 @@ static void test_sync_reader_types(void) ...@@ -981,6 +987,12 @@ static void test_sync_reader_types(void)
else else
check_video_type(mt); 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); hr = IWMSyncReader_SetOutputProps(reader, output_number, output_props);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IWMSyncReader_SetOutputProps(reader, 1 - output_number, output_props); hr = IWMSyncReader_SetOutputProps(reader, 1 - output_number, output_props);
...@@ -1398,13 +1410,13 @@ static void test_async_reader_types(void) ...@@ -1398,13 +1410,13 @@ static void test_async_reader_types(void)
bool got_video = false, got_audio = false; bool got_video = false, got_audio = false;
DWORD size, ret_size, output_number; DWORD size, ret_size, output_number;
IWMReaderAdvanced2 *advanced; IWMReaderAdvanced2 *advanced;
GUID majortype, majortype2;
struct teststream stream; struct teststream stream;
struct callback callback; struct callback callback;
IWMStreamConfig *config; IWMStreamConfig *config;
ULONG count, ref, i, j; ULONG count, ref, i, j;
IWMProfile *profile; IWMProfile *profile;
IWMReader *reader; IWMReader *reader;
GUID majortype;
HANDLE file; HANDLE file;
HRESULT hr; HRESULT hr;
BOOL ret; BOOL ret;
...@@ -1458,11 +1470,17 @@ static void test_async_reader_types(void) ...@@ -1458,11 +1470,17 @@ static void test_async_reader_types(void)
ret_size = sizeof(mt_buffer); ret_size = sizeof(mt_buffer);
hr = IWMOutputMediaProps_GetMediaType(output_props, mt, &ret_size); hr = IWMOutputMediaProps_GetMediaType(output_props, mt, &ret_size);
ok(hr == S_OK, "Got hr %#x.\n", hr); 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); ref = IWMOutputMediaProps_Release(output_props);
ok(!ref, "Got outstanding refcount %d.\n", ref); ok(!ref, "Got outstanding refcount %d.\n", ref);
majortype = mt->majortype;
if (IsEqualGUID(&majortype, &MEDIATYPE_Audio)) if (IsEqualGUID(&majortype, &MEDIATYPE_Audio))
{ {
got_audio = true; got_audio = true;
...@@ -1538,6 +1556,12 @@ static void test_async_reader_types(void) ...@@ -1538,6 +1556,12 @@ static void test_async_reader_types(void)
else else
check_video_type(mt); 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); hr = IWMReader_SetOutputProps(reader, output_number, output_props);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IWMReader_SetOutputProps(reader, 1 - output_number, output_props); hr = IWMReader_SetOutputProps(reader, 1 - output_number, output_props);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment