[vlc-devel] [RFC 3/8] libvlc: rename libvlc_video_set_opengl_callbacks() to libvlc_video_set_output_callbacks()
Steve Lhomme
robux4 at ycbcr.xyz
Tue Nov 20 16:42:37 CET 2018
We're going to support D3D11 and D3D9 with the same API.
At some point it may be merged with libvlc_video_set_callbacks() as well.
---
doc/libvlc/sdl_opengl_player.cpp | 4 ++--
include/vlc/libvlc_media_player.h | 32 +++++++++++++++----------------
lib/libvlc.sym | 2 +-
lib/media_player.c | 6 +++---
4 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/doc/libvlc/sdl_opengl_player.cpp b/doc/libvlc/sdl_opengl_player.cpp
index eefe078ac1..dabc430bdd 100644
--- a/doc/libvlc/sdl_opengl_player.cpp
+++ b/doc/libvlc/sdl_opengl_player.cpp
@@ -16,7 +16,7 @@
#include <vlc/vlc.h>
/*
- * This program show how to use libvlc_video_set_opengl_callbacks API.
+ * This program show how to use libvlc_video_set_output_callbacks API.
*
* The main idea is to set up libvlc to render into FBO, and to use a
* triple buffer mechanism to share textures between VLC and the rendering
@@ -79,7 +79,7 @@ public:
return false;
}
// Define the opengl rendering callbacks
- libvlc_video_set_opengl_callbacks(m_mp, libvlc_gl_engine_opengl,
+ libvlc_video_set_output_callbacks(m_mp, libvlc_video_engine_opengl,
setup, cleanup, resize, swap,
make_current, get_proc_address,
this);
diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
index 72d3b787ad..fd1ab8defd 100644
--- a/include/vlc/libvlc_media_player.h
+++ b/include/vlc/libvlc_media_player.h
@@ -425,7 +425,7 @@ void libvlc_video_set_callbacks( libvlc_media_player_t *mp,
/**
* Callback prototype called to initialize user data.
*
- * \param opaque private pointer passed to the @a libvlc_video_set_opengl_callbacks() [IN]
+ * \param opaque private pointer passed to the @a libvlc_video_set_output_callbacks() [IN]
* \return true on success
* \version LibVLC 4.0.0 or later
*/
@@ -435,7 +435,7 @@ typedef bool (*libvlc_gl_setup_cb)(void* opaque);
/**
* Callback prototype called to release user data
*
- * \param opaque private pointer passed to the @a libvlc_video_set_opengl_callbacks() [IN]
+ * \param opaque private pointer passed to the @a libvlc_video_set_output_callbacks() [IN]
* \version LibVLC 4.0.0 or later
*/
typedef void (*libvlc_gl_cleanup_cb)(void* opaque);
@@ -443,7 +443,7 @@ typedef void (*libvlc_gl_cleanup_cb)(void* opaque);
/**
* Callback prototype called on video size changes
*
- * \param opaque private pointer passed to the @a libvlc_video_set_opengl_callbacks() [IN]
+ * \param opaque private pointer passed to the @a libvlc_video_set_output_callbacks() [IN]
* \param width video width in pixel [IN]
* \param height video height in pixel [IN]
* \return true on success
@@ -455,7 +455,7 @@ typedef bool (*libvlc_update_output_cb)(void* opaque, unsigned width, unsigned h
/**
* Callback prototype called after performing drawing calls.
*
- * \param opaque private pointer passed to the @a libvlc_video_set_opengl_callbacks() [IN]
+ * \param opaque private pointer passed to the @a libvlc_video_set_output_callbacks() [IN]
* \version LibVLC 4.0.0 or later
*/
typedef void (*libvlc_gl_swap_cb)(void* opaque);
@@ -463,7 +463,7 @@ typedef void (*libvlc_gl_swap_cb)(void* opaque);
/**
* Callback prototype to set up the OpenGL context for rendering
*
- * \param opaque private pointer passed to the @a libvlc_video_set_opengl_callbacks() [IN]
+ * \param opaque private pointer passed to the @a libvlc_video_set_output_callbacks() [IN]
* \param enter true to set the context as current, false to unset it [IN]
* \return true on success
* \version LibVLC 4.0.0 or later
@@ -473,7 +473,7 @@ typedef bool (*libvlc_gl_makeCurrent_cb)(void* opaque, bool enter);
/**
* Callback prototype to load opengl functions
*
- * \param opaque private pointer passed to the @a libvlc_video_set_opengl_callbacks() [IN]
+ * \param opaque private pointer passed to the @a libvlc_video_set_output_callbacks() [IN]
* \param fct_name name of the opengl function to load
* \return a pointer to the named OpenGL function the NULL otherwise
* \version LibVLC 4.0.0 or later
@@ -481,16 +481,16 @@ typedef bool (*libvlc_gl_makeCurrent_cb)(void* opaque, bool enter);
typedef void* (*libvlc_gl_getProcAddress_cb)(void* opaque, const char* fct_name);
/**
- * Enumeration of the OpenGL engine to be used
- * can be passed to @a libvlc_video_set_opengl_callbacks
+ * Enumeration of the Video engine to be used on output.
+ * can be passed to @a libvlc_video_set_output_callbacks
*/
-typedef enum libvlc_gl_engine_t {
- libvlc_gl_engine_opengl,
- libvlc_gl_engine_gles2
-} libvlc_gl_engine_t;
+typedef enum libvlc_video_engine_t {
+ libvlc_video_engine_opengl,
+ libvlc_video_engine_gles2,
+} libvlc_video_engine_t;
/**
- * Set callbacks and data to render decoded video to a custom OpenGL texture
+ * Set callbacks and data to render decoded video to a custom texture
*
* \warning VLC will perform video rendering in its own thread and at its own rate,
* You need to provide your own synchronisation mechanism.
@@ -498,7 +498,7 @@ typedef enum libvlc_gl_engine_t {
* OpenGL context need to be created before playing a media.
*
* \param mp the media player
- * \param gl_engine the OpenGL engine to use
+ * \param engine the GPU engine to use
* \param setup_cb callback called to initialize user data
* \param cleanup_cb callback called to clean up user data
* \param update_output_cb callback called to get the size of the video
@@ -509,8 +509,8 @@ typedef enum libvlc_gl_engine_t {
* \version LibVLC 4.0.0 or later
*/
LIBVLC_API
-void libvlc_video_set_opengl_callbacks( libvlc_media_player_t *mp,
- libvlc_gl_engine_t gl_engine,
+void libvlc_video_set_output_callbacks( libvlc_media_player_t *mp,
+ libvlc_video_engine_t engine,
libvlc_gl_setup_cb setup_cb,
libvlc_gl_cleanup_cb cleanup_cb,
libvlc_update_output_cb update_output_cb,
diff --git a/lib/libvlc.sym b/lib/libvlc.sym
index 0b4d3fd74a..285cf4f7af 100644
--- a/lib/libvlc.sym
+++ b/lib/libvlc.sym
@@ -246,7 +246,7 @@ libvlc_video_set_crop_geometry
libvlc_video_set_deinterlace
libvlc_video_set_format
libvlc_video_set_format_callbacks
-libvlc_video_set_opengl_callbacks
+libvlc_video_set_output_callbacks
libvlc_video_set_key_input
libvlc_video_set_logo_int
libvlc_video_set_logo_string
diff --git a/lib/media_player.c b/lib/media_player.c
index 831a17f9f8..7f64ad238c 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -1160,8 +1160,8 @@ void libvlc_video_set_format( libvlc_media_player_t *mp, const char *chroma,
var_SetInteger( mp, "vmem-pitch", pitch );
}
-void libvlc_video_set_opengl_callbacks( libvlc_media_player_t *mp,
- libvlc_gl_engine_t gl_engine,
+void libvlc_video_set_output_callbacks( libvlc_media_player_t *mp,
+ libvlc_video_engine_t engine,
libvlc_gl_setup_cb setup_cb,
libvlc_gl_cleanup_cb cleanup_cb,
libvlc_update_output_cb update_output_cb,
@@ -1177,7 +1177,7 @@ void libvlc_video_set_opengl_callbacks( libvlc_media_player_t *mp,
var_SetString( mp, "window", "wdummy");
#endif
- if( gl_engine == libvlc_gl_engine_gles2 )
+ if( engine == libvlc_video_engine_gles2 )
{
var_SetString ( mp, "vout", "gles2" );
var_SetString ( mp, "gles2", "vgl" );
--
2.17.1
More information about the vlc-devel
mailing list