X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Finterface%2Fmain.c;h=bca5b5124bc02eb8fbf784078512b22281319acd;hb=53c2e3acf70a10efeb412d7a713562ea4fccbd72;hp=785a9ea55fd5ce8ccad6c0d6a2602a02575ab109;hpb=9d8d50a8fab8abfed4405269637f7ee8422be602;p=vlc diff --git a/src/interface/main.c b/src/interface/main.c index 785a9ea55f..bca5b5124b 100644 --- a/src/interface/main.c +++ b/src/interface/main.c @@ -28,9 +28,12 @@ #include "defs.h" #include /* SIGHUP, SIGINT, SIGKILL */ -#include /* getopt() */ #include /* sprintf() */ +#ifdef HAVE_GETOPT_H +#include /* getopt() */ +#endif + #include /* ENOMEM */ #include /* getenv(), strtol(), */ #include /* strerror() */ @@ -42,8 +45,8 @@ #include "tests.h" /* TestMMX() */ #include "plugins.h" #include "playlist.h" -#include "input_vlan.h" -#include "input_ps.h" +#include "stream_control.h" +#include "input_ext-intf.h" #include "intf_msg.h" #include "interface.h" @@ -76,19 +79,22 @@ #define OPT_COLOR 165 #define OPT_YUV 166 -#define OPT_NOVLANS 170 +#define OPT_VLANS 170 #define OPT_SERVER 171 #define OPT_PORT 172 #define OPT_BROADCAST 173 #define OPT_SYNCHRO 180 +#define OPT_WARNING 190 + /* Usage fashion */ #define USAGE 0 #define SHORT_HELP 1 #define LONG_HELP 2 /* Long options */ +#ifdef HAVE_GETOPT_H static const struct option longopts[] = { /* name, has_arg, flag, val */ @@ -120,7 +126,7 @@ static const struct option longopts[] = { "dvdsubtitle", 1, 0, 's' }, /* Input options */ - { "novlans", 0, 0, OPT_NOVLANS }, + { "vlans", 0, 0, OPT_VLANS }, { "server", 1, 0, OPT_SERVER }, { "port", 1, 0, OPT_PORT }, { "broadcast", 0, 0, OPT_BROADCAST }, @@ -128,11 +134,15 @@ static const struct option longopts[] = /* Synchro options */ { "synchro", 1, 0, OPT_SYNCHRO }, + /* Interface messages */ + { "warning", 1, 0, OPT_WARNING }, { 0, 0, 0, 0 } }; /* Short options */ static const char *psz_shortopts = "hHvga:s:c:"; +#endif + /***************************************************************************** * Global variable program_data - this is the one and only, see main.h @@ -237,6 +247,8 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) /* * Initialize shared resources and libraries */ + /* FIXME: no VLANs */ +#if 0 if( p_main->b_vlans && input_VlanCreate() ) { /* On error during vlans initialization, switch off vlans */ @@ -244,6 +256,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) "vlans management is deactivated\n" ); p_main->b_vlans = 0; } +#endif /* * Open audio device and start aout thread @@ -286,10 +299,13 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) /* * Free shared resources and libraries */ + /* FIXME */ +#if 0 if( p_main->b_vlans ) { input_VlanDestroy(); } +#endif /* * Free plugin bank @@ -411,11 +427,11 @@ void main_PutIntVariable( char *psz_name, int i_value ) static void SetDefaultConfiguration( void ) { /* - * All features are activated by default + * All features are activated by default execpted vlans */ p_main->b_audio = 1; p_main->b_video = 1; - p_main->b_vlans = 1; + p_main->b_vlans = 0; } /***************************************************************************** @@ -455,6 +471,7 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) } /* Parse command line options */ +#ifdef HAVE_GETOPT_H opterr = 0; while( ( c = getopt_long( i_argc, ppsz_argv, psz_shortopts, longopts, 0 ) ) != EOF ) { @@ -515,6 +532,8 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) main_PutPszVariable( YUV_METHOD_VAR, optarg ); break; + /* FIXME */ +#if 0 /* DVD options */ case 'a': if ( ! strcmp(optarg, "mpeg") ) @@ -526,6 +545,7 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) else main_PutIntVariable( INPUT_DVD_AUDIO_VAR, REQUESTED_AC3 ); break; +#endif case 'c': main_PutIntVariable( INPUT_DVD_CHANNEL_VAR, atoi(optarg) ); break; @@ -534,8 +554,8 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) break; /* Input options */ - case OPT_NOVLANS: /* --novlans */ - p_main->b_vlans = 0; + case OPT_VLANS: /* --vlans */ + p_main->b_vlans = 1; break; case OPT_SERVER: /* --server */ main_PutPszVariable( INPUT_SERVER_VAR, optarg ); @@ -548,10 +568,15 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) break; /* Synchro options */ - case OPT_SYNCHRO: + case OPT_SYNCHRO: main_PutPszVariable( VPAR_SYNCHRO_VAR, optarg ); break; + /* Interface warning messages level */ + case OPT_WARNING: /* --warning */ + main_PutIntVariable( INTF_WARNING_VAR, atoi(optarg) ); + break; + /* Internal error: unknown option */ case '?': default: @@ -561,6 +586,7 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) break; } } +#endif /* Parse command line parameters - no check is made for these options */ for( i_opt = optind; i_opt < i_argc; i_opt++ ) @@ -606,13 +632,15 @@ static void Usage( int i_fashion ) " -c, --dvdchannel \tchoose DVD audio channel\n" " -s, --dvdsubtitle \tchoose DVD subtitle channel\n" "\n" - " --novlans \tdisable vlans\n" + " --vlans \tenable vlans\n" " --server \tvideo server address\n" " --port \tvideo server port\n" " --broadcast \tlisten to a broadcast\n" "\n" " --synchro \tforce synchro algorithm\n" "\n" + " --warning \tdisplay warning messages\n" + "\n" " -h, --help \tprint help and exit\n" " -H, --longhelp \tprint long help and exit\n" " -v, --version \toutput version information and exit\n" ); @@ -624,7 +652,8 @@ static void Usage( int i_fashion ) intf_Msg( "\n" "Interface parameters:\n" " " INTF_INIT_SCRIPT_VAR "= \tinitialization script\n" - " " INTF_CHANNELS_VAR "= \tchannels list\n" ); + " " INTF_CHANNELS_VAR "= \tchannels list\n" + " " INTF_WARNING_VAR "= \twarning level\n" ); /* Audio parameters */ intf_Msg( "\n"