evr/mixer: Implement GetInputStatus().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
081f5ae24f
commit
5496b88917
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue