#pragma once #include "OpenGLRenderPipeline.h" #include #include #include class RuntimeHost; class OpenGLVideoIOBridge { public: OpenGLVideoIOBridge( VideoIODevice* videoIO, OpenGLRenderer& renderer, OpenGLRenderPipeline& renderPipeline, RuntimeHost& runtimeHost, CRITICAL_SECTION& mutex, HDC hdc, HGLRC hglrc); void SetVideoIODevice(VideoIODevice* videoIO); void VideoFrameArrived(const VideoIOFrame& inputFrame); void PlayoutFrameCompleted(const VideoIOCompletion& completion); private: void RecordFramePacing(VideoIOCompletionResult completionResult); VideoIODevice* mVideoIO; OpenGLRenderer& mRenderer; OpenGLRenderPipeline& mRenderPipeline; RuntimeHost& mRuntimeHost; CRITICAL_SECTION& mMutex; HDC mHdc; HGLRC mHglrc; std::chrono::steady_clock::time_point mLastPlayoutCompletionTime; double mCompletionIntervalMilliseconds = 0.0; double mSmoothedCompletionIntervalMilliseconds = 0.0; double mMaxCompletionIntervalMilliseconds = 0.0; uint64_t mLateFrameCount = 0; uint64_t mDroppedFrameCount = 0; uint64_t mFlushedFrameCount = 0; };