| 762 | // drawn - unless of course we stop streaming in which case we cancel links |
| 763 | |
| 764 | BOOL CBaseVideoRenderer2::ScheduleSample(IMediaSample *pMediaSample) |
| 765 | { |
| 766 | // We override ShouldDrawSampleNow to add quality management |
| 767 | |
| 768 | REFERENCE_TIME StartTime, EndTime; |
| 769 | if (!pMediaSample || FAILED(pMediaSample->GetTime(&StartTime, &EndTime))) { |
| 770 | if (m_pClock && SUCCEEDED(m_pClock->GetTime(&StartTime))) { |
| 771 | StartTime -= m_tStart; |
| 772 | } else { |
| 773 | StartTime = m_tRenderStart * 10000ll; |
| 774 | } |
| 775 | } |
| 776 | m_FrameStats.Add(StartTime); // do it for every input frame |
| 777 | |
| 778 | BOOL bDrawImage = CBaseRenderer::ScheduleSample(pMediaSample); |
| 779 | if (bDrawImage == FALSE) { |
| 780 | //++m_cFramesDropped; |
| 781 | m_DrawStats.m_dropped++; |
| 782 | #if 0 && _DEBUG |
| 783 | REFERENCE_TIME clockTime; |
| 784 | if (m_pClock && SUCCEEDED(m_pClock->GetTime(&clockTime))) { |
| 785 | clockTime -= m_tStart; |
| 786 | DbgLog((LOG_TRACE, 0, L"Frame %lld ms is dropped, lateness %lld ms", StartTime / 10000, (clockTime - StartTime) / 10000)); |
| 787 | } else { |
| 788 | DbgLog((LOG_TRACE, 0, L"Frame %lld ms is dropped.", StartTime / 10000)); |
| 789 | } |
| 790 | #endif |
| 791 | return FALSE; |
| 792 | } |
| 793 | |
| 794 | // m_cFramesDrawn must NOT be updated here. It has to be updated |
| 795 | // in RecordFrameLateness at the same time as the other statistics. |
| 796 | return TRUE; |
| 797 | } |
| 798 | |
| 799 | |
| 800 | // Implementation of IQualProp interface needed to support the property page |