* and spawn threads.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: main.c,v 1.136 2001/12/12 02:13:50 sam Exp $
+ * $Id: main.c,v 1.139 2001/12/17 03:38:21 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
#define OPT_OVERLAY 166
#define OPT_XVADAPTOR 167
#define OPT_SMP 168
+#define OPT_FILTER 169
#define OPT_CHANNELS 170
#define OPT_SERVER 171
#define SHORT_HELP 1
#define LONG_HELP 2
-/* Needed for x86 CPU capabilities detection */
-#define cpuid( a ) \
- asm volatile ( "cpuid" \
- : "=a" ( i_eax ), \
- "=b" ( i_ebx ), \
- "=c" ( i_ecx ), \
- "=d" ( i_edx ) \
- : "a" ( a ) \
- : "cc" );
-
/* Long options */
static const struct option longopts[] =
{
{ "overlay", 0, 0, OPT_OVERLAY },
{ "xvadaptor", 1, 0, OPT_XVADAPTOR },
{ "smp", 1, 0, OPT_SMP },
+ { "filter", 1, 0, OPT_FILTER },
/* DVD options */
{ "dvdtitle", 1, 0, 't' },
{ "dvdsubtitle", 1, 0, 's' },
{ "dvdcss-method", 1, 0, OPT_DVDCSS_METHOD },
{ "dvdcss-verbose", 1, 0, OPT_DVDCSS_VERBOSE },
-
+
/* Input options */
{ "input", 1, 0, OPT_INPUT },
{ "channels", 0, 0, OPT_CHANNELS },
p_vout_bank = &vout_bank;
#ifdef ENABLE_NLS
- /*
+ /*
* Support for getext
*/
-#ifdef HAVE_LOCALE_H
- if( ! setlocale(LC_MESSAGES, "") )
+#if defined( HAVE_LOCALE_H ) && defined( HAVE_LC_MESSAGES )
+ if( !setlocale( LC_MESSAGES, "" ) )
{
fprintf( stderr, "warning: unsupported locale.\n" );
}
#endif
- if( ! bindtextdomain(PACKAGE, LOCALEDIR) )
+ if( !bindtextdomain( PACKAGE, LOCALEDIR ) )
{
fprintf( stderr, "warning: no domain %s in directory %s\n",
PACKAGE, LOCALEDIR );
textdomain( PACKAGE );
#endif
-
+
/*
* Initialize threads system
*/
vlc_threads_init( );
/*
- * Test if our code is likely to run on this CPU
+ * Test if our code is likely to run on this CPU
*/
p_main->i_cpu_capabilities = CPUCapabilities();
-
+
/*
* System specific initialization code
*/
case OPT_SMP: /* --smp */
main_PutIntVariable( VDEC_SMP_VAR, atoi(optarg) );
break;
+ case OPT_FILTER: /* --filter */
+ main_PutPszVariable( VOUT_FILTER_VAR, optarg );
+ break;
/* DVD options */
case 't': /* --dvdtitle */
break;
/* Misc options */
- case OPT_SYNCHRO:
+ case OPT_SYNCHRO:
main_PutPszVariable( VPAR_SYNCHRO_VAR, optarg );
break;
- case OPT_MEMCPY:
+ case OPT_MEMCPY:
main_PutPszVariable( MEMCPY_METHOD_VAR, optarg );
break;
-
+
/* Decoder options */
case OPT_MPEG_ADEC:
main_PutPszVariable( ADEC_MPEG_VAR, optarg );
"\n --yuv <module> \tYUV method"
"\n --synchro <type> \tforce synchro algorithm"
"\n --smp <number of threads> \tuse several processors"
+ "\n --filter <module> \tvideo filter module"
"\n"
"\n -t, --dvdtitle <num> \tchoose DVD title"
"\n -T, --dvdchapter <num> \tchoose DVD chapter"
"\n " IDCT_METHOD_VAR "=<method name> \tIDCT method"
"\n " YUV_METHOD_VAR "=<method name> \tYUV method"
"\n " VPAR_SYNCHRO_VAR "={I|I+|IP|IP+|IPB} \tsynchro algorithm"
- "\n " VDEC_SMP_VAR "=<number of threads> \tuse several processors" );
+ "\n " VDEC_SMP_VAR "=<number of threads> \tuse several processors"
+ "\n " VOUT_FILTER_VAR "=<method name> \tvideo filter method" );
/* DVD parameters */
intf_MsgImm( "\nDVD parameters:"
/* Acknowledge the signal received */
i_illegal = 1;
-
+
#ifdef HAVE_SIGRELSE
sigrelse( i_signal );
#endif
{
volatile int i_capabilities = CPU_CAPABILITY_NONE;
-#if defined( SYS_BEOS )
- i_capabilities |= CPU_CAPABILITY_FPU
- | CPU_CAPABILITY_486
- | CPU_CAPABILITY_586
- | CPU_CAPABILITY_MMX;
-
- return( i_capabilities );
-
-#elif defined( SYS_DARWIN )
+#if defined( SYS_DARWIN )
struct host_basic_info hi;
kern_return_t ret;
host_name_port_t host;
volatile unsigned int i_eax, i_ebx, i_ecx, i_edx;
volatile boolean_t b_amd;
+ /* Needed for x86 CPU capabilities detection */
+# define cpuid( a ) \
+ asm volatile ( "pushl %%ebx\n\t" \
+ "cpuid\n\t" \
+ "movl %%ebx,%1\n\t" \
+ "popl %%ebx\n\t" \
+ : "=a" ( i_eax ), \
+ "=r" ( i_ebx ), \
+ "=c" ( i_ecx ), \
+ "=d" ( i_edx ) \
+ : "a" ( a ) \
+ : "cc" );
+
i_capabilities |= CPU_CAPABILITY_FPU;
signal( SIGILL, InstructionSignalHandler );
-
+
/* test for a 486 CPU */
- asm volatile ( "pushfl\n\t"
+ asm volatile ( "pushl %%ebx\n\t"
+ "pushfl\n\t"
"popl %%eax\n\t"
"movl %%eax, %%ebx\n\t"
"xorl $0x200000, %%eax\n\t"
"pushl %%eax\n\t"
"popfl\n\t"
"pushfl\n\t"
- "popl %%eax"
+ "popl %%eax\n\t"
+ "movl %%ebx,%1\n\t"
+ "popl %%ebx\n\t"
: "=a" ( i_eax ),
- "=b" ( i_ebx )
+ "=r" ( i_ebx )
:
: "cc" );
if( i_eax == i_ebx )
{
- signal( SIGILL, NULL );
+ signal( SIGILL, NULL );
return( i_capabilities );
}
if( !i_eax )
{
- signal( SIGILL, NULL );
+ signal( SIGILL, NULL );
return( i_capabilities );
}
if( ! (i_edx & 0x00800000) )
{
- signal( SIGILL, NULL );
+ signal( SIGILL, NULL );
return( i_capabilities );
}
}
#endif
}
-
+
/* test for additional capabilities */
cpuid( 0x80000000 );
if( i_eax < 0x80000001 )
{
- signal( SIGILL, NULL );
+ signal( SIGILL, NULL );
return( i_capabilities );
}
__asm__ __volatile__ ( "pfadd %%mm0,%%mm0\n" "femms\n" : : );
}
- if( i_illegal == 0 )
+ if( i_illegal == 0 )
{
i_capabilities |= CPU_CAPABILITY_3DNOW;
}
i_capabilities |= CPU_CAPABILITY_MMXEXT;
}
- signal( SIGILL, NULL );
+ signal( SIGILL, NULL );
return( i_capabilities );
#elif defined( __powerpc__ )
}
#endif
- signal( SIGILL, NULL );
+ signal( SIGILL, NULL );
return( i_capabilities );
#else