Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/evr/mixer.c | 24 +++++++++++++++++++++--- dlls/evr/tests/evr.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 3 deletions(-)
diff --git a/dlls/evr/mixer.c b/dlls/evr/mixer.c index 55acf179bdc..b87b621835e 100644 --- a/dlls/evr/mixer.c +++ b/dlls/evr/mixer.c @@ -909,11 +909,29 @@ static HRESULT WINAPI video_mixer_transform_GetOutputCurrentType(IMFTransform *i return hr; }
-static HRESULT WINAPI video_mixer_transform_GetInputStatus(IMFTransform *iface, DWORD id, DWORD *flags) +static HRESULT WINAPI video_mixer_transform_GetInputStatus(IMFTransform *iface, DWORD id, DWORD *status) { - FIXME("%p, %u, %p.\n", iface, id, flags); + struct video_mixer *mixer = impl_from_IMFTransform(iface); + struct input_stream *stream; + HRESULT hr;
- return E_NOTIMPL; + TRACE("%p, %u, %p.\n", iface, id, status); + + if (!status) + return E_POINTER; + + EnterCriticalSection(&mixer->cs); + + if (!mixer->output.media_type) + hr = MF_E_TRANSFORM_TYPE_NOT_SET; + else if (SUCCEEDED(hr = video_mixer_get_input(mixer, id, &stream))) + { + *status = stream->sample ? 0 : MFT_INPUT_STATUS_ACCEPT_DATA; + } + + LeaveCriticalSection(&mixer->cs); + + return hr; }
static HRESULT WINAPI video_mixer_transform_GetOutputStatus(IMFTransform *iface, DWORD *flags) diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c index d71a63ff602..776f61bbbe7 100644 --- a/dlls/evr/tests/evr.c +++ b/dlls/evr/tests/evr.c @@ -2086,6 +2086,18 @@ static void test_mixer_samples(void) hr = MFCreateVideoMixer(NULL, &IID_IDirect3DDevice9, &IID_IMFTransform, (void **)&mixer); ok(hr == S_OK, "Failed to create a mixer, hr %#x.\n", hr);
+ hr = IMFTransform_GetInputStatus(mixer, 0, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + hr = IMFTransform_GetInputStatus(mixer, 1, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + hr = IMFTransform_GetInputStatus(mixer, 0, &status); + ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr); + + hr = IMFTransform_GetInputStatus(mixer, 1, &status); + ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr); + /* Configure device and media types. */ hr = DXVA2CreateDirect3DDeviceManager9(&token, &manager); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); @@ -2106,9 +2118,20 @@ static void test_mixer_samples(void) hr = IMFTransform_SetInputType(mixer, 0, video_type, 0); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ hr = IMFTransform_GetInputStatus(mixer, 0, &status); + ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr); + hr = IMFTransform_SetOutputType(mixer, 0, video_type, 0); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ status = 0; + hr = IMFTransform_GetInputStatus(mixer, 0, &status); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(status == MFT_INPUT_STATUS_ACCEPT_DATA, "Unexpected status %#x.\n", status); + + hr = IMFTransform_GetInputStatus(mixer, 1, &status); + ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr); + IMFMediaType_Release(video_type);
memset(&buffer, 0, sizeof(buffer)); @@ -2162,9 +2185,19 @@ todo_wine hr = IMFTransform_ProcessInput(mixer, 5, NULL, 0); ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ status = 0; + hr = IMFTransform_GetInputStatus(mixer, 0, &status); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(status == MFT_INPUT_STATUS_ACCEPT_DATA, "Unexpected status %#x.\n", status); + hr = IMFTransform_ProcessInput(mixer, 0, sample, 0); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ status = ~0u; + hr = IMFTransform_GetInputStatus(mixer, 0, &status); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(!status, "Unexpected status %#x.\n", status); + hr = IMFTransform_ProcessInput(mixer, 0, sample, 0); ok(hr == MF_E_NOTACCEPTING, "Unexpected hr %#x.\n", hr);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/evr/mixer.c | 32 +++++++++++++++++++++++++++++--- dlls/evr/tests/evr.c | 20 ++++++++++++++++++++ 2 files changed, 49 insertions(+), 3 deletions(-)
diff --git a/dlls/evr/mixer.c b/dlls/evr/mixer.c index b87b621835e..2c2fda51cd1 100644 --- a/dlls/evr/mixer.c +++ b/dlls/evr/mixer.c @@ -934,11 +934,37 @@ static HRESULT WINAPI video_mixer_transform_GetInputStatus(IMFTransform *iface, return hr; }
-static HRESULT WINAPI video_mixer_transform_GetOutputStatus(IMFTransform *iface, DWORD *flags) +static HRESULT WINAPI video_mixer_transform_GetOutputStatus(IMFTransform *iface, DWORD *status) { - FIXME("%p, %p.\n", iface, flags); + struct video_mixer *mixer = impl_from_IMFTransform(iface); + HRESULT hr = S_OK; + unsigned int i;
- return E_NOTIMPL; + TRACE("%p, %p.\n", iface, status); + + if (!status) + return E_POINTER; + + EnterCriticalSection(&mixer->cs); + + if (!mixer->output.media_type) + hr = MF_E_TRANSFORM_TYPE_NOT_SET; + else + { + *status = MFT_OUTPUT_STATUS_SAMPLE_READY; + for (i = 0; i < mixer->input_count; ++i) + { + if (!mixer->inputs[i].sample) + { + *status = 0; + break; + } + } + } + + LeaveCriticalSection(&mixer->cs); + + return hr; }
static HRESULT WINAPI video_mixer_transform_SetOutputBounds(IMFTransform *iface, LONGLONG lower, LONGLONG upper) diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c index 776f61bbbe7..7cf127d4d8c 100644 --- a/dlls/evr/tests/evr.c +++ b/dlls/evr/tests/evr.c @@ -2098,6 +2098,12 @@ static void test_mixer_samples(void) hr = IMFTransform_GetInputStatus(mixer, 1, &status); ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr);
+ hr = IMFTransform_GetOutputStatus(mixer, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + hr = IMFTransform_GetOutputStatus(mixer, &status); + ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr); + /* Configure device and media types. */ hr = DXVA2CreateDirect3DDeviceManager9(&token, &manager); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); @@ -2132,6 +2138,11 @@ static void test_mixer_samples(void) hr = IMFTransform_GetInputStatus(mixer, 1, &status); ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
+ status = ~0u; + hr = IMFTransform_GetOutputStatus(mixer, &status); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(!status, "Unexpected status %#x.\n", status); + IMFMediaType_Release(video_type);
memset(&buffer, 0, sizeof(buffer)); @@ -2190,6 +2201,11 @@ todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(status == MFT_INPUT_STATUS_ACCEPT_DATA, "Unexpected status %#x.\n", status);
+ status = ~0u; + hr = IMFTransform_GetOutputStatus(mixer, &status); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(!status, "Unexpected status %#x.\n", status); + hr = IMFTransform_ProcessInput(mixer, 0, sample, 0); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
@@ -2198,6 +2214,10 @@ todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(!status, "Unexpected status %#x.\n", status);
+ hr = IMFTransform_GetOutputStatus(mixer, &status); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(status == MFT_OUTPUT_STATUS_SAMPLE_READY, "Unexpected status %#x.\n", status); + hr = IMFTransform_ProcessInput(mixer, 0, sample, 0); ok(hr == MF_E_NOTACCEPTING, "Unexpected hr %#x.\n", hr);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/evr/mixer.c | 91 +++++++++++++++++++++++++++++++++++++++++--- dlls/evr/tests/evr.c | 19 +++++++-- 2 files changed, 100 insertions(+), 10 deletions(-)
diff --git a/dlls/evr/mixer.c b/dlls/evr/mixer.c index 2c2fda51cd1..b4bf1ed0967 100644 --- a/dlls/evr/mixer.c +++ b/dlls/evr/mixer.c @@ -712,6 +712,13 @@ static HRESULT video_mixer_collect_output_types(struct video_mixer *mixer, const return count ? S_OK : hr; }
+static HRESULT video_mixer_open_device_handle(struct video_mixer *mixer) +{ + IDirect3DDeviceManager9_CloseDeviceHandle(mixer->device_manager, mixer->device_handle); + mixer->device_handle = NULL; + return IDirect3DDeviceManager9_OpenDeviceHandle(mixer->device_manager, &mixer->device_handle); +} + static HRESULT video_mixer_get_processor_service(struct video_mixer *mixer, IDirectXVideoProcessorService **service) { HRESULT hr; @@ -728,9 +735,7 @@ static HRESULT video_mixer_get_processor_service(struct video_mixer *mixer, IDir &IID_IDirectXVideoProcessorService, (void **)service); if (hr == DXVA2_E_NEW_VIDEO_DEVICE) { - IDirect3DDeviceManager9_CloseDeviceHandle(mixer->device_manager, mixer->device_handle); - mixer->device_handle = NULL; - if (SUCCEEDED(hr = IDirect3DDeviceManager9_OpenDeviceHandle(mixer->device_manager, &mixer->device_handle))) + if (SUCCEEDED(hr = video_mixer_open_device_handle(mixer))) continue; } break; @@ -1083,12 +1088,86 @@ static HRESULT WINAPI video_mixer_transform_ProcessInput(IMFTransform *iface, DW return hr; }
+static HRESULT video_mixer_get_sample_surface(IMFSample *sample, IDirect3DSurface9 **surface) +{ + IMFMediaBuffer *buffer; + IMFGetService *gs; + HRESULT hr; + + if (FAILED(hr = IMFSample_GetBufferByIndex(sample, 0, &buffer))) + return hr; + + hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMFGetService, (void **)&gs); + IMFMediaBuffer_Release(buffer); + if (FAILED(hr)) + return hr; + + hr = IMFGetService_GetService(gs, &MR_BUFFER_SERVICE, &IID_IDirect3DSurface9, (void **)surface); + IMFGetService_Release(gs); + return hr; +} + +static HRESULT video_mixer_get_d3d_device(struct video_mixer *mixer, IDirect3DDevice9 **device) +{ + HRESULT hr; + + for (;;) + { + hr = IDirect3DDeviceManager9_LockDevice(mixer->device_manager, mixer->device_handle, + device, TRUE); + if (hr == DXVA2_E_NEW_VIDEO_DEVICE) + { + if (SUCCEEDED(hr = video_mixer_open_device_handle(mixer))) + continue; + } + break; + } + + return hr; +} + static HRESULT WINAPI video_mixer_transform_ProcessOutput(IMFTransform *iface, DWORD flags, DWORD count, - MFT_OUTPUT_DATA_BUFFER *samples, DWORD *status) + MFT_OUTPUT_DATA_BUFFER *buffers, DWORD *status) { - FIXME("%p, %#x, %u, %p, %p.\n", iface, flags, count, samples, status); + struct video_mixer *mixer = impl_from_IMFTransform(iface); + IDirect3DSurface9 *surface; + IDirect3DDevice9 *device; + HRESULT hr;
- return E_NOTIMPL; + TRACE("%p, %#x, %u, %p, %p.\n", iface, flags, count, buffers, status); + + if (!buffers || !count || !buffers->pSample) + return E_INVALIDARG; + + if (count > 1) + FIXME("Multiple buffers are not handled.\n"); + + *status = 0; + + EnterCriticalSection(&mixer->cs); + + if (SUCCEEDED(hr = video_mixer_get_sample_surface(buffers->pSample, &surface))) + { + if (mixer->is_streaming) + { + FIXME("Streaming state is not handled.\n"); + hr = E_NOTIMPL; + } + else + { + if (SUCCEEDED(hr = video_mixer_get_d3d_device(mixer, &device))) + { + IDirect3DDevice9_ColorFill(device, surface, NULL, 0); + IDirect3DDeviceManager9_UnlockDevice(mixer->device_manager, mixer->device_handle, FALSE); + IDirect3DDevice9_Release(device); + } + } + IDirect3DSurface9_Release(surface); + } + + LeaveCriticalSection(&mixer->cs); + + return hr; }
static const IMFTransformVtbl video_mixer_transform_vtbl = diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c index 7cf127d4d8c..fc74a11496b 100644 --- a/dlls/evr/tests/evr.c +++ b/dlls/evr/tests/evr.c @@ -2062,6 +2062,7 @@ static void test_mixer_samples(void) { IDirect3DDeviceManager9 *manager; MFT_OUTPUT_DATA_BUFFER buffer; + IMFVideoProcessor *processor; IDirect3DSurface9 *surface; IMFDesiredSample *desired; IDirect3DDevice9 *device; @@ -2086,6 +2087,9 @@ static void test_mixer_samples(void) hr = MFCreateVideoMixer(NULL, &IID_IDirect3DDevice9, &IID_IMFTransform, (void **)&mixer); ok(hr == S_OK, "Failed to create a mixer, hr %#x.\n", hr);
+ hr = IMFTransform_QueryInterface(mixer, &IID_IMFVideoProcessor, (void **)&processor); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + hr = IMFTransform_GetInputStatus(mixer, 0, NULL); ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
@@ -2147,7 +2151,6 @@ static void test_mixer_samples(void)
memset(&buffer, 0, sizeof(buffer)); hr = IMFTransform_ProcessOutput(mixer, 0, 1, &buffer, &status); -todo_wine ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
/* It needs a sample with a backing surface. */ @@ -2156,7 +2159,6 @@ todo_wine
buffer.pSample = sample; hr = IMFTransform_ProcessOutput(mixer, 0, 1, &buffer, &status); -todo_wine ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
IMFSample_Release(sample); @@ -2175,17 +2177,25 @@ todo_wine ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "Unexpected hr %#x.\n", hr);
color = get_surface_color(surface, 0, 0); +todo_wine ok(color == D3DCOLOR_ARGB(0x10, 0xff, 0x00, 0x00), "Unexpected color %#x.\n", color);
/* Streaming is not started yet. Output is colored black, but only if desired timestamps were set. */ IMFDesiredSample_SetDesiredSampleTimeAndDuration(desired, 100, 0);
hr = IMFTransform_ProcessOutput(mixer, 0, 1, &buffer, &status); -todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
color = get_surface_color(surface, 0, 0); -todo_wine + ok(!color, "Unexpected color %#x.\n", color); + + hr = IMFVideoProcessor_SetBackgroundColor(processor, RGB(0, 0, 255)); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + + hr = IMFTransform_ProcessOutput(mixer, 0, 1, &buffer, &status); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + + color = get_surface_color(surface, 0, 0); ok(!color, "Unexpected color %#x.\n", color);
IMFDesiredSample_Clear(desired); @@ -2231,6 +2241,7 @@ todo_wine
IDirect3DSurface9_Release(surface);
+ IMFVideoProcessor_Release(processor); IMFTransform_Release(mixer);
IDirect3DDevice9_Release(device);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/evr/mixer.c | 6 +++--- dlls/evr/tests/evr.c | 29 ++++++++++++++++++++--------- 2 files changed, 23 insertions(+), 12 deletions(-)
diff --git a/dlls/evr/mixer.c b/dlls/evr/mixer.c index b4bf1ed0967..48875a200fd 100644 --- a/dlls/evr/mixer.c +++ b/dlls/evr/mixer.c @@ -1136,11 +1136,11 @@ static HRESULT WINAPI video_mixer_transform_ProcessOutput(IMFTransform *iface, D
TRACE("%p, %#x, %u, %p, %p.\n", iface, flags, count, buffers, status);
- if (!buffers || !count || !buffers->pSample) + if (!buffers || !count || count > 1 || !buffers->pSample) return E_INVALIDARG;
- if (count > 1) - FIXME("Multiple buffers are not handled.\n"); + if (buffers->dwStreamID) + return MF_E_INVALIDSTREAMNUMBER;
*status = 0;
diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c index fc74a11496b..7447f388ed7 100644 --- a/dlls/evr/tests/evr.c +++ b/dlls/evr/tests/evr.c @@ -2061,7 +2061,7 @@ static DWORD get_surface_color(IDirect3DSurface9 *surface, unsigned int x, unsig static void test_mixer_samples(void) { IDirect3DDeviceManager9 *manager; - MFT_OUTPUT_DATA_BUFFER buffer; + MFT_OUTPUT_DATA_BUFFER buffers[2]; IMFVideoProcessor *processor; IDirect3DSurface9 *surface; IMFDesiredSample *desired; @@ -2149,16 +2149,16 @@ static void test_mixer_samples(void)
IMFMediaType_Release(video_type);
- memset(&buffer, 0, sizeof(buffer)); - hr = IMFTransform_ProcessOutput(mixer, 0, 1, &buffer, &status); + memset(buffers, 0, sizeof(buffers)); + hr = IMFTransform_ProcessOutput(mixer, 0, 1, buffers, &status); ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
/* It needs a sample with a backing surface. */ hr = MFCreateSample(&sample); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- buffer.pSample = sample; - hr = IMFTransform_ProcessOutput(mixer, 0, 1, &buffer, &status); + buffers[0].pSample = sample; + hr = IMFTransform_ProcessOutput(mixer, 0, 1, buffers, &status); ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
IMFSample_Release(sample); @@ -2171,8 +2171,8 @@ static void test_mixer_samples(void) hr = IMFSample_QueryInterface(sample, &IID_IMFDesiredSample, (void **)&desired); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- buffer.pSample = sample; - hr = IMFTransform_ProcessOutput(mixer, 0, 1, &buffer, &status); + buffers[0].pSample = sample; + hr = IMFTransform_ProcessOutput(mixer, 0, 1, buffers, &status); todo_wine ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "Unexpected hr %#x.\n", hr);
@@ -2183,7 +2183,7 @@ todo_wine /* Streaming is not started yet. Output is colored black, but only if desired timestamps were set. */ IMFDesiredSample_SetDesiredSampleTimeAndDuration(desired, 100, 0);
- hr = IMFTransform_ProcessOutput(mixer, 0, 1, &buffer, &status); + hr = IMFTransform_ProcessOutput(mixer, 0, 1, buffers, &status); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
color = get_surface_color(surface, 0, 0); @@ -2192,12 +2192,23 @@ todo_wine hr = IMFVideoProcessor_SetBackgroundColor(processor, RGB(0, 0, 255)); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- hr = IMFTransform_ProcessOutput(mixer, 0, 1, &buffer, &status); + hr = IMFTransform_ProcessOutput(mixer, 0, 1, buffers, &status); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
color = get_surface_color(surface, 0, 0); ok(!color, "Unexpected color %#x.\n", color);
+ hr = IMFTransform_ProcessOutput(mixer, 0, 2, buffers, &status); + ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + + buffers[1].pSample = sample; + hr = IMFTransform_ProcessOutput(mixer, 0, 2, buffers, &status); + ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + + buffers[0].dwStreamID = 1; + hr = IMFTransform_ProcessOutput(mixer, 0, 1, buffers, &status); + ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr); + IMFDesiredSample_Clear(desired);
hr = IMFTransform_ProcessInput(mixer, 0, NULL, 0);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/evr/presenter.c | 50 +++++++++++++++++++++++++++++++++++++++++++- dlls/evr/tests/evr.c | 8 +++++++ 2 files changed, 57 insertions(+), 1 deletion(-)
diff --git a/dlls/evr/presenter.c b/dlls/evr/presenter.c index 8fcd6d58b3c..96eaa4426fc 100644 --- a/dlls/evr/presenter.c +++ b/dlls/evr/presenter.c @@ -48,6 +48,7 @@ struct video_presenter IMFVideoDisplayControl IMFVideoDisplayControl_iface; IMFRateSupport IMFRateSupport_iface; IMFGetService IMFGetService_iface; + IMFVideoPositionMapper IMFVideoPositionMapper_iface; IUnknown IUnknown_inner; IUnknown *outer_unk; LONG refcount; @@ -104,6 +105,11 @@ static struct video_presenter *impl_from_IMFGetService(IMFGetService *iface) return CONTAINING_RECORD(iface, struct video_presenter, IMFGetService_iface); }
+static struct video_presenter *impl_from_IMFVideoPositionMapper(IMFVideoPositionMapper *iface) +{ + return CONTAINING_RECORD(iface, struct video_presenter, IMFVideoPositionMapper_iface); +} + static unsigned int get_gcd(unsigned int a, unsigned int b) { unsigned int m; @@ -191,6 +197,10 @@ static HRESULT WINAPI video_presenter_inner_QueryInterface(IUnknown *iface, REFI { *obj = &presenter->IMFGetService_iface; } + else if (IsEqualIID(riid, &IID_IMFVideoPositionMapper)) + { + *obj = &presenter->IMFVideoPositionMapper_iface; + } else { WARN("Unimplemented interface %s.\n", debugstr_guid(riid)); @@ -900,8 +910,11 @@ static HRESULT WINAPI video_presenter_getservice_GetService(IMFGetService *iface
if (IsEqualGUID(&MR_VIDEO_RENDER_SERVICE, service)) { - if (IsEqualIID(riid, &IID_IMFVideoDisplayControl)) + if (IsEqualIID(riid, &IID_IMFVideoDisplayControl) || + IsEqualIID(riid, &IID_IMFVideoPositionMapper)) + { return IMFVideoPresenter_QueryInterface(&presenter->IMFVideoPresenter_iface, riid, obj); + } else { FIXME("Unsupported interface %s.\n", debugstr_guid(riid)); @@ -922,6 +935,40 @@ static const IMFGetServiceVtbl video_presenter_getservice_vtbl = video_presenter_getservice_GetService, };
+static HRESULT WINAPI video_presenter_position_mapper_QueryInterface(IMFVideoPositionMapper *iface, REFIID riid, void **obj) +{ + struct video_presenter *presenter = impl_from_IMFVideoPositionMapper(iface); + return IMFVideoPresenter_QueryInterface(&presenter->IMFVideoPresenter_iface, riid, obj); +} + +static ULONG WINAPI video_presenter_position_mapper_AddRef(IMFVideoPositionMapper *iface) +{ + struct video_presenter *presenter = impl_from_IMFVideoPositionMapper(iface); + return IMFVideoPresenter_AddRef(&presenter->IMFVideoPresenter_iface); +} + +static ULONG WINAPI video_presenter_position_mapper_Release(IMFVideoPositionMapper *iface) +{ + struct video_presenter *presenter = impl_from_IMFVideoPositionMapper(iface); + return IMFVideoPresenter_Release(&presenter->IMFVideoPresenter_iface); +} + +static HRESULT WINAPI video_presenter_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_presenter_position_mapper_vtbl = +{ + video_presenter_position_mapper_QueryInterface, + video_presenter_position_mapper_AddRef, + video_presenter_position_mapper_Release, + video_presenter_position_mapper_MapOutputCoordinateToInputStream, +}; + HRESULT WINAPI MFCreateVideoPresenter(IUnknown *owner, REFIID riid_device, REFIID riid, void **obj) { TRACE("%p, %s, %s, %p.\n", owner, debugstr_guid(riid_device), debugstr_guid(riid), obj); @@ -984,6 +1031,7 @@ HRESULT evr_presenter_create(IUnknown *outer, void **out) object->IMFVideoDisplayControl_iface.lpVtbl = &video_presenter_control_vtbl; object->IMFRateSupport_iface.lpVtbl = &video_presenter_rate_support_vtbl; object->IMFGetService_iface.lpVtbl = &video_presenter_getservice_vtbl; + object->IMFVideoPositionMapper_iface.lpVtbl = &video_presenter_position_mapper_vtbl; object->IUnknown_inner.lpVtbl = &video_presenter_inner_vtbl; object->outer_unk = outer ? outer : &object->IUnknown_inner; object->refcount = 1; diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c index 7447f388ed7..0158a0320a7 100644 --- a/dlls/evr/tests/evr.c +++ b/dlls/evr/tests/evr.c @@ -1099,6 +1099,14 @@ static void test_default_presenter(void) if (FAILED(hr)) return;
+ hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFVideoPositionMapper, (void **)&unk); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + IUnknown_Release(unk); + + hr = MFGetService((IUnknown *)presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFVideoPositionMapper, (void **)&unk); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + IUnknown_Release(unk); + hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFVideoDeviceID, (void **)&deviceid); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=80812
Your paranoid android.
=== debiant (32 bit Chinese:China report) ===
evr: evr: Timeout