#include "defs.h"
#include <signal.h> /* SIGHUP, SIGINT, SIGKILL */
-#include <getopt.h> /* getopt() */
#include <stdio.h> /* sprintf() */
+#ifdef HAVE_GETOPT_H
+#include <getopt.h> /* getopt() */
+#endif
+
#include <errno.h> /* ENOMEM */
#include <stdlib.h> /* getenv(), strtol(), */
#include <string.h> /* strerror() */
#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"
#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 */
{ "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 },
/* 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
/*
* 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 */
"vlans management is deactivated\n" );
p_main->b_vlans = 0;
}
+#endif
/*
* Open audio device and start aout thread
/*
* Free shared resources and libraries
*/
+ /* FIXME */
+#if 0
if( p_main->b_vlans )
{
input_VlanDestroy();
}
+#endif
/*
* Free plugin bank
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;
}
/*****************************************************************************
}
/* Parse command line options */
+#ifdef HAVE_GETOPT_H
opterr = 0;
while( ( c = getopt_long( i_argc, ppsz_argv, psz_shortopts, longopts, 0 ) ) != EOF )
{
main_PutPszVariable( YUV_METHOD_VAR, optarg );
break;
+ /* FIXME */
+#if 0
/* DVD options */
case 'a':
if ( ! strcmp(optarg, "mpeg") )
else
main_PutIntVariable( INPUT_DVD_AUDIO_VAR, REQUESTED_AC3 );
break;
+#endif
case 'c':
main_PutIntVariable( INPUT_DVD_CHANNEL_VAR, atoi(optarg) );
break;
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 );
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:
break;
}
}
+#endif
/* Parse command line parameters - no check is made for these options */
for( i_opt = optind; i_opt < i_argc; i_opt++ )
" -c, --dvdchannel <channel> \tchoose DVD audio channel\n"
" -s, --dvdsubtitle <channel> \tchoose DVD subtitle channel\n"
"\n"
- " --novlans \tdisable vlans\n"
+ " --vlans \tenable vlans\n"
" --server <host> \tvideo server address\n"
" --port <port> \tvideo server port\n"
" --broadcast \tlisten to a broadcast\n"
"\n"
" --synchro <type> \tforce synchro algorithm\n"
"\n"
+ " --warning <level> \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" );
intf_Msg( "\n"
"Interface parameters:\n"
" " INTF_INIT_SCRIPT_VAR "=<filename> \tinitialization script\n"
- " " INTF_CHANNELS_VAR "=<filename> \tchannels list\n" );
+ " " INTF_CHANNELS_VAR "=<filename> \tchannels list\n"
+ " " INTF_WARNING_VAR "=<level> \twarning level\n" );
/* Audio parameters */
intf_Msg( "\n"