]> git.sesse.net Git - vlc/blobdiff - src/libvlc-module.c
Add --data-path option. Access the src share directory now works from build tree.
[vlc] / src / libvlc-module.c
index a084cffbe6baa4cbd7a74fcdb94c34cc6f6e2f73..c8b95f2b45494fef0c3c05da539d0519418500ca 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
- * libvlc.h: Options for the main (libvlc itself) module
+ * libvlc-module.c: Options for the main (libvlc itself) module
  *****************************************************************************
- * Copyright (C) 1998-2006 the VideoLAN team
+ * Copyright (C) 1998-2009 the VideoLAN team
  * $Id$
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
@@ -36,6 +36,7 @@
 
 #include <vlc_common.h>
 #include <vlc_plugin.h>
+#include <vlc_cpu.h>
 #include "libvlc.h"
 
 //#define Nothing here, this is just to prevent update-po from being stupid
@@ -63,12 +64,16 @@ static const char *const ppsz_language[] =
     "ka",
     "de",
     "he",
+    "hr",
     "hu",
     "id",
     "it",
     "ja",
     "ko",
+    "lt",
+    "mn",
     "ms",
+    "kk",
     "km",
     "oc",
     "fa",
@@ -86,6 +91,7 @@ static const char *const ppsz_language[] =
     "sv",
     "tr",
     "uk",
+    "vi",
 };
 
 static const char *const ppsz_language_text[] =
@@ -108,12 +114,16 @@ static const char *const ppsz_language_text[] =
     "ქართული",
     "Deutsch",
     "עברית",
+    "hrvatski",
     "Magyar",
     "Bahasa Indonesia",
     "Italiano",
     "日本語",
     "한국어",
+    "lietuvių",
+    "Монгол хэл",
     "Melayu",
+    "Қазақ тілі",
     "ភាសាខ្មែរ",
     "Occitan",
     "ﻑﺍﺮﺳی",
@@ -131,6 +141,7 @@ static const char *const ppsz_language_text[] =
     "Svenska",
     "Türkçe",
     "украї́нська мо́ва",
+    "tiếng Việt",
 };
 #endif
 
@@ -210,11 +221,6 @@ static const char *const ppsz_snap_formats[] =
     "show all available options, including those that most users should " \
     "never touch.")
 
-#define SHOWINTF_TEXT N_("Show interface with mouse")
-#define SHOWINTF_LONGTEXT N_( \
-    "When this is enabled, the interface is shown when you move the mouse to "\
-    "the edge of the screen in fullscreen mode." )
-
 #define INTERACTION_TEXT N_("Interface interaction")
 #define INTERACTION_LONGTEXT N_( \
     "When this is enabled, the interface will show a dialog box each time " \
@@ -415,6 +421,11 @@ static const char *const ppsz_align_descriptions[] =
 #define EMBEDDED_LONGTEXT N_( \
     "Embed the video output in the main interface." )
 
+#define DISPLAY_TEXT N_("X11 display")
+#define DISPLAY_LONGTEXT N_( \
+    "X11 hardware display to use. By default VLC will " \
+    "use the value of the DISPLAY environment variable.")
+
 #define FULLSCREEN_TEXT N_("Fullscreen video output")
 #define FULLSCREEN_LONGTEXT N_( \
     "Start video in fullscreen mode" )
@@ -446,6 +457,28 @@ static const char *const ppsz_align_descriptions[] =
     "Hide mouse cursor and fullscreen controller after " \
     "n milliseconds, default is 3000 ms (3 sec.)")
 
+#define DEINTERLACE_TEXT N_("Deinterlace")
+#define DEINTERLACE_LONGTEXT N_(\
+    "Deinterlace")
+static const int pi_deinterlace[] = {
+    0, -1, 1
+};
+static const char * const  ppsz_deinterlace_text[] = {
+    "Off", "Automatic", "On"
+};
+
+#define DEINTERLACE_MODE_TEXT N_("Deinterlace mode")
+#define DEINTERLACE_MODE_LONGTEXT N_( \
+    "Deinterlace method to use for video processing.")
+static const char * const ppsz_deinterlace_mode[] = {
+    "discard", "blend", "mean", "bob",
+    "linear", "x", "yadif", "yadif2x"
+};
+static const char * const ppsz_deinterlace_mode_text[] = {
+    N_("Discard"), N_("Blend"), N_("Mean"), N_("Bob"),
+    N_("Linear"), "X", "Yadif", "Yadif (2x)"
+};
+
 static const int pi_pos_values[] = { 0, 1, 2, 4, 8, 5, 6, 9, 10 };
 static const char *const ppsz_pos_descriptions[] =
 { N_("Center"), N_("Left"), N_("Right"), N_("Top"), N_("Bottom"),
@@ -567,15 +600,13 @@ static const char *const ppsz_pos_descriptions[] =
     "This avoids flooding the message log with debug output from the " \
     "video output synchronization mechanism.")
 
-#define VOUT_EVENT_TEXT N_("key and mouse event handling at vout level.")
-#define VOUT_EVENT_LONGTEXT N_( \
-    "This parameter accepts values : 1 (full event handling support), " \
-    "2 (event handling only for fullscreen) or 3 (No event handling). "  \
-    "Full event handling support is the default value.")
+#define KEYBOARD_EVENTS_TEXT N_("Key press events")
+#define KEYBOARD_EVENTS_LONGTEXT N_( \
+    "This enables VLC hotkeys from the (non-embedded) video window." )
 
-static const int pi_vout_event_values[] = { 1, 2, 3 };
-static const char *const ppsz_vout_event_descriptions[] =
-     { N_("Full support"), N_("Fullscreen-only"), N_("None") };
+#define MOUSE_EVENTS_TEXT N_("Key press events")
+#define MOUSE_EVENTS_LONGTEXT N_( \
+    "This enables handling of mouse clicks on the video." )
 
 /*****************************************************************************
  * Input
@@ -701,6 +732,10 @@ static const char *const ppsz_clock_descriptions[] =
 #define INPUT_FAST_SEEK_LONGTEXT N_( \
     "Favor speed over precision while seeking" )
 
+#define INPUT_RATE_TEXT N_("Playback speed")
+#define INPUT_RATE_LONGTEXT N_( \
+    "This defines the playback speed (nominal speed is 1.0)." )
+
 #define INPUT_LIST_TEXT N_("Input list")
 #define INPUT_LIST_LONGTEXT N_( \
     "You can give a comma-separated list " \
@@ -984,11 +1019,6 @@ static const char *const ppsz_clock_descriptions[] =
     "These options allow you to enable special CPU optimizations. " \
     "You should always leave all these enabled." )
 
-#define FPU_TEXT N_("Enable FPU support")
-#define FPU_LONGTEXT N_( \
-    "If your processor has a floating point calculation unit, VLC can take " \
-    "advantage of it.")
-
 #define MMX_TEXT N_("Enable CPU MMX support")
 #define MMX_LONGTEXT N_( \
     "If your processor supports the MMX instructions set, VLC can take " \
@@ -1014,6 +1044,26 @@ static const char *const ppsz_clock_descriptions[] =
     "If your processor supports the SSE2 instructions set, VLC can take " \
     "advantage of them.")
 
+#define SSE3_TEXT N_("Enable CPU SSE3 support")
+#define SSE3_LONGTEXT N_( \
+    "If your processor supports the SSE3 instructions set, VLC can take " \
+    "advantage of them.")
+
+#define SSSE3_TEXT N_("Enable CPU SSSE3 support")
+#define SSSE3_LONGTEXT N_( \
+    "If your processor supports the SSSE3 instructions set, VLC can take " \
+    "advantage of them.")
+
+#define SSE4_1_TEXT N_("Enable CPU SSE4.1 support")
+#define SSE4_1_LONGTEXT N_( \
+    "If your processor supports the SSE4.1 instructions set, VLC can take " \
+    "advantage of them.")
+
+#define SSE4_2_TEXT N_("Enable CPU SSE4.2 support")
+#define SSE4_2_LONGTEXT N_( \
+    "If your processor supports the SSE4.2 instructions set, VLC can take " \
+    "advantage of them.")
+
 #define ALTIVEC_TEXT N_("Enable CPU AltiVec support")
 #define ALTIVEC_LONGTEXT N_( \
     "If your processor supports the AltiVec instructions set, VLC can take " \
@@ -1070,6 +1120,10 @@ static const char *const ppsz_clock_descriptions[] =
     "Additional path for VLC to look for its modules. You can add " \
     "several paths by concatenating them using \" PATH_SEP \" as separator")
 
+#define DATA_PATH_TEXT N_("Data search path")
+#define DATA_PATH_LONGTEXT N_( \
+    "Override the default data/share search path.")
+
 #define VLM_CONF_TEXT N_("VLM configuration file")
 #define VLM_CONF_LONGTEXT N_( \
     "Read a VLM configuration file as soon as VLM is started." )
@@ -1078,9 +1132,9 @@ static const char *const ppsz_clock_descriptions[] =
 #define PLUGINS_CACHE_LONGTEXT N_( \
     "Use a plugins cache which will greatly improve the startup time of VLC.")
 
-#define STATS_TEXT N_("Collect statistics")
+#define STATS_TEXT N_("Locally collect statistics")
 #define STATS_LONGTEXT N_( \
-     "Collect miscellaneous statistics.")
+     "Collect miscellaneous local statistics about the playing media.")
 
 #define DAEMON_TEXT N_("Run as daemon process")
 #define DAEMON_LONGTEXT N_( \
@@ -1190,7 +1244,11 @@ static const char *const ppsz_albumart_descriptions[] =
 
 #define PAE_TEXT N_("Play and exit")
 #define PAE_LONGTEXT N_( \
-                "Exit if there are no more items in the playlist." )
+    "Exit if there are no more items in the playlist." )
+
+#define PAP_TEXT N_("Play and pause")
+#define PAP_LONGTEXT N_( \
+    "Pause each item in the playlist on the last frame." )
 
 #define ML_TEXT N_("Use media library")
 #define ML_LONGTEXT N_( \
@@ -1310,6 +1368,10 @@ static const char *const ppsz_albumart_descriptions[] =
 #define SUBDELAY_UP_KEY_LONGTEXT N_("Select the key to increase the subtitle delay.")
 #define SUBDELAY_DOWN_KEY_TEXT N_("Subtitle delay down")
 #define SUBDELAY_DOWN_KEY_LONGTEXT N_("Select the key to decrease the subtitle delay.")
+#define SUBPOS_UP_KEY_TEXT N_("Subtitle position up")
+#define SUBPOS_UP_KEY_LONGTEXT N_("Select the key to move subtitles higher.")
+#define SUBPOS_DOWN_KEY_TEXT N_("Subtitle position down")
+#define SUBPOS_DOWN_KEY_LONGTEXT N_("Select the key to move subtitles lower.")
 #define AUDIODELAY_UP_KEY_TEXT N_("Audio delay up")
 #define AUDIODELAY_UP_KEY_LONGTEXT N_("Select the key to increase the audio delay.")
 #define AUDIODELAY_DOWN_KEY_TEXT N_("Audio delay down")
@@ -1513,7 +1575,7 @@ vlc_module_begin ()
                             VOLUME_STEP_LONGTEXT, true )
     add_integer( "aout-rate", -1, NULL, AOUT_RATE_TEXT,
                  AOUT_RATE_LONGTEXT, true )
-#if !defined( __APPLE__ )
+#if HAVE_FPU && !defined( __APPLE__ )
     add_bool( "hq-resampling", 1, NULL, AOUT_RESAMP_TEXT,
               AOUT_RESAMP_LONGTEXT, true )
 #endif
@@ -1536,7 +1598,7 @@ vlc_module_begin ()
     add_bool( "audio-replay-gain-peak-protection", true, NULL,
               AUDIO_REPLAY_GAIN_PEAK_PROTECTION_TEXT, AUDIO_REPLAY_GAIN_PEAK_PROTECTION_LONGTEXT, true )
 
-    add_bool( "audio-time-stretch", true, NULL,
+    add_bool( "audio-time-stretch", HAVE_FPU, NULL,
               AUDIO_TIME_STRETCH_TEXT, AUDIO_TIME_STRETCH_LONGTEXT, false )
 
     set_subcategory( SUBCAT_AUDIO_AOUT )
@@ -1560,7 +1622,12 @@ vlc_module_begin ()
         change_safe ()
     add_bool( "grayscale", 0, NULL, GRAYSCALE_TEXT,
               GRAYSCALE_LONGTEXT, true )
-    add_bool( "fullscreen", 0, NULL, FULLSCREEN_TEXT,
+#if defined (HAVE_MAEMO)
+# define FULLSCREEN_DEFAULT true
+#else
+# define FULLSCREEN_DEFAULT false
+#endif
+    add_bool( "fullscreen", FULLSCREEN_DEFAULT, NULL, FULLSCREEN_TEXT,
               FULLSCREEN_LONGTEXT, false )
         change_short('f')
         change_safe ()
@@ -1569,6 +1636,9 @@ vlc_module_begin ()
 #ifdef __APPLE__
        add_deprecated_alias( "macosx-embedded" ) /*deprecated since 0.9.0 */
 #endif
+    add_string( "x11-display", NULL, NULL,
+                DISPLAY_TEXT, DISPLAY_LONGTEXT, true )
+        add_deprecated_alias( "xvideo-display" ) /* deprecated since 1.1.0 */
     add_bool( "drop-late-frames", 1, NULL, DROP_LATE_FRAMES_TEXT,
               DROP_LATE_FRAMES_LONGTEXT, true )
     /* Used in vout_synchro */
@@ -1576,10 +1646,12 @@ vlc_module_begin ()
               SKIP_FRAMES_LONGTEXT, true )
     add_bool( "quiet-synchro", 0, NULL, QUIET_SYNCHRO_TEXT,
               QUIET_SYNCHRO_LONGTEXT, true )
-    add_integer( "vout-event", 1, NULL, VOUT_EVENT_TEXT, VOUT_EVENT_LONGTEXT, true )
-        change_safe()
-        change_integer_list( pi_vout_event_values, ppsz_vout_event_descriptions, NULL )
-        add_deprecated_alias( "x11-event" ) /* renamed since 1.0.0 */
+    add_bool( "keyboard-events", true, NULL, KEYBOARD_EVENTS_TEXT,
+              KEYBOARD_EVENTS_LONGTEXT, true )
+    add_bool( "mouse-events", true, NULL, MOUSE_EVENTS_TEXT,
+              MOUSE_EVENTS_LONGTEXT, true )
+    add_obsolete_integer( "vout-event" ) /* deprecated since 1.1.0 */
+    add_obsolete_integer( "x11-event" ) /* renamed since 1.0.0 */
 #ifndef __APPLE__
     add_bool( "overlay", 1, NULL, OVERLAY_TEXT, OVERLAY_LONGTEXT, false )
 #endif
@@ -1650,7 +1722,14 @@ vlc_module_begin ()
     add_integer( "align", 0, NULL, ALIGN_TEXT, ALIGN_LONGTEXT, true )
         change_integer_list( pi_align_values, ppsz_align_descriptions, NULL )
     add_float( "zoom", 1, NULL, ZOOM_TEXT, ZOOM_LONGTEXT, true )
-
+    add_integer( "deinterlace", 0, NULL,
+                 DEINTERLACE_TEXT, DEINTERLACE_LONGTEXT, false )
+        change_integer_list( pi_deinterlace, ppsz_deinterlace_text, 0 )
+        change_safe()
+    add_string( "deinterlace-mode", "blend", NULL,
+                DEINTERLACE_MODE_TEXT, DEINTERLACE_MODE_LONGTEXT, false )
+        change_string_list( ppsz_deinterlace_mode, ppsz_deinterlace_mode_text, 0 )
+        change_safe()
 
     set_subcategory( SUBCAT_VIDEO_VOUT )
     add_module( "vout", "video output", NULL, NULL, VOUT_TEXT, VOUT_LONGTEXT,
@@ -1749,6 +1828,8 @@ vlc_module_begin ()
     add_bool( "input-fast-seek", false, NULL,
               INPUT_FAST_SEEK_TEXT, INPUT_FAST_SEEK_LONGTEXT, false )
         change_safe ()
+    add_float( "rate", 1., NULL,
+               INPUT_RATE_TEXT, INPUT_RATE_LONGTEXT, false )
 
     add_string( "input-list", NULL, NULL,
                  INPUT_LIST_TEXT, INPUT_LIST_LONGTEXT, true )
@@ -1915,8 +1996,7 @@ vlc_module_begin ()
     set_category( CAT_ADVANCED )
     set_subcategory( SUBCAT_ADVANCED_CPU )
     add_category_hint( N_("CPU"), CPU_CAT_LONGTEXT, true )
-    add_bool( "fpu", 1, NULL, FPU_TEXT, FPU_LONGTEXT, true )
-        change_need_restart ()
+    add_obsolete_bool( "fpu" )
 #if defined( __i386__ ) || defined( __x86_64__ )
     add_bool( "mmx", 1, NULL, MMX_TEXT, MMX_LONGTEXT, true )
         change_need_restart ()
@@ -1928,6 +2008,14 @@ vlc_module_begin ()
         change_need_restart ()
     add_bool( "sse2", 1, NULL, SSE2_TEXT, SSE2_LONGTEXT, true )
         change_need_restart ()
+    add_bool( "sse3", 1, NULL, SSE3_TEXT, SSE3_LONGTEXT, true )
+        change_need_restart ()
+    add_bool( "ssse3", 1, NULL, SSSE3_TEXT, SSSE3_LONGTEXT, true )
+        change_need_restart ()
+    add_bool( "sse41", 1, NULL, SSE4_1_TEXT, SSE4_1_LONGTEXT, true )
+        change_need_restart ()
+    add_bool( "sse42", 1, NULL, SSE4_2_TEXT, SSE4_2_LONGTEXT, true )
+        change_need_restart ()
 #endif
 #if defined( __powerpc__ ) || defined( __ppc__ ) || defined( __ppc64__ )
     add_bool( "altivec", 1, NULL, ALTIVEC_TEXT, ALTIVEC_LONGTEXT, true )
@@ -1949,6 +2037,9 @@ vlc_module_begin ()
     add_directory( "plugin-path", NULL, NULL, PLUGIN_PATH_TEXT,
                    PLUGIN_PATH_LONGTEXT, true )
         change_need_restart ()
+    add_directory( "data-path", NULL, NULL, DATA_PATH_TEXT,
+                   DATA_PATH_LONGTEXT, true )
+        change_need_restart ()
 
     set_section( N_("Performance options"), NULL )
     add_obsolete_bool( "minimize-threads" )
@@ -2011,6 +2102,8 @@ vlc_module_begin ()
     add_bool( "play-and-exit", 0, NULL, PAE_TEXT, PAE_LONGTEXT, false )
     add_bool( "play-and-stop", 0, NULL, PAS_TEXT, PAS_LONGTEXT, false )
         change_safe()
+    add_bool( "play-and-pause", 0, NULL, PAP_TEXT, PAP_LONGTEXT, true )
+        change_safe()
     add_bool( "media-library", 1, NULL, ML_TEXT, ML_LONGTEXT, false )
     add_bool( "playlist-tree", 0, NULL, PLTREE_TEXT, PLTREE_LONGTEXT, false )
 
@@ -2075,9 +2168,7 @@ vlc_module_begin ()
     add_bool( "interact", true, NULL, INTERACTION_TEXT,
               INTERACTION_LONGTEXT, false )
 
-    add_bool( "show-intf", false, NULL, SHOWINTF_TEXT, SHOWINTF_LONGTEXT,
-              false )
-        change_need_restart ()
+    add_obsolete_bool( "show-intf" );
 
     add_bool ( "stats", true, NULL, STATS_TEXT, STATS_LONGTEXT, true )
         change_need_restart ()
@@ -2169,6 +2260,8 @@ vlc_module_begin ()
 #   define KEY_VOL_MUTE           KEY_MODIFIER_COMMAND|KEY_MODIFIER_ALT|KEY_DOWN
 #   define KEY_SUBDELAY_UP        'j'
 #   define KEY_SUBDELAY_DOWN      'h'
+#   define KEY_SUBPOS_DOWN        KEY_UNSET
+#   define KEY_SUBPOS_UP          KEY_UNSET
 #   define KEY_AUDIODELAY_UP      'g'
 #   define KEY_AUDIODELAY_DOWN    'f'
 #   define KEY_AUDIO_TRACK        'l'
@@ -2252,7 +2345,7 @@ vlc_module_begin ()
      */
 #   define KEY_TOGGLE_FULLSCREEN  'f'
 #   define KEY_LEAVE_FULLSCREEN   KEY_ESC
-#   define KEY_PLAY_PAUSE         KEY_SPACE
+#   define KEY_PLAY_PAUSE         ' '
 #   define KEY_PAUSE              KEY_UNSET
 #   define KEY_PLAY               KEY_UNSET
 #   define KEY_FASTER             '+'
@@ -2284,6 +2377,8 @@ vlc_module_begin ()
 #   define KEY_VOL_MUTE           'm'
 #   define KEY_SUBDELAY_UP        'h'
 #   define KEY_SUBDELAY_DOWN      'g'
+#   define KEY_SUBPOS_DOWN        KEY_UNSET
+#   define KEY_SUBPOS_UP          KEY_UNSET
 #   define KEY_AUDIODELAY_UP      'k'
 #   define KEY_AUDIODELAY_DOWN    'j'
 #   define KEY_RANDOM             'r'
@@ -2445,6 +2540,10 @@ vlc_module_begin ()
              SUBDELAY_UP_KEY_TEXT, SUBDELAY_UP_KEY_LONGTEXT, true )
     add_key( "key-subdelay-down", KEY_SUBDELAY_DOWN, NULL,
              SUBDELAY_DOWN_KEY_TEXT, SUBDELAY_DOWN_KEY_LONGTEXT, true )
+    add_key( "key-subpos-up", KEY_SUBPOS_UP, NULL,
+             SUBPOS_UP_KEY_TEXT, SUBPOS_UP_KEY_LONGTEXT, true )
+    add_key( "key-subpos-down", KEY_SUBPOS_DOWN, NULL,
+             SUBPOS_DOWN_KEY_TEXT, SUBPOS_DOWN_KEY_LONGTEXT, true )
     add_key( "key-audiodelay-up", KEY_AUDIODELAY_UP, NULL,
              AUDIODELAY_UP_KEY_TEXT, AUDIODELAY_UP_KEY_LONGTEXT, true )
     add_key( "key-audiodelay-down", KEY_AUDIODELAY_DOWN, NULL,
@@ -2668,7 +2767,7 @@ vlc_module_begin ()
         change_short( 'p' )
         change_internal ()
         change_unsaveable ()
-    add_bool( "ignore-config", false, NULL, IGNORE_CONFIG_TEXT, "", false )
+    add_bool( "ignore-config", true, NULL, IGNORE_CONFIG_TEXT, "", false )
         change_internal ()
         change_unsaveable ()
     add_bool( "save-config", false, NULL, SAVE_CONFIG_TEXT, "",
@@ -2738,6 +2837,8 @@ const struct action libvlc_actions[] =
     { "key-vol-mute", ACTIONID_VOL_MUTE, },
     { "key-subdelay-down", ACTIONID_SUBDELAY_DOWN, },
     { "key-subdelay-up", ACTIONID_SUBDELAY_UP, },
+    { "key-subpos-down", ACTIONID_SUBPOS_DOWN, },
+    { "key-subpos-up", ACTIONID_SUBPOS_UP, },
     { "key-audiodelay-down", ACTIONID_AUDIODELAY_DOWN, },
     { "key-audiodelay-up", ACTIONID_AUDIODELAY_UP, },
     { "key-audio-track", ACTIONID_AUDIO_TRACK, },