[vlc-devel] [PATCH 4/4] doc: libvlc: get the OpenGL functions properly

Steve Lhomme robux4 at ycbcr.xyz
Wed Feb 12 08:12:38 CET 2020


Ultimately after that we should add an API to select the hardware acceleration the user wants (for ex opengl with dxva2 or nvdec) or disable it. That will remove the forced decoder device in use now.

> On 11 Feb 2020, at 15:40, Steve Lhomme <robux4 at ycbcr.xyz> wrote:
> 
> The context has its own functions we already access.
> ---
> doc/libvlc/QtGL/qtvlcwidget.cpp | 5 ++---
> doc/libvlc/QtGL/qtvlcwidget.h   | 3 +--
> 2 files changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/doc/libvlc/QtGL/qtvlcwidget.cpp b/doc/libvlc/QtGL/qtvlcwidget.cpp
> index 46b9034f78f..ef712390cce 100644
> --- a/doc/libvlc/QtGL/qtvlcwidget.cpp
> +++ b/doc/libvlc/QtGL/qtvlcwidget.cpp
> @@ -3,6 +3,7 @@
> #include <QOpenGLShaderProgram>
> #include <QCoreApplication>
> #include <QOpenGLFramebufferObject>
> +#include <QOpenGLFunctions>
> #include <QThread>
> #include <cmath>
> 
> @@ -41,7 +42,7 @@ public:
>     static bool resizeRenderTextures(void* data, const libvlc_video_render_cfg_t *cfg,
>                                      libvlc_video_output_cfg_t *render_cfg)
>     {
> -       VLCVideo* that = static_cast<VLCVideo*>(data);
> +        VLCVideo* that = static_cast<VLCVideo*>(data);
>         if (cfg->width != that->m_width || cfg->height != that->m_height)
>             cleanup(data);
> 
> @@ -264,8 +265,6 @@ void QtVLCWidget::initializeGL()
>     // can recreate all resources.
>     connect(context(), &QOpenGLContext::aboutToBeDestroyed, this, &QtVLCWidget::cleanup);
> 
> -    initializeOpenGLFunctions();
> -
>     vertexBuffer.create();
>     vertexBuffer.bind();
>     vertexBuffer.allocate(g_vertex_buffer_data, sizeof(g_vertex_buffer_data));
> diff --git a/doc/libvlc/QtGL/qtvlcwidget.h b/doc/libvlc/QtGL/qtvlcwidget.h
> index 01cc9868a8f..a52026c0033 100644
> --- a/doc/libvlc/QtGL/qtvlcwidget.h
> +++ b/doc/libvlc/QtGL/qtvlcwidget.h
> @@ -2,13 +2,12 @@
> #define GLWIDGET_H
> 
> #include <QOpenGLWidget>
> -#include <QOpenGLFunctions>
> #include <QOpenGLVertexArrayObject>
> #include <QOpenGLBuffer>
> 
> QT_FORWARD_DECLARE_CLASS(QOpenGLShaderProgram)
> 
> -class QtVLCWidget : public QOpenGLWidget, protected QOpenGLFunctions
> +class QtVLCWidget : public QOpenGLWidget
> {
>     Q_OBJECT
> 
> -- 
> 2.17.1
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel



More information about the vlc-devel mailing list