evr/mixer: Only accept single output buffer in ProcessOutput().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
775daad7ef
commit
8c4723c5bd
|
@ -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);
|
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;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
if (count > 1)
|
if (buffers->dwStreamID)
|
||||||
FIXME("Multiple buffers are not handled.\n");
|
return MF_E_INVALIDSTREAMNUMBER;
|
||||||
|
|
||||||
*status = 0;
|
*status = 0;
|
||||||
|
|
||||||
|
|
|
@ -2061,7 +2061,7 @@ static DWORD get_surface_color(IDirect3DSurface9 *surface, unsigned int x, unsig
|
||||||
static void test_mixer_samples(void)
|
static void test_mixer_samples(void)
|
||||||
{
|
{
|
||||||
IDirect3DDeviceManager9 *manager;
|
IDirect3DDeviceManager9 *manager;
|
||||||
MFT_OUTPUT_DATA_BUFFER buffer;
|
MFT_OUTPUT_DATA_BUFFER buffers[2];
|
||||||
IMFVideoProcessor *processor;
|
IMFVideoProcessor *processor;
|
||||||
IDirect3DSurface9 *surface;
|
IDirect3DSurface9 *surface;
|
||||||
IMFDesiredSample *desired;
|
IMFDesiredSample *desired;
|
||||||
|
@ -2149,16 +2149,16 @@ static void test_mixer_samples(void)
|
||||||
|
|
||||||
IMFMediaType_Release(video_type);
|
IMFMediaType_Release(video_type);
|
||||||
|
|
||||||
memset(&buffer, 0, sizeof(buffer));
|
memset(buffers, 0, sizeof(buffers));
|
||||||
hr = IMFTransform_ProcessOutput(mixer, 0, 1, &buffer, &status);
|
hr = IMFTransform_ProcessOutput(mixer, 0, 1, buffers, &status);
|
||||||
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
|
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
/* It needs a sample with a backing surface. */
|
/* It needs a sample with a backing surface. */
|
||||||
hr = MFCreateSample(&sample);
|
hr = MFCreateSample(&sample);
|
||||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
buffer.pSample = sample;
|
buffers[0].pSample = sample;
|
||||||
hr = IMFTransform_ProcessOutput(mixer, 0, 1, &buffer, &status);
|
hr = IMFTransform_ProcessOutput(mixer, 0, 1, buffers, &status);
|
||||||
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
|
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
IMFSample_Release(sample);
|
IMFSample_Release(sample);
|
||||||
|
@ -2171,8 +2171,8 @@ static void test_mixer_samples(void)
|
||||||
hr = IMFSample_QueryInterface(sample, &IID_IMFDesiredSample, (void **)&desired);
|
hr = IMFSample_QueryInterface(sample, &IID_IMFDesiredSample, (void **)&desired);
|
||||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
buffer.pSample = sample;
|
buffers[0].pSample = sample;
|
||||||
hr = IMFTransform_ProcessOutput(mixer, 0, 1, &buffer, &status);
|
hr = IMFTransform_ProcessOutput(mixer, 0, 1, buffers, &status);
|
||||||
todo_wine
|
todo_wine
|
||||||
ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "Unexpected hr %#x.\n", hr);
|
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. */
|
/* Streaming is not started yet. Output is colored black, but only if desired timestamps were set. */
|
||||||
IMFDesiredSample_SetDesiredSampleTimeAndDuration(desired, 100, 0);
|
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);
|
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
color = get_surface_color(surface, 0, 0);
|
color = get_surface_color(surface, 0, 0);
|
||||||
|
@ -2192,12 +2192,23 @@ todo_wine
|
||||||
hr = IMFVideoProcessor_SetBackgroundColor(processor, RGB(0, 0, 255));
|
hr = IMFVideoProcessor_SetBackgroundColor(processor, RGB(0, 0, 255));
|
||||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
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);
|
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
color = get_surface_color(surface, 0, 0);
|
color = get_surface_color(surface, 0, 0);
|
||||||
ok(!color, "Unexpected color %#x.\n", color);
|
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);
|
IMFDesiredSample_Clear(desired);
|
||||||
|
|
||||||
hr = IMFTransform_ProcessInput(mixer, 0, NULL, 0);
|
hr = IMFTransform_ProcessInput(mixer, 0, NULL, 0);
|
||||||
|
|
Loading…
Reference in New Issue