[vlc-commits] display: use function rather than event for invalid pictures

Rémi Denis-Courmont git at videolan.org
Wed Jan 2 17:54:33 CET 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jan  2 12:13:57 2019 +0200| [163ae591ec62f0178492df34f1ee1670a2ebe781] | committer: Rémi Denis-Courmont

display: use function rather than event for invalid pictures

Handling is the same for all (two) cases and does not depend on the
owner.

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

 include/vlc_vout_display.h | 17 ++++-------------
 src/libvlccore.sym         |  1 +
 src/video_output/display.c | 21 ++++++++++-----------
 3 files changed, 15 insertions(+), 24 deletions(-)

diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index 54d13b549f..343a24419f 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -108,7 +108,7 @@ typedef struct {
 typedef struct {
     bool is_slow;                           /* The picture memory has slow read/write */
     bool has_double_click;                  /* Is double-click generated */
-    bool has_pictures_invalid;              /* Will VOUT_DISPLAY_EVENT_PICTURES_INVALID be used */
+    bool has_pictures_invalid;              /* May invoke vout_display_SendEventPicturesInvalid() */
     bool can_scale_spu;                     /* Handles subpictures with a non default zoom factor */
     const vlc_fourcc_t *subpicture_chromas; /* List of supported chromas for subpicture rendering. */
 } vout_display_info_t;
@@ -117,8 +117,8 @@ typedef struct {
  * Control query for vout_display_t
  */
 enum {
-    /* Ask to reset the internal buffers after a VOUT_DISPLAY_EVENT_PICTURES_INVALID
-     * request.
+    /* Ask to reset the internal buffers after calling
+     * vout_display_SendEventPicturesInvalid().
      */
     VOUT_DISPLAY_RESET_PICTURES, /* const vout_display_cfg_t *, es_format_t * */
 
@@ -163,12 +163,6 @@ enum {
  * Only the transition will be retained and acted upon.
  */
 enum {
-    /* TODO:
-     * ZOOM ? DISPLAY_FILLED ? ON_TOP ?
-     */
-    /* */
-    VOUT_DISPLAY_EVENT_PICTURES_INVALID,    /* The buffer are now invalid and need to be changed */
-
     /* VR navigation */
     VOUT_DISPLAY_EVENT_VIEWPOINT_MOVED,
 };
@@ -342,10 +336,7 @@ static inline void vout_display_SendEvent(vout_display_t *vd, int query, ...)
     va_end(args);
 }
 
-static inline void vout_display_SendEventPicturesInvalid(vout_display_t *vd)
-{
-    vout_display_SendEvent(vd, VOUT_DISPLAY_EVENT_PICTURES_INVALID);
-}
+VLC_API void vout_display_SendEventPicturesInvalid(vout_display_t *vd);
 
 #if defined(_WIN32) || defined(__OS2__)
 VLC_DEPRECATED
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index a71433b0ae..b454b18650 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -748,6 +748,7 @@ vout_window_Enable
 vout_window_Disable
 vout_display_GetDefaultDisplaySize
 vout_display_PlacePicture
+vout_display_SendEventPicturesInvalid
 vout_display_SendMouseMovedDisplayCoordinates
 xml_Create
 text_style_Copy
diff --git a/src/video_output/display.c b/src/video_output/display.c
index cf863df80e..762a61d435 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -373,6 +373,15 @@ static void VoutDisplayDestroyRender(vout_display_t *vd)
         filter_chain_Delete(osys->converters);
 }
 
+void vout_display_SendEventPicturesInvalid(vout_display_t *vd)
+{
+    vout_display_priv_t *osys = container_of(vd, vout_display_priv_t, display);
+
+    msg_Warn(vd, "picture buffers invalidated");
+    assert(vd->info.has_pictures_invalid);
+    atomic_store(&osys->reset_pictures, true);
+}
+
 static void VoutDisplayEvent(vout_display_t *vd, int event, va_list args)
 {
     vout_display_priv_t *osys = container_of(vd, vout_display_priv_t, display);
@@ -382,13 +391,6 @@ static void VoutDisplayEvent(vout_display_t *vd, int event, va_list args)
         var_SetAddress(osys->vout, "viewpoint-moved",
                        (void *)va_arg(args, const vlc_viewpoint_t *));
         break;
-
-    case VOUT_DISPLAY_EVENT_PICTURES_INVALID: {
-        msg_Warn(vd, "VoutDisplayEvent 'pictures invalid'");
-        assert(vd->info.has_pictures_invalid);
-        atomic_store(&osys->reset_pictures, true);
-        break;
-    }
     default:
         msg_Err(vd, "VoutDisplayEvent received event %d", event);
         /* TODO add an assert when all event are handled */
@@ -851,12 +853,9 @@ static void SplitterEvent(vout_display_t *vd, int event, va_list args)
     //vout_display_owner_sys_t *osys = vd->owner.sys;
 
     switch (event) {
-    case VOUT_DISPLAY_EVENT_PICTURES_INVALID:
-        VoutDisplayEvent(vd, event, args);
-        break;
-
     default:
         msg_Err(vd, "splitter event not implemented: %d", event);
+        (void) args;
         break;
     }
 }



More information about the vlc-commits mailing list