[vlc-commits] libvlc: let the OpenGL host refuse a source format if it can't handle it

Steve Lhomme git at videolan.org
Mon Feb 10 09:06:56 CET 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Feb  4 14:37:13 2020 +0100| [87836261f7a4fa7236d2244563eff1ca85c24391] | committer: Steve Lhomme

libvlc: let the OpenGL host refuse a source format if it can't handle it

Changing internal resources may fail and we shouldn't try to render with this
format.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=87836261f7a4fa7236d2244563eff1ca85c24391
---

 doc/libvlc/QtGL/qtvlcwidget.cpp   | 4 +++-
 doc/libvlc/sdl_opengl_player.cpp  | 4 +++-
 include/vlc/libvlc_media_player.h | 2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/doc/libvlc/QtGL/qtvlcwidget.cpp b/doc/libvlc/QtGL/qtvlcwidget.cpp
index b1bf535e39..22483efc7c 100644
--- a/doc/libvlc/QtGL/qtvlcwidget.cpp
+++ b/doc/libvlc/QtGL/qtvlcwidget.cpp
@@ -38,7 +38,7 @@ public:
     }
 
     /// this callback will create the surfaces and FBO used by VLC to perform its rendering
-    static void resizeRenderTextures(void* data, const libvlc_video_render_cfg_t *cfg,
+    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);
@@ -59,6 +59,8 @@ public:
         render_cfg->colorspace = libvlc_video_colorspace_BT709;
         render_cfg->primaries  = libvlc_video_primaries_BT709;
         render_cfg->transfer   = libvlc_video_transfer_func_SRGB;
+
+        return true;
     }
 
     // This callback is called during initialisation.
diff --git a/doc/libvlc/sdl_opengl_player.cpp b/doc/libvlc/sdl_opengl_player.cpp
index 6b25f8d3f2..6e067ccba0 100644
--- a/doc/libvlc/sdl_opengl_player.cpp
+++ b/doc/libvlc/sdl_opengl_player.cpp
@@ -116,7 +116,7 @@ public:
     }
 
     /// this callback will create the surfaces and FBO used by VLC to perform its rendering
-    static void resize(void* data, const libvlc_video_render_cfg_t *cfg,
+    static bool resize(void* data, const libvlc_video_render_cfg_t *cfg,
                        libvlc_video_output_cfg_t *render_cfg)
     {
         VLCVideo* that = static_cast<VLCVideo*>(data);
@@ -155,6 +155,8 @@ public:
         render_cfg->colorspace = libvlc_video_colorspace_BT709;
         render_cfg->primaries  = libvlc_video_primaries_BT709;
         render_cfg->transfer   = libvlc_video_transfer_func_SRGB;
+
+        return true;
     }
 
     // This callback is called during initialisation.
diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
index 975779c5ca..095b562e69 100644
--- a/include/vlc/libvlc_media_player.h
+++ b/include/vlc/libvlc_media_player.h
@@ -553,7 +553,7 @@ typedef struct
  * \param output configuration describing with how the rendering is setup [OUT]
  * \version LibVLC 4.0.0 or later
  */
-typedef void (*libvlc_video_update_output_cb)(void* opaque, const libvlc_video_render_cfg_t *cfg,
+typedef bool (*libvlc_video_update_output_cb)(void* opaque, const libvlc_video_render_cfg_t *cfg,
                                               libvlc_video_output_cfg_t *output );
 
 



More information about the vlc-commits mailing list