Commit f9490876 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

evr: Create and initialize mixer transform attributes.

parent 5ec9505a
...@@ -70,11 +70,9 @@ struct video_mixer ...@@ -70,11 +70,9 @@ struct video_mixer
struct output_stream output; struct output_stream output;
COLORREF bkgnd_color; COLORREF bkgnd_color;
IDirect3DDeviceManager9 *device_manager; IDirect3DDeviceManager9 *device_manager;
IMediaEventSink *event_sink; IMediaEventSink *event_sink;
IMFAttributes *attributes;
CRITICAL_SECTION cs; CRITICAL_SECTION cs;
}; };
...@@ -246,6 +244,8 @@ static ULONG WINAPI video_mixer_inner_Release(IUnknown *iface) ...@@ -246,6 +244,8 @@ static ULONG WINAPI video_mixer_inner_Release(IUnknown *iface)
video_mixer_clear_types(mixer); video_mixer_clear_types(mixer);
if (mixer->device_manager) if (mixer->device_manager)
IDirect3DDeviceManager9_Release(mixer->device_manager); IDirect3DDeviceManager9_Release(mixer->device_manager);
if (mixer->attributes)
IMFAttributes_Release(mixer->attributes);
DeleteCriticalSection(&mixer->cs); DeleteCriticalSection(&mixer->cs);
free(mixer); free(mixer);
} }
...@@ -360,9 +360,17 @@ static HRESULT WINAPI video_mixer_transform_GetOutputStreamInfo(IMFTransform *if ...@@ -360,9 +360,17 @@ static HRESULT WINAPI video_mixer_transform_GetOutputStreamInfo(IMFTransform *if
static HRESULT WINAPI video_mixer_transform_GetAttributes(IMFTransform *iface, IMFAttributes **attributes) static HRESULT WINAPI video_mixer_transform_GetAttributes(IMFTransform *iface, IMFAttributes **attributes)
{ {
FIXME("%p, %p.\n", iface, attributes); struct video_mixer *mixer = impl_from_IMFTransform(iface);
return E_NOTIMPL; TRACE("%p, %p.\n", iface, attributes);
if (!attributes)
return E_POINTER;
*attributes = mixer->attributes;
IMFAttributes_AddRef(*attributes);
return S_OK;
} }
static HRESULT WINAPI video_mixer_transform_GetInputStreamAttributes(IMFTransform *iface, DWORD id, static HRESULT WINAPI video_mixer_transform_GetInputStreamAttributes(IMFTransform *iface, DWORD id,
...@@ -1317,6 +1325,8 @@ HRESULT WINAPI MFCreateVideoMixer(IUnknown *owner, REFIID riid_device, REFIID ri ...@@ -1317,6 +1325,8 @@ HRESULT WINAPI MFCreateVideoMixer(IUnknown *owner, REFIID riid_device, REFIID ri
HRESULT evr_mixer_create(IUnknown *outer, void **out) HRESULT evr_mixer_create(IUnknown *outer, void **out)
{ {
struct video_mixer *object; struct video_mixer *object;
MFVideoNormalizedRect rect;
HRESULT hr;
if (!(object = calloc(1, sizeof(*object)))) if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
...@@ -1335,6 +1345,14 @@ HRESULT evr_mixer_create(IUnknown *outer, void **out) ...@@ -1335,6 +1345,14 @@ HRESULT evr_mixer_create(IUnknown *outer, void **out)
object->input_count = 1; object->input_count = 1;
video_mixer_init_input(&object->inputs[0]); video_mixer_init_input(&object->inputs[0]);
InitializeCriticalSection(&object->cs); InitializeCriticalSection(&object->cs);
if (FAILED(hr = MFCreateAttributes(&object->attributes, 0)))
{
IUnknown_Release(&object->IUnknown_inner);
return hr;
}
rect.left = rect.top = 0.0f;
rect.right = rect.bottom = 1.0f;
IMFAttributes_SetBlob(object->attributes, &VIDEO_ZOOM_RECT, (const UINT8 *)&rect, sizeof(rect));
*out = &object->IUnknown_inner; *out = &object->IUnknown_inner;
......
...@@ -419,6 +419,7 @@ static void test_default_mixer(void) ...@@ -419,6 +419,7 @@ static void test_default_mixer(void)
DWORD input_count, output_count; DWORD input_count, output_count;
IMFVideoProcessor *processor; IMFVideoProcessor *processor;
IMFVideoDeviceID *deviceid; IMFVideoDeviceID *deviceid;
MFVideoNormalizedRect rect;
DWORD input_id, output_id; DWORD input_id, output_id;
IMFTransform *transform; IMFTransform *transform;
DXVA2_ValueRange range; DXVA2_ValueRange range;
...@@ -508,6 +509,29 @@ todo_wine ...@@ -508,6 +509,29 @@ todo_wine
hr = IMFTransform_QueryInterface(transform, &IID_IMFVideoDeviceID, (void **)&deviceid); hr = IMFTransform_QueryInterface(transform, &IID_IMFVideoDeviceID, (void **)&deviceid);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFTransform_GetAttributes(transform, NULL);
ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
hr = IMFTransform_GetAttributes(transform, &attributes);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFTransform_GetAttributes(transform, &attributes2);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(attributes == attributes2, "Unexpected attributes instance.\n");
IMFAttributes_Release(attributes2);
hr = IMFAttributes_GetCount(attributes, &count);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(count == 1, "Unexpected attribute count %u.\n", count);
memset(&rect, 0, sizeof(rect));
hr = IMFAttributes_GetBlob(attributes, &VIDEO_ZOOM_RECT, (UINT8 *)&rect, sizeof(rect), NULL);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(rect.left == 0.0f && rect.top == 0.0f && rect.right == 1.0f && rect.bottom == 1.0f,
"Unexpected zoom rect (%f, %f) - (%f, %f).\n", rect.left, rect.top, rect.right, rect.bottom);
IMFAttributes_Release(attributes);
hr = IMFVideoDeviceID_GetDeviceID(deviceid, NULL); hr = IMFVideoDeviceID_GetDeviceID(deviceid, NULL);
ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment