[vlc-commits] display: export new/delete functions

Rémi Denis-Courmont git at videolan.org
Sat Jan 12 14:33:18 CET 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jan  2 12:49:24 2019 +0200| [449a07c368ee7840d51bb3e30452a481e979c802] | committer: Rémi Denis-Courmont

display: export new/delete functions

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

 include/vlc_vout_display.h      | 13 +++++++++++++
 src/libvlccore.sym              |  2 ++
 src/video_output/display.c      | 26 +++++++++++++++-----------
 src/video_output/vout_wrapper.c |  4 ++--
 src/video_output/vout_wrapper.h |  6 ------
 5 files changed, 32 insertions(+), 19 deletions(-)

diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index 343a24419f..9c343fbcb6 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -298,6 +298,19 @@ struct vout_display_t {
 };
 
 /**
+ * Creates video output display.
+ */
+VLC_API
+vout_display_t *vout_display_New(vlc_object_t *, const video_format_t *,
+    const vout_display_cfg_t *, const char *module,
+    const vout_display_owner_t *);
+
+/**
+ * Destroys a video output display.
+ */
+VLC_API void vout_display_Delete(vout_display_t *);
+
+/**
  * Prepares a picture for display.
  */
 static inline void vout_display_Prepare(vout_display_t *vd, picture_t *picture,
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index b454b18650..87a656f62d 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -750,6 +750,8 @@ vout_display_GetDefaultDisplaySize
 vout_display_PlacePicture
 vout_display_SendEventPicturesInvalid
 vout_display_SendMouseMovedDisplayCoordinates
+vout_display_New
+vout_display_Delete
 xml_Create
 text_style_Copy
 text_style_Create
diff --git a/src/video_output/display.c b/src/video_output/display.c
index 729dbe75c7..d47aa826eb 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -790,6 +790,13 @@ void vout_DeleteDisplay(vout_display_t *vd, vout_display_cfg_t *cfg)
     if (cfg != NULL && !osys->is_splitter)
         *cfg = osys->cfg;
 
+    vout_display_Delete(vd);
+}
+
+void vout_display_Delete(vout_display_t *vd)
+{
+    vout_display_priv_t *osys = container_of(vd, vout_display_priv_t, display);
+
     VoutDisplayDestroyRender(vd);
     if (osys->is_splitter)
         SplitterClose(vd);
@@ -805,14 +812,11 @@ void vout_DeleteDisplay(vout_display_t *vd, vout_display_cfg_t *cfg)
     vlc_object_release(vd);
 }
 
-/*****************************************************************************
- *
- *****************************************************************************/
-vout_display_t *vout_NewDisplay(vlc_object_t *parent,
-                                const video_format_t *source,
-                                const vout_display_cfg_t *cfg,
-                                const char *module,
-                                const vout_display_owner_t *owner)
+vout_display_t *vout_display_New(vlc_object_t *parent,
+                                 const video_format_t *source,
+                                 const vout_display_cfg_t *cfg,
+                                 const char *module,
+                                 const vout_display_owner_t *owner)
 {
     return DisplayNew(parent, source, cfg, module, false, owner);
 }
@@ -890,7 +894,7 @@ static void SplitterClose(vout_display_t *vd)
     for (int i = 0; i < sys->count; i++) {
         vout_window_t *wnd = sys->display[i]->cfg->window;
 
-        vout_DeleteDisplay(sys->display[i], NULL);
+        vout_display_Delete(sys->display[i]);
         vout_display_window_Delete(wnd);
     }
     TAB_CLEAN(sys->count, sys->display);
@@ -954,7 +958,7 @@ vout_display_t *vout_NewSplitter(vout_thread_t *vout,
                                            source, &ocfg);
         ocfg.window = vout_display_window_New(vout, &wcfg);
         if (unlikely(ocfg.window == NULL)) {
-            vout_DeleteDisplay(wrapper, NULL);
+            vout_display_Delete(wrapper);
             return NULL;
         }
 
@@ -962,7 +966,7 @@ vout_display_t *vout_NewSplitter(vout_thread_t *vout,
                                         output->psz_module ? output->psz_module : module,
                                         false, &vdo);
         if (!vd) {
-            vout_DeleteDisplay(wrapper, NULL);
+            vout_display_Delete(wrapper);
             if (ocfg.window != NULL)
                 vout_display_window_Delete(ocfg.window);
             return NULL;
diff --git a/src/video_output/vout_wrapper.c b/src/video_output/vout_wrapper.c
index b731abecd3..81c41977ce 100644
--- a/src/video_output/vout_wrapper.c
+++ b/src/video_output/vout_wrapper.c
@@ -82,8 +82,8 @@ int vout_OpenWrapper(vout_thread_t *vout,
     if (splitter_name)
         vd = vout_NewSplitter(vout, &vout->p->original, cfg, modlist, splitter_name);
     else
-        vd = vout_NewDisplay(VLC_OBJECT(vout), &vout->p->original, cfg,
-                             modlist, &owner);
+        vd = vout_display_New(VLC_OBJECT(vout), &vout->p->original, cfg,
+                              modlist, &owner);
     free(modlist);
 
     if (vd == NULL)
diff --git a/src/video_output/vout_wrapper.h b/src/video_output/vout_wrapper.h
index 7b55f9b6f9..182bd3b46d 100644
--- a/src/video_output/vout_wrapper.h
+++ b/src/video_output/vout_wrapper.h
@@ -31,12 +31,6 @@
 picture_pool_t *vout_GetPool(vout_display_t *vd, unsigned count);
 
 /**
- * It creates a vout managed display.
- */
-vout_display_t *vout_NewDisplay(vlc_object_t *, const video_format_t *,
-    const vout_display_cfg_t *, const char *module,
-    const vout_display_owner_t *);
-/**
  * It destroy a vout managed display.
  */
 void vout_DeleteDisplay(vout_display_t *, vout_display_cfg_t *);



More information about the vlc-commits mailing list