[vlc-commits] display: use set_callbacks_display() to set the display module callbacks

Steve Lhomme git at videolan.org
Mon Jul 22 07:20:51 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jul  9 12:38:03 2019 +0200| [bc701ed6c0199e41ce1701f54046382fd26b491c] | committer: Steve Lhomme

display: use set_callbacks_display() to set the display module callbacks

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

 modules/hw/mmal/vout.c                  | 3 +--
 modules/hw/vdpau/display.c              | 3 +--
 modules/video_output/android/display.c  | 6 ++----
 modules/video_output/caca.c             | 3 +--
 modules/video_output/caopengllayer.m    | 3 +--
 modules/video_output/decklink.cpp       | 3 +--
 modules/video_output/fb.c               | 3 +--
 modules/video_output/flaschen.c         | 3 +--
 modules/video_output/ios.m              | 3 +--
 modules/video_output/kms.c              | 3 +--
 modules/video_output/kva.c              | 3 +--
 modules/video_output/macosx.m           | 3 +--
 modules/video_output/opengl/display.c   | 6 ++----
 modules/video_output/splitter.c         | 3 +--
 modules/video_output/vdummy.c           | 6 ++----
 modules/video_output/vmem.c             | 3 +--
 modules/video_output/vulkan/display.c   | 6 +++---
 modules/video_output/wayland/shm.c      | 3 +--
 modules/video_output/win32/direct3d11.c | 3 +--
 modules/video_output/win32/direct3d9.c  | 3 +--
 modules/video_output/win32/glwin32.c    | 3 +--
 modules/video_output/win32/wingdi.c     | 3 +--
 modules/video_output/xcb/render.c       | 5 ++---
 modules/video_output/xcb/x11.c          | 3 +--
 modules/video_output/yuv.c              | 5 ++---
 25 files changed, 32 insertions(+), 59 deletions(-)

diff --git a/modules/hw/mmal/vout.c b/modules/hw/mmal/vout.c
index 8493d6ad64..03aa6719cf 100644
--- a/modules/hw/mmal/vout.c
+++ b/modules/hw/mmal/vout.c
@@ -74,7 +74,6 @@ static void Close(vout_display_t *vd);
 vlc_module_begin()
     set_shortname(N_("MMAL vout"))
     set_description(N_("MMAL-based vout plugin for Raspberry Pi"))
-    set_capability("vout display", 90)
     add_shortcut("mmal_vout")
     add_integer(MMAL_LAYER_NAME, 1, MMAL_LAYER_TEXT, MMAL_LAYER_LONGTEXT, false)
     add_bool(MMAL_BLANK_BACKGROUND_NAME, true, MMAL_BLANK_BACKGROUND_TEXT,
@@ -83,7 +82,7 @@ vlc_module_begin()
                     MMAL_ADJUST_REFRESHRATE_LONGTEXT, false)
     add_bool(MMAL_NATIVE_INTERLACED, false, MMAL_NATIVE_INTERLACE_TEXT,
                     MMAL_NATIVE_INTERLACE_LONGTEXT, false)
-    set_callbacks(Open, Close)
+    set_callbacks_display(Open, Close, 90)
 vlc_module_end()
 
 struct dmx_region_t {
diff --git a/modules/hw/vdpau/display.c b/modules/hw/vdpau/display.c
index c5ebf6639f..acd7a856c1 100644
--- a/modules/hw/vdpau/display.c
+++ b/modules/hw/vdpau/display.c
@@ -46,8 +46,7 @@ vlc_module_begin()
     set_description(N_("VDPAU output"))
     set_category(CAT_VIDEO)
     set_subcategory(SUBCAT_VIDEO_VOUT)
-    set_capability("vout display", 0)
-    set_callbacks(Open, Close)
+    set_callbacks_display(Open, Close, 0)
 
     add_shortcut("vdpau")
 vlc_module_end()
diff --git a/modules/video_output/android/display.c b/modules/video_output/android/display.c
index 908eb6d06c..1b28bea50d 100644
--- a/modules/video_output/android/display.c
+++ b/modules/video_output/android/display.c
@@ -62,15 +62,13 @@ vlc_module_begin()
     set_category(CAT_VIDEO)
     set_subcategory(SUBCAT_VIDEO_VOUT)
     set_description("Android video output")
-    set_capability("vout display", 260)
     add_shortcut("android-display")
     add_string(CFG_PREFIX "chroma", NULL, CHROMA_TEXT, CHROMA_LONGTEXT, true)
-    set_callbacks(Open, Close)
+    set_callbacks_display(Open, Close, 260)
     add_submodule ()
         set_description("Android opaque video output")
-        set_capability("vout display", 280)
         add_shortcut("android-opaque")
-        set_callbacks(OpenOpaque, Close)
+        set_callbacks_display(OpenOpaque, Close, 280)
 vlc_module_end()
 
 /*****************************************************************************
diff --git a/modules/video_output/caca.c b/modules/video_output/caca.c
index 3c79b01b6c..117f146523 100644
--- a/modules/video_output/caca.c
+++ b/modules/video_output/caca.c
@@ -532,6 +532,5 @@ vlc_module_begin()
     set_category(CAT_VIDEO)
     set_subcategory(SUBCAT_VIDEO_VOUT)
     set_description(N_("Color ASCII art video output"))
-    set_capability("vout display", 15)
-    set_callbacks(Open, Close)
+    set_callbacks_display(Open, Close, 15)
 vlc_module_end()
diff --git a/modules/video_output/caopengllayer.m b/modules/video_output/caopengllayer.m
index f328657655..00d2477f84 100644
--- a/modules/video_output/caopengllayer.m
+++ b/modules/video_output/caopengllayer.m
@@ -53,10 +53,9 @@ static void Close(vout_display_t *vd);
 
 vlc_module_begin()
     set_description(N_("Core Animation OpenGL Layer (Mac OS X)"))
-    set_capability("vout display", 0)
     set_category(CAT_VIDEO)
     set_subcategory(SUBCAT_VIDEO_VOUT)
-    set_callbacks(Open, Close)
+    set_callbacks_display(Open, Close, 0)
 vlc_module_end()
 
 static picture_pool_t *Pool (vout_display_t *vd, unsigned requested_count);
diff --git a/modules/video_output/decklink.cpp b/modules/video_output/decklink.cpp
index 2fc32f5126..1516f2182d 100644
--- a/modules/video_output/decklink.cpp
+++ b/modules/video_output/decklink.cpp
@@ -254,8 +254,7 @@ vlc_module_begin()
     set_description (N_("DeckLink Video Output module"))
     set_category(CAT_VIDEO)
     set_subcategory(SUBCAT_VIDEO_VOUT)
-    set_capability("vout display", 0)
-    set_callbacks (OpenVideo, CloseVideo)
+    set_callbacks_display (OpenVideo, CloseVideo, 0)
     set_section(N_("DeckLink Video Options"), NULL)
     add_string(VIDEO_CFG_PREFIX "video-connection", "sdi",
                 VIDEO_CONNECTION_TEXT, VIDEO_CONNECTION_LONGTEXT, true)
diff --git a/modules/video_output/fb.c b/modules/video_output/fb.c
index fff5ff31fd..d585945192 100644
--- a/modules/video_output/fb.c
+++ b/modules/video_output/fb.c
@@ -87,8 +87,7 @@ vlc_module_begin ()
                  true)
     add_obsolete_bool("fb-hw-accel") /* since 4.0.0 */
     set_description(N_("GNU/Linux framebuffer video output"))
-    set_capability("vout display", 30)
-    set_callbacks(Open, Close)
+    set_callbacks_display(Open, Close, 30)
 vlc_module_end ()
 
 /*****************************************************************************
diff --git a/modules/video_output/flaschen.c b/modules/video_output/flaschen.c
index 15d6dd48b9..b316b5b065 100644
--- a/modules/video_output/flaschen.c
+++ b/modules/video_output/flaschen.c
@@ -61,8 +61,7 @@ static void Close(vout_display_t *vd);
 vlc_module_begin ()
     set_shortname( N_("Flaschen") )
     set_description( N_("Flaschen-Taschen video output") )
-    set_capability( "vout display", 0 )
-    set_callbacks( Open, Close )
+    set_callbacks_display( Open, Close, 0 )
     add_shortcut( "flaschen" )
 
     set_category( CAT_VIDEO )
diff --git a/modules/video_output/ios.m b/modules/video_output/ios.m
index d394e8a92a..cd7a49cebf 100644
--- a/modules/video_output/ios.m
+++ b/modules/video_output/ios.m
@@ -73,8 +73,7 @@ vlc_module_begin ()
     set_description("iOS OpenGL video output")
     set_category(CAT_VIDEO)
     set_subcategory(SUBCAT_VIDEO_VOUT)
-    set_capability("vout display", 300)
-    set_callbacks(Open, Close)
+    set_callbacks_display(Open, Close, 300)
 
     add_shortcut("vout_ios2", "vout_ios")
     add_glopts()
diff --git a/modules/video_output/kms.c b/modules/video_output/kms.c
index 3e0f02188f..4304235c92 100644
--- a/modules/video_output/kms.c
+++ b/modules/video_output/kms.c
@@ -788,6 +788,5 @@ vlc_module_begin ()
     add_string( "kms-drm-chroma", NULL, DRM_CHROMA_TEXT, DRM_CHROMA_LONGTEXT,
                 true)
     set_description("Linux kernel mode setting video output")
-    set_capability("vout display", 30)
-    set_callbacks(Open, Close)
+    set_callbacks_display(Open, Close, 30)
 vlc_module_end ()
diff --git a/modules/video_output/kva.c b/modules/video_output/kva.c
index 7900614019..13161cc5e9 100644
--- a/modules/video_output/kva.c
+++ b/modules/video_output/kva.c
@@ -70,9 +70,8 @@ vlc_module_begin ()
         change_string_list( ppsz_kva_video_mode, ppsz_kva_video_mode_text )
     add_bool( "kva-fixt23", false, KVA_FIXT23_TEXT, KVA_FIXT23_LONGTEXT, true )
     set_description( N_("K Video Acceleration video output") )
-    set_capability( "vout display", 100 )
     add_shortcut( "kva" )
-    set_callbacks( Open, Close )
+    set_callbacks_display( Open, Close, 100 )
 vlc_module_end ()
 
 /*****************************************************************************
diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index de85879341..49596aa0d2 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -76,8 +76,7 @@ vlc_module_begin ()
     set_description (N_("Mac OS X OpenGL video output"))
     set_category (CAT_VIDEO)
     set_subcategory (SUBCAT_VIDEO_VOUT)
-    set_capability ("vout display", 300)
-    set_callbacks (Open, Close)
+    set_callbacks_display (Open, Close, 300)
     add_shortcut ("macosx", "vout_macosx")
     add_glopts ()
 vlc_module_end ()
diff --git a/modules/video_output/opengl/display.c b/modules/video_output/opengl/display.c
index 69e45e744d..afec7b5c42 100644
--- a/modules/video_output/opengl/display.c
+++ b/modules/video_output/opengl/display.c
@@ -49,8 +49,7 @@ vlc_module_begin ()
 # define MODULE_VARNAME "gles2"
     set_shortname (N_("OpenGL ES2"))
     set_description (N_("OpenGL for Embedded Systems 2 video output"))
-    set_capability ("vout display", 265)
-    set_callbacks (Open, Close)
+    set_callbacks_display (Open, Close, 265)
     add_shortcut ("opengles2", "gles2")
     add_module("gles2", "opengl es2", NULL, GLES2_TEXT, PROVIDER_LONGTEXT)
 
@@ -62,8 +61,7 @@ vlc_module_begin ()
     set_description (N_("OpenGL video output"))
     set_category (CAT_VIDEO)
     set_subcategory (SUBCAT_VIDEO_VOUT)
-    set_capability ("vout display", 270)
-    set_callbacks (Open, Close)
+    set_callbacks_display (Open, Close, 270)
     add_shortcut ("opengl", "gl")
     add_module("gl", "opengl", NULL, GL_TEXT, PROVIDER_LONGTEXT)
 #endif
diff --git a/modules/video_output/splitter.c b/modules/video_output/splitter.c
index 818841ca08..04cf26b7a6 100644
--- a/modules/video_output/splitter.c
+++ b/modules/video_output/splitter.c
@@ -327,8 +327,7 @@ vlc_module_begin()
     set_description(N_("Video splitter display plugin"))
     set_category(CAT_VIDEO)
     set_subcategory(SUBCAT_VIDEO_VOUT)
-    set_capability("vout display", 0)
-    set_callbacks(vlc_vidsplit_Open, vlc_vidsplit_Close)
+    set_callbacks_display(vlc_vidsplit_Open, vlc_vidsplit_Close, 0)
     add_module("video-splitter", "video splitter", NULL,
                N_("Video splitter module"), N_("Video splitter module"))
 vlc_module_end()
diff --git a/modules/video_output/vdummy.c b/modules/video_output/vdummy.c
index 2e88691aa3..664723740f 100644
--- a/modules/video_output/vdummy.c
+++ b/modules/video_output/vdummy.c
@@ -46,8 +46,7 @@ static int OpenStats(vout_display_t *vd, const vout_display_cfg_t *cfg,
 vlc_module_begin ()
     set_shortname( N_("Dummy") )
     set_description( N_("Dummy video output") )
-    set_capability( "vout display", 0 )
-    set_callback( OpenDummy )
+    set_callback_display( OpenDummy, 0 )
     add_shortcut( "dummy" )
 
     set_category( CAT_VIDEO )
@@ -56,9 +55,8 @@ vlc_module_begin ()
 
     add_submodule ()
     set_description( N_("Statistics video output") )
-    set_capability( "vout display", 0 )
     add_shortcut( "stats" )
-    set_callback( OpenStats )
+    set_callback_display( OpenStats, 0 )
 vlc_module_end ()
 
 
diff --git a/modules/video_output/vmem.c b/modules/video_output/vmem.c
index ee5e544656..f8e0fbee1a 100644
--- a/modules/video_output/vmem.c
+++ b/modules/video_output/vmem.c
@@ -61,7 +61,6 @@ vlc_module_begin()
 
     set_category(CAT_VIDEO)
     set_subcategory(SUBCAT_VIDEO_VOUT)
-    set_capability("vout display", 0)
 
     add_integer("vmem-width", 320, T_WIDTH, LT_WIDTH, false)
         change_private()
@@ -75,7 +74,7 @@ vlc_module_begin()
     add_obsolete_string("vmem-unlock") /* obsoleted since 1.1.1 */
     add_obsolete_string("vmem-data") /* obsoleted since 1.1.1 */
 
-    set_callbacks(Open, Close)
+    set_callbacks_display(Open, Close, 0)
 vlc_module_end()
 
 /*****************************************************************************
diff --git a/modules/video_output/vulkan/display.c b/modules/video_output/vulkan/display.c
index 511446324d..79f6f93964 100644
--- a/modules/video_output/vulkan/display.c
+++ b/modules/video_output/vulkan/display.c
@@ -368,12 +368,12 @@ static int Control(vout_display_t *vd, int query, va_list ap)
 #define DISABLE_DR_TEXT "Disable direct rendering / zero-copy upload"
 #define DISABLE_DR_LONGTEXT "Direct rendering is a technique where image data is uploaded via a mapped buffer instead of via memcpy. On some platforms this might be very slow (due to poor readback performance from mapped memory), in which cases this flag would help."
 
-vlc_module_begin () set_shortname ("Vulkan")
+vlc_module_begin ()
+    set_shortname ("Vulkan")
     set_description (N_("Vulkan video output"))
     set_category (CAT_VIDEO)
     set_subcategory (SUBCAT_VIDEO_VOUT)
-    set_capability ("vout display", 0)
-    set_callbacks (Open, Close)
+    set_callbacks_display (Open, Close, 0)
     add_shortcut ("vulkan", "vk")
     add_module ("vk", "vulkan", NULL, VK_TEXT, PROVIDER_LONGTEXT)
 
diff --git a/modules/video_output/wayland/shm.c b/modules/video_output/wayland/shm.c
index 699c8dc50c..6cea58d300 100644
--- a/modules/video_output/wayland/shm.c
+++ b/modules/video_output/wayland/shm.c
@@ -399,7 +399,6 @@ vlc_module_begin()
     set_description(N_("Wayland shared memory video output"))
     set_category(CAT_VIDEO)
     set_subcategory(SUBCAT_VIDEO_VOUT)
-    set_capability("vout display", 170)
-    set_callbacks(Open, Close)
+    set_callbacks_display(Open, Close, 170)
     add_shortcut("wl")
 vlc_module_end()
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index f23cd04810..7b5f19d2de 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -84,9 +84,8 @@ vlc_module_begin ()
     add_integer("winrt-swapchain",     0x0, NULL, NULL, true) /* IDXGISwapChain1*     */
 #endif
 
-    set_capability("vout display", 300)
     add_shortcut("direct3d11")
-    set_callbacks(Open, Close)
+    set_callbacks_display(Open, Close,300)
 vlc_module_end ()
 
 struct vout_display_sys_t
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index 5372ffd465..215b727846 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -110,9 +110,8 @@ vlc_module_begin ()
     add_loadfile("direct3d9-shader-file", NULL,
                  PIXEL_SHADER_FILE_TEXT, PIXEL_SHADER_FILE_LONGTEXT)
 
-    set_capability("vout display", 280)
     add_shortcut("direct3d9", "direct3d")
-    set_callbacks(Open, Close)
+    set_callbacks_display(Open, Close, 280)
 
 #ifdef HAVE_GL
     add_submodule()
diff --git a/modules/video_output/win32/glwin32.c b/modules/video_output/win32/glwin32.c
index a10a740709..4b03e0ea25 100644
--- a/modules/video_output/win32/glwin32.c
+++ b/modules/video_output/win32/glwin32.c
@@ -49,9 +49,8 @@ vlc_module_begin()
     set_subcategory(SUBCAT_VIDEO_VOUT)
     set_shortname("OpenGL")
     set_description(N_("OpenGL video output for Windows"))
-    set_capability("vout display", 275)
     add_shortcut("glwin32", "opengl")
-    set_callbacks(Open, Close)
+    set_callbacks_display(Open, Close, 275)
     add_glopts()
 vlc_module_end()
 
diff --git a/modules/video_output/win32/wingdi.c b/modules/video_output/win32/wingdi.c
index 25308b92a7..be0556b245 100644
--- a/modules/video_output/win32/wingdi.c
+++ b/modules/video_output/win32/wingdi.c
@@ -51,8 +51,7 @@ vlc_module_begin ()
     set_subcategory(SUBCAT_VIDEO_VOUT)
     set_shortname("GDI")
     set_description(N_("Windows GDI video output"))
-    set_capability("vout display", 110)
-    set_callbacks(Open, Close)
+    set_callbacks_display(Open, Close, 110)
 vlc_module_end ()
 
 
diff --git a/modules/video_output/xcb/render.c b/modules/video_output/xcb/render.c
index 93825a32d4..524eb1d4a1 100644
--- a/modules/video_output/xcb/render.c
+++ b/modules/video_output/xcb/render.c
@@ -516,7 +516,7 @@ FindPictScreen(const xcb_setup_t *setup, const xcb_screen_t *scr,
 
 /* Find an X11 visual for a RENDER picture format */
 static xcb_visualid_t
-FindVisual(const xcb_setup_t *setup, const xcb_screen_t *scr, 
+FindVisual(const xcb_setup_t *setup, const xcb_screen_t *scr,
            const xcb_render_query_pict_formats_reply_t *r,
            xcb_render_pictformat_t fmt_id)
 {
@@ -713,8 +713,7 @@ vlc_module_begin()
     set_description(N_("X11 RENDER video output (XCB)"))
     set_category(CAT_VIDEO)
     set_subcategory(SUBCAT_VIDEO_VOUT)
-    set_capability("vout display", 200)
-    set_callbacks(Open, Close)
+    set_callbacks_display(Open, Close, 200)
     add_shortcut("x11-render", "xcb-render", "render")
     add_string("x11-render-filter", "good", N_("Scaling mode"),
                N_("Scaling mode"), true)
diff --git a/modules/video_output/xcb/x11.c b/modules/video_output/xcb/x11.c
index 379a83abc7..dd1e9f7a66 100644
--- a/modules/video_output/xcb/x11.c
+++ b/modules/video_output/xcb/x11.c
@@ -354,8 +354,7 @@ vlc_module_begin()
     set_description(N_("X11 video output (XCB)"))
     set_category(CAT_VIDEO)
     set_subcategory(SUBCAT_VIDEO_VOUT)
-    set_capability("vout display", 100)
-    set_callbacks(Open, Close)
+    set_callbacks_display(Open, Close, 100)
     add_shortcut("xcb-x11", "x11")
 
     add_obsolete_bool("x11-shm") /* obsoleted since 2.0.0 */
diff --git a/modules/video_output/yuv.c b/modules/video_output/yuv.c
index 790729ca96..7f4c4333a3 100644
--- a/modules/video_output/yuv.c
+++ b/modules/video_output/yuv.c
@@ -58,7 +58,6 @@ vlc_module_begin()
     set_description(N_("YUV video output"))
     set_category(CAT_VIDEO)
     set_subcategory(SUBCAT_VIDEO_VOUT)
-    set_capability("vout display", 0)
 
     add_string(CFG_PREFIX "file", "stream.yuv",
                 YUV_FILE_TEXT, YUV_FILE_LONGTEXT, false)
@@ -67,7 +66,7 @@ vlc_module_begin()
     add_bool  (CFG_PREFIX "yuv4mpeg2", false,
                 YUV4MPEG2_TEXT, YUV4MPEG2_LONGTEXT, true)
 
-    set_callbacks(Open, Close)
+    set_callbacks_display(Open, Close, 0)
 vlc_module_end()
 
 /*****************************************************************************
@@ -212,7 +211,7 @@ static void Display(vout_display_t *vd, picture_t *picture)
              * the exact fourcc used. */
             header = "YUV4MPEG2";
         } else {
-            snprintf(buffer, sizeof(buffer), "%4.4s", 
+            snprintf(buffer, sizeof(buffer), "%4.4s",
                      (const char*)&fmt.i_chroma);
             header = buffer;
         }



More information about the vlc-commits mailing list