Files
video-shader-toys/apps/LoopThroughWithOpenGLCompositing/gl/pipeline/OpenGLVideoIOBridge.cpp
2026-05-10 23:53:27 +10:00

26 lines
783 B
C++

#include "OpenGLVideoIOBridge.h"
#include "RenderEngine.h"
OpenGLVideoIOBridge::OpenGLVideoIOBridge(RenderEngine& renderEngine) :
mRenderEngine(renderEngine)
{
}
void OpenGLVideoIOBridge::UploadInputFrame(const VideoIOFrame& inputFrame, const VideoIOState& state)
{
if (inputFrame.hasNoInputSource || inputFrame.bytes == nullptr)
return; // don't transfer texture when there's no input
mRenderEngine.TryUploadInputFrame(inputFrame, state);
}
void OpenGLVideoIOBridge::RenderScheduledFrame(const VideoIOState& state, const VideoIOCompletion& completion, VideoIOOutputFrame& outputFrame)
{
RenderPipelineFrameContext frameContext;
frameContext.videoState = state;
frameContext.completion = completion;
mRenderEngine.RenderOutputFrame(frameContext, outputFrame);
}