[vlc-devel] [PATCH 6/7] libvlc: add an API entry to set the new video area size

Steve Lhomme robux4 at ycbcr.xyz
Tue May 7 11:39:54 CEST 2019


---
 include/vlc/libvlc_media_player.h | 12 ++++++++++++
 lib/libvlc.sym                    |  1 +
 lib/media_player.c                | 11 +++++++++++
 3 files changed, 24 insertions(+)

diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
index cb6816797a..19556e65b7 100644
--- a/include/vlc/libvlc_media_player.h
+++ b/include/vlc/libvlc_media_player.h
@@ -777,6 +777,18 @@ int libvlc_video_direct3d_set_callbacks( libvlc_media_player_t *mp,
                                         libvlc_video_direct3d_select_plane_cb select_plane_cb,
                                         void* opaque );
 
+/**
+ * Set the rendering size to use with \ref libvlc_video_direct3d_set_callbacks
+ *
+ * \param mp the media player
+ * \param width the width of the available area to render
+ * \param height the height of the available area to render
+ * \version LibVLC 4.0.0 or later
+ */
+LIBVLC_API
+void libvlc_video_direct3d_set_rendering_size( libvlc_media_player_t *mp,
+                                              unsigned width, unsigned height );
+
 /**
  * Set the NSView handler where the media player should render its video output.
  *
diff --git a/lib/libvlc.sym b/lib/libvlc.sym
index 51a45688de..257876beac 100644
--- a/lib/libvlc.sym
+++ b/lib/libvlc.sym
@@ -245,6 +245,7 @@ libvlc_video_set_format
 libvlc_video_set_format_callbacks
 libvlc_video_set_output_callbacks
 libvlc_video_direct3d_set_callbacks
+libvlc_video_direct3d_set_rendering_size
 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 4060aa1f7e..10dbcb4668 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -652,6 +652,9 @@ libvlc_media_player_new( libvlc_instance_t *instance )
     var_Create (mp, "drawable-xid", VLC_VAR_INTEGER);
 #if defined (_WIN32) || defined (__OS2__)
     var_Create (mp, "drawable-hwnd", VLC_VAR_INTEGER);
+    var_Create( mp, "width", VLC_VAR_INTEGER );
+    var_Create( mp, "height", VLC_VAR_INTEGER );
+    var_Create( mp, "window-size", VLC_VAR_COORDS );
 #endif
 #ifdef __APPLE__
     var_Create (mp, "drawable-nsobject", VLC_VAR_ADDRESS);
@@ -1238,6 +1241,14 @@ int libvlc_video_direct3d_set_callbacks( libvlc_media_player_t *mp,
     return 1;
 }
 
+void libvlc_video_direct3d_set_rendering_size( libvlc_media_player_t *mp,
+                                      unsigned width, unsigned height )
+{
+    var_SetInteger( mp, "width", width );
+    var_SetInteger( mp, "height", height );
+    var_SetCoords( mp, "window-size", width, height );
+}
+
 /**************************************************************************
  * set_nsobject
  **************************************************************************/
-- 
2.17.1



More information about the vlc-devel mailing list