winegstreamer: Implement media_object_GetInputType for WMV decoder.

This commit is contained in:
Ziqing Hui 2022-11-17 19:36:25 +08:00 committed by Alexandre Julliard
parent 8844d42428
commit d596f97250
2 changed files with 35 additions and 10 deletions

View file

@ -4563,30 +4563,22 @@ static void test_wmv_decoder_media_object(void)
check_dmo_media_type(&media_type, &expected_input_types[i]);
winetest_pop_context();
}
todo_wine
ok(i == ARRAY_SIZE(expected_input_types), "%lu input types.\n", i);
/* Test GetInputType with invalid arguments. */
hr = IMediaObject_GetInputType(media_object, 0, ARRAY_SIZE(expected_input_types) - 1, &media_type);
todo_wine
ok(hr == S_OK, "GetInputType returned unexpected hr %#lx.\n", hr);
hr = IMediaObject_GetInputType(media_object, 0, ARRAY_SIZE(expected_input_types), &media_type);
todo_wine
ok(hr == DMO_E_NO_MORE_ITEMS, "GetInputType returned unexpected hr %#lx.\n", hr);
hr = IMediaObject_GetInputType(media_object, 1, 0, &media_type);
todo_wine
ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetInputType returned unexpected hr %#lx.\n", hr);
hr = IMediaObject_GetInputType(media_object, 0, 0, NULL);
todo_wine
ok(hr == S_OK, "GetInputType returned unexpected hr %#lx.\n", hr);
hr = IMediaObject_GetInputType(media_object, 1, ARRAY_SIZE(expected_input_types), &media_type);
todo_wine
ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetInputType returned unexpected hr %#lx.\n", hr);
hr = IMediaObject_GetInputType(media_object, 0, ARRAY_SIZE(expected_input_types), NULL);
todo_wine
ok(hr == DMO_E_NO_MORE_ITEMS, "GetInputType returned unexpected hr %#lx.\n", hr);
hr = IMediaObject_GetInputType(media_object, 1, 0, NULL);
todo_wine
ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetInputType returned unexpected hr %#lx.\n", hr);
ret = IMediaObject_Release(media_object);

View file

@ -19,6 +19,7 @@
#include "mfapi.h"
#include "mferror.h"
#include "mediaerr.h"
#include "mfobjects.h"
#include "mftransform.h"
#include "wmcodecdsp.h"
@ -28,6 +29,23 @@
WINE_DEFAULT_DEBUG_CHANNEL(mfplat);
extern const GUID MFVideoFormat_VC1S;
DEFINE_GUID(MFVideoFormat_WMV_Unknown, 0x7ce12ca9,0xbfbf,0x43d9,0x9d,0x00,0x82,0xb8,0xed,0x54,0x31,0x6b);
static const GUID *const wmv_decoder_input_types[] =
{
&MFVideoFormat_WMV1,
&MFVideoFormat_WMV2,
&MEDIASUBTYPE_WMVA,
&MEDIASUBTYPE_WMVP,
&MEDIASUBTYPE_WVP2,
&MFVideoFormat_WMV_Unknown,
&MFVideoFormat_WVC1,
&MFVideoFormat_WMV3,
&MFVideoFormat_VC1S,
};
struct wmv_decoder
{
IUnknown IUnknown_inner;
@ -345,8 +363,23 @@ static HRESULT WINAPI media_object_GetOutputStreamInfo(IMediaObject *iface, DWOR
static HRESULT WINAPI media_object_GetInputType(IMediaObject *iface, DWORD index, DWORD type_index,
DMO_MEDIA_TYPE *type)
{
FIXME("iface %p, index %lu, type_index %lu, type %p stub!\n", iface, index, type_index, type);
return E_NOTIMPL;
TRACE("iface %p, index %lu, type_index %lu, type %p.\n", iface, index, type_index, type);
if (index > 0)
return DMO_E_INVALIDSTREAMINDEX;
if (type_index >= ARRAY_SIZE(wmv_decoder_input_types))
return DMO_E_NO_MORE_ITEMS;
if (!type)
return S_OK;
memset(type, 0, sizeof(*type));
type->majortype = MFMediaType_Video;
type->subtype = *wmv_decoder_input_types[type_index];
type->bFixedSizeSamples = FALSE;
type->bTemporalCompression = TRUE;
type->lSampleSize = 0;
return S_OK;
}
static HRESULT WINAPI media_object_GetOutputType(IMediaObject *iface, DWORD index, DWORD type_index,