[vlc-devel] [PATCH 3/3] display: set the capability at the same time as the (de)activate callbacks
Steve Lhomme
robux4 at ycbcr.xyz
Tue Jul 9 15:01:04 CEST 2019
We could have one without the other, I don't have a strong opinion.
Although in general, the less code we have to write, the less bugs and
the more readable it is.
If we go down this road we could also add
set_subcategory(SUBCAT_VIDEO_VOUT).
On 2019-07-09 14:35, Thomas Guillem wrote:
> Maybe merge 2 and 3
>
> On Tue, Jul 9, 2019, at 14:11, Steve Lhomme wrote:
>> ---
>> include/vlc_vout_display.h | 3 ++-
>> 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 | 3 +--
>> 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 | 3 +--
>> modules/video_output/xcb/x11.c | 3 +--
>> modules/video_output/yuv.c | 3 +--
>> 26 files changed, 30 insertions(+), 57 deletions(-)
>>
>> diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
>> index a02bf676c98..d3ed0ffad2f 100644
>> --- a/include/vlc_vout_display.h
>> +++ b/include/vlc_vout_display.h
>> @@ -208,7 +208,8 @@ typedef int (*vout_display_open_cb)(vout_display_t *vd,
>> video_format_t *fmtp,
>> vlc_video_context *context);
>>
>> -#define set_callbacks_display(Activate, Deactivate) \
>> +#define set_callbacks_display(Activate, Deactivate, priority) \
>> + set_capability("vout display", priority) \
>> { \
>> vout_display_open_cb open__ = Activate; \
>> set_callbacks( open__, Deactivate ) \
>> diff --git a/modules/hw/mmal/vout.c b/modules/hw/mmal/vout.c
>> index 3c5ceeb6816..03aa6719cf9 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_display(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 c1891ae713d..acd7a856c12 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_display(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 63cbfc28493..1b28bea50d7 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_display(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_display(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 6d79c658142..98e5e61b7ab 100644
>> --- a/modules/video_output/caca.c
>> +++ b/modules/video_output/caca.c
>> @@ -530,6 +530,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_display(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 8aac36ada9a..00d2477f845 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_display(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 f28e3c772fe..177720cccc0 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_display (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 41cdcc9821f..d5859451926 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_display(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 20941e745ba..b316b5b0650 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_display( 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 ce0b46681c5..cd7a49cebf8 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_display(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 0d27d0d574a..4304235c925 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_display(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 b59b8e2efcf..13161cc5e99 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_display( 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 d69efbf1d00..49596aa0d26 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_display (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 d99a1b6e6d7..afec7b5c422 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_display (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_display (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 89c54508201..677ce4d2596 100644
>> --- a/modules/video_output/splitter.c
>> +++ b/modules/video_output/splitter.c
>> @@ -335,8 +335,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_display(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 1d6c1cfe395..7fb35c25737 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_callbacks_display( OpenDummy, NULL )
>> + set_callbacks_display( OpenDummy, NULL, 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_callbacks_display( OpenStats, NULL )
>> + set_callbacks_display( OpenStats, NULL, 0 )
>> vlc_module_end ()
>>
>>
>> diff --git a/modules/video_output/vmem.c b/modules/video_output/vmem.c
>> index 4506703ecfc..f8e0fbee1a9 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_display(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 1af573b1f1d..c085e07f5d9 100644
>> --- a/modules/video_output/vulkan/display.c
>> +++ b/modules/video_output/vulkan/display.c
>> @@ -391,8 +391,7 @@ vlc_module_begin ()
>> set_description (N_("Vulkan video output"))
>> set_category (CAT_VIDEO)
>> set_subcategory (SUBCAT_VIDEO_VOUT)
>> - set_capability ("vout display", 0)
>> - set_callbacks_display (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 5ced9b206d2..6cea58d300a 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_display(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 16752161045..7b5f19d2dee 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_display(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 b30a22dee20..0b5599ee569 100644
>> --- a/modules/video_output/win32/direct3d9.c
>> +++ b/modules/video_output/win32/direct3d9.c
>> @@ -113,9 +113,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_display(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 fce46d879cf..4b03e0ea25c 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_display(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 d5fbb565ef2..be0556b2456 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_display(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 5a79bc37810..524eb1d4a18 100644
>> --- a/modules/video_output/xcb/render.c
>> +++ b/modules/video_output/xcb/render.c
>> @@ -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_display(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 4d4109bbd5d..dd1e9f7a66a 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_display(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 ba590227406..7f4c4333a3c 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_display(Open, Close)
>> + set_callbacks_display(Open, Close, 0)
>> vlc_module_end()
>>
>> /*****************************************************************************
>> --
>> 2.17.1
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
More information about the vlc-devel
mailing list