MCPcopy Create free account
hub / github.com/Aleksoid1978/VideoRenderer / ScheduleSample

Method ScheduleSample

Source/renbase2.cpp:764–797  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

762// drawn - unless of course we stop streaming in which case we cancel links
763
764BOOL 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

Callers

nothing calls this directly

Calls 1

AddMethod · 0.45

Tested by

no test coverage detected