[vlc-devel] [PATCH 20/21] libvlc: pass the select_plane/frame_metadata callback to OpenGL as well

Steve Lhomme robux4 at ycbcr.xyz
Wed Feb 5 16:13:28 CET 2020


So we have the same prototype between OpenGL and D3D setup functions.
---
 doc/libvlc/QtGL/qtvlcwidget.cpp   | 2 +-
 doc/libvlc/sdl_opengl_player.cpp  | 2 +-
 include/vlc/libvlc_media_player.h | 4 ++++
 lib/media_player.c                | 4 ++++
 4 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/doc/libvlc/QtGL/qtvlcwidget.cpp b/doc/libvlc/QtGL/qtvlcwidget.cpp
index db48bb571ea..bf621167910 100644
--- a/doc/libvlc/QtGL/qtvlcwidget.cpp
+++ b/doc/libvlc/QtGL/qtvlcwidget.cpp
@@ -172,7 +172,7 @@ bool QtVLCWidget::playMedia(const char* url)
     // Define the opengl rendering callbacks
     libvlc_video_set_output_callbacks(m_mp, libvlc_video_engine_opengl,
         VLCVideo::setup, VLCVideo::cleanup, nullptr, VLCVideo::resizeRenderTextures, VLCVideo::swap,
-        VLCVideo::make_current, VLCVideo::get_proc_address,
+        VLCVideo::make_current, VLCVideo::get_proc_address, nullptr, nullptr,
         mVLC);
 
     // Play the video
diff --git a/doc/libvlc/sdl_opengl_player.cpp b/doc/libvlc/sdl_opengl_player.cpp
index f40fca99e20..ba6b4be872e 100644
--- a/doc/libvlc/sdl_opengl_player.cpp
+++ b/doc/libvlc/sdl_opengl_player.cpp
@@ -81,7 +81,7 @@ public:
         // Define the opengl rendering callbacks
         libvlc_video_set_output_callbacks(m_mp, libvlc_video_engine_opengl,
             setup, cleanup, nullptr, resize, swap,
-            make_current, get_proc_address,
+            make_current, get_proc_address, nullptr, nullptr,
             this);
 
         // Play the video
diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
index 6610dced5c2..9dc0056abf6 100644
--- a/include/vlc/libvlc_media_player.h
+++ b/include/vlc/libvlc_media_player.h
@@ -730,6 +730,8 @@ typedef bool( *libvlc_video_output_select_plane_cb )( void *opaque, size_t plane
  * \param swap_cb callback called after rendering a video frame (cannot be NULL)
  * \param makeCurrent_cb callback called to enter/leave the opengl context (cannot be NULL for \ref libvlc_video_engine_opengl and for \ref libvlc_video_engine_gles2)
  * \param getProcAddress_cb opengl function loading callback (cannot be NULL for \ref libvlc_video_engine_opengl and for \ref libvlc_video_engine_gles2)
+ * \param metadata_cb callback to provide frame metadata (D3D11 only)
+ * \param select_plane_cb callback to select different D3D11 rendering targets
  * \param opaque private pointer passed to callbacks
  *
  * \retval true engine selected and callbacks set
@@ -746,6 +748,8 @@ bool libvlc_video_set_output_callbacks( libvlc_media_player_t *mp,
                                         libvlc_video_swap_cb swap_cb,
                                         libvlc_video_makeCurrent_cb makeCurrent_cb,
                                         libvlc_video_getProcAddress_cb getProcAddress_cb,
+                                        libvlc_video_frameMetadata_cb metadata_cb,
+                                        libvlc_video_output_select_plane_cb select_plane_cb,
                                         void* opaque );
 
 
diff --git a/lib/media_player.c b/lib/media_player.c
index aa24872b787..1ee29b96023 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -1041,6 +1041,8 @@ bool libvlc_video_set_output_callbacks(libvlc_media_player_t *mp,
                                        libvlc_video_swap_cb swap_cb,
                                        libvlc_video_makeCurrent_cb makeCurrent_cb,
                                        libvlc_video_getProcAddress_cb getProcAddress_cb,
+                                       libvlc_video_frameMetadata_cb metadata_cb,
+                                       libvlc_video_output_select_plane_cb select_plane_cb,
                                        void *opaque)
 {
 #ifdef __ANDROID__
@@ -1071,6 +1073,8 @@ bool libvlc_video_set_output_callbacks(libvlc_media_player_t *mp,
     var_SetAddress( mp, "vout-cb-swap", swap_cb );
     var_SetAddress( mp, "vout-cb-get-proc-address", getProcAddress_cb );
     var_SetAddress( mp, "vout-cb-make-current", makeCurrent_cb );
+    var_SetAddress( mp, "vout-cb-metadata", metadata_cb );
+    var_SetAddress( mp, "vout-cb-select-plane", select_plane_cb );
     return true;
 }
 
-- 
2.17.1



More information about the vlc-devel mailing list