Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/evr/mixer.c | 24 ++++++++++++++++++++---- dlls/evr/tests/evr.c | 15 ++++++++++++++- include/evr.idl | 10 ++++++++++ 3 files changed, 44 insertions(+), 5 deletions(-)
diff --git a/dlls/evr/mixer.c b/dlls/evr/mixer.c index 7e08beae353..c7dbf8ff975 100644 --- a/dlls/evr/mixer.c +++ b/dlls/evr/mixer.c @@ -73,6 +73,7 @@ struct video_mixer IDirect3DDeviceManager9 *device_manager; IMediaEventSink *event_sink; IMFAttributes *attributes; + unsigned int mixing_flags; CRITICAL_SECTION cs; };
@@ -1008,16 +1009,31 @@ static HRESULT WINAPI video_mixer_control_GetStreamOutputRect(IMFVideoMixerContr
static HRESULT WINAPI video_mixer_control_SetMixingPrefs(IMFVideoMixerControl2 *iface, DWORD flags) { - FIXME("%p, %#x.\n", iface, flags); + struct video_mixer *mixer = impl_from_IMFVideoMixerControl2(iface);
- return E_NOTIMPL; + TRACE("%p, %#x.\n", iface, flags); + + EnterCriticalSection(&mixer->cs); + mixer->mixing_flags = flags; + LeaveCriticalSection(&mixer->cs); + + return S_OK; }
static HRESULT WINAPI video_mixer_control_GetMixingPrefs(IMFVideoMixerControl2 *iface, DWORD *flags) { - FIXME("%p, %p.\n", iface, flags); + struct video_mixer *mixer = impl_from_IMFVideoMixerControl2(iface);
- return E_NOTIMPL; + TRACE("%p, %p.\n", iface, flags); + + if (!flags) + return E_POINTER; + + EnterCriticalSection(&mixer->cs); + *flags = mixer->mixing_flags; + LeaveCriticalSection(&mixer->cs); + + return S_OK; }
static const IMFVideoMixerControl2Vtbl video_mixer_control_vtbl = diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c index ba97eba53d1..92810b516a7 100644 --- a/dlls/evr/tests/evr.c +++ b/dlls/evr/tests/evr.c @@ -414,6 +414,7 @@ static void test_default_mixer(void) { DWORD input_min, input_max, output_min, output_max; IMFAttributes *attributes, *attributes2; + IMFVideoMixerControl2 *mixer_control2; MFT_OUTPUT_STREAM_INFO output_info; MFT_INPUT_STREAM_INFO input_info; DWORD input_count, output_count; @@ -424,12 +425,12 @@ static void test_default_mixer(void) IMFTransform *transform; DXVA2_ValueRange range; DXVA2_Fixed32 value; + DWORD flags, count; IMFGetService *gs; COLORREF color; unsigned int i; DWORD ids[16]; IUnknown *unk; - DWORD count; GUID *guids; HRESULT hr; IID iid; @@ -455,6 +456,18 @@ static void test_default_mixer(void) ok(hr == S_OK, "Unexpected hr %#x.\n", hr); IUnknown_Release(unk);
+ if (SUCCEEDED(IMFGetService_GetService(gs, &MR_VIDEO_MIXER_SERVICE, &IID_IMFVideoMixerControl2, (void **)&mixer_control2))) + { + hr = IMFVideoMixerControl2_GetMixingPrefs(mixer_control2, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + hr = IMFVideoMixerControl2_GetMixingPrefs(mixer_control2, &flags); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(!flags, "Unexpected flags %#x.\n", flags); + + IMFVideoMixerControl2_Release(mixer_control2); + } + hr = IMFVideoProcessor_GetBackgroundColor(processor, NULL); ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
diff --git a/include/evr.idl b/include/evr.idl index 6369a39b2f3..77c46a075f1 100644 --- a/include/evr.idl +++ b/include/evr.idl @@ -184,6 +184,16 @@ interface IMFVideoMixerControl : IUnknown ); }
+typedef enum _MFVideoMixPrefs +{ + MFVideoMixPrefs_ForceHalfInterlace = 0x00000001, + MFVideoMixPrefs_AllowDropToHalfInterlace = 0x00000002, + MFVideoMixPrefs_AllowDropToBob = 0x00000004, + MFVideoMixPrefs_ForceBob = 0x00000008, + MFVideoMixPrefs_EnableRotation = 0x00000010, + MFVideoMixPrefs_Mask = 0x0000001f, +} MFVideoMixPrefs; + [ object, uuid(8459616d-966e-4930-b658-54fa7e5a16d3)