Commit 75eb696d authored by Sam Hocevar's avatar Sam Hocevar

 * added --intf option to vlc
 * started cleaning vout_sdl.c
 * the dummy plugin works again
 * added a slider to the Gnome interface so that we can browse through streams

  There is a problem with the slider: we sometimes get unexpected async
  replies, which would mean that we don't properly lock our Xlib calls.
  Which is true. But we also get these errors when using `--vout dummy'.
  I'll investigate.
parent e8ceb0e1
...@@ -22,7 +22,7 @@ ac_help="$ac_help ...@@ -22,7 +22,7 @@ ac_help="$ac_help
ac_help="$ac_help ac_help="$ac_help
--disable-optimizations Disable compiler optimizations (default enabled)" --disable-optimizations Disable compiler optimizations (default enabled)"
ac_help="$ac_help ac_help="$ac_help
--enable-dummy dummy audio and video support (default disabled)" --disable-dummy dummy module (default enabled)"
ac_help="$ac_help ac_help="$ac_help
--disable-null Null module (default enabled)" --disable-null Null module (default enabled)"
ac_help="$ac_help ac_help="$ac_help
...@@ -3419,9 +3419,10 @@ else ...@@ -3419,9 +3419,10 @@ else
# Check whether --enable-dummy or --disable-dummy was given. # Check whether --enable-dummy or --disable-dummy was given.
if test "${enable_dummy+set}" = set; then if test "${enable_dummy+set}" = set; then
enableval="$enable_dummy" enableval="$enable_dummy"
if test x$enable_dummy = xyes; then PLUGINS=${PLUGINS}"dummy "; fi :
fi fi
if test x$enable_dummy != xno; then PLUGINS=${PLUGINS}"dummy "; fi
# Check whether --enable-null or --disable-null was given. # Check whether --enable-null or --disable-null was given.
if test "${enable_null+set}" = set; then if test "${enable_null+set}" = set; then
enableval="$enable_null" enableval="$enable_null"
...@@ -3508,17 +3509,17 @@ if test "${enable_alsa+set}" = set; then ...@@ -3508,17 +3509,17 @@ if test "${enable_alsa+set}" = set; then
enableval="$enable_alsa" enableval="$enable_alsa"
if test x$enable_alsa = xyes; then ac_safe=`echo "sys/asoundlib.h" | sed 'y%./+-%__p_%'` if test x$enable_alsa = xyes; then ac_safe=`echo "sys/asoundlib.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/asoundlib.h""... $ac_c" 1>&6 echo $ac_n "checking for sys/asoundlib.h""... $ac_c" 1>&6
echo "configure:3512: checking for sys/asoundlib.h" >&5 echo "configure:3513: checking for sys/asoundlib.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3517 "configure" #line 3518 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/asoundlib.h> #include <sys/asoundlib.h>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3522: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:3523: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -3535,7 +3536,7 @@ fi ...@@ -3535,7 +3536,7 @@ fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6 echo "$ac_t""yes" 1>&6
echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6 echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6
echo "configure:3539: checking for main in -lasound" >&5 echo "configure:3540: checking for main in -lasound" >&5
ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'` ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -3543,14 +3544,14 @@ else ...@@ -3543,14 +3544,14 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lasound $LIBS" LIBS="-lasound $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3547 "configure" #line 3548 "configure"
#include "confdefs.h" #include "confdefs.h"
int main() { int main() {
main() main()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:3554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:3555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
......
...@@ -138,8 +138,8 @@ dnl default case ...@@ -138,8 +138,8 @@ dnl default case
else else
AC_ARG_ENABLE(dummy, AC_ARG_ENABLE(dummy,
[ --enable-dummy dummy audio and video support (default disabled)], [ --disable-dummy dummy module (default enabled)])
[if test x$enable_dummy = xyes; then PLUGINS=${PLUGINS}"dummy "; fi]) if test x$enable_dummy != xno; then PLUGINS=${PLUGINS}"dummy "; fi
AC_ARG_ENABLE(null, AC_ARG_ENABLE(null,
[ --disable-null Null module (default enabled)]) [ --disable-null Null module (default enabled)])
if test x$enable_null != xno; then PLUGINS=${PLUGINS}"null "; fi if test x$enable_null != xno; then PLUGINS=${PLUGINS}"null "; fi
......
...@@ -32,6 +32,9 @@ follows the usual GNU command line syntax, with long ...@@ -32,6 +32,9 @@ follows the usual GNU command line syntax, with long
options starting with two dashes (`-'). options starting with two dashes (`-').
A summary of options is included below. A summary of options is included below.
.TP .TP
.B \-\-intf <module>
Specify an interface module: "gnome", "curses", "shell", for instance.
.TP
.B \-\-noaudio .B \-\-noaudio
Disable audio output. Disable audio output.
.TP .TP
...@@ -45,7 +48,7 @@ Choose stereo or mono audio output ...@@ -45,7 +48,7 @@ Choose stereo or mono audio output
Disable video output. Disable video output.
.TP .TP
.B \-\-vout <module> .B \-\-vout <module>
Specify a video output module: "gnome", "fb", "glide", for instance. Specify a video output module: "x11", "sdl", "fb", for instance.
.TP .TP
.B \-\-motion <module> .B \-\-motion <module>
Specify a module for motion compensation: "motion", "motionmmx", for instance. Specify a module for motion compensation: "motion", "motionmmx", for instance.
...@@ -85,9 +88,6 @@ displaying of all images. ...@@ -85,9 +88,6 @@ displaying of all images.
Note that the vlc is certainly going to crash if you ask it to Note that the vlc is certainly going to crash if you ask it to
display more images than your CPU can cope with. display more images than your CPU can cope with.
.TP .TP
.B \-\-dvd
Activate DVD mode, by directly accessing the DVD drive (no need to mount
it). By default,
.B vlc .B vlc
opens /dev/dvd, but this behaviour may be overridden by the vlc_dvd_device opens /dev/dvd, but this behaviour may be overridden by the vlc_dvd_device
environment variable (see below). environment variable (see below).
...@@ -124,6 +124,7 @@ Output version information and exit. ...@@ -124,6 +124,7 @@ Output version information and exit.
also accepts a lot of parameters to customize its behaviour. also accepts a lot of parameters to customize its behaviour.
.TP .TP
.B Interface parameters: .B Interface parameters:
vlc_intf=<method name> interface method
vlc_init=<filename> initialization script vlc_init=<filename> initialization script
vlc_channels=<filename> channels list vlc_channels=<filename> channels list
warning_level=<level> warning level warning_level=<level> warning level
......
...@@ -129,9 +129,9 @@ typedef struct function_list_s ...@@ -129,9 +129,9 @@ typedef struct function_list_s
void ( * pf_frame_field_##yuv ) ( struct macroblock_s * ); \ void ( * pf_frame_field_##yuv ) ( struct macroblock_s * ); \
void ( * pf_frame_frame_##yuv ) ( struct macroblock_s * ); \ void ( * pf_frame_frame_##yuv ) ( struct macroblock_s * ); \
void ( * pf_frame_dmv_##yuv ) ( struct macroblock_s * ); void ( * pf_frame_dmv_##yuv ) ( struct macroblock_s * );
motion_functions( 420 ) motion_functions( 420 )
motion_functions( 422 ) motion_functions( 422 )
motion_functions( 444 ) motion_functions( 444 )
#undef motion_functions #undef motion_functions
} motion; } motion;
......
/***************************************************************************** /*****************************************************************************
* aout_dummy.c : dummy audio output plugin * aout_dummy.c : dummy audio output plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* *
* Authors: * Authors: Samuel Hocevar <sam@zoy.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -94,8 +94,10 @@ static int aout_Open( aout_thread_t *p_aout ) ...@@ -94,8 +94,10 @@ static int aout_Open( aout_thread_t *p_aout )
{ {
/* Initialize some variables */ /* Initialize some variables */
p_aout->i_format = AOUT_FORMAT_DEFAULT; p_aout->i_format = AOUT_FORMAT_DEFAULT;
p_aout->i_channels = 1 + main_GetIntVariable( AOUT_STEREO_VAR, AOUT_STEREO_DEFAULT ); p_aout->i_channels = 1 + main_GetIntVariable( AOUT_STEREO_VAR,
p_aout->l_rate = main_GetIntVariable( AOUT_RATE_VAR, AOUT_RATE_DEFAULT ); AOUT_STEREO_DEFAULT );
p_aout->l_rate = main_GetIntVariable( AOUT_RATE_VAR,
AOUT_RATE_DEFAULT );
return( 0 ); return( 0 );
} }
......
/***************************************************************************** /*****************************************************************************
* dummy.c : dummy plugin for vlc * dummy.c : dummy plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* *
* Authors: * Authors: Samuel Hocevar <sam@zoy.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -34,10 +34,11 @@ ...@@ -34,10 +34,11 @@
#include "threads.h" #include "threads.h"
#include "mtime.h" #include "mtime.h"
#include "tests.h" #include "tests.h"
#include "plugins.h"
#include "interface.h" #include "interface.h"
#include "audio_output.h" #include "audio_output.h"
#include "video.h" #include "video.h"
#include "video_output.h" #include "video_output.h"
...@@ -56,6 +57,8 @@ MODULE_CONFIG_END ...@@ -56,6 +57,8 @@ MODULE_CONFIG_END
* Capabilities defined in the other files. * Capabilities defined in the other files.
*****************************************************************************/ *****************************************************************************/
extern void aout_getfunctions( function_list_t * p_function_list ); extern void aout_getfunctions( function_list_t * p_function_list );
extern void vout_getfunctions( function_list_t * p_function_list );
extern void intf_getfunctions( function_list_t * p_function_list );
/***************************************************************************** /*****************************************************************************
* InitModule: get the module structure and configuration. * InitModule: get the module structure and configuration.
...@@ -72,7 +75,9 @@ int InitModule( module_t * p_module ) ...@@ -72,7 +75,9 @@ int InitModule( module_t * p_module )
p_module->psz_version = VERSION; p_module->psz_version = VERSION;
p_module->i_capabilities = MODULE_CAPABILITY_NULL p_module->i_capabilities = MODULE_CAPABILITY_NULL
| MODULE_CAPABILITY_AOUT; | MODULE_CAPABILITY_AOUT
| MODULE_CAPABILITY_VOUT
| MODULE_CAPABILITY_INTF;
return( 0 ); return( 0 );
} }
...@@ -94,6 +99,8 @@ int ActivateModule( module_t * p_module ) ...@@ -94,6 +99,8 @@ int ActivateModule( module_t * p_module )
} }
aout_getfunctions( &p_module->p_functions->aout ); aout_getfunctions( &p_module->p_functions->aout );
vout_getfunctions( &p_module->p_functions->vout );
intf_getfunctions( &p_module->p_functions->intf );
p_module->p_config = p_config; p_module->p_config = p_config;
...@@ -114,76 +121,3 @@ int DeactivateModule( module_t * p_module ) ...@@ -114,76 +121,3 @@ int DeactivateModule( module_t * p_module )
return( 0 ); return( 0 );
} }
/* OLD MODULE STRUCTURE -- soon to be removed */
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
static void vout_GetPlugin( p_vout_thread_t p_vout );
static void intf_GetPlugin( p_intf_thread_t p_intf );
/* Video output */
int vout_DummyCreate ( vout_thread_t *p_vout, char *psz_display,
int i_root_window, void *p_data );
int vout_DummyInit ( p_vout_thread_t p_vout );
void vout_DummyEnd ( p_vout_thread_t p_vout );
void vout_DummyDestroy ( p_vout_thread_t p_vout );
int vout_DummyManage ( p_vout_thread_t p_vout );
void vout_DummyDisplay ( p_vout_thread_t p_vout );
void vout_DummySetPalette ( p_vout_thread_t p_vout,
u16 *red, u16 *green, u16 *blue, u16 *transp );
/* Interface */
int intf_DummyCreate ( p_intf_thread_t p_intf );
void intf_DummyDestroy ( p_intf_thread_t p_intf );
void intf_DummyManage ( p_intf_thread_t p_intf );
/*****************************************************************************
* GetConfig: get the plugin structure and configuration
*****************************************************************************/
plugin_info_t * GetConfig( void )
{
plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
p_info->psz_name = "Dummy";
p_info->psz_version = VERSION;
p_info->psz_author = "the VideoLAN team <vlc@videolan.org>";
p_info->aout_GetPlugin = NULL;
p_info->vout_GetPlugin = vout_GetPlugin;
p_info->intf_GetPlugin = intf_GetPlugin;
p_info->yuv_GetPlugin = NULL;
/* The dummy plugin always works, but should have low priority */
p_info->i_score = 0x1;
/* If this plugin was requested, score it higher */
if( TestMethod( VOUT_METHOD_VAR, "dummy" ) )
{
p_info->i_score += 0x200;
}
return( p_info );
}
/*****************************************************************************
* Following functions are only called through the p_info structure
*****************************************************************************/
static void vout_GetPlugin( p_vout_thread_t p_vout )
{
p_vout->p_sys_create = vout_DummyCreate;
p_vout->p_sys_init = vout_DummyInit;
p_vout->p_sys_end = vout_DummyEnd;
p_vout->p_sys_destroy = vout_DummyDestroy;
p_vout->p_sys_manage = vout_DummyManage;
p_vout->p_sys_display = vout_DummyDisplay;
}
static void intf_GetPlugin( p_intf_thread_t p_intf )
{
p_intf->p_sys_create = intf_DummyCreate;
p_intf->p_sys_destroy = intf_DummyDestroy;
p_intf->p_sys_manage = intf_DummyManage;
}
/***************************************************************************** /*****************************************************************************
* intf_dummy.c: dummy interface plugin * intf_dummy.c: dummy interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* *
* Authors: * Authors: Samuel Hocevar <sam@zoy.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -31,13 +31,8 @@ ...@@ -31,13 +31,8 @@
#include "common.h" #include "common.h"
#include "threads.h" #include "threads.h"
#include "mtime.h" #include "mtime.h"
#include "plugins.h" #include "tests.h"
#include "modules.h"
#include "stream_control.h"
#include "input_ext-intf.h"
#include "video.h"
#include "video_output.h"
#include "intf_msg.h" #include "intf_msg.h"
#include "interface.h" #include "interface.h"
...@@ -53,9 +48,45 @@ typedef struct intf_sys_s ...@@ -53,9 +48,45 @@ typedef struct intf_sys_s
} intf_sys_t; } intf_sys_t;
/***************************************************************************** /*****************************************************************************
* intf_DummyCreate: initialize dummy interface * Local prototypes.
*****************************************************************************/
static int intf_Probe ( probedata_t *p_data );
static int intf_Open ( intf_thread_t *p_intf );
static void intf_Close ( intf_thread_t *p_intf );
static void intf_Run ( intf_thread_t *p_intf );
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
void intf_getfunctions( function_list_t * p_function_list )
{
p_function_list->pf_probe = intf_Probe;
p_function_list->functions.intf.pf_open = intf_Open;
p_function_list->functions.intf.pf_close = intf_Close;
p_function_list->functions.intf.pf_run = intf_Run;
}
/*****************************************************************************
* intf_Probe: probe the interface and return a score
*****************************************************************************
* This function tries to initialize Gnome and returns a score to the
* plugin manager so that it can select the best plugin.
*****************************************************************************/
static int intf_Probe( probedata_t *p_data )
{
if( TestMethod( INTF_METHOD_VAR, "dummy" ) )
{
return( 999 );
}
return( 1 );
}
/*****************************************************************************
* intf_Open: initialize dummy interface
*****************************************************************************/ *****************************************************************************/
int intf_DummyCreate( intf_thread_t *p_intf ) static int intf_Open( intf_thread_t *p_intf )
{ {
/* Allocate instance and initialize some members */ /* Allocate instance and initialize some members */
p_intf->p_sys = malloc( sizeof( intf_sys_t ) ); p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
...@@ -64,46 +95,31 @@ int intf_DummyCreate( intf_thread_t *p_intf ) ...@@ -64,46 +95,31 @@ int intf_DummyCreate( intf_thread_t *p_intf )
return( 1 ); return( 1 );
}; };
/* Spawn video output thread */
if( p_main->b_video )
{
p_intf->p_vout = vout_CreateThread( NULL, 0, 0, 0, NULL, 0, NULL );
if( p_intf->p_vout == NULL ) /* error */
{
intf_ErrMsg("intf error: can't create output thread" );
return( 1 );
}
}
return( 0 ); return( 0 );
} }
/***************************************************************************** /*****************************************************************************
* intf_DummyDestroy: destroy dummy interface * intf_Close: destroy dummy interface
*****************************************************************************/ *****************************************************************************/
void intf_DummyDestroy( intf_thread_t *p_intf ) static void intf_Close( intf_thread_t *p_intf )
{ {
/* Close input thread, if any (blocking) */
if( p_intf->p_input )
{
input_DestroyThread( p_intf->p_input, NULL );
}
/* Close video output thread, if any (blocking) */
if( p_intf->p_vout )
{
vout_DestroyThread( p_intf->p_vout, NULL );
}
/* Destroy structure */ /* Destroy structure */
free( p_intf->p_sys ); free( p_intf->p_sys );
} }
/***************************************************************************** /*****************************************************************************
* intf_DummyManage: event loop * intf_Run: main loop
*****************************************************************************/ *****************************************************************************/
void intf_DummyManage( intf_thread_t *p_intf ) static void intf_Run( intf_thread_t *p_intf )
{ {
; while( !p_intf->b_die )
{
/* Manage core vlc functions through the callback */
p_intf->pf_manage( p_intf );
/* Wait a bit */
msleep( INTF_IDLE_SLEEP );
}
} }
/***************************************************************************** /*****************************************************************************
* vout_dummy.c: Dummy video output display method for testing purposes * vout_dummy.c: Dummy video output display method for testing purposes
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* *
* Authors: * Authors: Samuel Hocevar <sam@zoy.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -33,17 +33,18 @@ ...@@ -33,17 +33,18 @@
#include "common.h" #include "common.h"
#include "threads.h" #include "threads.h"
#include "mtime.h" #include "mtime.h"
#include "plugins.h" #include "tests.h"
#include "modules.h"
#include "video.h" #include "video.h"
#include "video_output.h" #include "video_output.h"
#include "intf_msg.h" #include "intf_msg.h"
#define WIDTH 16 #define DUMMY_WIDTH 16
#define HEIGHT 16 #define DUMMY_HEIGHT 16
#define BITS_PER_PLANE 16 #define DUMMY_BITS_PER_PLANE 16
#define BYTES_PER_PIXEL 2 #define DUMMY_BYTES_PER_PIXEL 2
/***************************************************************************** /*****************************************************************************
* vout_sys_t: dummy video output method descriptor * vout_sys_t: dummy video output method descriptor
...@@ -62,16 +63,49 @@ typedef struct vout_sys_s ...@@ -62,16 +63,49 @@ typedef struct vout_sys_s
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
*****************************************************************************/ *****************************************************************************/
static int DummyOpenDisplay ( vout_thread_t *p_vout ); static int vout_Probe ( probedata_t *p_data );
static void DummyCloseDisplay ( vout_thread_t *p_vout ); static int vout_Create ( struct vout_thread_s * );
static int vout_Init ( struct vout_thread_s * );
static void vout_End ( struct vout_thread_s * );
static void vout_Destroy ( struct vout_thread_s * );
static int vout_Manage ( struct vout_thread_s * );
static void vout_Display ( struct vout_thread_s * );
/***************************************************************************** /*****************************************************************************
* vout_DummyCreate: allocates dummy video thread output method * Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
void vout_getfunctions( function_list_t * p_function_list )
{
p_function_list->pf_probe = vout_Probe;
p_function_list->functions.vout.pf_create = vout_Create;
p_function_list->functions.vout.pf_init = vout_Init;
p_function_list->functions.vout.pf_end = vout_End;
p_function_list->functions.vout.pf_destroy = vout_Destroy;
p_function_list->functions.vout.pf_manage = vout_Manage;
p_function_list->functions.vout.pf_display = vout_Display;
p_function_list->functions.vout.pf_setpalette = NULL;
}
/*****************************************************************************