public Scheduler(int iMaxSamples, D3DPresentEngine pCB) { if (pCB == null) { throw new COMException("Null D3DPresentEngine", MFError.MF_E_NOT_INITIALIZED); } m_ScheduledSamples = new Queue(iMaxSamples); m_EventQueue = new Queue(iMaxSamples * 2); m_pCB = pCB; m_pClock = null; m_bSchedulerThread = false; m_hThreadReadyEvent = null; m_hFlushEvent = new AutoResetEvent(false); m_hMsgEvent = new AutoResetEvent(false); m_fRate = 1.0f; m_LastSampleTime = 0; m_PerFrameInterval = 0; m_PerFrame_1_4th = 0; }
private long m_LastSampleTime; // Most recent sample time. #endregion public Scheduler(int iMaxSamples, D3DPresentEngine pCB) { if (pCB == null) { throw new COMException("Null D3DPresentEngine", (int)HResult.MF_E_NOT_INITIALIZED); } m_ScheduledSamples = new Queue(iMaxSamples); m_EventQueue = new Queue(iMaxSamples * 2); m_pCB = pCB; m_pClock = null; m_bSchedulerThread = false; m_hThreadReadyEvent = null; m_hFlushEvent = new AutoResetEvent(false); m_hMsgEvent = new AutoResetEvent(false); m_fRate = 1.0f; m_LastSampleTime = 0; m_PerFrameInterval = 0; m_PerFrame_1_4th = 0; }
protected int m_TokenCounter; // Counter. Incremented whenever we create new samples. #endregion Fields #region Constructors /// <summary> /// Constructor /// </summary> public EVRCustomPresenter() { if (System.Threading.Thread.CurrentThread.GetApartmentState() != System.Threading.ApartmentState.MTA) { throw new Exception("Unsupported theading model"); } m_iDiscarded = 0; m_pClock = null; m_pMixer = null; m_pMediaEventSink = null; m_h2 = null; m_pMediaType = null; m_bSampleNotify = false; m_bRepaint = false; m_bEndStreaming = false; m_bPrerolled = false; m_RenderState = RenderState.Shutdown; m_fRate = 1.0f; m_TokenCounter = 0; m_pD3DPresentEngine = new D3DPresentEngine(); m_FrameStep = new FrameStep(); // Frame-stepping information. m_nrcSource = new MFVideoNormalizedRect(0.0f, 0.0f, 1.0f, 1.0f); m_scheduler = new Scheduler(D3DPresentEngine.PRESENTER_BUFFER_COUNT, m_pD3DPresentEngine); // Manages scheduling of samples. m_SamplePool = new SamplePool(D3DPresentEngine.PRESENTER_BUFFER_COUNT); // Pool of allocated samples. // Force load of mf.dll now, rather than when we try to start streaming DllCanUnloadNow(); }