Commit 6ae872e8 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

evr/mixer: Fix output filling behaviour regarding sample properties.

parent 35d7dc90
......@@ -1222,10 +1222,25 @@ static void video_mixer_render(struct video_mixer *mixer, IDirect3DSurface9 *rt)
IDirect3DSurface9_Release(surface);
}
static HRESULT video_mixer_get_sample_desired_time(IMFSample *sample, LONGLONG *timestamp, LONGLONG *duration)
{
IMFDesiredSample *desired;
HRESULT hr;
if (SUCCEEDED(hr = IMFSample_QueryInterface(sample, &IID_IMFDesiredSample, (void **)&desired)))
{
hr = IMFDesiredSample_GetDesiredSampleTimeAndDuration(desired, timestamp, duration);
IMFDesiredSample_Release(desired);
}
return hr;
}
static HRESULT WINAPI video_mixer_transform_ProcessOutput(IMFTransform *iface, DWORD flags, DWORD count,
MFT_OUTPUT_DATA_BUFFER *buffers, DWORD *status)
{
struct video_mixer *mixer = impl_from_IMFTransform(iface);
LONGLONG timestamp, duration;
IDirect3DSurface9 *surface;
IDirect3DDevice9 *device;
unsigned int i;
......@@ -1272,12 +1287,17 @@ static HRESULT WINAPI video_mixer_transform_ProcessOutput(IMFTransform *iface, D
}
else
{
if (SUCCEEDED(hr = video_mixer_get_d3d_device(mixer, &device)))
if (SUCCEEDED(video_mixer_get_sample_desired_time(buffers->pSample, &timestamp, &duration)))
{
IDirect3DDevice9_ColorFill(device, surface, NULL, 0);
IDirect3DDeviceManager9_UnlockDevice(mixer->device_manager, mixer->device_handle, FALSE);
IDirect3DDevice9_Release(device);
if (SUCCEEDED(hr = video_mixer_get_d3d_device(mixer, &device)))
{
IDirect3DDevice9_ColorFill(device, surface, NULL, 0);
IDirect3DDeviceManager9_UnlockDevice(mixer->device_manager, mixer->device_handle, FALSE);
IDirect3DDevice9_Release(device);
}
}
else
hr = MF_E_TRANSFORM_NEED_MORE_INPUT;
}
IDirect3DSurface9_Release(surface);
}
......
......@@ -2324,11 +2324,9 @@ static void test_mixer_samples(void)
buffers[0].pSample = sample;
hr = IMFTransform_ProcessOutput(mixer, 0, 1, buffers, &status);
todo_wine
ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "Unexpected hr %#x.\n", hr);
color = get_surface_color(surface, 0, 0);
todo_wine
ok(color == D3DCOLOR_ARGB(0x10, 0xff, 0x00, 0x00), "Unexpected color %#x.\n", color);
/* Streaming is not started yet. Output is colored black, but only if desired timestamps were set. */
......
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