18#ifndef OPENGLVIDEOWIDGET_H
19#define OPENGLVIDEOWIDGET_H
21#include "videowidget.h"
23#include <QOpenGLFunctions>
24#include <QOpenGLShaderProgram>
25#include <QOpenGLFramebufferObject>
26#include <QOpenGLContext>
27#include <QOffscreenSurface>
29class OpenGLVideoWidget :
public Mlt::VideoWidget,
protected QOpenGLFunctions
34 explicit OpenGLVideoWidget(QObject *parent =
nullptr);
35 virtual ~OpenGLVideoWidget();
38 virtual void initialize();
39 virtual void renderVideo();
40 virtual void onFrameDisplayed(
const SharedFrame &frame);
45 QOffscreenSurface m_offscreenSurface;
46 std::unique_ptr<QOpenGLShaderProgram> m_shader;
47 GLint m_projectionLocation;
48 GLint m_modelViewLocation;
49 GLint m_vertexLocation;
50 GLint m_texCoordLocation;
51 GLint m_colorspaceLocation;
52 GLint m_textureLocation[3];
53 QOpenGLContext *m_quickContext;
54 std::unique_ptr<QOpenGLContext> m_context;
55 GLuint m_renderTexture[3];
56 GLuint m_displayTexture[3];
57 bool m_isThreadedOpenGL;
The SharedFrame provides thread safe access to Mlt::Frame data.
Definition sharedframe.h:49