From 2fc1ccebf773cba6392a7907e392df51715207f5 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Tue, 9 Jun 2020 02:35:41 +1000 Subject: [PATCH] openglproxy: implemented extra function for loading pre-cached frames into textures --- app/render/backend/opengl/openglproxy.cpp | 5 +++++ app/render/backend/opengl/openglproxy.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/app/render/backend/opengl/openglproxy.cpp b/app/render/backend/opengl/openglproxy.cpp index 267b3de9d..8528244d1 100644 --- a/app/render/backend/opengl/openglproxy.cpp +++ b/app/render/backend/opengl/openglproxy.cpp @@ -170,6 +170,11 @@ NodeValue OpenGLProxy::FrameToValue(FramePtr frame, StreamPtr stream, const Vide return NodeValue(NodeParam::kTexture, QVariant::fromValue(footage_tex_ref)); } +NodeValue OpenGLProxy::PreCachedFrameToValue(FramePtr frame) +{ + return NodeValue(NodeParam::kTexture, QVariant::fromValue(texture_cache_.Get(ctx_, frame))); +} + void OpenGLProxy::Close() { shader_cache_.clear(); diff --git a/app/render/backend/opengl/openglproxy.h b/app/render/backend/opengl/openglproxy.h index e2288ec88..6850bd675 100644 --- a/app/render/backend/opengl/openglproxy.h +++ b/app/render/backend/opengl/openglproxy.h @@ -82,6 +82,8 @@ public slots: const OLIVE_NAMESPACE::VideoParams ¶ms, const OLIVE_NAMESPACE::RenderMode::Mode &mode); + OLIVE_NAMESPACE::NodeValue PreCachedFrameToValue(OLIVE_NAMESPACE::FramePtr frame); + private: QOpenGLContext* ctx_; QOffscreenSurface surface_;