Commit efb819c7 authored by Ziqing Hui's avatar Ziqing Hui Committed by Alexandre Julliard

winegstreamer: Implement GetOutputSizeInfo for WMV decoder.

parent 53b455c9
......@@ -5090,7 +5090,6 @@ static void test_wmv_decoder_media_object(void)
hr = IMediaObject_SetOutputType(media_object, 0, NULL, DMO_SET_TYPEF_CLEAR);
ok(hr == S_OK, "SetOutputType returned %#lx.\n", hr);
hr = IMediaObject_GetOutputSizeInfo(media_object, 0, &size, &alignment);
todo_wine
ok(hr == DMO_E_TYPE_NOT_SET, "GetOutputSizeInfo returned %#lx.\n", hr);
for (i = 0; i < ARRAY_SIZE(expected_output_types); ++i)
......@@ -5120,12 +5119,9 @@ static void test_wmv_decoder_media_object(void)
ok(hr == S_OK, "MFCalculateImageSize returned %#lx.\n", hr);
hr = IMediaObject_GetOutputSizeInfo(media_object, 0, &size, &alignment);
todo_wine
{
ok(hr == S_OK, "GetOutputSizeInfo returned %#lx.\n", hr);
ok(size == expected_size, "Got unexpected size %lu, expected %lu.\n", size, expected_size);
ok(alignment == 1, "Got unexpected alignment %lu.\n", alignment);
}
}
winetest_pop_context();
}
......
......@@ -82,6 +82,7 @@ struct wmv_decoder
struct wg_format input_format;
struct wg_format output_format;
GUID output_subtype;
};
static bool wg_format_is_set(struct wg_format *format)
......@@ -549,7 +550,10 @@ static HRESULT WINAPI media_object_SetOutputType(IMediaObject *iface, DWORD inde
return DMO_E_TYPE_NOT_ACCEPTED;
if (!(flags & DMO_SET_TYPEF_TEST_ONLY))
{
decoder->output_subtype = type->subtype;
decoder->output_format = wg_format;
}
return S_OK;
}
......@@ -576,8 +580,25 @@ static HRESULT WINAPI media_object_GetInputSizeInfo(IMediaObject *iface, DWORD i
static HRESULT WINAPI media_object_GetOutputSizeInfo(IMediaObject *iface, DWORD index, DWORD *size, DWORD *alignment)
{
FIXME("iface %p, index %lu, size %p, alignment %p stub!\n", iface, index, size, alignment);
return E_NOTIMPL;
struct wmv_decoder *decoder = impl_from_IMediaObject(iface);
HRESULT hr;
TRACE("iface %p, index %lu, size %p, alignment %p.\n", iface, index, size, alignment);
if (index > 0)
return DMO_E_INVALIDSTREAMINDEX;
if (!wg_format_is_set(&decoder->output_format))
return DMO_E_TYPE_NOT_SET;
if (FAILED(hr = MFCalculateImageSize(&decoder->output_subtype,
decoder->output_format.u.video.width, decoder->output_format.u.video.height, (UINT32 *)size)))
{
FIXME("Failed to get image size of subtype %s.\n", debugstr_guid(&decoder->output_subtype));
return hr;
}
*alignment = 1;
return S_OK;
}
static HRESULT WINAPI media_object_GetInputMaxLatency(IMediaObject *iface, DWORD index, REFERENCE_TIME *latency)
......
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