evr: Add IMFVideoMixerBitmap stub.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2020-06-25 17:58:00 +03:00 committed by Alexandre Julliard
parent e4791f6f9b
commit a9431eb0a2
2 changed files with 73 additions and 3 deletions

View File

@ -27,6 +27,9 @@
#include "evr_classes.h"
#include "initguid.h"
#include "evr9.h"
WINE_DEFAULT_DEBUG_CHANNEL(evr);
#define MAX_MIXER_INPUT_STREAMS 16
@ -44,6 +47,7 @@ struct video_mixer
IMFTopologyServiceLookupClient IMFTopologyServiceLookupClient_iface;
IMFVideoMixerControl2 IMFVideoMixerControl2_iface;
IMFGetService IMFGetService_iface;
IMFVideoMixerBitmap IMFVideoMixerBitmap_iface;
LONG refcount;
struct input_stream inputs[MAX_MIXER_INPUT_STREAMS];
@ -80,6 +84,11 @@ static struct video_mixer *impl_from_IMFGetService(IMFGetService *iface)
return CONTAINING_RECORD(iface, struct video_mixer, IMFGetService_iface);
}
static struct video_mixer *impl_from_IMFVideoMixerBitmap(IMFVideoMixerBitmap *iface)
{
return CONTAINING_RECORD(iface, struct video_mixer, IMFVideoMixerBitmap_iface);
}
static int video_mixer_compare_input_id(const void *a, const void *b)
{
const unsigned int *key = a;
@ -129,6 +138,10 @@ static HRESULT WINAPI video_mixer_transform_QueryInterface(IMFTransform *iface,
{
*obj = &mixer->IMFGetService_iface;
}
else if (IsEqualIID(riid, &IID_IMFVideoMixerBitmap))
{
*obj = &mixer->IMFVideoMixerBitmap_iface;
}
else
{
WARN("Unsupported interface %s.\n", debugstr_guid(riid));
@ -787,6 +800,64 @@ static const IMFGetServiceVtbl video_mixer_getservice_vtbl =
video_mixer_getservice_GetService,
};
static HRESULT WINAPI video_mixer_bitmap_QueryInterface(IMFVideoMixerBitmap *iface, REFIID riid, void **obj)
{
struct video_mixer *mixer = impl_from_IMFVideoMixerBitmap(iface);
return IMFTransform_QueryInterface(&mixer->IMFTransform_iface, riid, obj);
}
static ULONG WINAPI video_mixer_bitmap_AddRef(IMFVideoMixerBitmap *iface)
{
struct video_mixer *mixer = impl_from_IMFVideoMixerBitmap(iface);
return IMFTransform_AddRef(&mixer->IMFTransform_iface);
}
static ULONG WINAPI video_mixer_bitmap_Release(IMFVideoMixerBitmap *iface)
{
struct video_mixer *mixer = impl_from_IMFVideoMixerBitmap(iface);
return IMFTransform_Release(&mixer->IMFTransform_iface);
}
static HRESULT WINAPI video_mixer_bitmap_SetAlphaBitmap(IMFVideoMixerBitmap *iface, const MFVideoAlphaBitmap *bitmap)
{
FIXME("%p, %p.\n", iface, bitmap);
return E_NOTIMPL;
}
static HRESULT WINAPI video_mixer_bitmap_ClearAlphaBitmap(IMFVideoMixerBitmap *iface)
{
FIXME("%p.\n", iface);
return E_NOTIMPL;
}
static HRESULT WINAPI video_mixer_bitmap_UpdateAlphaBitmapParameters(IMFVideoMixerBitmap *iface,
const MFVideoAlphaBitmapParams *params)
{
FIXME("%p, %p.\n", iface, params);
return E_NOTIMPL;
}
static HRESULT WINAPI video_mixer_bitmap_GetAlphaBitmapParameters(IMFVideoMixerBitmap *iface, MFVideoAlphaBitmapParams *params)
{
FIXME("%p, %p.\n", iface, params);
return E_NOTIMPL;
}
static const IMFVideoMixerBitmapVtbl video_mixer_bitmap_vtbl =
{
video_mixer_bitmap_QueryInterface,
video_mixer_bitmap_AddRef,
video_mixer_bitmap_Release,
video_mixer_bitmap_SetAlphaBitmap,
video_mixer_bitmap_ClearAlphaBitmap,
video_mixer_bitmap_UpdateAlphaBitmapParameters,
video_mixer_bitmap_GetAlphaBitmapParameters,
};
HRESULT WINAPI MFCreateVideoMixer(IUnknown *owner, REFIID riid_device, REFIID riid, void **obj)
{
TRACE("%p, %s, %s, %p.\n", owner, debugstr_guid(riid_device), debugstr_guid(riid), obj);
@ -814,6 +885,7 @@ HRESULT evr_mixer_create(IUnknown *outer, void **out)
object->IMFTopologyServiceLookupClient_iface.lpVtbl = &video_mixer_service_client_vtbl;
object->IMFVideoMixerControl2_iface.lpVtbl = &video_mixer_control_vtbl;
object->IMFGetService_iface.lpVtbl = &video_mixer_getservice_vtbl;
object->IMFVideoMixerBitmap_iface.lpVtbl = &video_mixer_bitmap_vtbl;
object->refcount = 1;
object->input_count = 1;
video_mixer_init_input(&object->inputs[0]);

View File

@ -401,10 +401,8 @@ static void test_default_mixer(void)
IUnknown_Release(unk);
hr = IMFTransform_QueryInterface(transform, &IID_IMFVideoMixerBitmap, (void **)&unk);
todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
if (SUCCEEDED(hr))
IUnknown_Release(unk);
IUnknown_Release(unk);
hr = IMFTransform_QueryInterface(transform, &IID_IMFVideoPositionMapper, (void **)&unk);
todo_wine