[vlc-commits] video_output: the display callback is not mandatory anymore

Steve Lhomme git at videolan.org
Sat Oct 27 10:14:57 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Oct 26 10:17:33 2018 +0200| [8e8df143c363bb951cfed7bb08730e6fb41224e4] | committer: Thomas Guillem

video_output: the display callback is not mandatory anymore

For asynchronous displays it may be better to schedule the display
in Prepare() and nothing is done in Display().

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

 include/vlc_vout_display.h        |  2 +-
 modules/video_output/decklink.cpp |  7 +------
 modules/video_output/vdummy.c     | 10 +---------
 src/video_output/vout_wrapper.h   |  3 ++-
 4 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index 0ffdbcbfad..ffb988f41d 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -270,7 +270,7 @@ struct vout_display_t {
     void       (*prepare)(vout_display_t *, picture_t *, subpicture_t *,
                           vlc_tick_t date);
 
-    /* Display a picture and an optional subpicture (mandatory).
+    /* Display a picture and an optional subpicture.
      *
      * The picture and the optional subpicture must be displayed as soon as
      * possible.
diff --git a/modules/video_output/decklink.cpp b/modules/video_output/decklink.cpp
index 8da517d257..605de7fa69 100644
--- a/modules/video_output/decklink.cpp
+++ b/modules/video_output/decklink.cpp
@@ -1024,11 +1024,6 @@ end:
         pDLVideoFrame->Release();
 }
 
-static void DisplayVideo(vout_display_t *, picture_t *picture, subpicture_t *)
-{
-    VLC_UNUSED(picture);
-}
-
 static int ControlVideo(vout_display_t *vd, int query, va_list args)
 {
     (void) vd; (void) query; (void) args;
@@ -1080,7 +1075,7 @@ static int OpenVideo(vlc_object_t *p_this)
 
     vd->pool    = PoolVideo;
     vd->prepare = PrepareVideo;
-    vd->display = DisplayVideo;
+    vd->display = NULL;
     vd->control = ControlVideo;
 
     return VLC_SUCCESS;
diff --git a/modules/video_output/vdummy.c b/modules/video_output/vdummy.c
index a4fdc796d4..bddf3a5ce1 100644
--- a/modules/video_output/vdummy.c
+++ b/modules/video_output/vdummy.c
@@ -69,7 +69,6 @@ struct vout_display_sys_t {
     picture_pool_t *pool;
 };
 static picture_pool_t *Pool(vout_display_t *, unsigned count);
-static void            Display(vout_display_t *, picture_t *, subpicture_t *);
 static void            DisplayStat(vout_display_t *, picture_t *, subpicture_t *);
 static int             Control(vout_display_t *, int, va_list);
 
@@ -108,7 +107,7 @@ static int Open(vlc_object_t *object,
 
 static int OpenDummy(vlc_object_t *object)
 {
-    return Open(object, Display);
+    return Open(object, NULL);
 }
 
 static int OpenStats(vlc_object_t *object)
@@ -134,13 +133,6 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
     return sys->pool;
 }
 
-static void Display(vout_display_t *vd, picture_t *picture, subpicture_t *subpicture)
-{
-    VLC_UNUSED(vd);
-    VLC_UNUSED(subpicture);
-    VLC_UNUSED(picture);
-}
-
 static void DisplayStat(vout_display_t *vd, picture_t *picture, subpicture_t *subpicture)
 {
     plane_t *p = picture->p;
diff --git a/src/video_output/vout_wrapper.h b/src/video_output/vout_wrapper.h
index 2cb0681d8f..8c82c44780 100644
--- a/src/video_output/vout_wrapper.h
+++ b/src/video_output/vout_wrapper.h
@@ -55,7 +55,8 @@ static inline void vout_display_Display(vout_display_t *vd,
                                         picture_t *picture,
                                         subpicture_t *subpicture)
 {
-    vd->display(vd, picture, subpicture);
+    if (vd->display)
+        vd->display(vd, picture, subpicture);
     picture_Release(picture);
     if (subpicture)
         subpicture_Delete(subpicture);



More information about the vlc-commits mailing list