[vlc-commits] vout: hide vout_Request/vout_Close

Thomas Guillem git at videolan.org
Thu May 3 11:05:38 CEST 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu May  3 10:26:28 2018 +0200| [f1faf78de9238b2760ac4eb7d320f659d6925ef2] | committer: Thomas Guillem

vout: hide vout_Request/vout_Close

So that we can use private structs to initialize the vout.

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

 include/vlc_vout.h               | 50 --------------------------------------
 src/libvlccore.sym               |  2 --
 src/video_output/control.c       |  2 +-
 src/video_output/vout_internal.h | 52 +++++++++++++++++++++++++++++++++++++++-
 4 files changed, 52 insertions(+), 54 deletions(-)

diff --git a/include/vlc_vout.h b/include/vlc_vout.h
index f98faf50dd..89d9821438 100644
--- a/include/vlc_vout.h
+++ b/include/vlc_vout.h
@@ -46,17 +46,6 @@
  */
 
 /**
- * Vout configuration
- */
-typedef struct {
-    vout_thread_t        *vout;
-    vlc_object_t         *input;
-    bool                 change_fmt;
-    const video_format_t *fmt;
-    unsigned             dpb_size;
-} vout_configuration_t;
-
-/**
  * Video output thread private structure
  */
 typedef struct vout_thread_sys_t vout_thread_sys_t;
@@ -88,45 +77,6 @@ struct vout_thread_t {
  *****************************************************************************/
 
 /**
- * Returns a suitable vout or release the given one.
- *
- * If cfg->fmt is non NULL and valid, a vout will be returned, reusing cfg->vout
- * is possible, otherwise it returns NULL.
- * If cfg->vout is not used, it will be closed and released.
- *
- * You can release the returned value either by vout_Request or vout_Close()
- * followed by a vlc_object_release() or shorter vout_CloseAndRelease()
- *
- * \param object a vlc object
- * \param cfg the video configuration requested.
- * \return a vout
- */
-VLC_API vout_thread_t * vout_Request( vlc_object_t *object, const vout_configuration_t *cfg );
-#define vout_Request(a,b) vout_Request(VLC_OBJECT(a),b)
-
-/**
- * This function will close a vout created by vout_Request.
- * The associated vout module is closed.
- * Note: It is not released yet, you'll have to call vlc_object_release()
- * or use the convenient vout_CloseAndRelease().
- *
- * \param p_vout the vout to close
- */
-VLC_API void vout_Close( vout_thread_t *p_vout );
-
-/**
- * This function will close a vout created by vout_Create
- * and then release it.
- *
- * \param p_vout the vout to close and release
- */
-static inline void vout_CloseAndRelease( vout_thread_t *p_vout )
-{
-    vout_Close( p_vout );
-    vlc_object_release( p_vout );
-}
-
-/**
  * This function will handle a snapshot request.
  *
  * pp_image, pp_picture and p_fmt can be NULL otherwise they will be
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 89d69b85f5..ce655489dc 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -703,7 +703,6 @@ vlm_MessageNew
 vlm_MessageSimpleNew
 vlm_New
 vout_ChangeAspectRatio
-vout_Close
 vout_GetPicture
 vout_PutPicture
 vout_PutSubpicture
@@ -715,7 +714,6 @@ vout_OSDMessage
 vout_OSDEpg
 vout_OSDSlider
 vout_OSDText
-vout_Request
 vout_window_New
 vout_window_Delete
 vout_display_GetDefaultDisplaySize
diff --git a/src/video_output/control.c b/src/video_output/control.c
index f60b3fc371..f20a5f5053 100644
--- a/src/video_output/control.c
+++ b/src/video_output/control.c
@@ -27,7 +27,7 @@
 
 #include <vlc_common.h>
 #include <vlc_vout.h>
-#include "control.h"
+#include "vout_internal.h"
 
 /* */
 void vout_control_cmd_Init(vout_control_cmd_t *cmd, int type)
diff --git a/src/video_output/vout_internal.h b/src/video_output/vout_internal.h
index fae8c92f83..89c7542943 100644
--- a/src/video_output/vout_internal.h
+++ b/src/video_output/vout_internal.h
@@ -29,7 +29,6 @@
 #include <vlc_picture_pool.h>
 #include <vlc_vout_display.h>
 #include <vlc_vout_wrapper.h>
-#include "control.h"
 #include "snapshot.h"
 #include "statistic.h"
 #include "chrono.h"
@@ -42,6 +41,18 @@
  */
 #define VOUT_MAX_PICTURES (20)
 
+/**
+ * Vout configuration
+ */
+typedef struct {
+    vout_thread_t        *vout;
+    vlc_object_t         *input;
+    bool                 change_fmt;
+    const video_format_t *fmt;
+    unsigned             dpb_size;
+} vout_configuration_t;
+#include "control.h"
+
 /* */
 struct vout_thread_sys_t
 {
@@ -137,6 +148,45 @@ struct vout_thread_sys_t
     vout_chrono_t   render;           /**< picture render time estimator */
 };
 
+/**
+ * Returns a suitable vout or release the given one.
+ *
+ * If cfg->fmt is non NULL and valid, a vout will be returned, reusing cfg->vout
+ * is possible, otherwise it returns NULL.
+ * If cfg->vout is not used, it will be closed and released.
+ *
+ * You can release the returned value either by vout_Request or vout_Close()
+ * followed by a vlc_object_release() or shorter vout_CloseAndRelease()
+ *
+ * \param object a vlc object
+ * \param cfg the video configuration requested.
+ * \return a vout
+ */
+vout_thread_t * vout_Request( vlc_object_t *object, const vout_configuration_t *cfg );
+#define vout_Request(a,b) vout_Request(VLC_OBJECT(a),b)
+
+/**
+ * This function will close a vout created by vout_Request.
+ * The associated vout module is closed.
+ * Note: It is not released yet, you'll have to call vlc_object_release()
+ * or use the convenient vout_CloseAndRelease().
+ *
+ * \param p_vout the vout to close
+ */
+void vout_Close( vout_thread_t *p_vout );
+
+/**
+ * This function will close a vout created by vout_Create
+ * and then release it.
+ *
+ * \param p_vout the vout to close and release
+ */
+static inline void vout_CloseAndRelease( vout_thread_t *p_vout )
+{
+    vout_Close( p_vout );
+    vlc_object_release( p_vout );
+}
+
 /* TODO to move them to vlc_vout.h */
 void vout_ControlChangeFullscreen(vout_thread_t *, bool fullscreen);
 void vout_ControlChangeWindowState(vout_thread_t *, unsigned state);



More information about the vlc-commits mailing list