evr/mixer: Add support for MFT_SET_TYPE_TEST_ONLY for inputs.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
430c179fe8
commit
24c9d77cee
|
@ -611,12 +611,12 @@ static int rt_formats_sort_compare(const void *left, const void *right)
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT video_mixer_collect_output_types(struct video_mixer *mixer, const DXVA2_VideoDesc *video_desc,
|
static HRESULT video_mixer_collect_output_types(struct video_mixer *mixer, const DXVA2_VideoDesc *video_desc,
|
||||||
IDirectXVideoProcessorService *service, unsigned int device_count, const GUID *devices)
|
IDirectXVideoProcessorService *service, unsigned int device_count, const GUID *devices, unsigned int flags)
|
||||||
{
|
{
|
||||||
unsigned int i, j, format_count, count;
|
unsigned int i, j, format_count, count;
|
||||||
D3DFORMAT *rt_formats = NULL, *formats, *ptr;
|
D3DFORMAT *rt_formats = NULL, *formats, *ptr;
|
||||||
|
HRESULT hr = MF_E_INVALIDMEDIATYPE;
|
||||||
GUID subtype;
|
GUID subtype;
|
||||||
HRESULT hr;
|
|
||||||
|
|
||||||
count = 0;
|
count = 0;
|
||||||
for (i = 0; i < device_count; ++i)
|
for (i = 0; i < device_count; ++i)
|
||||||
|
@ -640,7 +640,7 @@ static HRESULT video_mixer_collect_output_types(struct video_mixer *mixer, const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count)
|
if (count && !(flags & MFT_SET_TYPE_TEST_ONLY))
|
||||||
{
|
{
|
||||||
qsort(rt_formats, count, sizeof(*rt_formats), rt_formats_sort_compare);
|
qsort(rt_formats, count, sizeof(*rt_formats), rt_formats_sort_compare);
|
||||||
|
|
||||||
|
@ -690,6 +690,7 @@ static HRESULT WINAPI video_mixer_transform_SetInputType(IMFTransform *iface, DW
|
||||||
|
|
||||||
EnterCriticalSection(&mixer->cs);
|
EnterCriticalSection(&mixer->cs);
|
||||||
|
|
||||||
|
if (!(flags & MFT_SET_TYPE_TEST_ONLY))
|
||||||
video_mixer_clear_types(mixer);
|
video_mixer_clear_types(mixer);
|
||||||
|
|
||||||
if (!mixer->device_manager)
|
if (!mixer->device_manager)
|
||||||
|
@ -708,7 +709,8 @@ static HRESULT WINAPI video_mixer_transform_SetInputType(IMFTransform *iface, DW
|
||||||
if (SUCCEEDED(hr = IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids(service, &video_desc,
|
if (SUCCEEDED(hr = IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids(service, &video_desc,
|
||||||
&count, &guids)))
|
&count, &guids)))
|
||||||
{
|
{
|
||||||
if (SUCCEEDED(hr = video_mixer_collect_output_types(mixer, &video_desc, service, count, guids)))
|
if (SUCCEEDED(hr = video_mixer_collect_output_types(mixer, &video_desc, service, count,
|
||||||
|
guids, flags)) && !(flags & MFT_SET_TYPE_TEST_ONLY))
|
||||||
{
|
{
|
||||||
GUID subtype = { 0 };
|
GUID subtype = { 0 };
|
||||||
|
|
||||||
|
|
|
@ -862,6 +862,9 @@ static void test_default_mixer_type_negotiation(void)
|
||||||
hr = IMFTransform_SetInputType(transform, 0, media_type, 0);
|
hr = IMFTransform_SetInputType(transform, 0, media_type, 0);
|
||||||
ok(hr == MF_E_NOT_INITIALIZED, "Unexpected hr %#x.\n", hr);
|
ok(hr == MF_E_NOT_INITIALIZED, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
|
hr = IMFTransform_SetInputType(transform, 0, media_type, MFT_SET_TYPE_TEST_ONLY);
|
||||||
|
ok(hr == MF_E_NOT_INITIALIZED, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
/* Now try with device manager. */
|
/* Now try with device manager. */
|
||||||
|
|
||||||
window = create_window();
|
window = create_window();
|
||||||
|
@ -883,6 +886,9 @@ static void test_default_mixer_type_negotiation(void)
|
||||||
hr = IMFTransform_SetInputType(transform, 0, media_type, 0);
|
hr = IMFTransform_SetInputType(transform, 0, media_type, 0);
|
||||||
ok(hr == DXVA2_E_NOT_INITIALIZED, "Unexpected hr %#x.\n", hr);
|
ok(hr == DXVA2_E_NOT_INITIALIZED, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
|
hr = IMFTransform_SetInputType(transform, 0, media_type, MFT_SET_TYPE_TEST_ONLY);
|
||||||
|
ok(hr == DXVA2_E_NOT_INITIALIZED, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
hr = IDirect3DDeviceManager9_ResetDevice(manager, device, token);
|
hr = IDirect3DDeviceManager9_ResetDevice(manager, device, token);
|
||||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -904,6 +910,12 @@ static void test_default_mixer_type_negotiation(void)
|
||||||
hr = IMFVideoMediaType_SetUINT32(video_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE);
|
hr = IMFVideoMediaType_SetUINT32(video_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE);
|
||||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
|
hr = IMFTransform_SetInputType(transform, 0, (IMFMediaType *)video_type, MFT_SET_TYPE_TEST_ONLY);
|
||||||
|
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
|
hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type);
|
||||||
|
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
hr = IMFTransform_SetInputType(transform, 0, (IMFMediaType *)video_type, 0);
|
hr = IMFTransform_SetInputType(transform, 0, (IMFMediaType *)video_type, 0);
|
||||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue