]> git.sesse.net Git - vlc/blobdiff - src/libvlc-module.c
src/Makefile.am: Make sure we link test_i18n_atof with libvlc, especially if vlc_icon...
[vlc] / src / libvlc-module.c
index c1611f1bc982a68654eb57f88682c178a5b7904f..a372d4a2100b0bddafe74b880aac6115b641e828 100644 (file)
 #define __BUILTIN__
 
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <vlc/vlc.h>
 #include "libvlc.h"
 
 
 #if defined (WIN32) || defined (__APPLE__)
 static const char *ppsz_language[] =
-{ "auto", "en", "ar", "pt_BR", "en_GB", "ca", "zh_TW", "cs", "da", "nl", "fr",
-  "gl", "ka", "de", "he", "hu", "it", "ja", "ko", "ms", "oc", "fa", "pl", "ro",
-  "ru", "zh_CN", "sk", "sl", "es", "sv", "tr" };
+{
+    "auto",
+    "en",
+    "ar",
+    "pt_BR",
+    "en_GB",
+    "ca",
+    "zh_TW",
+    "cs",
+    "da",
+    "nl",
+    "fi",
+    "fr",
+    "gl",
+    "ka",
+    "de",
+    "he",
+    "hu",
+    "it",
+    "ja",
+    "ko",
+    "ms",
+    "oc",
+    "fa",
+    "pl",
+    "ro",
+    "ru",
+    "zh_CN",
+    "sk",
+    "sl",
+    "es",
+    "sv",
+    "tr"
+};
 
 static const char *ppsz_language_text[] =
-{ N_("Auto"), N_("American English"), N_("Arabic"), N_("Brazilian Portuguese"),
-  N_("British English"), N_("Catalan"), N_("Chinese Traditional"), N_("Czech"),
-  N_("Danish"), N_("Dutch"), N_("French"), N_("Galician"), N_("Georgian"),
-  N_("German"), N_("Hebrew"), N_("Hungarian"), N_("Italian"), N_("Japanese"),
-  N_("Korean"), N_("Malay"), N_("Occitan"), N_("Persian"), N_("Polish"),
-  N_("Romanian"), N_("Russian"), N_("Simplified Chinese"), N_("Slovak"),
-  N_("Slovenian"), N_("Spanish"), N_("Swedish"), N_("Turkish") };
+{
+    N_("Auto"),
+    N_("American English"),
+    N_("Arabic"),
+    N_("Brazilian Portuguese"),
+    N_("British English"),
+    N_("Catalan"),
+    N_("Chinese Traditional"),
+    N_("Czech"),
+    N_("Danish"),
+    N_("Dutch"),
+    N_("Finnish"),
+    N_("French"),
+    N_("Galician"),
+    N_("Georgian"),
+    N_("German"),
+    N_("Hebrew"),
+    N_("Hungarian"),
+    N_("Italian"),
+    N_("Japanese"),
+    N_("Korean"),
+    N_("Malay"),
+    N_("Occitan"),
+    N_("Persian"),
+    N_("Polish"),
+    N_("Romanian"),
+    N_("Russian"),
+    N_("Simplified Chinese"),
+    N_("Slovak"),
+    N_("Slovenian"),
+    N_("Spanish"),
+    N_("Swedish"),
+    N_("Turkish")
+};
 #endif
 
 static const char *ppsz_snap_formats[] =
@@ -345,6 +407,10 @@ static const char *ppsz_pos_descriptions[] =
 #define SS_TEXT N_("Disable screensaver")
 #define SS_LONGTEXT N_("Disable the screensaver during video playback." )
 
+#define INHIBIT_TEXT N_("Inhibits the power management daemon during playback.")
+#define INHIBIT_LONGTEXT N_("Inhibits the power management daemon during any " \
+    "playback, to avoid the computer being suspended because of inactivity.")
+
 #define VIDEO_DECO_TEXT N_("Window decorations")
 #define VIDEO_DECO_LONGTEXT N_( \
     "VLC can avoid creating window caption, frames, etc... around the video" \
@@ -382,6 +448,16 @@ static const char *ppsz_pos_descriptions[] =
 #define SNAP_SEQUENTIAL_LONGTEXT N_( \
     "Use sequential numbers instead of timestamps for snapshot numbering")
 
+#define SNAP_WIDTH_TEXT N_("Video snapshot width")
+#define SNAP_WIDTH_LONGTEXT N_( \
+    "You can enforce the width of the video snapshot. By default " \
+    "it will be 320 pixels." )
+
+#define SNAP_HEIGHT_TEXT N_("Video snapshot height")
+#define SNAP_HEIGHT_LONGTEXT N_( \
+    "You can enforce the height of the video snapshot. By default " \
+    "it will be 200 pixels." )
+
 #define CROP_TEXT N_("Video cropping")
 #define CROP_LONGTEXT N_( \
     "This forces the cropping of the source video. " \
@@ -786,6 +862,11 @@ static const char *ppsz_clock_descriptions[] =
     "multiple playlist item (automatically insert the gather stream output " \
     "if not specified)" )
 
+#define SOUT_MUX_CACHING_TEXT N_("Stream output muxer caching (ms)")
+#define SOUT_MUX_CACHING_LONGTEXT N_( \
+    "This allow you to configure the initial caching amount for stream output " \
+    " muxer. This value should be set in milliseconds." )
+
 #define PACKETIZER_TEXT N_("Preferred packetizer list")
 #define PACKETIZER_LONGTEXT N_( \
     "This allows you to select the order in which VLC will choose its " \
@@ -900,6 +981,14 @@ static const char *ppsz_clock_descriptions[] =
 #define MINIMIZE_THREADS_LONGTEXT N_( \
      "This option minimizes the number of threads needed to run VLC.")
 
+#define SECURITY_POLICY_TEXT N_("Policy for handling unsafe options.")
+#define SECURITY_POLICY_LONGTEXT N_( \
+     "This option dictates the default policy when processing options " \
+     "which may be harmful when used in a malicious way.")
+
+static int pi_secpolicy_values[] = { 0, 1, 2 };
+static const char *ppsz_secpolicy_descriptions[] = { N_("Block"), N_("Allow"), N_("Prompt") };
+
 #define PLUGIN_PATH_TEXT N_("Modules search path")
 #define PLUGIN_PATH_LONGTEXT N_( \
     "Additional path for VLC to look for its modules.")
@@ -988,9 +1077,14 @@ static const char *ppsz_clock_descriptions[] =
     "Automatically preparse files added to the playlist " \
     "(to retrieve some metadata)." )
 
+#define FETCH_META_TEXT N_( "Authorise meta information fetching" )
+#define FETCH_META_LONGTEXT N_( \
+    "Specify if you want to attempt to fetch files'"\
+    "meta informations using the network." )
+
 #define ALBUM_ART_TEXT N_( "Album art policy" )
 #define ALBUM_ART_LONGTEXT N_( \
-    "Choose how album art will be downloaded." );
+    "Choose how album art will be downloaded." )
 
 static int pi_albumart_values[] = { ALBUM_ART_WHEN_ASKED,
                                     ALBUM_ART_WHEN_PLAYED,
@@ -1351,6 +1445,7 @@ vlc_module_begin();
     set_subcategory( SUBCAT_AUDIO_AOUT );
     add_module( "aout", "audio output", NULL, NULL, AOUT_TEXT, AOUT_LONGTEXT,
                 VLC_TRUE );
+        change_short('A');
     set_subcategory( SUBCAT_AUDIO_AFILTER );
     add_module_list_cat( "audio-filter", SUBCAT_AUDIO_AFILTER, 0,
                          NULL, AUDIO_FILTER_TEXT,
@@ -1398,6 +1493,7 @@ vlc_module_begin();
     set_section( N_("Snapshot") , NULL );
     add_directory( "snapshot-path", NULL, NULL, SNAP_PATH_TEXT,
                    SNAP_PATH_LONGTEXT, VLC_FALSE );
+        change_unsafe();
     add_string( "snapshot-prefix", "vlcsnap-", NULL, SNAP_PREFIX_TEXT,
                    SNAP_PREFIX_LONGTEXT, VLC_FALSE );
     add_string( "snapshot-format", "png", NULL, SNAP_FORMAT_TEXT,
@@ -1407,6 +1503,10 @@ vlc_module_begin();
               SNAP_PREVIEW_LONGTEXT, VLC_FALSE );
     add_bool( "snapshot-sequential", VLC_FALSE, NULL, SNAP_SEQUENTIAL_TEXT,
               SNAP_SEQUENTIAL_LONGTEXT, VLC_FALSE );
+    add_integer( "snapshot-width", 320, NULL, SNAP_WIDTH_TEXT,
+                 SNAP_WIDTH_LONGTEXT, VLC_TRUE );
+    add_integer( "snapshot-height", 200, NULL, SNAP_HEIGHT_TEXT,
+                 SNAP_HEIGHT_LONGTEXT, VLC_TRUE );
 
     set_section( N_("Window properties" ), NULL );
     add_integer( "width", -1, NULL, WIDTH_TEXT, WIDTH_LONGTEXT, VLC_TRUE );
@@ -1526,7 +1626,7 @@ vlc_module_begin();
 
     set_section( N_( "Default devices") , NULL );
 
-    add_file( "dvd", NULL, NULL, DVD_DEV_TEXT, DVD_DEV_LONGTEXT,
+    add_file( "dvd", DVD_DEVICE, NULL, DVD_DEV_TEXT, DVD_DEV_LONGTEXT,
               VLC_FALSE );
     add_file( "vcd", VCD_DEVICE, NULL, VCD_DEV_TEXT, VCD_DEV_LONGTEXT,
               VLC_FALSE );
@@ -1628,6 +1728,8 @@ vlc_module_begin();
                                 SOUT_VIDEO_LONGTEXT, VLC_TRUE );
     add_bool( "sout-spu", 1, NULL, SOUT_SPU_TEXT,
                                 SOUT_SPU_LONGTEXT, VLC_TRUE );
+    add_integer( "sout-mux-caching", 1500, NULL, SOUT_MUX_CACHING_TEXT,
+                                SOUT_MUX_CACHING_LONGTEXT, VLC_TRUE );
 
     set_section( N_("VLM"), NULL );
     add_string( "vlm-conf", NULL, NULL, VLM_CONF_TEXT,
@@ -1688,7 +1790,6 @@ vlc_module_begin();
     add_category_hint( N_("Miscellaneous"), MISC_CAT_LONGTEXT, VLC_TRUE );
     add_module( "memcpy", "memcpy", NULL, NULL, MEMCPY_TEXT,
                 MEMCPY_LONGTEXT, VLC_TRUE );
-        change_short('A');
         change_need_restart();
 
     set_section( N_("Plugins" ), NULL );
@@ -1698,19 +1799,27 @@ vlc_module_begin();
     add_directory( "plugin-path", NULL, NULL, PLUGIN_PATH_TEXT,
                    PLUGIN_PATH_LONGTEXT, VLC_TRUE );
         change_need_restart();
+        change_unsafe();
 
     set_section( N_("Performance options"), NULL );
     add_bool( "minimize-threads", 0, NULL, MINIMIZE_THREADS_TEXT,
               MINIMIZE_THREADS_LONGTEXT, VLC_TRUE );
         change_need_restart();
 
-#if !defined(__APPLE__) && !defined(SYS_BEOS) && defined(PTHREAD_COND_T_IN_PTHREAD_H)
+    set_section( N_("Security options"), NULL );
+    add_integer( "security-policy", 2, NULL, SECURITY_POLICY_TEXT,
+              SECURITY_POLICY_LONGTEXT, VLC_TRUE );
+        change_integer_list( pi_secpolicy_values, ppsz_secpolicy_descriptions, 0 );
+        change_unsafe();
+        change_need_restart();
+
+#if !defined(__APPLE__) && !defined(SYS_BEOS) && defined(LIBVLC_USE_PTHREAD)
     add_bool( "rt-priority", VLC_FALSE, NULL, RT_PRIORITY_TEXT,
               RT_PRIORITY_LONGTEXT, VLC_TRUE );
         change_need_restart();
 #endif
 
-#if !defined(SYS_BEOS) && defined(PTHREAD_COND_T_IN_PTHREAD_H)
+#if !defined(SYS_BEOS) && defined(LIBVLC_USE_PTHREAD)
     add_integer( "rt-offset", 0, NULL, RT_OFFSET_TEXT,
                  RT_OFFSET_LONGTEXT, VLC_TRUE );
         change_need_restart();
@@ -1721,6 +1830,10 @@ vlc_module_begin();
               ONEINSTANCE_DBUS_LONGTEXT, VLC_TRUE );
     add_bool( "playlist-enqueue", 0, NULL, PLAYLISTENQUEUE_TEXT,
               PLAYLISTENQUEUE_LONGTEXT, VLC_TRUE );
+        change_unsaveable();
+
+    add_bool( "inhibit", 1, NULL, INHIBIT_TEXT,
+              INHIBIT_LONGTEXT, VLC_TRUE );
 #endif
 
 #if defined(WIN32)
@@ -1735,6 +1848,7 @@ vlc_module_begin();
               ONEINSTANCEWHENSTARTEDFROMFILE_LONGTEXT, VLC_TRUE );
     add_bool( "playlist-enqueue", 0, NULL, PLAYLISTENQUEUE_TEXT,
               PLAYLISTENQUEUE_LONGTEXT, VLC_TRUE );
+        change_unsaveable();
     add_bool( "high-priority", 0, NULL, HPRIORITY_TEXT,
               HPRIORITY_LONGTEXT, VLC_FALSE );
         change_need_restart();
@@ -1763,7 +1877,10 @@ vlc_module_begin();
     add_bool( "auto-preparse", VLC_TRUE, NULL, PREPARSE_TEXT,
               PREPARSE_LONGTEXT, VLC_FALSE );
 
-    add_integer( "album-art", ALBUM_ART_WHEN_PLAYED, NULL, ALBUM_ART_TEXT,
+    add_integer( "fetch-meta", VLC_TRUE, NULL, FETCH_META_TEXT,
+                 FETCH_META_LONGTEXT, VLC_FALSE );
+
+    add_integer( "album-art", ALBUM_ART_WHEN_ASKED, NULL, ALBUM_ART_TEXT,
                  ALBUM_ART_LONGTEXT, VLC_FALSE );
         change_integer_list( pi_albumart_values,
                              ppsz_albumart_descriptions, 0 );
@@ -1809,8 +1926,8 @@ vlc_module_begin();
         change_need_restart();
 #endif
 
-    add_bool( "color", 0, NULL, COLOR_TEXT, COLOR_LONGTEXT, VLC_TRUE );
-    add_bool( "advanced", 0, NULL, ADVANCED_TEXT, ADVANCED_LONGTEXT,
+    add_bool( "color", VLC_TRUE, NULL, COLOR_TEXT, COLOR_LONGTEXT, VLC_TRUE );
+    add_bool( "advanced", VLC_FALSE, NULL, ADVANCED_TEXT, ADVANCED_LONGTEXT,
                     VLC_FALSE );
         change_need_restart();
     add_bool( "interact", VLC_TRUE, NULL, INTERACTION_TEXT,
@@ -1959,11 +2076,11 @@ vlc_module_begin();
 
 #   define KEY_MENU_ON            KEY_MODIFIER_ALT|'m'
 #   define KEY_MENU_OFF           KEY_MODIFIER_ALT|KEY_MODIFIER_SHIFT|'m'
-#   define KEY_MENU_RIGHT         KEY_MODIFIER_ALT|KEY_RIGHT
-#   define KEY_MENU_LEFT          KEY_MODIFIER_ALT|KEY_LEFT
-#   define KEY_MENU_UP            KEY_MODIFIER_ALT|KEY_UP
-#   define KEY_MENU_DOWN          KEY_MODIFIER_ALT|KEY_DOWN
-#   define KEY_MENU_SELECT        KEY_MODIFIER_ALT|KEY_ENTER
+#   define KEY_MENU_RIGHT         KEY_MODIFIER_ALT|KEY_MODIFIER_SHIFT|KEY_RIGHT
+#   define KEY_MENU_LEFT          KEY_MODIFIER_ALT|KEY_MODIFIER_SHIFT|KEY_LEFT
+#   define KEY_MENU_UP            KEY_MODIFIER_ALT|KEY_MODIFIER_SHIFT|KEY_UP
+#   define KEY_MENU_DOWN          KEY_MODIFIER_ALT|KEY_MODIFIER_SHIFT|KEY_DOWN
+#   define KEY_MENU_SELECT        KEY_MODIFIER_ALT|KEY_MODIFIER_SHIFT|KEY_ENTER
 
 #else
 #   define KEY_TOGGLE_FULLSCREEN  'f'
@@ -2055,11 +2172,11 @@ vlc_module_begin();
 
 #   define KEY_MENU_ON            KEY_MODIFIER_ALT|'m'
 #   define KEY_MENU_OFF           KEY_MODIFIER_ALT|KEY_MODIFIER_SHIFT|'m'
-#   define KEY_MENU_RIGHT         KEY_MODIFIER_ALT|KEY_RIGHT
-#   define KEY_MENU_LEFT          KEY_MODIFIER_ALT|KEY_LEFT
-#   define KEY_MENU_UP            KEY_MODIFIER_ALT|KEY_UP
-#   define KEY_MENU_DOWN          KEY_MODIFIER_ALT|KEY_DOWN
-#   define KEY_MENU_SELECT        KEY_MODIFIER_ALT|KEY_ENTER
+#   define KEY_MENU_RIGHT         KEY_MODIFIER_ALT|KEY_MODIFIER_SHIFT|KEY_RIGHT
+#   define KEY_MENU_LEFT          KEY_MODIFIER_ALT|KEY_MODIFIER_SHIFT|KEY_LEFT
+#   define KEY_MENU_UP            KEY_MODIFIER_ALT|KEY_MODIFIER_SHIFT|KEY_UP
+#   define KEY_MENU_DOWN          KEY_MODIFIER_ALT|KEY_MODIFIER_SHIFT|KEY_DOWN
+#   define KEY_MENU_SELECT        KEY_MODIFIER_ALT|KEY_MODIFIER_SHIFT|KEY_ENTER
 #endif
 
     add_key( "key-toggle-fullscreen", KEY_TOGGLE_FULLSCREEN, NULL, TOGGLE_FULLSCREEN_KEY_TEXT,
@@ -2281,84 +2398,85 @@ vlc_module_begin();
     add_string( "bookmark10", NULL, NULL,
               BOOKMARK10_TEXT, BOOKMARK_LONGTEXT, VLC_FALSE );
 
-    /* Usage (mainly useful for cmd line stuff) */
+#define HELP_TEXT \
+    N_("print help for VLC (can be combined with --advanced and " \
+       "--help-verbose)")
+#define LONGHELP_TEXT \
+    N_("print help for VLC and all its modules (can be combined with " \
+       "--advanced and --help-verbose)")
+#define HELP_VERBOSE_TEXT \
+    N_("ask for extra verbosity when displaying help")
+#define LIST_TEXT \
+    N_("print a list of available modules")
+#define LIST_VERBOSE_TEXT \
+    N_("print a list of available modules with extra detail")
+#define MODULE_TEXT \
+    N_("print help on a specific module (can be combined with --advanced " \
+       "and --help-verbose)")
+#define SAVE_CONFIG_TEXT \
+    N_("save the current command line options in the config")
+#define RESET_CONFIG_TEXT \
+    N_("reset the current config to the default values")
+#define CONFIG_TEXT \
+    N_("use alternate config file")
+#define RESET_PLUGINS_CACHE_TEXT \
+    N_("resets the current plugins cache")
+#define VERSION_TEXT \
+    N_("print version information")
+    add_bool( "help", VLC_FALSE, NULL, HELP_TEXT, "", VLC_FALSE );
+        change_short( 'h' );
+        change_internal();
+        change_unsaveable();
+    add_bool( "longhelp", VLC_FALSE, NULL, LONGHELP_TEXT, "", VLC_FALSE );
+        change_short( 'H' );
+        change_internal();
+        change_unsaveable();
+    add_bool( "help-verbose", VLC_FALSE, NULL, HELP_VERBOSE_TEXT, "",
+              VLC_FALSE );
+        change_internal();
+        change_unsaveable();
+    add_bool( "list", VLC_FALSE, NULL, LIST_TEXT, "", VLC_FALSE );
+        change_short( 'l' );
+        change_internal();
+        change_unsaveable();
+    add_bool( "list-verbose", VLC_FALSE, NULL, LIST_VERBOSE_TEXT, "",
+              VLC_FALSE );
+        change_short( 'l' );
+        change_internal();
+        change_unsaveable();
+    add_string( "module", NULL, NULL, MODULE_TEXT, "", VLC_FALSE );
+        change_short( 'p' );
+        change_internal();
+        change_unsaveable();
+    add_bool( "save-config", VLC_FALSE, NULL, SAVE_CONFIG_TEXT, "",
+              VLC_FALSE );
+        change_internal();
+        change_unsaveable();
+    add_bool( "reset-config", VLC_FALSE, NULL, MODULE_TEXT, "", VLC_FALSE );
+        change_internal();
+        change_unsaveable();
+    add_bool( "reset-plugins-cache", VLC_FALSE, NULL,
+              RESET_PLUGINS_CACHE_TEXT, "", VLC_FALSE );
+        change_internal();
+        change_unsaveable();
+    add_bool( "version", VLC_FALSE, NULL, VERSION_TEXT, "", VLC_FALSE );
+        change_internal();
+        change_unsaveable();
+    add_string( "config", NULL, NULL, CONFIG_TEXT, "", VLC_FALSE );
+        change_internal();
+        change_unsaveable();
+    add_bool( "version", VLC_FALSE, NULL, VERSION_TEXT, "", VLC_FALSE );
+        change_internal();
+        change_unsaveable();
+
+   /* Usage (mainly useful for cmd line stuff) */
     /* add_usage_hint( PLAYLIST_USAGE ); */
 
     set_description( N_("main program") );
     set_capability( "main", 100 );
 vlc_module_end();
 
-const module_config_t libvlc_config[] =
-{
-    {
-        .i_type   = CONFIG_ITEM_BOOL,
-        .psz_name = "help",
-        .i_short  = 'h',
-        .psz_text = N_("print help for VLC (can be combined with --advanced and --help-verbose)")
-    },
-    {
-        .i_type   = CONFIG_ITEM_BOOL,
-        .psz_name = "longhelp",
-        .i_short  = 'H',
-        .psz_text = N_("print help for VLC and all its modules (can be combined with --advanced and --help-verbose)")
-    },
-    {
-        .i_type   = CONFIG_ITEM_BOOL,
-        .psz_name = "advanced",
-        .psz_text = N_("print help for the advanced options")
-    },
-    {
-        .i_type   = CONFIG_ITEM_BOOL,
-        .psz_name = "help-verbose",
-        .psz_text = N_("ask for extra verbosity when displaying help")
-    },
-    {
-        .i_type   = CONFIG_ITEM_BOOL,
-        .psz_name = "list",
-        .i_short  = 'l',
-        .psz_text = N_("print a list of available modules")
-    },
-    {
-        .i_type   = CONFIG_ITEM_BOOL,
-        .psz_name = "list-verbose",
-        .psz_text = N_("print a list of available modules with extra detail")
-    },
-    {
-        .i_type   = CONFIG_ITEM_STRING,
-        .psz_name = "module",
-        .i_short  = 'p',
-        .psz_text = N_("print help on a specific module (can be combined with --advanced and --help-verbose)")
-    },
-    {
-        .i_type   = CONFIG_ITEM_BOOL,
-        .psz_name = "save-config",
-        .psz_text = N_("save the current command line options in the config")
-    },
-    {
-        .i_type   = CONFIG_ITEM_BOOL,
-        .psz_name = "reset-config",
-        .psz_text = N_("reset the current config to the default values")
-    },
-    {
-        .i_type   = CONFIG_ITEM_STRING,
-        .psz_name = "config",
-        .psz_text = N_("use alternate config file")
-    },
-    {
-        .i_type   = CONFIG_ITEM_BOOL,
-        .psz_name = "reset-plugins-cache",
-        .psz_text = N_("resets the current plugins cache")
-    },
-    {
-        .i_type   = CONFIG_ITEM_BOOL,
-        .psz_name = "version",
-        .psz_text = N_("print version information")
-    }
-};
-
-const size_t libvlc_config_count = sizeof (libvlc_config)
-                                 / sizeof (libvlc_config[0]);
-
 /*****************************************************************************
  * End configuration.
  *****************************************************************************/