[vlc-devel] [PATCH 19/21] libvlc: rename the select_plane callback to something more generic

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


And move the structure up.

No functional changes.
---
 include/vlc/libvlc_media_player.h       | 42 ++++++++++++-------------
 lib/media_player.c                      |  2 +-
 modules/video_output/win32/direct3d11.c |  2 +-
 3 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
index 1c990d2bb38..6610dced5c2 100644
--- a/include/vlc/libvlc_media_player.h
+++ b/include/vlc/libvlc_media_player.h
@@ -693,6 +693,26 @@ typedef void( *libvlc_video_output_set_resize_cb )( void *opaque,
                                                     void (*report_size_change)(void *report_opaque, unsigned width, unsigned height),
                                                     void *report_opaque );
 
+/** Tell the host the rendering for the given plane is about to start
+ *
+ * \param opaque private pointer set on the opaque parameter of @a libvlc_video_output_setup_cb() [IN]
+ * \param plane number of the rendering plane to select
+ * \return true on success
+ * \version LibVLC 4.0.0 or later
+ *
+ * \note This is only used with \ref libvlc_video_direct3d_engine_d3d11.
+ *
+ * The host should call OMSetRenderTargets for Direct3D11. If this callback is
+ * not used (set to NULL in @a libvlc_video_direct3d_set_callbacks()) OMSetRenderTargets
+ * has to be set during the @a libvlc_video_makeCurrent_cb()
+ * entering call.
+ *
+ * The number of planes depend on the DXGI_FORMAT returned during the
+ * \ref LIBVLC_VIDEO_UPDATE_OUTPUT call. It's usually one plane except for
+ * semi-planar formats like DXGI_FORMAT_NV12 or DXGI_FORMAT_P010.
+ */
+typedef bool( *libvlc_video_output_select_plane_cb )( void *opaque, size_t plane );
+
 /**
  * Set callbacks and data to render decoded video to a custom texture
  *
@@ -740,26 +760,6 @@ typedef enum libvlc_video_direct3d_engine_t {
     libvlc_video_direct3d_engine_d3d9,
 } libvlc_video_direct3d_engine_t;
 
-/** Tell the host the rendering for the given plane is about to start
- *
- * \param opaque private pointer set on the opaque parameter of @a libvlc_video_output_setup_cb() [IN]
- * \param plane number of the rendering plane to select
- * \return true on success
- * \version LibVLC 4.0.0 or later
- *
- * \note This is only used with \ref libvlc_video_direct3d_engine_d3d11.
- *
- * The host should call OMSetRenderTargets for Direct3D11. If this callback is
- * not used (set to NULL in @a libvlc_video_direct3d_set_callbacks()) OMSetRenderTargets
- * has to be set during the @a libvlc_video_makeCurrent_cb()
- * entering call.
- *
- * The number of planes depend on the DXGI_FORMAT returned during the
- * \ref LIBVLC_VIDEO_UPDATE_OUTPUT call. It's usually one plane except for
- * semi-planar formats like DXGI_FORMAT_NV12 or DXGI_FORMAT_P010.
- */
-typedef bool( *libvlc_video_direct3d_select_plane_cb )( void *opaque, size_t plane );
-
 /**
  * Set callbacks and data to render decoded video to a custom Direct3D output
  *
@@ -793,7 +793,7 @@ bool libvlc_video_direct3d_set_callbacks( libvlc_media_player_t *mp,
                                          libvlc_video_swap_cb swap_cb,
                                          libvlc_video_makeCurrent_cb makeCurrent_cb,
                                          libvlc_video_frameMetadata_cb metadata_cb,
-                                         libvlc_video_direct3d_select_plane_cb select_plane_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 f487907740a..aa24872b787 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -1084,7 +1084,7 @@ bool libvlc_video_direct3d_set_callbacks(libvlc_media_player_t *mp,
                                          libvlc_video_swap_cb swap_cb,
                                          libvlc_video_makeCurrent_cb makeCurrent_cb,
                                          libvlc_video_frameMetadata_cb metadata_cb,
-                                         libvlc_video_direct3d_select_plane_cb select_plane_cb,
+                                         libvlc_video_output_select_plane_cb select_plane_cb,
                                          void *opaque)
 {
     var_SetString( mp, "window", "wextern");
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index b40423da130..996542021c5 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -123,7 +123,7 @@ struct vout_display_sys_t
     libvlc_video_swap_cb                     swapCb;
     libvlc_video_makeCurrent_cb              startEndRenderingCb;
     libvlc_video_frameMetadata_cb            sendMetadataCb;
-    libvlc_video_direct3d_select_plane_cb    selectPlaneCb;
+    libvlc_video_output_select_plane_cb      selectPlaneCb;
 };
 
 static void Prepare(vout_display_t *, picture_t *, subpicture_t *subpicture, vlc_tick_t);
-- 
2.17.1



More information about the vlc-devel mailing list