Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- include/Makefile.in | 1 + include/evr9.idl | 114 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 include/evr9.idl
diff --git a/include/Makefile.in b/include/Makefile.in index 9f70e72b4c7..90fb873f203 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -276,6 +276,7 @@ SOURCES = \ evntprov.h \ evntrace.h \ evr.idl \ + evr9.idl \ excpt.h \ exdisp.idl \ exdispid.h \ diff --git a/include/evr9.idl b/include/evr9.idl new file mode 100644 index 00000000000..1572d878387 --- /dev/null +++ b/include/evr9.idl @@ -0,0 +1,114 @@ +/* + * Copyright 2020 Nikolay Sivov for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +import "unknwn.idl"; +import "evr.idl"; +import "dxva2api.idl"; + +typedef struct MFVideoAlphaBitmapParams +{ + DWORD dwFlags; + COLORREF clrSrcKey; + RECT rcSrc; + MFVideoNormalizedRect nrcDest; + FLOAT fAlpha; + DWORD dwFilterMode; +} MFVideoAlphaBitmapParams; + +typedef struct MFVideoAlphaBitmap +{ + BOOL GetBitmapFromDC; + union + { + HDC hdc; + IDirect3DSurface9 *pDDS; + } bitmap; + MFVideoAlphaBitmapParams params; +} MFVideoAlphaBitmap; + +[ + object, + uuid(814c7b20-0fdb-4eec-af8f-f957c8f69edc), + local +] +interface IMFVideoMixerBitmap : IUnknown +{ + HRESULT SetAlphaBitmap( + [in] const MFVideoAlphaBitmap *bitmap + ); + HRESULT ClearAlphaBitmap(void); + HRESULT UpdateAlphaBitmapParameters( + [in] const MFVideoAlphaBitmapParams *params + ); + HRESULT GetAlphaBitmapParameters( + [out] MFVideoAlphaBitmapParams *params + ); +} + +[ + object, + uuid(6AB0000C-FECE-4d1f-A2AC-A9573530656E), + pointer_default(unique) +] +interface IMFVideoProcessor : IUnknown +{ + HRESULT GetAvailableVideoProcessorModes( + [out] UINT *count, + [out, size_is(*count)] GUID **modes + ); + HRESULT GetVideoProcessorCaps( + [in] GUID *mode, + [out] DXVA2_VideoProcessorCaps *caps + ); + HRESULT GetVideoProcessorMode( + [out] GUID *mode + ); + HRESULT SetVideoProcessorMode( + [in] GUID *mode + ); + HRESULT GetProcAmpRange( + [in] DWORD prop, + [out] DXVA2_ValueRange *range + ); + HRESULT GetProcAmpValues( + [in] DWORD flags, + [out] DXVA2_ProcAmpValues *values + ); + HRESULT SetProcAmpValues( + [in] DWORD flags, + [in] DXVA2_ProcAmpValues *values + ); + HRESULT GetFilteringRange( + [in] DWORD prop, + [out] DXVA2_ValueRange *range + ); + HRESULT GetFilteringValue( + [in] DWORD prop, + [out] DXVA2_Fixed32 *value + ); + HRESULT SetFilteringValue( + [in] DWORD prop, + [in] DXVA2_Fixed32 *value + ); + HRESULT GetBackgroundColor( + [out] COLORREF *color + ); + HRESULT SetBackgroundColor( + [in] COLORREF color + ); +}
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/evr/tests/evr.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c index 44819c1b387..6e51dba9929 100644 --- a/dlls/evr/tests/evr.c +++ b/dlls/evr/tests/evr.c @@ -27,7 +27,7 @@ #include "mferror.h" #include "mfapi.h" #include "initguid.h" -#include "dxva2api.h" +#include "evr9.h"
static const WCHAR sink_id[] = {'E','V','R',' ','I','n','p','u','t','0',0};
@@ -396,6 +396,30 @@ static void test_default_mixer(void) ok(hr == S_OK, "Unexpected hr %#x.\n", hr); IUnknown_Release(unk);
+ hr = IMFTransform_QueryInterface(transform, &IID_IMFGetService, (void **)&unk); +todo_wine + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + if (SUCCEEDED(hr)) + 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); + + hr = IMFTransform_QueryInterface(transform, &IID_IMFVideoPositionMapper, (void **)&unk); +todo_wine + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + if (SUCCEEDED(hr)) + IUnknown_Release(unk); + + hr = IMFTransform_QueryInterface(transform, &IID_IMFVideoProcessor, (void **)&unk); +todo_wine + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + if (SUCCEEDED(hr)) + IUnknown_Release(unk); + hr = IMFTransform_QueryInterface(transform, &IID_IMFVideoMixerControl, (void **)&unk); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); IUnknown_Release(unk);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/evr/mixer.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ dlls/evr/tests/evr.c | 4 +--- 2 files changed, 45 insertions(+), 3 deletions(-)
diff --git a/dlls/evr/mixer.c b/dlls/evr/mixer.c index a65e82d4ca8..c835a62ad93 100644 --- a/dlls/evr/mixer.c +++ b/dlls/evr/mixer.c @@ -43,6 +43,7 @@ struct video_mixer IMFVideoDeviceID IMFVideoDeviceID_iface; IMFTopologyServiceLookupClient IMFTopologyServiceLookupClient_iface; IMFVideoMixerControl2 IMFVideoMixerControl2_iface; + IMFGetService IMFGetService_iface; LONG refcount;
struct input_stream inputs[MAX_MIXER_INPUT_STREAMS]; @@ -74,6 +75,11 @@ static struct video_mixer *impl_from_IMFVideoMixerControl2(IMFVideoMixerControl2 return CONTAINING_RECORD(iface, struct video_mixer, IMFVideoMixerControl2_iface); }
+static struct video_mixer *impl_from_IMFGetService(IMFGetService *iface) +{ + return CONTAINING_RECORD(iface, struct video_mixer, IMFGetService_iface); +} + static int video_mixer_compare_input_id(const void *a, const void *b) { const unsigned int *key = a; @@ -119,6 +125,10 @@ static HRESULT WINAPI video_mixer_transform_QueryInterface(IMFTransform *iface, { *obj = &mixer->IMFVideoMixerControl2_iface; } + else if (IsEqualIID(riid, &IID_IMFGetService)) + { + *obj = &mixer->IMFGetService_iface; + } else { WARN("Unsupported interface %s.\n", debugstr_guid(riid)); @@ -744,6 +754,39 @@ static const IMFVideoMixerControl2Vtbl video_mixer_control_vtbl = video_mixer_control_GetMixingPrefs, };
+static HRESULT WINAPI video_mixer_getservice_QueryInterface(IMFGetService *iface, REFIID riid, void **obj) +{ + struct video_mixer *mixer = impl_from_IMFGetService(iface); + return IMFTransform_QueryInterface(&mixer->IMFTransform_iface, riid, obj); +} + +static ULONG WINAPI video_mixer_getservice_AddRef(IMFGetService *iface) +{ + struct video_mixer *mixer = impl_from_IMFGetService(iface); + return IMFTransform_AddRef(&mixer->IMFTransform_iface); +} + +static ULONG WINAPI video_mixer_getservice_Release(IMFGetService *iface) +{ + struct video_mixer *mixer = impl_from_IMFGetService(iface); + return IMFTransform_Release(&mixer->IMFTransform_iface); +} + +static HRESULT WINAPI video_mixer_getservice_GetService(IMFGetService *iface, REFGUID service, REFIID riid, void **obj) +{ + FIXME("%p, %s, %s, %p.\n", iface, debugstr_guid(service), debugstr_guid(riid), obj); + + return E_NOTIMPL; +} + +static const IMFGetServiceVtbl video_mixer_getservice_vtbl = +{ + video_mixer_getservice_QueryInterface, + video_mixer_getservice_AddRef, + video_mixer_getservice_Release, + video_mixer_getservice_GetService, +}; + 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); @@ -770,6 +813,7 @@ HRESULT evr_mixer_create(IUnknown *outer, void **out) object->IMFVideoDeviceID_iface.lpVtbl = &video_mixer_device_id_vtbl; 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->refcount = 1; object->input_count = 1; video_mixer_init_input(&object->inputs[0]); diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c index 6e51dba9929..5ea1f1a644d 100644 --- a/dlls/evr/tests/evr.c +++ b/dlls/evr/tests/evr.c @@ -397,10 +397,8 @@ static void test_default_mixer(void) IUnknown_Release(unk);
hr = IMFTransform_QueryInterface(transform, &IID_IMFGetService, (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_IMFVideoMixerBitmap, (void **)&unk); todo_wine
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/evr/mixer.c | 72 ++++++++++++++++++++++++++++++++++++++++++++ dlls/evr/tests/evr.c | 4 +-- 2 files changed, 73 insertions(+), 3 deletions(-)
diff --git a/dlls/evr/mixer.c b/dlls/evr/mixer.c index c835a62ad93..1bc4f470401 100644 --- a/dlls/evr/mixer.c +++ b/dlls/evr/mixer.c @@ -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]); diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c index 5ea1f1a644d..4e97f65be09 100644 --- a/dlls/evr/tests/evr.c +++ b/dlls/evr/tests/evr.c @@ -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
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/evr/mixer.c | 45 ++++++++++++++++++++++++++++++++++++++++++++ dlls/evr/tests/evr.c | 4 +--- 2 files changed, 46 insertions(+), 3 deletions(-)
diff --git a/dlls/evr/mixer.c b/dlls/evr/mixer.c index 1bc4f470401..7663a28ab10 100644 --- a/dlls/evr/mixer.c +++ b/dlls/evr/mixer.c @@ -48,6 +48,7 @@ struct video_mixer IMFVideoMixerControl2 IMFVideoMixerControl2_iface; IMFGetService IMFGetService_iface; IMFVideoMixerBitmap IMFVideoMixerBitmap_iface; + IMFVideoPositionMapper IMFVideoPositionMapper_iface; LONG refcount;
struct input_stream inputs[MAX_MIXER_INPUT_STREAMS]; @@ -89,6 +90,11 @@ static struct video_mixer *impl_from_IMFVideoMixerBitmap(IMFVideoMixerBitmap *if return CONTAINING_RECORD(iface, struct video_mixer, IMFVideoMixerBitmap_iface); }
+static struct video_mixer *impl_from_IMFVideoPositionMapper(IMFVideoPositionMapper *iface) +{ + return CONTAINING_RECORD(iface, struct video_mixer, IMFVideoPositionMapper_iface); +} + static int video_mixer_compare_input_id(const void *a, const void *b) { const unsigned int *key = a; @@ -142,6 +148,10 @@ static HRESULT WINAPI video_mixer_transform_QueryInterface(IMFTransform *iface, { *obj = &mixer->IMFVideoMixerBitmap_iface; } + else if (IsEqualIID(riid, &IID_IMFVideoPositionMapper)) + { + *obj = &mixer->IMFVideoPositionMapper_iface; + } else { WARN("Unsupported interface %s.\n", debugstr_guid(riid)); @@ -858,6 +868,40 @@ static const IMFVideoMixerBitmapVtbl video_mixer_bitmap_vtbl = video_mixer_bitmap_GetAlphaBitmapParameters, };
+static HRESULT WINAPI video_mixer_position_mapper_QueryInterface(IMFVideoPositionMapper *iface, REFIID riid, void **obj) +{ + struct video_mixer *mixer = impl_from_IMFVideoPositionMapper(iface); + return IMFTransform_QueryInterface(&mixer->IMFTransform_iface, riid, obj); +} + +static ULONG WINAPI video_mixer_position_mapper_AddRef(IMFVideoPositionMapper *iface) +{ + struct video_mixer *mixer = impl_from_IMFVideoPositionMapper(iface); + return IMFTransform_AddRef(&mixer->IMFTransform_iface); +} + +static ULONG WINAPI video_mixer_position_mapper_Release(IMFVideoPositionMapper *iface) +{ + struct video_mixer *mixer = impl_from_IMFVideoPositionMapper(iface); + return IMFTransform_Release(&mixer->IMFTransform_iface); +} + +static HRESULT WINAPI video_mixer_position_mapper_MapOutputCoordinateToInputStream(IMFVideoPositionMapper *iface, + float x_out, float y_out, DWORD output_stream, DWORD input_stream, float *x_in, float *y_in) +{ + FIXME("%p, %f, %f, %u, %u, %p, %p.\n", iface, x_out, y_out, output_stream, input_stream, x_in, y_in); + + return E_NOTIMPL; +} + +static const IMFVideoPositionMapperVtbl video_mixer_position_mapper_vtbl = +{ + video_mixer_position_mapper_QueryInterface, + video_mixer_position_mapper_AddRef, + video_mixer_position_mapper_Release, + video_mixer_position_mapper_MapOutputCoordinateToInputStream, +}; + 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); @@ -886,6 +930,7 @@ HRESULT evr_mixer_create(IUnknown *outer, void **out) 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->IMFVideoPositionMapper_iface.lpVtbl = &video_mixer_position_mapper_vtbl; object->refcount = 1; object->input_count = 1; video_mixer_init_input(&object->inputs[0]); diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c index 4e97f65be09..4f954d868a6 100644 --- a/dlls/evr/tests/evr.c +++ b/dlls/evr/tests/evr.c @@ -405,10 +405,8 @@ static void test_default_mixer(void) IUnknown_Release(unk);
hr = IMFTransform_QueryInterface(transform, &IID_IMFVideoPositionMapper, (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_IMFVideoProcessor, (void **)&unk); todo_wine