[vlc-devel] [PATCH 3/5] doc: QtGl: check OpenGLES with OpenGL too
Alexandre Janniaux
ajanni at videolabs.io
Mon Nov 9 18:15:01 CET 2020
We might be running OpenGLES, and thus need libvlc_video_engine_gles2
instead of the OpenGL one.
---
doc/libvlc/QtGL/qtvlcwidget.cpp | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/doc/libvlc/QtGL/qtvlcwidget.cpp b/doc/libvlc/QtGL/qtvlcwidget.cpp
index c45324e106..761c6d7cf1 100644
--- a/doc/libvlc/QtGL/qtvlcwidget.cpp
+++ b/doc/libvlc/QtGL/qtvlcwidget.cpp
@@ -48,6 +48,13 @@ public:
cleanup(this);
}
+ /// return whether we are using OpenGLES or OpenGL, which is needed to know
+ /// whether we use the libvlc OpenGLES2 engine or the OpenGL one
+ bool isOpenGLES()
+ {
+ return mContext->isOpenGLES();
+ }
+
/// return the texture to be displayed
QOpenGLFramebufferObject *getVideoFrame()
{
@@ -198,7 +205,8 @@ bool QtVLCWidget::playMedia(const char* url)
}
// Define the opengl rendering callbacks
- libvlc_video_set_output_callbacks(m_mp, libvlc_video_engine_opengl,
+ libvlc_video_set_output_callbacks(m_mp,
+ mVLC->isOpenGLES() ? libvlc_video_engine_gles2 : libvlc_video_engine_opengl,
VLCVideo::setup, VLCVideo::cleanup, nullptr, VLCVideo::resizeRenderTextures, VLCVideo::swap,
VLCVideo::make_current, VLCVideo::get_proc_address, nullptr, nullptr,
mVLC);
--
2.29.2
More information about the vlc-devel
mailing list