Commit 71293a01 authored by Anton Baskanov's avatar Anton Baskanov Committed by Alexandre Julliard

amstream: Send quality control messages from AMDirectDrawStream::Receive.

parent cf931159
......@@ -1409,6 +1409,7 @@ static HRESULT WINAPI ddraw_meminput_Receive(IMemInputPin *iface, IMediaSample *
if (!list_empty(&stream->update_queue))
{
struct ddraw_sample *sample = LIST_ENTRY(list_head(&stream->update_queue), struct ddraw_sample, entry);
IQualityControl *qc;
sample->update_hr = process_update(sample, top_down_stride, top_down_pointer,
start_stream_time, end_stream_time);
......@@ -1422,6 +1423,19 @@ static HRESULT WINAPI ddraw_meminput_Receive(IMemInputPin *iface, IMediaSample *
{
remove_queued_update(sample);
}
if (S_OK == IMediaStreamFilter_GetCurrentStreamTime(filter, &current_time)
&& SUCCEEDED(IPin_QueryInterface(stream->peer, &IID_IQualityControl, (void **)&qc)))
{
Quality q;
q.Type = Famine;
q.Proportion = 1000;
q.Late = current_time - start_time;
q.TimeStamp = start_time;
IQualityControl_Notify(qc, (IBaseFilter *)stream->filter, q);
IQualityControl_Release(qc);
}
LeaveCriticalSection(&stream->cs);
return S_OK;
}
......
......@@ -8400,15 +8400,15 @@ static void test_ddrawstream_qc(void)
hr = IDirectDrawStreamSample_CompletionStatus(stream_sample, 0, 0);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
todo_wine ok(source.qc_notify_sender == (IBaseFilter *)filter, "Got sender %p.\n",
ok(source.qc_notify_sender == (IBaseFilter *)filter, "Got sender %p.\n",
source.qc_notify_sender);
todo_wine ok(source.qc_notify_quality.Type == Famine, "Got type %d.\n",
ok(source.qc_notify_quality.Type == Famine, "Got type %d.\n",
source.qc_notify_quality.Type);
todo_wine ok(source.qc_notify_quality.Proportion == 1000, "Got proportion %ld.\n",
ok(source.qc_notify_quality.Proportion == 1000, "Got proportion %ld.\n",
source.qc_notify_quality.Proportion);
todo_wine ok(source.qc_notify_quality.Late == 0, "Got late %s.\n",
ok(source.qc_notify_quality.Late == 0, "Got late %s.\n",
wine_dbgstr_longlong(source.qc_notify_quality.Late));
todo_wine ok(source.qc_notify_quality.TimeStamp == start_time, "Got time stamp %s.\n",
ok(source.qc_notify_quality.TimeStamp == start_time, "Got time stamp %s.\n",
wine_dbgstr_longlong(source.qc_notify_quality.TimeStamp));
/* Test Update() after Reveive(). */
......@@ -8451,15 +8451,15 @@ static void test_ddrawstream_qc(void)
ok(!WaitForSingleObject(thread, 2000), "Wait timed out.\n");
CloseHandle(thread);
todo_wine ok(source.qc_notify_sender == (IBaseFilter *)filter, "Got sender %p.\n",
ok(source.qc_notify_sender == (IBaseFilter *)filter, "Got sender %p.\n",
source.qc_notify_sender);
todo_wine ok(source.qc_notify_quality.Type == Famine, "Got type %d.\n",
ok(source.qc_notify_quality.Type == Famine, "Got type %d.\n",
source.qc_notify_quality.Type);
todo_wine ok(source.qc_notify_quality.Proportion == 1000, "Got proportion %ld.\n",
ok(source.qc_notify_quality.Proportion == 1000, "Got proportion %ld.\n",
source.qc_notify_quality.Proportion);
todo_wine ok(source.qc_notify_quality.Late == 100000, "Got late %s.\n",
ok(source.qc_notify_quality.Late == 100000, "Got late %s.\n",
wine_dbgstr_longlong(source.qc_notify_quality.Late));
todo_wine ok(source.qc_notify_quality.TimeStamp == start_time, "Got time stamp %s.\n",
ok(source.qc_notify_quality.TimeStamp == start_time, "Got time stamp %s.\n",
wine_dbgstr_longlong(source.qc_notify_quality.TimeStamp));
hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_STOP);
......
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