evr/mixer: Keep one input sample per stream.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
16430c45cd
commit
60bf1b2548
|
@ -43,6 +43,7 @@ struct input_stream
|
||||||
IMFMediaType *media_type;
|
IMFMediaType *media_type;
|
||||||
MFVideoNormalizedRect rect;
|
MFVideoNormalizedRect rect;
|
||||||
unsigned int zorder;
|
unsigned int zorder;
|
||||||
|
IMFSample *sample;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct output_stream
|
struct output_stream
|
||||||
|
@ -172,6 +173,9 @@ static void video_mixer_clear_types(struct video_mixer *mixer)
|
||||||
if (mixer->inputs[i].media_type)
|
if (mixer->inputs[i].media_type)
|
||||||
IMFMediaType_Release(mixer->inputs[i].media_type);
|
IMFMediaType_Release(mixer->inputs[i].media_type);
|
||||||
mixer->inputs[i].media_type = NULL;
|
mixer->inputs[i].media_type = NULL;
|
||||||
|
if (mixer->inputs[i].sample)
|
||||||
|
IMFSample_Release(mixer->inputs[i].sample);
|
||||||
|
mixer->inputs[i].sample = NULL;
|
||||||
}
|
}
|
||||||
for (i = 0; i < mixer->output.type_count; ++i)
|
for (i = 0; i < mixer->output.type_count; ++i)
|
||||||
{
|
{
|
||||||
|
@ -899,9 +903,33 @@ static HRESULT WINAPI video_mixer_transform_ProcessMessage(IMFTransform *iface,
|
||||||
|
|
||||||
static HRESULT WINAPI video_mixer_transform_ProcessInput(IMFTransform *iface, DWORD id, IMFSample *sample, DWORD flags)
|
static HRESULT WINAPI video_mixer_transform_ProcessInput(IMFTransform *iface, DWORD id, IMFSample *sample, DWORD flags)
|
||||||
{
|
{
|
||||||
FIXME("%p, %u, %p, %#x.\n", iface, id, sample, flags);
|
struct video_mixer *mixer = impl_from_IMFTransform(iface);
|
||||||
|
struct input_stream *input;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
return E_NOTIMPL;
|
TRACE("%p, %u, %p, %#x.\n", iface, id, sample, flags);
|
||||||
|
|
||||||
|
if (!sample)
|
||||||
|
return E_POINTER;
|
||||||
|
|
||||||
|
EnterCriticalSection(&mixer->cs);
|
||||||
|
|
||||||
|
if (SUCCEEDED(hr = video_mixer_get_input(mixer, id, &input)))
|
||||||
|
{
|
||||||
|
if (!input->media_type || !mixer->output.media_type)
|
||||||
|
hr = MF_E_TRANSFORM_TYPE_NOT_SET;
|
||||||
|
else if (input->sample)
|
||||||
|
hr = MF_E_NOTACCEPTING;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
input->sample = sample;
|
||||||
|
IMFSample_AddRef(input->sample);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LeaveCriticalSection(&mixer->cs);
|
||||||
|
|
||||||
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI video_mixer_transform_ProcessOutput(IMFTransform *iface, DWORD flags, DWORD count,
|
static HRESULT WINAPI video_mixer_transform_ProcessOutput(IMFTransform *iface, DWORD flags, DWORD count,
|
||||||
|
|
|
@ -2154,6 +2154,23 @@ todo_wine
|
||||||
todo_wine
|
todo_wine
|
||||||
ok(!color, "Unexpected color %#x.\n", color);
|
ok(!color, "Unexpected color %#x.\n", color);
|
||||||
|
|
||||||
|
IMFDesiredSample_Clear(desired);
|
||||||
|
|
||||||
|
hr = IMFTransform_ProcessInput(mixer, 0, NULL, 0);
|
||||||
|
ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
|
hr = IMFTransform_ProcessInput(mixer, 5, NULL, 0);
|
||||||
|
ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
|
hr = IMFTransform_ProcessInput(mixer, 0, sample, 0);
|
||||||
|
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
|
hr = IMFTransform_ProcessInput(mixer, 0, sample, 0);
|
||||||
|
ok(hr == MF_E_NOTACCEPTING, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
|
hr = IMFTransform_ProcessInput(mixer, 5, sample, 0);
|
||||||
|
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
IMFSample_Release(sample);
|
IMFSample_Release(sample);
|
||||||
|
|
||||||
IDirect3DSurface9_Release(surface);
|
IDirect3DSurface9_Release(surface);
|
||||||
|
|
Loading…
Reference in New Issue