45 lines
1.0 KiB
C++
45 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#include "OpenGLRenderPipeline.h"
|
|
|
|
#include <windows.h>
|
|
|
|
#include <chrono>
|
|
#include <cstdint>
|
|
|
|
class RuntimeHost;
|
|
|
|
class OpenGLVideoIOBridge
|
|
{
|
|
public:
|
|
OpenGLVideoIOBridge(
|
|
VideoIODevice& videoIO,
|
|
OpenGLRenderer& renderer,
|
|
OpenGLRenderPipeline& renderPipeline,
|
|
RuntimeHost& runtimeHost,
|
|
CRITICAL_SECTION& mutex,
|
|
HDC hdc,
|
|
HGLRC hglrc);
|
|
|
|
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;
|
|
};
|