Module: wine Branch: master Commit: 71293a018fdb4b8daa2fe9997f4b6f0057d71be6 URL: https://gitlab.winehq.org/wine/wine/-/commit/71293a018fdb4b8daa2fe9997f4b6f0...
Author: Anton Baskanov baskanov@gmail.com Date: Fri Dec 1 15:58:01 2023 +0700
amstream: Send quality control messages from AMDirectDrawStream::Receive.
---
dlls/amstream/ddrawstream.c | 14 ++++++++++++++ dlls/amstream/tests/amstream.c | 20 ++++++++++---------- 2 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/dlls/amstream/ddrawstream.c b/dlls/amstream/ddrawstream.c index b31466803f4..dc77cb87813 100644 --- a/dlls/amstream/ddrawstream.c +++ b/dlls/amstream/ddrawstream.c @@ -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, ¤t_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; } diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index abf0428140b..b796dbd64f8 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -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);