[vlc-commits] [Git][videolan/vlc][master] 17 commits: Remove --access_output

Rémi Denis-Courmont (@Courmisch) gitlab at videolan.org
Sat Jan 15 20:59:20 UTC 2022



Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC


Commits:
f00a14d3 by Rémi Denis-Courmont at 2022-01-15T20:40:24+00:00
Remove --access_output

That option was added in 0.5.0 but does not seem to have ever had any
effects. In practice, the access output is selected with the
--sout-standard-access or --sout-es-access options.

- - - - -
4aa60ffa by Rémi Denis-Courmont at 2022-01-15T20:40:24+00:00
Remove --mux

That option was added in 0.5.0 but does not seem to have ever had any
effects. In practice, the access output is selected with the
--sout-standard-mux or --sout-es-mux options.

- - - - -
e09aab00 by Rémi Denis-Courmont at 2022-01-15T20:40:24+00:00
Remove --access

This has had no effects for some time. Unlike other module names, the
access name is always taken from the MRL/URL.

- - - - -
e204a0c7 by Rémi Denis-Courmont at 2022-01-15T20:40:24+00:00
input: remove write-only "access" variable

- - - - -
6eb94dde by Rémi Denis-Courmont at 2022-01-15T20:40:24+00:00
aout: --aout defaults as "any"

This picks a default value that actually belongs in the choice list.
This also potentially allows to distinguish between default and error.

- - - - -
7eb1959a by Rémi Denis-Courmont at 2022-01-15T20:40:24+00:00
aout: --audio-resampler defaults as "any"

This picks a default value that actually belongs in the choice list.
This also potentially allows to distinguish between default and error.

- - - - -
eea9f1f4 by Rémi Denis-Courmont at 2022-01-15T20:40:24+00:00
vout: --vout defaults as "any"

This picks a default value that actually belongs in the choice list.
This also distinguishes between default and error.

- - - - -
e6fcacbd by Rémi Denis-Courmont at 2022-01-15T20:40:24+00:00
spu: --text-renderer defaults as "any"

This picks a default value that actually belongs in the choice list.
This also potentially allows to distinguish between default and error.

- - - - -
303df23b by Rémi Denis-Courmont at 2022-01-15T20:40:24+00:00
splitter: have default --video-splitter to "none"

The choice list always offers "any" and "none", and in this case, the
default is to not have a video splitter. This change fixes a bug whereby
the GUI would save the value "none", which the core would then treat as
a module name. No module by that name exists, so this would ultimately
cause the video output to fail entirely.

Also this treats NULL as an actual memory allocation error, instead of
the default value which was previously undistiguishable.

- - - - -
fede6a7e by Rémi Denis-Courmont at 2022-01-15T20:40:24+00:00
placebo: --pl-gpu defaults as "any"

This picks a default value that actually belongs in the choice list.
This also potentially allows to distinguish between default and error.

- - - - -
b17e3867 by Rémi Denis-Courmont at 2022-01-15T20:40:24+00:00
placebo: --pl-gl defaults as "any"

This picks a default value that actually belongs in the choice list.
This also potentially allows to distinguish between default and error.

- - - - -
1c6090da by Rémi Denis-Courmont at 2022-01-15T20:40:24+00:00
vulkan: --vk-platform defaults as "any"

This picks a default value that actually belongs in the choice list.
This also potentially allows to distinguish between default and error.

- - - - -
7551a7a1 by Rémi Denis-Courmont at 2022-01-15T20:40:24+00:00
vk: respect user platform choice

Consistent with GL (vlc_gl_Create()) and with the function
documentation, this sets the strict flag when looking for a VK platform
plugin. Note that this change has no effects with the default setting.

- - - - -
7f86c2f8 by Rémi Denis-Courmont at 2022-01-15T20:40:24+00:00
opengl: --gl defaults as "any"

This picks a default value that actually belongs in the choice list.
This also potentially allows to distinguish between default and error.

- - - - -
770b892b by Rémi Denis-Courmont at 2022-01-15T20:40:24+00:00
opengl: --glinterop defaults as "any"

This picks a default value that actually belongs in the choice list.
This also potentially allows to distinguish between default and error.

- - - - -
c3ba3a32 by Rémi Denis-Courmont at 2022-01-15T20:40:24+00:00
transcode: --sout-transcode-?enc default to "none"

This picks a default value that actually belongs in the choice list. In
this particular cases, the default is not to transcode ES in the given
category. Note that this does **not** interfere with the
--sout-transcode-?codec options which are handled separately.

This also enables to distinguish between default and error, though this
change does not actually implement this.

- - - - -
2480a515 by Rémi Denis-Courmont at 2022-01-15T20:40:24+00:00
modules: handle error in module_need_var()

This ensures that all variables used have a sane non-empty default (only
"codec" was left). Then we can assume that NULL is an error rather than
an empty variable.

- - - - -


14 changed files:

- include/vlc_modules.h
- modules/gui/macosx/windows/video/VLCVideoOutputProvider.m
- modules/stream_out/transcode/transcode.c
- modules/video_output/libplacebo/display.c
- modules/video_output/libplacebo/instance_opengl.c
- modules/video_output/libplacebo/instance_vulkan.c
- modules/video_output/opengl/display.c
- modules/video_output/opengl/vout_helper.h
- modules/video_output/splitter.c
- modules/video_output/vulkan/platform.c
- src/input/var.c
- src/libvlc-module.c
- src/video_output/video_output.c
- src/video_output/vout_wrapper.c


Changes:

=====================================
include/vlc_modules.h
=====================================
@@ -114,6 +114,9 @@ static inline module_t *module_need_var(vlc_object_t *obj, const char *cap,
                                         const char *varname)
 {
     char *list = var_InheritString(obj, varname);
+    if (unlikely(list == NULL))
+        return NULL;
+
     module_t *m = module_need(obj, cap, list, false);
 
     free(list);


=====================================
modules/gui/macosx/windows/video/VLCVideoOutputProvider.m
=====================================
@@ -361,7 +361,7 @@ int WindowOpen(vout_window_t *p_wnd)
 
     /* detect the video-splitter and prevent starts in fullscreen if it is enabled */
     char *psz_splitter = var_GetString(voutView.voutThread, "video-splitter");
-    BOOL b_have_splitter = psz_splitter != NULL && *psz_splitter != '\0';
+    BOOL b_have_splitter = psz_splitter != NULL && strcmp(psz_splitter, "none");
     free(psz_splitter);
 
     if (!videoWallpaper && !b_have_splitter && (var_InheritBool(getIntf(), "fullscreen") || _playerController.fullscreen)) {


=====================================
modules/stream_out/transcode/transcode.c
=====================================
@@ -151,7 +151,7 @@ vlc_module_begin ()
     set_callbacks( Open, Close )
     set_subcategory( SUBCAT_SOUT_STREAM )
     set_section( N_("Video"), NULL )
-    add_module(SOUT_CFG_PREFIX "venc", "video encoder", NULL,
+    add_module(SOUT_CFG_PREFIX "venc", "video encoder", "none",
                VENC_TEXT, VENC_LONGTEXT)
     add_string( SOUT_CFG_PREFIX "vcodec", NULL, VCODEC_TEXT,
                 VCODEC_LONGTEXT )
@@ -178,7 +178,7 @@ vlc_module_begin ()
                     VFILTER_TEXT, VFILTER_LONGTEXT)
 
     set_section( N_("Audio"), NULL )
-    add_module(SOUT_CFG_PREFIX "aenc", "audio encoder", NULL,
+    add_module(SOUT_CFG_PREFIX "aenc", "audio encoder", "none",
                AENC_TEXT, AENC_LONGTEXT)
     add_string( SOUT_CFG_PREFIX "acodec", NULL, ACODEC_TEXT,
                 ACODEC_LONGTEXT )
@@ -196,7 +196,7 @@ vlc_module_begin ()
                     AFILTER_TEXT, AFILTER_LONGTEXT)
 
     set_section( N_("Overlays/Subtitles"), NULL )
-    add_module(SOUT_CFG_PREFIX "senc", "spu encoder", NULL,
+    add_module(SOUT_CFG_PREFIX "senc", "spu encoder", "none",
                SENC_TEXT, SENC_LONGTEXT)
     add_string( SOUT_CFG_PREFIX "scodec", NULL, SCODEC_TEXT,
                 SCODEC_LONGTEXT )
@@ -233,7 +233,7 @@ static int   Send( sout_stream_t *, void *, block_t * );
 static void SetAudioEncoderConfig( sout_stream_t *p_stream, transcode_encoder_config_t *p_cfg )
 {
     char *psz_string = var_GetString( p_stream, SOUT_CFG_PREFIX "aenc" );
-    if( psz_string && *psz_string )
+    if( psz_string && strcmp( psz_string, "none" ) )
     {
         char *psz_next = config_ChainCreate( &p_cfg->psz_name,
                                             &p_cfg->p_config_chain,
@@ -283,7 +283,7 @@ static void SetAudioEncoderConfig( sout_stream_t *p_stream, transcode_encoder_co
 static void SetVideoEncoderConfig( sout_stream_t *p_stream, transcode_encoder_config_t *p_cfg )
 {
     char *psz_string = var_GetString( p_stream, SOUT_CFG_PREFIX "venc" );
-    if( psz_string && *psz_string )
+    if( psz_string && strcmp( psz_string, "none" ) )
     {
         char *psz_next;
         psz_next = config_ChainCreate( &p_cfg->psz_name,
@@ -333,7 +333,7 @@ static void SetVideoEncoderConfig( sout_stream_t *p_stream, transcode_encoder_co
 static void SetSPUEncoderConfig( sout_stream_t *p_stream, transcode_encoder_config_t *p_cfg )
 {
     char *psz_string = var_GetString( p_stream, SOUT_CFG_PREFIX "senc" );
-    if( psz_string && *psz_string )
+    if( psz_string && strcmp( psz_string, "none" ) )
     {
         char *psz_next;
         psz_next = config_ChainCreate( &p_cfg->psz_name, &p_cfg->p_config_chain,


=====================================
modules/video_output/libplacebo/display.c
=====================================
@@ -607,7 +607,7 @@ vlc_module_begin ()
     set_subcategory (SUBCAT_VIDEO_VOUT)
     set_callback_display(Open, 0)
     add_shortcut ("libplacebo", "pl")
-    add_module ("pl-gpu", "libplacebo gpu", NULL, PROVIDER_TEXT, PROVIDER_LONGTEXT)
+    add_module ("pl-gpu", "libplacebo gpu", "any", PROVIDER_TEXT, PROVIDER_LONGTEXT)
 
     set_section("Custom shaders", NULL)
     add_loadfile("pl-user-shader", NULL, USER_SHADER_FILE_TEXT, USER_SHADER_FILE_LONGTEXT)


=====================================
modules/video_output/libplacebo/instance_opengl.c
=====================================
@@ -59,14 +59,14 @@ vlc_module_begin()
     set_shortname("libplacebo OpenGL ES2")
     set_description(N_("OpenGL ES2 based GPU instance"))
     add_shortcut("pl_opengles2", "pl_gles2")
-    add_module(MODULE_VARNAME, "opengl es2", NULL, GLES2_TEXT, PROVIDER_LONGTEXT);
+    add_module(MODULE_VARNAME, "opengl es2", "any", GLES2_TEXT, PROVIDER_LONGTEXT);
 #else // !USE_OPENGL_ES2
 # define API VLC_OPENGL
 # define MODULE_VARNAME "pl-gl"
     set_shortname("libplacebo OpenGL")
     set_description(N_("OpenGL based GPU instance"))
     add_shortcut("pl_opengl", "pl_gl")
-    add_module(MODULE_VARNAME, "opengl", NULL, GL_TEXT, PROVIDER_LONGTEXT);
+    add_module(MODULE_VARNAME, "opengl", "any", GL_TEXT, PROVIDER_LONGTEXT);
 #endif
 
     set_section("Context settings", NULL)


=====================================
modules/video_output/libplacebo/instance_vulkan.c
=====================================
@@ -173,7 +173,7 @@ vlc_module_begin()
     set_capability("libplacebo gpu", 50)
     set_callback(InitInstance)
     add_shortcut("pl_vulkan")
-    add_module ("vk-platform", "vulkan platform", NULL, PROVIDER_TEXT, PROVIDER_LONGTEXT)
+    add_module ("vk-platform", "vulkan platform", "any", PROVIDER_TEXT, PROVIDER_LONGTEXT)
 
     set_section("Device selection", NULL)
     add_bool("vk-debug", false, DEBUG_TEXT, DEBUG_LONGTEXT)


=====================================
modules/video_output/opengl/display.c
=====================================
@@ -54,7 +54,7 @@ vlc_module_begin ()
     set_description (N_("OpenGL for Embedded Systems 2 video output"))
     set_callback_display(Open, 265)
     add_shortcut ("opengles2", "gles2")
-    add_module("gles2", "opengl es2", NULL, GLES2_TEXT, PROVIDER_LONGTEXT)
+    add_module("gles2", "opengl es2", "any", GLES2_TEXT, PROVIDER_LONGTEXT)
 
 #else
 
@@ -64,7 +64,7 @@ vlc_module_begin ()
     set_description (N_("OpenGL video output"))
     set_callback_display(Open, 270)
     add_shortcut ("opengl", "gl")
-    add_module("gl", "opengl", NULL, GL_TEXT, PROVIDER_LONGTEXT)
+    add_module("gl", "opengl", "any", GL_TEXT, PROVIDER_LONGTEXT)
 #endif
     add_glopts ()
 


=====================================
modules/video_output/opengl/vout_helper.h
=====================================
@@ -81,7 +81,7 @@
     "Force a \"glinterop\" module.")
 
 #define add_glopts() \
-    add_module("glinterop", "glinterop", NULL, GLINTEROP_TEXT, GLINTEROP_LONGTEXT) \
+    add_module("glinterop", "glinterop", "any", GLINTEROP_TEXT, GLINTEROP_LONGTEXT) \
     add_glscale_opts() \
     add_glopts_placebo ()
 


=====================================
modules/video_output/splitter.c
=====================================
@@ -329,6 +329,6 @@ vlc_module_begin()
     set_description(N_("Video splitter display plugin"))
     set_subcategory(SUBCAT_VIDEO_VOUT)
     set_callback_display(vlc_vidsplit_Open, 0)
-    add_module("video-splitter", "video splitter", NULL,
+    add_module("video-splitter", "video splitter", "none",
                N_("Video splitter module"), NULL)
 vlc_module_end()


=====================================
modules/video_output/vulkan/platform.c
=====================================
@@ -45,7 +45,7 @@ static int vlc_vk_start(void *func, bool forced, va_list ap)
  * Initializes a Vulkan platform module for a given window
  *
  * @param wnd window to use as Vulkan surface
- * @param name module name (or NULL for auto)
+ * @param name module name (or "any")
  * @return a new platform object, or NULL on failure
  */
 vlc_vk_platform_t *vlc_vk_platform_Create(struct vout_window_t *wnd, const char *name)
@@ -61,7 +61,7 @@ vlc_vk_platform_t *vlc_vk_platform_Create(struct vout_window_t *wnd, const char
     vk->ops = NULL;
     vk->window = wnd;
 
-    vk->module = vlc_module_load(wnd, "vulkan platform", name, false,
+    vk->module = vlc_module_load(wnd, "vulkan platform", name, true,
                                  vlc_vk_start, vk);
 
     if (vk->module == NULL)


=====================================
src/input/var.c
=====================================
@@ -106,7 +106,6 @@ void input_ConfigVarInit ( input_thread_t *p_input )
     var_Create( p_input, "input-record-native", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
 
     /* */
-    var_Create( p_input, "access", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
     var_Create( p_input, "demux", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
     var_Create( p_input, "demux-filter", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
     var_Create( p_input, "stream-filter", VLC_VAR_STRING | VLC_VAR_DOINHERIT );


=====================================
src/libvlc-module.c
=====================================
@@ -1044,14 +1044,6 @@ static const char* const ppsz_restore_playback_desc[] = {
     "This allows you to select the order in which VLC will choose its " \
     "packetizers."  )
 
-#define MUX_TEXT N_("Mux module")
-#define MUX_LONGTEXT N_( \
-    "This is a legacy entry to let you configure mux modules")
-
-#define ACCESS_OUTPUT_TEXT N_("Access output module")
-#define ACCESS_OUTPUT_LONGTEXT N_( \
-    "This is a legacy entry to let you configure access output modules")
-
 #define ANN_SAPINTV_TEXT N_("SAP announcement interval")
 #define ANN_SAPINTV_LONGTEXT N_( \
     "When the SAP flow control is disabled, " \
@@ -1601,7 +1593,7 @@ vlc_module_begin ()
               AUDIO_TIME_STRETCH_TEXT, AUDIO_TIME_STRETCH_LONGTEXT )
 
     set_subcategory( SUBCAT_AUDIO_AOUT )
-    add_module("aout", "audio output", NULL, AOUT_TEXT, AOUT_LONGTEXT)
+    add_module("aout", "audio output", "any", AOUT_TEXT, AOUT_LONGTEXT)
         change_short('A')
     add_string( "role", "video", ROLE_TEXT, ROLE_LONGTEXT )
         change_string_list( ppsz_roles, ppsz_roles_text )
@@ -1616,7 +1608,7 @@ vlc_module_begin ()
                AUDIO_VISUAL_TEXT, AUDIO_VISUAL_LONGTEXT)
 
     set_subcategory( SUBCAT_AUDIO_RESAMPLER )
-    add_module("audio-resampler", "audio resampler", NULL,
+    add_module("audio-resampler", "audio resampler", "any",
                AUDIO_RESAMPLER_TEXT, AUDIO_RESAMPLER_LONGTEXT)
 
 /* Video options */
@@ -1727,7 +1719,7 @@ vlc_module_begin ()
         change_safe()
 
     set_subcategory( SUBCAT_VIDEO_VOUT )
-    add_module("vout", "vout display", NULL, VOUT_TEXT, VOUT_LONGTEXT)
+    add_module("vout", "vout display", "any", VOUT_TEXT, VOUT_LONGTEXT)
         change_short('V')
 
     set_subcategory( SUBCAT_VIDEO_VFILTER )
@@ -1746,7 +1738,7 @@ vlc_module_begin ()
     add_bool( "spu", true, SPU_TEXT, SPU_LONGTEXT )
         change_safe ()
     add_bool( "osd", true, OSD_TEXT, OSD_LONGTEXT )
-    add_module("text-renderer", "text renderer", NULL,
+    add_module("text-renderer", "text renderer", "any",
                TEXTRENDERER_TEXT, TEXTRENDERER_LONGTEXT)
 
     set_section( N_("Subtitles") , NULL )
@@ -1987,9 +1979,9 @@ vlc_module_begin ()
 
 /* Decoder options */
     add_category_hint(N_("Input access and codecs"), CODEC_CAT_LONGTEXT)
-    set_subcategory( SUBCAT_INPUT_ACCESS )
 
-    add_module("access", "access", NULL, ACCESS_TEXT, ACCESS_LONGTEXT)
+    //set_subcategory( SUBCAT_INPUT_ACCESS )
+    add_obsolete_string("access") /* since 4.0.0 */
 
     set_subcategory( SUBCAT_INPUT_DEMUX )
 
@@ -1999,7 +1991,7 @@ vlc_module_begin ()
     //set_subcategory( SUBCAT_INPUT_ACODEC )
     set_subcategory( SUBCAT_INPUT_VCODEC )
 
-    add_string( "codec", NULL, CODEC_TEXT, CODEC_LONGTEXT )
+    add_string( "codec", "any", CODEC_TEXT, CODEC_LONGTEXT )
     add_bool( "hw-dec", true, HW_DEC_TEXT, HW_DEC_LONGTEXT )
     add_obsolete_string( "encoder" ) /* since 4.0.0 */
     add_module("dec-dev", "decoder device", "any", DEC_DEV_TEXT, DEC_DEV_LONGTEXT)
@@ -2038,11 +2030,9 @@ vlc_module_begin ()
     add_integer( "sap-interval", 5, ANN_SAPINTV_TEXT,
                                ANN_SAPINTV_LONGTEXT )
 
-    set_subcategory( SUBCAT_SOUT_MUX )
-    add_module("mux", "sout mux", NULL, MUX_TEXT, MUX_LONGTEXT)
+    add_obsolete_string("mux") /* since 0.5.0 (warning since 4.0) */
     set_subcategory( SUBCAT_SOUT_ACO )
-    add_module("access_output", "sout access", NULL,
-               ACCESS_OUTPUT_TEXT, ACCESS_OUTPUT_LONGTEXT)
+    add_obsolete_string("access_output") /* since 0.5.0 (warning since 4.0) */
     add_integer( "ttl", -1, TTL_TEXT, TTL_LONGTEXT )
     add_string( "miface", NULL, MIFACE_TEXT, MIFACE_LONGTEXT )
     add_integer( "dscp", 0, DSCP_TEXT, DSCP_LONGTEXT )


=====================================
src/video_output/video_output.c
=====================================
@@ -1925,11 +1925,21 @@ vout_thread_t *vout_Create(vlc_object_t *object)
     vout_IntfInit(vout);
 
     /* Get splitter name if present */
-    sys->splitter_name = config_GetType("video-splitter") ?
-        var_InheritString(vout, "video-splitter") : NULL;
-    if (sys->splitter_name != NULL) {
-        var_Create(vout, "window", VLC_VAR_STRING);
-        var_SetString(vout, "window", "wdummy");
+    sys->splitter_name = NULL;
+
+    if (config_GetType("video-splitter")) {
+        char *splitter_name = var_InheritString(vout, "video-splitter");
+        if (unlikely(splitter_name == NULL)) {
+            vlc_object_delete(vout);
+            return NULL;
+        }
+
+        if (strcmp(splitter_name, "none") != 0) {
+            var_Create(vout, "window", VLC_VAR_STRING);
+            var_SetString(vout, "window", "wdummy");
+            sys->splitter_name = splitter_name;
+        } else
+            free(splitter_name);
     }
 
     video_format_Init(&sys->original, 0);


=====================================
src/video_output/vout_wrapper.c
=====================================
@@ -68,9 +68,11 @@ vout_display_t *vout_OpenWrapper(vout_thread_t *vout, vout_thread_private_t *sys
 
     msg_Dbg(vout, "Opening vout display wrapper");
 
-    if (splitter_name == NULL)
+    if (splitter_name == NULL) {
         modlist = modlistbuf = var_InheritString(vout, "vout");
-    else
+        if (unlikely(modlist == NULL))
+            return NULL;
+    } else
         modlist = "splitter,none";
 
     vd = vout_display_New(VLC_OBJECT(vout), fmt, vctx, cfg, modlist, &owner);



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/67ef35731739255b93a350a5b09aa06ef333263a...2480a5159fd80916084777b78bbab59f6c6e789b

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/67ef35731739255b93a350a5b09aa06ef333263a...2480a5159fd80916084777b78bbab59f6c6e789b
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list