[vlc-devel] [PATCH 1/3] vout: decklink: fix callback signatures

Steve Lhomme robux4 at ycbcr.xyz
Tue Jul 16 14:51:35 CEST 2019


---
 modules/video_output/decklink.cpp | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/modules/video_output/decklink.cpp b/modules/video_output/decklink.cpp
index 177720cccc..207aa72c5b 100644
--- a/modules/video_output/decklink.cpp
+++ b/modules/video_output/decklink.cpp
@@ -234,8 +234,9 @@ struct decklink_sys_t
  * Local prototypes.
  *****************************************************************************/
 
-static int  OpenVideo           (vlc_object_t *);
-static void CloseVideo          (vlc_object_t *);
+static int  OpenVideo           (vout_display_t *, const vout_display_cfg_t *,
+                                 video_format_t *, vlc_video_context *);
+static void CloseVideo          (vout_display_t *);
 static int  OpenAudio           (vlc_object_t *);
 static void CloseAudio          (vlc_object_t *);
 
@@ -770,10 +771,10 @@ static int ControlVideo(vout_display_t *vd, int query, va_list args)
     return VLC_EGENERIC;
 }
 
-static int OpenVideo(vlc_object_t *p_this)
+static int OpenVideo(vout_display_t *vd, const vout_display_cfg_t *cfg,
+                     video_format_t *fmtp, vlc_video_context *context)
 {
-    vout_display_t *vd = (vout_display_t *)p_this;
-    decklink_sys_t *sys = HoldDLSys(p_this, VIDEO_ES);
+    decklink_sys_t *sys = HoldDLSys(VLC_OBJECT(vd), VIDEO_ES);
     if(!sys)
         return VLC_ENOMEM;
 
@@ -786,24 +787,24 @@ static int OpenVideo(vlc_object_t *p_this)
 
     if( b_init )
     {
-        sys->video.tenbits = var_InheritBool(p_this, VIDEO_CFG_PREFIX "tenbits");
-        sys->video.nosignal_delay = var_InheritInteger(p_this, VIDEO_CFG_PREFIX "nosignal-delay");
-        sys->video.afd = var_InheritInteger(p_this, VIDEO_CFG_PREFIX "afd");
-        sys->video.ar = var_InheritInteger(p_this, VIDEO_CFG_PREFIX "ar");
+        sys->video.tenbits = var_InheritBool(vd, VIDEO_CFG_PREFIX "tenbits");
+        sys->video.nosignal_delay = var_InheritInteger(vd, VIDEO_CFG_PREFIX "nosignal-delay");
+        sys->video.afd = var_InheritInteger(vd, VIDEO_CFG_PREFIX "afd");
+        sys->video.ar = var_InheritInteger(vd, VIDEO_CFG_PREFIX "ar");
         sys->video.pic_nosignal = NULL;
 
         if (OpenDecklink(vd, sys) != VLC_SUCCESS)
         {
-            CloseVideo(p_this);
+            CloseVideo(vd);
             return VLC_EGENERIC;
         }
 
-        char *pic_file = var_InheritString(p_this, VIDEO_CFG_PREFIX "nosignal-image");
+        char *pic_file = var_InheritString(vd, VIDEO_CFG_PREFIX "nosignal-image");
         if (pic_file)
         {
-            sys->video.pic_nosignal = sdi::Generator::Picture(p_this, pic_file, &vd->fmt);
+            sys->video.pic_nosignal = sdi::Generator::Picture(VLC_OBJECT(vd), pic_file, &vd->fmt);
             if (!sys->video.pic_nosignal)
-                msg_Err(p_this, "Could not create no signal picture");
+                msg_Err(vd, "Could not create no signal picture");
             free(pic_file);
         }
     }
@@ -819,9 +820,9 @@ static int OpenVideo(vlc_object_t *p_this)
     return VLC_SUCCESS;
 }
 
-static void CloseVideo(vlc_object_t *p_this)
+static void CloseVideo(vout_display_t *vd)
 {
-    ReleaseDLSys(p_this, VIDEO_ES);
+    ReleaseDLSys(VLC_OBJECT(vd), VIDEO_ES);
 }
 
 /*****************************************************************************
-- 
2.17.1



More information about the vlc-devel mailing list