]> git.sesse.net Git - vlc/commitdiff
. autod�tection des plugins
authorSam Hocevar <sam@videolan.org>
Sun, 30 Jul 2000 01:59:50 +0000 (01:59 +0000)
committerSam Hocevar <sam@videolan.org>
Sun, 30 Jul 2000 01:59:50 +0000 (01:59 +0000)
 . les aliases "gvlc" "fbvlc" "ggivlc" fonctionne comme il faut

49 files changed:
Makefile.in
README
include/config.h.in
include/main.h
include/plugins.h
include/plugins_export.h [deleted file]
include/tests.h [new file with mode: 0644]
plugins/beos/aout_beos.cpp
plugins/beos/beos.cpp
plugins/beos/intf_beos.cpp
plugins/beos/vout_beos.cpp
plugins/dsp/aout_dsp.c
plugins/dsp/dsp.c
plugins/dummy/aout_dummy.c
plugins/dummy/dummy.c
plugins/dummy/intf_dummy.c
plugins/dummy/vout_dummy.c
plugins/esd/aout_esd.c
plugins/esd/esd.c
plugins/fb/fb.c
plugins/fb/intf_fb.c
plugins/fb/vout_fb.c
plugins/ggi/ggi.c
plugins/ggi/intf_ggi.c
plugins/ggi/vout_ggi.c
plugins/glide/glide.c
plugins/glide/intf_glide.c
plugins/glide/vout_glide.c
plugins/gnome/gnome.c
plugins/gnome/intf_gnome.c
plugins/gnome/vout_gnome.c
plugins/mga/intf_mga.c
plugins/mga/mga.c
plugins/mga/vout_mga.c
plugins/x11/intf_x11.c
plugins/x11/vout_x11.c
plugins/x11/x11.c
plugins/yuv/video_yuv.c
plugins/yuv/video_yuv16.c
plugins/yuv/yuv.c
plugins/yuvmmx/video_yuv.c
plugins/yuvmmx/yuvmmx.c
src/audio_output/audio_output.c
src/interface/interface.c
src/interface/main.c
src/misc/plugins.c
src/misc/tests.c [new file with mode: 0644]
src/video_output/video_output.c
src/video_parser/vpar_synchro.c

index 2d37bbc60eeff9791146ccb111e863be75c493f7..88a627d0a028f39dfc87f72d65b369dee022034d 100644 (file)
@@ -211,6 +211,7 @@ video_decoder_obj =         video_decoder/video_decoder.o \
                                                video_decoder/vdec_idct.o
 
 misc_obj =                     misc/mtime.o \
+                                               misc/tests.o \
                                                misc/rsc_files.o \
                                                misc/netutils.o \
                                                misc/playlist.o \
diff --git a/README b/README
index 290ce66057542c12bf6d80829aaddd6cc9bad4a5..f4aef212f1fca0a11ce6d5e0c97a38891802213e 100644 (file)
--- a/README
+++ b/README
@@ -45,7 +45,7 @@ information about MPEG and DVD playing. Have a look at the documentation
 section, as well as the bookmarks.
 
 You can also try the OpenDVD site at http://www.opendvd.org/ or the
-the LiVid project at http://www.linuxvideo.org/. They have lots of
+the LiViD project at http://www.linuxvideo.org/. They have lots of
 information, too.
 
 
index 2f5972e67669c1b9ed6eda5c88b568e23566c186..24c9aafb51a2303a9f331b68234c15b67dbf0b8a 100644 (file)
 /* Environment variable containing the display method */
 #define VOUT_METHOD_VAR                 "vlc_vout"
 
+/* Environment variable containing the YUV method */
+#define YUV_METHOD_VAR                  "vlc_yuv"
+
 /* The fallback method */
 #define VOUT_DEFAULT_METHOD             "x11"
 
index b55bc743fc50fad12cd6645f90a7264b0512ac31..9bd0b97ed309514ffc1742d789a8fd2605f45d16 100644 (file)
@@ -38,6 +38,7 @@ typedef struct
     int                    i_argc;           /* command line arguments count */
     char **                ppsz_argv;              /* command line arguments */
     char **                ppsz_env;                /* environment variables */
+    char *                 psz_arg0;         /* program name (whithout path) */
 
     /* Generic settings */
     boolean_t              b_audio;             /* is audio output allowed ? */
index 818e34970b23688bc29a97ec6b9b671d6ac049ac..de1c34a923d811525b236b24fd898199644a22d1 100644 (file)
@@ -43,6 +43,8 @@ typedef struct plugin_info_s
     void *      vout_GetPlugin;
     void *      intf_GetPlugin;
     void *      yuv_GetPlugin;
+
+    int         i_score;
 } plugin_info_t;
 
 typedef struct plugin_bank_s
diff --git a/include/plugins_export.h b/include/plugins_export.h
deleted file mode 100644 (file)
index 04abe77..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*****************************************************************************
- * plugins_export.h : exporting plugins structure
- *****************************************************************************
- * Copyright (C) 1999, 2000 VideoLAN
- *
- * Authors:
- *
- * 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
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- *****************************************************************************/
-
-/*****************************************************************************
- * Prototypes
- *****************************************************************************/
-
-/* audio output */
-int     aout_SysOpen         ( aout_thread_t *p_aout );
-int     aout_SysReset        ( aout_thread_t *p_aout );
-int     aout_SysSetFormat    ( aout_thread_t *p_aout );
-int     aout_SysSetChannels  ( aout_thread_t *p_aout );
-int     aout_SysSetRate      ( aout_thread_t *p_aout );
-long    aout_SysGetBufInfo   ( aout_thread_t *p_aout, long l_buffer_info );
-void    aout_SysPlaySamples  ( aout_thread_t *p_aout, byte_t *buffer,
-                               int i_size );
-void    aout_SysClose        ( aout_thread_t *p_aout );
-
-/* video output */
-int     vout_SysCreate       ( vout_thread_t *p_vout, char *psz_display,
-                               int i_root_window, void *p_data );
-int     vout_SysInit         ( p_vout_thread_t p_vout );
-void    vout_SysEnd          ( p_vout_thread_t p_vout );
-void    vout_SysDestroy      ( p_vout_thread_t p_vout );
-int     vout_SysManage       ( p_vout_thread_t p_vout );
-void    vout_SysDisplay      ( p_vout_thread_t p_vout );
-void    vout_SetPalette      ( p_vout_thread_t p_vout,
-                               u16 *red, u16 *green, u16 *blue, u16 *transp );
-
-/* interface */
-int     intf_SysCreate       ( p_intf_thread_t p_intf );
-void    intf_SysDestroy      ( p_intf_thread_t p_intf );
-void    intf_SysManage       ( p_intf_thread_t p_intf );
-
-/* YUV transformations */
-int     yuv_SysInit          ( p_vout_thread_t p_vout );
-int     yuv_SysReset         ( p_vout_thread_t p_vout );
-void    yuv_SysEnd           ( p_vout_thread_t p_vout );
-
diff --git a/include/tests.h b/include/tests.h
new file mode 100644 (file)
index 0000000..c9104a3
--- /dev/null
@@ -0,0 +1,30 @@
+/*****************************************************************************
+ * tests.h: several test functions needed by the plugins
+ *****************************************************************************
+ * Copyright (C) 1996, 1997, 1998, 1999, 2000 VideoLAN
+ *
+ * Authors:
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Prototypes
+ *****************************************************************************/
+int TestProgram( char * psz_program );
+int TestMethod( char * psz_var, char * psz_method );
+int TestVersion( char * psz_version );
+int TestMMX( void );
+
index 0a2cdd1b82c7e938ccc500e14ebfacf8103e107f..3f16f91f503e535ef292e03cb04279d22698ac13 100644 (file)
@@ -75,9 +75,9 @@ extern "C"
 {
 
 /*****************************************************************************
- * aout_SysOpen: opens a BPushGameSound
+ * aout_BeOpen: opens a BPushGameSound
  *****************************************************************************/
-int aout_SysOpen( aout_thread_t *p_aout )
+int aout_BeOpen( aout_thread_t *p_aout )
 {
     /* Allocate structure */
     p_aout->p_sys = (aout_sys_t*) malloc( sizeof( aout_sys_t ) );
@@ -136,41 +136,41 @@ int aout_SysOpen( aout_thread_t *p_aout )
     return( 0 );
 }
 /*****************************************************************************
- * aout_SysReset: resets the dsp
+ * aout_BeReset: resets the dsp
  *****************************************************************************/
-int aout_SysReset( aout_thread_t *p_aout )
+int aout_BeReset( aout_thread_t *p_aout )
 {
     return( 0 );
 }
 
 /*****************************************************************************
- * aout_SysSetFormat: sets the dsp output format
+ * aout_BeSetFormat: sets the dsp output format
  *****************************************************************************/
-int aout_SysSetFormat( aout_thread_t *p_aout )
+int aout_BeSetFormat( aout_thread_t *p_aout )
 {
     return( 0 );
 }
 
 /*****************************************************************************
- * aout_SysSetChannels: sets the dsp's stereo or mono mode
+ * aout_BeSetChannels: sets the dsp's stereo or mono mode
  *****************************************************************************/
-int aout_SysSetChannels( aout_thread_t *p_aout )
+int aout_BeSetChannels( aout_thread_t *p_aout )
 {
     return( 0 );
 }
 
 /*****************************************************************************
- * aout_SysSetRate: sets the dsp's audio output rate
+ * aout_BeSetRate: sets the dsp's audio output rate
  *****************************************************************************/
-int aout_SysSetRate( aout_thread_t *p_aout )
+int aout_BeSetRate( aout_thread_t *p_aout )
 {
     return( 0 );
 }
 
 /*****************************************************************************
- * aout_SysGetBufInfo: buffer status query
+ * aout_BeGetBufInfo: buffer status query
  *****************************************************************************/
-long aout_SysGetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
+long aout_BeGetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
 {
 
     long i_hard_pos = 4 * p_aout->p_sys->p_sound->CurrentPosition();
@@ -189,11 +189,11 @@ long aout_SysGetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
 }
 
 /*****************************************************************************
- * aout_SysPlaySamples: plays a sound samples buffer
+ * aout_BePlaySamples: plays a sound samples buffer
  *****************************************************************************
  * This function writes a buffer of i_length bytes in the dsp
  *****************************************************************************/
-void aout_SysPlaySamples( aout_thread_t *p_aout, byte_t *buffer, int i_size )
+void aout_BePlaySamples( aout_thread_t *p_aout, byte_t *buffer, int i_size )
 {
     long i_newbuf_pos;
 
@@ -223,9 +223,9 @@ void aout_SysPlaySamples( aout_thread_t *p_aout, byte_t *buffer, int i_size )
 }
 
 /*****************************************************************************
- * aout_SysClose: closes the dsp audio device
+ * aout_BeClose: closes the dsp audio device
  *****************************************************************************/
-void aout_SysClose( aout_thread_t *p_aout )
+void aout_BeClose( aout_thread_t *p_aout )
 {
     p_aout->p_sys->p_sound->UnlockCyclic();
     p_aout->p_sys->p_sound->StopPlaying( );
index 0b92042925f292424f00ad3015092a737f4fe748..b86b2b55826a4766e1e478264033dafb874e872a 100644 (file)
@@ -40,14 +40,39 @@ extern "C"
 #include "video.h"
 #include "video_output.h"
 
-#include "plugins_export.h"
-
 /*****************************************************************************
  * Exported prototypes
  *****************************************************************************/
-void aout_GetPlugin( p_aout_thread_t p_aout );
-void vout_GetPlugin( p_vout_thread_t p_vout );
-void intf_GetPlugin( p_intf_thread_t p_intf );
+static void aout_GetPlugin( p_aout_thread_t p_aout );
+static void vout_GetPlugin( p_vout_thread_t p_vout );
+static void intf_GetPlugin( p_intf_thread_t p_intf );
+
+/* Audio output */
+int     aout_BeOpen         ( aout_thread_t *p_aout );
+int     aout_BeReset        ( aout_thread_t *p_aout );
+int     aout_BeSetFormat    ( aout_thread_t *p_aout );
+int     aout_BeSetChannels  ( aout_thread_t *p_aout );
+int     aout_BeSetRate      ( aout_thread_t *p_aout );
+long    aout_BeGetBufInfo   ( aout_thread_t *p_aout, long l_buffer_info );
+void    aout_BePlaySamples  ( aout_thread_t *p_aout, byte_t *buffer,
+                              int i_size );
+void    aout_BeClose        ( aout_thread_t *p_aout );
+
+/* Video output */
+int     vout_BeCreate       ( vout_thread_t *p_vout, char *psz_display,
+                              int i_root_window, void *p_data );
+int     vout_BeInit         ( p_vout_thread_t p_vout );
+void    vout_BeEnd          ( p_vout_thread_t p_vout );
+void    vout_BeDestroy      ( p_vout_thread_t p_vout );
+int     vout_BeManage       ( p_vout_thread_t p_vout );
+void    vout_BeDisplay      ( p_vout_thread_t p_vout );
+void    vout_BeSetPalette   ( p_vout_thread_t p_vout,
+                              u16 *red, u16 *green, u16 *blue, u16 *transp );
+
+/* Interface */
+int     intf_BeCreate       ( p_intf_thread_t p_intf );
+void    intf_BeDestroy      ( p_intf_thread_t p_intf );
+void    intf_BeManage       ( p_intf_thread_t p_intf );
 
 /*****************************************************************************
  * GetConfig: get the plugin structure and configuration
@@ -65,49 +90,43 @@ plugin_info_t * GetConfig( void )
     p_info->intf_GetPlugin = intf_GetPlugin;
     p_info->yuv_GetPlugin = NULL;
 
-    return( p_info );
-}
+    /* the beos plugin always works under BeOS :) */
+    p_info->i_score = 0x800;
 
-/*****************************************************************************
- * Test: tests if the plugin can be launched
- *****************************************************************************/
-int Test( void )
-{
-    /* the BeOS plugin always works under BeOS :) */
-    return( 1 );
+    return( p_info );
 }
 
 /*****************************************************************************
  * Following functions are only called through the p_info structure
  *****************************************************************************/
 
-void aout_GetPlugin( p_aout_thread_t p_aout )
+static void aout_GetPlugin( p_aout_thread_t p_aout )
 {
-    p_aout->p_sys_open        = aout_SysOpen;
-    p_aout->p_sys_reset       = aout_SysReset;
-    p_aout->p_sys_setformat   = aout_SysSetFormat;
-    p_aout->p_sys_setchannels = aout_SysSetChannels;
-    p_aout->p_sys_setrate     = aout_SysSetRate;
-    p_aout->p_sys_getbufinfo  = aout_SysGetBufInfo;
-    p_aout->p_sys_playsamples = aout_SysPlaySamples;
-    p_aout->p_sys_close       = aout_SysClose;
+    p_aout->p_sys_open        = aout_BeOpen;
+    p_aout->p_sys_reset       = aout_BeReset;
+    p_aout->p_sys_setformat   = aout_BeSetFormat;
+    p_aout->p_sys_setchannels = aout_BeSetChannels;
+    p_aout->p_sys_setrate     = aout_BeSetRate;
+    p_aout->p_sys_getbufinfo  = aout_BeGetBufInfo;
+    p_aout->p_sys_playsamples = aout_BePlaySamples;
+    p_aout->p_sys_close       = aout_BeClose;
 }
 
-void vout_GetPlugin( p_vout_thread_t p_vout )
+static void vout_GetPlugin( p_vout_thread_t p_vout )
 {
-    p_vout->p_sys_create  = vout_SysCreate;
-    p_vout->p_sys_init    = vout_SysInit;
-    p_vout->p_sys_end     = vout_SysEnd;
-    p_vout->p_sys_destroy = vout_SysDestroy;
-    p_vout->p_sys_manage  = vout_SysManage;
-    p_vout->p_sys_display = vout_SysDisplay;
+    p_vout->p_sys_create  = vout_BeCreate;
+    p_vout->p_sys_init    = vout_BeInit;
+    p_vout->p_sys_end     = vout_BeEnd;
+    p_vout->p_sys_destroy = vout_BeDestroy;
+    p_vout->p_sys_manage  = vout_BeManage;
+    p_vout->p_sys_display = vout_BeDisplay;
 }
 
-void intf_GetPlugin( p_intf_thread_t p_intf )
+static void intf_GetPlugin( p_intf_thread_t p_intf )
 {
-    p_intf->p_sys_create  = intf_SysCreate;
-    p_intf->p_sys_destroy = intf_SysDestroy;
-    p_intf->p_sys_manage  = intf_SysManage;
+    p_intf->p_sys_create  = intf_BeCreate;
+    p_intf->p_sys_destroy = intf_BeDestroy;
+    p_intf->p_sys_manage  = intf_BeManage;
 }
 
 } /* extern "C" */
index 51c13eb6fa4c339e79b539124fcac646f7986295..711841019067505c7f7c00578388a8718b890d64 100644 (file)
@@ -125,9 +125,9 @@ extern "C"
 {
 
 /*****************************************************************************
- * intf_SysCreate: initialize dummy interface
+ * intf_BeCreate: initialize dummy interface
  *****************************************************************************/
-int intf_SysCreate( intf_thread_t *p_intf )
+int intf_BeCreate( intf_thread_t *p_intf )
 {
     /* Allocate instance and initialize some members */
     p_intf->p_sys = (intf_sys_t*) malloc( sizeof( intf_sys_t ) );
@@ -162,9 +162,9 @@ int intf_SysCreate( intf_thread_t *p_intf )
 }
 
 /*****************************************************************************
- * intf_SysDestroy: destroy dummy interface
+ * intf_BeDestroy: destroy dummy interface
  *****************************************************************************/
-void intf_SysDestroy( intf_thread_t *p_intf )
+void intf_BeDestroy( intf_thread_t *p_intf )
 {
     /* Close input thread, if any (blocking) */
     if( p_intf->p_input )
@@ -188,9 +188,9 @@ void intf_SysDestroy( intf_thread_t *p_intf )
 
 
 /*****************************************************************************
- * intf_SysManage: event loop
+ * intf_BeManage: event loop
  *****************************************************************************/
-void intf_SysManage( intf_thread_t *p_intf )
+void intf_BeManage( intf_thread_t *p_intf )
 {
     if( p_intf->p_sys->i_key != -1 )
     {
index 979ea3f6d489185c1cfae8837707fd1dfce5da03..dfb1224852b5842ee9eb68db4d4bbeeff2ec4fdb 100644 (file)
@@ -340,11 +340,11 @@ static int     BeosOpenDisplay   ( vout_thread_t *p_vout );
 static void    BeosCloseDisplay  ( vout_thread_t *p_vout );
 
 /*****************************************************************************
- * vout_SysCreate: allocates dummy video thread output method
+ * vout_BeCreate: allocates dummy video thread output method
  *****************************************************************************
  * This function allocates and initializes a dummy vout method.
  *****************************************************************************/
-int vout_SysCreate( vout_thread_t *p_vout, char *psz_display,
+int vout_BeCreate( vout_thread_t *p_vout, char *psz_display,
                     int i_root_window, void *p_data )
 {
     /* Allocate structure */
@@ -371,9 +371,9 @@ int vout_SysCreate( vout_thread_t *p_vout, char *psz_display,
 }
 
 /*****************************************************************************
- * vout_SysInit: initialize dummy video thread output method
+ * vout_BeInit: initialize dummy video thread output method
  *****************************************************************************/
-int vout_SysInit( vout_thread_t *p_vout )
+int vout_BeInit( vout_thread_t *p_vout )
 {
     VideoWindow * p_win = p_vout->p_sys->p_window;
     u32 i_page_size;
@@ -406,9 +406,9 @@ int vout_SysInit( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_SysEnd: terminate dummy video thread output method
+ * vout_BeEnd: terminate dummy video thread output method
  *****************************************************************************/
-void vout_SysEnd( vout_thread_t *p_vout )
+void vout_BeEnd( vout_thread_t *p_vout )
 {
    VideoWindow * p_win = p_vout->p_sys->p_window;
    
@@ -422,11 +422,11 @@ void vout_SysEnd( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_SysDestroy: destroy dummy video thread output method
+ * vout_BeDestroy: destroy dummy video thread output method
  *****************************************************************************
  * Terminate an output method created by DummyCreateOutputMethod
  *****************************************************************************/
-void vout_SysDestroy( vout_thread_t *p_vout )
+void vout_BeDestroy( vout_thread_t *p_vout )
 {
     BeosCloseDisplay( p_vout );
     
@@ -434,12 +434,12 @@ void vout_SysDestroy( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_SysManage: handle dummy events
+ * vout_BeManage: handle dummy events
  *****************************************************************************
  * This function should be called regularly by video output thread. It manages
  * console events. It returns a non null value on error.
  *****************************************************************************/
-int vout_SysManage( vout_thread_t *p_vout )
+int vout_BeManage( vout_thread_t *p_vout )
 {
     if( p_vout->i_changes & VOUT_SIZE_CHANGE )
     {
@@ -468,12 +468,12 @@ int vout_SysManage( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_SysDisplay: displays previously rendered output
+ * vout_BeDisplay: displays previously rendered output
  *****************************************************************************
  * This function send the currently rendered image to dummy image, waits until
  * it is displayed and switch the two rendering buffers, preparing next frame.
  *****************************************************************************/
-void vout_SysDisplay( vout_thread_t *p_vout )
+void vout_BeDisplay( vout_thread_t *p_vout )
 {
     VideoWindow * p_win = p_vout->p_sys->p_window;
     
index 157ce257e4c9ce6a5d1596b014e967af79e74b1f..5828a87c8105d9b6e5bff92bca5300489a4e89b3 100644 (file)
 
 /* TODO:
  *
- * - an aout_sysGetFormats() function
+ * - an aout_DspGetFormats() function
  * - dsp inline/static
  * - make this library portable (see mpg123)
- * - macroify aout_sysPlaySamples &/| aout_sysGetBufInfo ?
+ * - macroify aout_DspPlaySamples &/| aout_DspGetBufInfo ?
  *
  */
 
@@ -74,12 +74,12 @@ typedef struct aout_sys_s
 } aout_sys_t;
 
 /*****************************************************************************
- * aout_SysOpen: opens the audio device (the digital sound processor)
+ * aout_DspOpen: opens the audio device (the digital sound processor)
  *****************************************************************************
  * - This function opens the dsp as an usual non-blocking write-only file, and
  *   modifies the p_aout->p_sys->i_fd with the file's descriptor.
  *****************************************************************************/
-int aout_SysOpen( aout_thread_t *p_aout )
+int aout_DspOpen( aout_thread_t *p_aout )
 {
     /* Allocate structure */
     p_aout->p_sys = malloc( sizeof( aout_sys_t ) );
@@ -106,9 +106,9 @@ int aout_SysOpen( aout_thread_t *p_aout )
 }
 
 /*****************************************************************************
- * aout_SysReset: resets the dsp
+ * aout_DspReset: resets the dsp
  *****************************************************************************/
-int aout_SysReset( aout_thread_t *p_aout )
+int aout_DspReset( aout_thread_t *p_aout )
 {
     if ( ioctl( p_aout->i_fd, SNDCTL_DSP_RESET, NULL ) < 0 )
     {
@@ -120,13 +120,13 @@ int aout_SysReset( aout_thread_t *p_aout )
 }
 
 /*****************************************************************************
- * aout_SysSetFormat: sets the dsp output format
+ * aout_DspSetFormat: sets the dsp output format
  *****************************************************************************
  * This functions tries to initialize the dsp output format with the value
  * contained in the dsp structure, and if this value could not be set, the
  * default value returned by ioctl is set.
  *****************************************************************************/
-int aout_SysSetFormat( aout_thread_t *p_aout )
+int aout_DspSetFormat( aout_thread_t *p_aout )
 {
     int i_format;
 
@@ -147,11 +147,11 @@ int aout_SysSetFormat( aout_thread_t *p_aout )
 }
 
 /*****************************************************************************
- * aout_SysSetChannels: sets the dsp's stereo or mono mode
+ * aout_DspSetChannels: sets the dsp's stereo or mono mode
  *****************************************************************************
  * This function acts just like the previous one...
  *****************************************************************************/
-int aout_SysSetChannels( aout_thread_t *p_aout )
+int aout_DspSetChannels( aout_thread_t *p_aout )
 {
     boolean_t b_stereo = p_aout->b_stereo;
 
@@ -172,13 +172,13 @@ int aout_SysSetChannels( aout_thread_t *p_aout )
 }
 
 /*****************************************************************************
- * aout_SysSetRate: sets the dsp's audio output rate
+ * aout_DspSetRate: sets the dsp's audio output rate
  *****************************************************************************
  * This function tries to initialize the dsp with the rate contained in the
  * dsp structure, but if the dsp doesn't support this value, the function uses
  * the value returned by ioctl...
  *****************************************************************************/
-int aout_SysSetRate( aout_thread_t *p_aout )
+int aout_DspSetRate( aout_thread_t *p_aout )
 {
     long l_rate;
 
@@ -199,7 +199,7 @@ int aout_SysSetRate( aout_thread_t *p_aout )
 }
 
 /*****************************************************************************
- * aout_SysGetBufInfo: buffer status query
+ * aout_DspGetBufInfo: buffer status query
  *****************************************************************************
  * This function fills in the audio_buf_info structure :
  * - int fragments : number of available fragments (partially usend ones not
@@ -209,7 +209,7 @@ int aout_SysSetRate( aout_thread_t *p_aout )
  * - int bytes : available space in bytes (includes partially used fragments)
  * Note! 'bytes' could be more than fragments*fragsize
  *****************************************************************************/
-long aout_SysGetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
+long aout_DspGetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
 {
     ioctl( p_aout->i_fd, SNDCTL_DSP_GETOSPACE, &p_aout->p_sys->audio_buf );
 
@@ -220,11 +220,11 @@ long aout_SysGetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
 }
 
 /*****************************************************************************
- * aout_SysPlaySamples: plays a sound samples buffer
+ * aout_DspPlaySamples: plays a sound samples buffer
  *****************************************************************************
  * This function writes a buffer of i_length bytes in the dsp
  *****************************************************************************/
-void aout_SysPlaySamples( aout_thread_t *p_aout, byte_t *buffer, int i_size )
+void aout_DspPlaySamples( aout_thread_t *p_aout, byte_t *buffer, int i_size )
 {
     if( p_aout->b_active )
     {
@@ -233,9 +233,9 @@ void aout_SysPlaySamples( aout_thread_t *p_aout, byte_t *buffer, int i_size )
 }
 
 /*****************************************************************************
- * aout_SysClose: closes the dsp audio device
+ * aout_DspClose: closes the dsp audio device
  *****************************************************************************/
-void aout_SysClose( aout_thread_t *p_aout )
+void aout_DspClose( aout_thread_t *p_aout )
 {
     close( p_aout->i_fd );
 }
index 05376bb6ee870ef6aba502e71a2c8cc7a7c8d1ae..78bccbf10fb75d930ea28a1fcbb9a7a08c442a5d 100644 (file)
  *****************************************************************************/
 #include "defs.h"
 
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
 #include <stdlib.h>                                      /* malloc(), free() */
+#include <unistd.h>                                               /* close() */
 
 #include "config.h"
 #include "common.h"                                     /* boolean_t, byte_t */
 #include "threads.h"
 #include "mtime.h"
+#include "tests.h"
 #include "plugins.h"
 
 #include "interface.h"
 #include "video.h"
 #include "video_output.h"
 
-#include "plugins_export.h"
+#include "main.h"
 
 /*****************************************************************************
  * Exported prototypes
  *****************************************************************************/
-void aout_GetPlugin( p_aout_thread_t p_aout );
+static void aout_GetPlugin( p_aout_thread_t p_aout );
+
+/* Audio output */
+int     aout_DspOpen         ( aout_thread_t *p_aout );
+int     aout_DspReset        ( aout_thread_t *p_aout );
+int     aout_DspSetFormat    ( aout_thread_t *p_aout );
+int     aout_DspSetChannels  ( aout_thread_t *p_aout );
+int     aout_DspSetRate      ( aout_thread_t *p_aout );
+long    aout_DspGetBufInfo   ( aout_thread_t *p_aout, long l_buffer_info );
+void    aout_DspPlaySamples  ( aout_thread_t *p_aout, byte_t *buffer,
+                               int i_size );
+void    aout_DspClose        ( aout_thread_t *p_aout );
 
 /*****************************************************************************
  * GetConfig: get the plugin structure and configuration
  *****************************************************************************/
 plugin_info_t * GetConfig( void )
 {
+    int i_fd;
     plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
 
     p_info->psz_name    = "OSS /dev/dsp";
@@ -61,31 +78,40 @@ plugin_info_t * GetConfig( void )
     p_info->intf_GetPlugin = NULL;
     p_info->yuv_GetPlugin  = NULL;
 
-    return( p_info );
-}
+    /* Test if the device can be opened */
+    if ( (i_fd = open( main_GetPszVariable( AOUT_DSP_VAR, AOUT_DSP_DEFAULT ),
+                       O_WRONLY )) < 0 )
+    {
+        p_info->i_score = 0;
+    }
+    else
+    {
+        close( i_fd );
+        p_info->i_score = 0x100;
+    }
 
-/*****************************************************************************
- * Test: tests if the plugin can be launched
- *****************************************************************************/
-int Test( void )
-{
-    /* TODO: check if suitable */
-    return( 1 );
+    /* If this plugin was requested, score it higher */
+    if( TestMethod( AOUT_METHOD_VAR, "dsp" ) )
+    {
+        p_info->i_score += 0x200;
+    }
+
+    return( p_info );
 }
 
 /*****************************************************************************
  * Following functions are only called through the p_info structure
  *****************************************************************************/
 
-void aout_GetPlugin( p_aout_thread_t p_aout )
+static void aout_GetPlugin( p_aout_thread_t p_aout )
 {
-    p_aout->p_sys_open        = aout_SysOpen;
-    p_aout->p_sys_reset       = aout_SysReset;
-    p_aout->p_sys_setformat   = aout_SysSetFormat;
-    p_aout->p_sys_setchannels = aout_SysSetChannels;
-    p_aout->p_sys_setrate     = aout_SysSetRate;
-    p_aout->p_sys_getbufinfo  = aout_SysGetBufInfo;
-    p_aout->p_sys_playsamples = aout_SysPlaySamples;
-    p_aout->p_sys_close       = aout_SysClose;
+    p_aout->p_sys_open        = aout_DspOpen;
+    p_aout->p_sys_reset       = aout_DspReset;
+    p_aout->p_sys_setformat   = aout_DspSetFormat;
+    p_aout->p_sys_setchannels = aout_DspSetChannels;
+    p_aout->p_sys_setrate     = aout_DspSetRate;
+    p_aout->p_sys_getbufinfo  = aout_DspGetBufInfo;
+    p_aout->p_sys_playsamples = aout_DspPlaySamples;
+    p_aout->p_sys_close       = aout_DspClose;
 }
 
index ae0563369d051e108dda6481747b502877ae98bf..8aa1cdc810a31cf452bc1df9fc20c36fd221d835 100644 (file)
@@ -48,9 +48,9 @@ typedef struct aout_sys_s
 } aout_sys_t;
 
 /*****************************************************************************
- * aout_SysOpen: opens a dummy audio device
+ * aout_DummyOpen: opens a dummy audio device
  *****************************************************************************/
-int aout_SysOpen( aout_thread_t *p_aout )
+int aout_DummyOpen( aout_thread_t *p_aout )
 {
     /* Initialize some variables */
     p_aout->i_format = AOUT_DEFAULT_FORMAT;
@@ -61,57 +61,57 @@ int aout_SysOpen( aout_thread_t *p_aout )
 }
 
 /*****************************************************************************
- * aout_SysReset: fake reset
+ * aout_DummyReset: fake reset
  *****************************************************************************/
-int aout_SysReset( aout_thread_t *p_aout )
+int aout_DummyReset( aout_thread_t *p_aout )
 {
     return( 0 );
 }
 
 /*****************************************************************************
- * aout_SysSetFormat: pretends to set the dsp output format
+ * aout_DummySetFormat: pretends to set the dsp output format
  *****************************************************************************/
-int aout_SysSetFormat( aout_thread_t *p_aout )
+int aout_DummySetFormat( aout_thread_t *p_aout )
 {
     return( 0 );
 }
 
 /*****************************************************************************
- * aout_SysSetChannels: pretends to set stereo or mono mode
+ * aout_DummySetChannels: pretends to set stereo or mono mode
  *****************************************************************************/
-int aout_SysSetChannels( aout_thread_t *p_aout )
+int aout_DummySetChannels( aout_thread_t *p_aout )
 {
     return( 0 );
 }
 
 /*****************************************************************************
- * aout_SysSetRate: pretends to set audio output rate
+ * aout_DummySetRate: pretends to set audio output rate
  *****************************************************************************/
-int aout_SysSetRate( aout_thread_t *p_aout )
+int aout_DummySetRate( aout_thread_t *p_aout )
 {
     return( 0 );
 }
 
 /*****************************************************************************
- * aout_SysGetBufInfo: returns available bytes in buffer
+ * aout_DummyGetBufInfo: returns available bytes in buffer
  *****************************************************************************/
-long aout_SysGetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
+long aout_DummyGetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
 {
     return( 2 * l_buffer_limit );               /* value big enough to sleep */
 }
 
 /*****************************************************************************
- * aout_SysPlaySamples: pretends to play a sound
+ * aout_DummyPlaySamples: pretends to play a sound
  *****************************************************************************/
-void aout_SysPlaySamples( aout_thread_t *p_aout, byte_t *buffer, int i_size )
+void aout_DummyPlaySamples( aout_thread_t *p_aout, byte_t *buffer, int i_size )
 {
     ;
 }
 
 /*****************************************************************************
- * aout_SysClose: closes the dummy audio device
+ * aout_DummyClose: closes the dummy audio device
  *****************************************************************************/
-void aout_SysClose( aout_thread_t *p_aout )
+void aout_DummyClose( aout_thread_t *p_aout )
 {
     ;
 }
index 28a091da7a4d42c4281ad4577f855c393b78a018..6113b3e7df683d2bdd1d8fcd531bedb414278187 100644 (file)
@@ -31,6 +31,7 @@
 #include "common.h"                                     /* boolean_t, byte_t */
 #include "threads.h"
 #include "mtime.h"
+#include "tests.h"
 #include "plugins.h"
 
 #include "interface.h"
 #include "video.h"
 #include "video_output.h"
 
-#include "plugins_export.h"
-
 /*****************************************************************************
  * Exported prototypes
  *****************************************************************************/
-void aout_GetPlugin( p_aout_thread_t p_aout );
-void vout_GetPlugin( p_vout_thread_t p_vout );
-void intf_GetPlugin( p_intf_thread_t p_intf );
+static void aout_GetPlugin( p_aout_thread_t p_aout );
+static void vout_GetPlugin( p_vout_thread_t p_vout );
+static void intf_GetPlugin( p_intf_thread_t p_intf );
+
+/* Audio output */
+int     aout_DummyOpen         ( aout_thread_t *p_aout );
+int     aout_DummyReset        ( aout_thread_t *p_aout );
+int     aout_DummySetFormat    ( aout_thread_t *p_aout );
+int     aout_DummySetChannels  ( aout_thread_t *p_aout );
+int     aout_DummySetRate      ( aout_thread_t *p_aout );
+long    aout_DummyGetBufInfo   ( aout_thread_t *p_aout, long l_buffer_info );
+void    aout_DummyPlaySamples  ( aout_thread_t *p_aout, byte_t *buffer,
+                                 int i_size );
+void    aout_DummyClose        ( aout_thread_t *p_aout );
+
+/* 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
@@ -63,48 +89,55 @@ plugin_info_t * GetConfig( void )
     p_info->intf_GetPlugin = intf_GetPlugin;
     p_info->yuv_GetPlugin  = NULL;
 
-    return( p_info );
-}
+    /* The dummy plugin always works, but should have low priority */
+    p_info->i_score = 0x1;
 
-/*****************************************************************************
- * Test: tests if the plugin can be launched
- *****************************************************************************/
-int Test( void )
-{
-    /* the dummy plugin always works */
-    return( 1 );
+    /* If this plugin was requested, score it higher */
+    if( TestMethod( VOUT_METHOD_VAR, "dummy" ) )
+    {
+        p_info->i_score += 0x200;
+    }
+
+    /* If this plugin was requested, score it higher */
+    if( TestMethod( AOUT_METHOD_VAR, "dummy" ) )
+    {
+        p_info->i_score += 0x200;
+    }
+
+
+    return( p_info );
 }
 
 /*****************************************************************************
  * Following functions are only called through the p_info structure
  *****************************************************************************/
 
-void aout_GetPlugin( p_aout_thread_t p_aout )
+static void aout_GetPlugin( p_aout_thread_t p_aout )
 {
-    p_aout->p_sys_open        = aout_SysOpen;
-    p_aout->p_sys_reset       = aout_SysReset;
-    p_aout->p_sys_setformat   = aout_SysSetFormat;
-    p_aout->p_sys_setchannels = aout_SysSetChannels;
-    p_aout->p_sys_setrate     = aout_SysSetRate;
-    p_aout->p_sys_getbufinfo  = aout_SysGetBufInfo;
-    p_aout->p_sys_playsamples = aout_SysPlaySamples;
-    p_aout->p_sys_close       = aout_SysClose;
+    p_aout->p_sys_open        = aout_DummyOpen;
+    p_aout->p_sys_reset       = aout_DummyReset;
+    p_aout->p_sys_setformat   = aout_DummySetFormat;
+    p_aout->p_sys_setchannels = aout_DummySetChannels;
+    p_aout->p_sys_setrate     = aout_DummySetRate;
+    p_aout->p_sys_getbufinfo  = aout_DummyGetBufInfo;
+    p_aout->p_sys_playsamples = aout_DummyPlaySamples;
+    p_aout->p_sys_close       = aout_DummyClose;
 }
 
-void vout_GetPlugin( p_vout_thread_t p_vout )
+static void vout_GetPlugin( p_vout_thread_t p_vout )
 {
-    p_vout->p_sys_create  = vout_SysCreate;
-    p_vout->p_sys_init    = vout_SysInit;
-    p_vout->p_sys_end     = vout_SysEnd;
-    p_vout->p_sys_destroy = vout_SysDestroy;
-    p_vout->p_sys_manage  = vout_SysManage;
-    p_vout->p_sys_display = vout_SysDisplay;
+    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;
 }
 
-void intf_GetPlugin( p_intf_thread_t p_intf )
+static void intf_GetPlugin( p_intf_thread_t p_intf )
 {
-    p_intf->p_sys_create  = intf_SysCreate;
-    p_intf->p_sys_destroy = intf_SysDestroy;
-    p_intf->p_sys_manage  = intf_SysManage;
+    p_intf->p_sys_create  = intf_DummyCreate;
+    p_intf->p_sys_destroy = intf_DummyDestroy;
+    p_intf->p_sys_manage  = intf_DummyManage;
 }
 
index 0e04a908014c41f6381ba37c47e41bedadec6ab1..911c0eec3e2315031fcd7a6bde370cdc63277902 100644 (file)
@@ -53,9 +53,9 @@ typedef struct intf_sys_s
 } intf_sys_t;
 
 /*****************************************************************************
- * intf_SysCreate: initialize dummy interface
+ * intf_DummyCreate: initialize dummy interface
  *****************************************************************************/
-int intf_SysCreate( intf_thread_t *p_intf )
+int intf_DummyCreate( intf_thread_t *p_intf )
 {
     /* Allocate instance and initialize some members */
     p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
@@ -78,9 +78,9 @@ int intf_SysCreate( intf_thread_t *p_intf )
 }
 
 /*****************************************************************************
- * intf_SysDestroy: destroy dummy interface
+ * intf_DummyDestroy: destroy dummy interface
  *****************************************************************************/
-void intf_SysDestroy( intf_thread_t *p_intf )
+void intf_DummyDestroy( intf_thread_t *p_intf )
 {
     /* Close input thread, if any (blocking) */
     if( p_intf->p_input )
@@ -100,9 +100,9 @@ void intf_SysDestroy( intf_thread_t *p_intf )
 
 
 /*****************************************************************************
- * intf_SysManage: event loop
+ * intf_DummyManage: event loop
  *****************************************************************************/
-void intf_SysManage( intf_thread_t *p_intf )
+void intf_DummyManage( intf_thread_t *p_intf )
 {
     ;
 }
index fda4744a2dbc316d35da355b3df6d283987b2fc4..10937363bd51eddc95b957a353f689b79b3a457d 100644 (file)
@@ -66,11 +66,11 @@ static int     DummyOpenDisplay   ( vout_thread_t *p_vout );
 static void    DummyCloseDisplay  ( vout_thread_t *p_vout );
 
 /*****************************************************************************
- * vout_SysCreate: allocates dummy video thread output method
+ * vout_DummyCreate: allocates dummy video thread output method
  *****************************************************************************
  * This function allocates and initializes a dummy vout method.
  *****************************************************************************/
-int vout_SysCreate( vout_thread_t *p_vout, char *psz_display,
+int vout_DummyCreate( vout_thread_t *p_vout, char *psz_display,
                     int i_root_window, void *p_data )
 {
     /* Allocate structure */
@@ -93,50 +93,50 @@ int vout_SysCreate( vout_thread_t *p_vout, char *psz_display,
 }
 
 /*****************************************************************************
- * vout_SysInit: initialize dummy video thread output method
+ * vout_DummyInit: initialize dummy video thread output method
  *****************************************************************************/
-int vout_SysInit( vout_thread_t *p_vout )
+int vout_DummyInit( vout_thread_t *p_vout )
 {
     return( 0 );
 }
 
 /*****************************************************************************
- * vout_SysEnd: terminate dummy video thread output method
+ * vout_DummyEnd: terminate dummy video thread output method
  *****************************************************************************/
-void vout_SysEnd( vout_thread_t *p_vout )
+void vout_DummyEnd( vout_thread_t *p_vout )
 {
     ;
 }
 
 /*****************************************************************************
- * vout_SysDestroy: destroy dummy video thread output method
+ * vout_DummyDestroy: destroy dummy video thread output method
  *****************************************************************************
  * Terminate an output method created by DummyCreateOutputMethod
  *****************************************************************************/
-void vout_SysDestroy( vout_thread_t *p_vout )
+void vout_DummyDestroy( vout_thread_t *p_vout )
 {
     DummyCloseDisplay( p_vout );
     free( p_vout->p_sys );
 }
 
 /*****************************************************************************
- * vout_SysManage: handle dummy events
+ * vout_DummyManage: handle dummy events
  *****************************************************************************
  * This function should be called regularly by video output thread. It manages
  * console events. It returns a non null value on error.
  *****************************************************************************/
-int vout_SysManage( vout_thread_t *p_vout )
+int vout_DummyManage( vout_thread_t *p_vout )
 {
     return( 0 );
 }
 
 /*****************************************************************************
- * vout_SysDisplay: displays previously rendered output
+ * vout_DummyDisplay: displays previously rendered output
  *****************************************************************************
  * This function send the currently rendered image to dummy image, waits until
  * it is displayed and switch the two rendering buffers, preparing next frame.
  *****************************************************************************/
-void vout_SysDisplay( vout_thread_t *p_vout )
+void vout_DummyDisplay( vout_thread_t *p_vout )
 {
     ;
 }
index c7a42bfcda2dc2fe6240cb85770a367c179f4595..62b188b2fa1f48b55e7df135028f9d0a69abcd20 100644 (file)
@@ -64,15 +64,16 @@ typedef struct aout_sys_s
 } aout_sys_t;
 
 /*****************************************************************************
- * aout_SysOpen: opens an esd socket
+ * aout_EsdOpen: opens an esd socket
  *****************************************************************************/
-int aout_SysOpen( aout_thread_t *p_aout )
+int aout_EsdOpen( aout_thread_t *p_aout )
 {
     /* mpg123 does it this way */
     int i_bits = ESD_BITS16;
     int i_mode = ESD_STREAM;
     int i_func = ESD_PLAY;
 
+    fprintf(stderr, "aout-esd !!\n");
     /* Allocate structure */
     p_aout->p_sys = malloc( sizeof( aout_sys_t ) );
     if( p_aout->p_sys == NULL )
@@ -112,52 +113,52 @@ int aout_SysOpen( aout_thread_t *p_aout )
 }
 
 /*****************************************************************************
- * aout_SysReset: resets the dsp
+ * aout_EsdReset: resets the dsp
  *****************************************************************************/
-int aout_SysReset( aout_thread_t *p_aout )
+int aout_EsdReset( aout_thread_t *p_aout )
 {
     return( 0 );
 }
 
 /*****************************************************************************
- * aout_SysSetFormat: sets the dsp output format
+ * aout_EsdSetFormat: sets the dsp output format
  *****************************************************************************/
-int aout_SysSetFormat( aout_thread_t *p_aout )
+int aout_EsdSetFormat( aout_thread_t *p_aout )
 {
     return( 0 );
 }
 
 /*****************************************************************************
- * aout_SysSetChannels: sets the dsp's stereo or mono mode
+ * aout_EsdSetChannels: sets the dsp's stereo or mono mode
  *****************************************************************************/
-int aout_SysSetChannels( aout_thread_t *p_aout )
+int aout_EsdSetChannels( aout_thread_t *p_aout )
 {
     return( 0 );
 }
 
 /*****************************************************************************
- * aout_SysSetRate: sets the dsp's audio output rate
+ * aout_EsdSetRate: sets the dsp's audio output rate
  *****************************************************************************/
-int aout_SysSetRate( aout_thread_t *p_aout )
+int aout_EsdSetRate( aout_thread_t *p_aout )
 {
     return( 0 );
 }
 
 /*****************************************************************************
- * aout_SysGetBufInfo: buffer status query
+ * aout_EsdGetBufInfo: buffer status query
  *****************************************************************************/
-long aout_SysGetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
+long aout_EsdGetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
 {
     /* arbitrary value that should be changed */
     return( l_buffer_limit );
 }
 
 /*****************************************************************************
- * aout_SysPlaySamples: plays a sound samples buffer
+ * aout_EsdPlaySamples: plays a sound samples buffer
  *****************************************************************************
  * This function writes a buffer of i_length bytes in the dsp
  *****************************************************************************/
-void aout_SysPlaySamples( aout_thread_t *p_aout, byte_t *buffer, int i_size )
+void aout_EsdPlaySamples( aout_thread_t *p_aout, byte_t *buffer, int i_size )
 {
     int amount;
 
@@ -182,9 +183,9 @@ void aout_SysPlaySamples( aout_thread_t *p_aout, byte_t *buffer, int i_size )
 }
 
 /*****************************************************************************
- * aout_SysClose: closes the dsp audio device
+ * aout_EsdClose: closes the dsp audio device
  *****************************************************************************/
-void aout_SysClose( aout_thread_t *p_aout )
+void aout_EsdClose( aout_thread_t *p_aout )
 {
     close( p_aout->i_fd );
 }
index afde0602e216cf5bd9a7cce232496cb4bdf2ebfc..ee35ec897d6bcf9d28add2bf8ad046892067cba4 100644 (file)
@@ -31,6 +31,7 @@
 #include "common.h"                                     /* boolean_t, byte_t */
 #include "threads.h"
 #include "mtime.h"
+#include "tests.h"
 #include "plugins.h"
 
 #include "interface.h"
 #include "video.h"
 #include "video_output.h"
 
-#include "plugins_export.h"
-
 /*****************************************************************************
  * Exported prototypes
  *****************************************************************************/
-void aout_GetPlugin( p_aout_thread_t p_aout );
+static void aout_GetPlugin( p_aout_thread_t p_aout );
+
+/* Audio output */
+int     aout_EsdOpen         ( aout_thread_t *p_aout );
+int     aout_EsdReset        ( aout_thread_t *p_aout );
+int     aout_EsdSetFormat    ( aout_thread_t *p_aout );
+int     aout_EsdSetChannels  ( aout_thread_t *p_aout );
+int     aout_EsdSetRate      ( aout_thread_t *p_aout );
+long    aout_EsdGetBufInfo   ( aout_thread_t *p_aout, long l_buffer_info );
+void    aout_EsdPlaySamples  ( aout_thread_t *p_aout, byte_t *buffer,
+                               int i_size );
+void    aout_EsdClose        ( aout_thread_t *p_aout );
 
 /*****************************************************************************
  * GetConfig: get the plugin structure and configuration
@@ -61,31 +71,31 @@ plugin_info_t * GetConfig( void )
     p_info->intf_GetPlugin = NULL;
     p_info->yuv_GetPlugin  = NULL;
 
-    return( p_info );
-}
+    /* esound should always work, but score it lower than DSP */
+    p_info->i_score = 0x100;
 
-/*****************************************************************************
- * Test: tests if the plugin can be launched
- *****************************************************************************/
-int Test( void )
-{
-    /* TODO: check if suitable */
-    return( 1 );
+    /* If this plugin was requested, score it higher */
+    if( TestMethod( AOUT_METHOD_VAR, "esd" ) )
+    {
+        p_info->i_score += 0x200;
+    }
+
+    return( p_info );
 }
 
 /*****************************************************************************
  * Following functions are only called through the p_info structure
  *****************************************************************************/
 
-void aout_GetPlugin( p_aout_thread_t p_aout )
+static void aout_GetPlugin( p_aout_thread_t p_aout )
 {
-    p_aout->p_sys_open        = aout_SysOpen;
-    p_aout->p_sys_reset       = aout_SysReset;
-    p_aout->p_sys_setformat   = aout_SysSetFormat;
-    p_aout->p_sys_setchannels = aout_SysSetChannels;
-    p_aout->p_sys_setrate     = aout_SysSetRate;
-    p_aout->p_sys_getbufinfo  = aout_SysGetBufInfo;
-    p_aout->p_sys_playsamples = aout_SysPlaySamples;
-    p_aout->p_sys_close       = aout_SysClose;
+    p_aout->p_sys_open        = aout_EsdOpen;
+    p_aout->p_sys_reset       = aout_EsdReset;
+    p_aout->p_sys_setformat   = aout_EsdSetFormat;
+    p_aout->p_sys_setchannels = aout_EsdSetChannels;
+    p_aout->p_sys_setrate     = aout_EsdSetRate;
+    p_aout->p_sys_getbufinfo  = aout_EsdGetBufInfo;
+    p_aout->p_sys_playsamples = aout_EsdPlaySamples;
+    p_aout->p_sys_close       = aout_EsdClose;
 }
 
index 836d82a332273ac3171cc59aca309916ac4ceb0e..4f6a571fbc2a3fe8d626163383e6c61b72098f16 100644 (file)
  *****************************************************************************/
 #include "defs.h"
 
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
 #include <stdlib.h>                                      /* malloc(), free() */
+#include <unistd.h>                                               /* close() */
 
 #include "config.h"
 #include "common.h"                                     /* boolean_t, byte_t */
 #include "threads.h"
 #include "mtime.h"
+#include "tests.h"
 #include "plugins.h"
 
 #include "interface.h"
 #include "video.h"
 #include "video_output.h"
 
-#include "plugins_export.h"
+#include "main.h"
 
 /*****************************************************************************
  * Exported prototypes
  *****************************************************************************/
-void vout_GetPlugin( p_vout_thread_t p_vout );
-void intf_GetPlugin( p_intf_thread_t p_intf );
+static void vout_GetPlugin( p_vout_thread_t p_vout );
+static void intf_GetPlugin( p_intf_thread_t p_intf );
+
+/* Video output */
+int     vout_FBCreate       ( vout_thread_t *p_vout, char *psz_display,
+                              int i_root_window, void *p_data );
+int     vout_FBInit         ( p_vout_thread_t p_vout );
+void    vout_FBEnd          ( p_vout_thread_t p_vout );
+void    vout_FBDestroy      ( p_vout_thread_t p_vout );
+int     vout_FBManage       ( p_vout_thread_t p_vout );
+void    vout_FBDisplay      ( p_vout_thread_t p_vout );
+void    vout_FBSetPalette   ( p_vout_thread_t p_vout,
+                              u16 *red, u16 *green, u16 *blue, u16 *transp );
+
+/* Interface */
+int     intf_FBCreate       ( p_intf_thread_t p_intf );
+void    intf_FBDestroy      ( p_intf_thread_t p_intf );
+void    intf_FBManage       ( p_intf_thread_t p_intf );
 
 /*****************************************************************************
  * GetConfig: get the plugin structure and configuration
  *****************************************************************************/
 plugin_info_t * GetConfig( void )
 {
+    int i_fd;
     plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
 
     p_info->psz_name    = "Linux framebuffer";
@@ -62,39 +84,54 @@ plugin_info_t * GetConfig( void )
     p_info->intf_GetPlugin = intf_GetPlugin;
     p_info->yuv_GetPlugin  = NULL;
 
-    return( p_info );
-}
+    /* Test if the device can be opened */
+    if ( (i_fd = open( main_GetPszVariable( VOUT_FB_DEV_VAR,
+                                            VOUT_FB_DEV_DEFAULT ),
+                       O_RDWR )) < 0 )
+    {
+        p_info->i_score = 0;
+    }
+    else
+    {
+        close( i_fd );
+        p_info->i_score = 0x100;
+    }
 
-/*****************************************************************************
- * Test: tests if the plugin can be launched
- *****************************************************************************/
-int Test( void )
-{
-    /* TODO: detect the framebuffer ioctl()s in the kernel */
-    return( 1 );
+    if( TestProgram( "fbvlc" ) )
+    {
+        p_info->i_score += 0x180;
+    }
+
+    /* If this plugin was requested, score it higher */
+    if( TestMethod( VOUT_METHOD_VAR, "fb" ) )
+    {
+        p_info->i_score += 0x200;
+    }
+
+    return( p_info );
 }
 
 /*****************************************************************************
  * Following functions are only called through the p_info structure
  *****************************************************************************/
 
-void vout_GetPlugin( p_vout_thread_t p_vout )
+static void vout_GetPlugin( p_vout_thread_t p_vout )
 {
-    p_vout->p_sys_create  = vout_SysCreate;
-    p_vout->p_sys_init    = vout_SysInit;
-    p_vout->p_sys_end     = vout_SysEnd;
-    p_vout->p_sys_destroy = vout_SysDestroy;
-    p_vout->p_sys_manage  = vout_SysManage;
-    p_vout->p_sys_display = vout_SysDisplay;
+    p_vout->p_sys_create  = vout_FBCreate;
+    p_vout->p_sys_init    = vout_FBInit;
+    p_vout->p_sys_end     = vout_FBEnd;
+    p_vout->p_sys_destroy = vout_FBDestroy;
+    p_vout->p_sys_manage  = vout_FBManage;
+    p_vout->p_sys_display = vout_FBDisplay;
     
     /* optional functions */
-    p_vout->p_set_palette = vout_SetPalette;
+    p_vout->p_set_palette = vout_FBSetPalette;
 }
 
-void intf_GetPlugin( p_intf_thread_t p_intf )
+static void intf_GetPlugin( p_intf_thread_t p_intf )
 {
-    p_intf->p_sys_create  = intf_SysCreate;
-    p_intf->p_sys_destroy = intf_SysDestroy;
-    p_intf->p_sys_manage  = intf_SysManage;
+    p_intf->p_sys_create  = intf_FBCreate;
+    p_intf->p_sys_destroy = intf_FBDestroy;
+    p_intf->p_sys_manage  = intf_FBManage;
 }
 
index 348b3cc1556300ae2b8e166492fdf3d7a3c5aea0..87c57b9967dd67aef133ab47592a6921bf6f65da 100644 (file)
@@ -82,9 +82,9 @@ static void    FBTextMode                 ( int i_tty_dev );
 static void    FBGfxMode                  ( int i_tty_dev );
 
 /*****************************************************************************
- * intf_SysCreate: initialize and create window
+ * intf_FBCreate: initialize and create window
  *****************************************************************************/
-int intf_SysCreate( intf_thread_t *p_intf )
+int intf_FBCreate( intf_thread_t *p_intf )
 {
     struct sigaction            sig_tty;         /* sigaction for tty change */
     struct vt_mode              vt_mode;                  /* vt current mode */
@@ -194,9 +194,9 @@ int intf_SysCreate( intf_thread_t *p_intf )
 }
 
 /*****************************************************************************
- * intf_SysDestroy: destroy interface window
+ * intf_FBDestroy: destroy interface window
  *****************************************************************************/
-void intf_SysDestroy( intf_thread_t *p_intf )
+void intf_FBDestroy( intf_thread_t *p_intf )
 {
     /* resets the keyboard state */
     tcsetattr(0, 0, &p_intf->p_sys->old_termios);
@@ -222,9 +222,9 @@ void intf_SysDestroy( intf_thread_t *p_intf )
 
 
 /*****************************************************************************
- * intf_SysManage: event loop
+ * intf_FBManage: event loop
  *****************************************************************************/
-void intf_SysManage( intf_thread_t *p_intf )
+void intf_FBManage( intf_thread_t *p_intf )
 {
     unsigned char buf[16];
 
index 15c1e7724259fc795e24c426d3a7c72ac405d12e..27b13a14e59927340187f7248f4f1229fc4d9ba4 100644 (file)
@@ -75,11 +75,11 @@ static int     FBOpenDisplay   ( vout_thread_t *p_vout );
 static void    FBCloseDisplay  ( vout_thread_t *p_vout );
 
 /*****************************************************************************
- * vout_SysCreate: allocates FB video thread output method
+ * vout_FBCreate: allocates FB video thread output method
  *****************************************************************************
  * This function allocates and initializes a FB vout method.
  *****************************************************************************/
-int vout_SysCreate( vout_thread_t *p_vout, char *psz_display,
+int vout_FBCreate( vout_thread_t *p_vout, char *psz_display,
                     int i_root_window, void *p_data )
 {
     /* Allocate structure */
@@ -102,39 +102,39 @@ int vout_SysCreate( vout_thread_t *p_vout, char *psz_display,
 }
 
 /*****************************************************************************
- * vout_SysInit: initialize framebuffer video thread output method
+ * vout_FBInit: initialize framebuffer video thread output method
  *****************************************************************************/
-int vout_SysInit( vout_thread_t *p_vout )
+int vout_FBInit( vout_thread_t *p_vout )
 {
     return( 0 );
 }
 
 /*****************************************************************************
- * vout_SysEnd: terminate FB video thread output method
+ * vout_FBEnd: terminate FB video thread output method
  *****************************************************************************/
-void vout_SysEnd( vout_thread_t *p_vout )
+void vout_FBEnd( vout_thread_t *p_vout )
 {
     ;
 }
 
 /*****************************************************************************
- * vout_SysDestroy: destroy FB video thread output method
+ * vout_FBDestroy: destroy FB video thread output method
  *****************************************************************************
  * Terminate an output method created by vout_CreateOutputMethod
  *****************************************************************************/
-void vout_SysDestroy( vout_thread_t *p_vout )
+void vout_FBDestroy( vout_thread_t *p_vout )
 {
     FBCloseDisplay( p_vout );
     free( p_vout->p_sys );
 }
 
 /*****************************************************************************
- * vout_SysManage: handle FB events
+ * vout_FBManage: handle FB events
  *****************************************************************************
  * This function should be called regularly by video output thread. It manages
  * console events. It returns a non null value on error.
  *****************************************************************************/
-int vout_SysManage( vout_thread_t *p_vout )
+int vout_FBManage( vout_thread_t *p_vout )
 {
     /*
      * Size change
@@ -145,10 +145,10 @@ int vout_SysManage( vout_thread_t *p_vout )
         p_vout->i_changes &= ~VOUT_SIZE_CHANGE;
 
         /* Destroy XImages to change their size */
-        vout_SysEnd( p_vout );
+        vout_FBEnd( p_vout );
 
         /* Recreate XImages. If SysInit failed, the thread can't go on. */
-        if( vout_SysInit( p_vout ) )
+        if( vout_FBInit( p_vout ) )
         {
             intf_ErrMsg("error: can't resize display\n");
             return( 1 );
@@ -166,12 +166,12 @@ int vout_SysManage( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_SysDisplay: displays previously rendered output
+ * vout_FBDisplay: displays previously rendered output
  *****************************************************************************
  * This function send the currently rendered image to FB image, waits until
  * it is displayed and switch the two rendering buffers, preparing next frame.
  *****************************************************************************/
-void vout_SysDisplay( vout_thread_t *p_vout )
+void vout_FBDisplay( vout_thread_t *p_vout )
 {
     /* swap the two Y offsets */
     p_vout->p_sys->var_info.yoffset = p_vout->i_buffer_index ? p_vout->p_sys->var_info.yres : 0;
@@ -184,13 +184,13 @@ void vout_SysDisplay( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_SetPalette: sets an 8 bpp palette
+ * vout_FBSetPalette: sets an 8 bpp palette
  *****************************************************************************
  * This function sets the palette given as an argument. It does not return
  * anything, but could later send information on which colors it was unable
  * to set.
  *****************************************************************************/
-void vout_SetPalette( p_vout_thread_t p_vout,
+void vout_FBSetPalette( p_vout_thread_t p_vout,
                       u16 *red, u16 *green, u16 *blue, u16 *transp )
 {
     struct fb_cmap cmap = { 0, 256, red, green, blue, transp };
index 2ff0e107feb58022afcaa0679283253b53db7ae9..3dd6a7819fa3d14d0f4dcfdcfd469ef45d8ab4c7 100644 (file)
@@ -31,6 +31,7 @@
 #include "common.h"                                     /* boolean_t, byte_t */
 #include "threads.h"
 #include "mtime.h"
+#include "tests.h"
 #include "plugins.h"
 
 #include "interface.h"
 #include "video.h"
 #include "video_output.h"
 
-#include "plugins_export.h"
-
 /*****************************************************************************
  * Exported prototypes
  *****************************************************************************/
-void vout_GetPlugin( p_vout_thread_t p_vout );
-void intf_GetPlugin( p_intf_thread_t p_intf );
+static void vout_GetPlugin( p_vout_thread_t p_vout );
+static void intf_GetPlugin( p_intf_thread_t p_intf );
+
+/* Video output */
+int     vout_GGICreate       ( vout_thread_t *p_vout, char *psz_display,
+                               int i_root_window, void *p_data );
+int     vout_GGIInit         ( p_vout_thread_t p_vout );
+void    vout_GGIEnd          ( p_vout_thread_t p_vout );
+void    vout_GGIDestroy      ( p_vout_thread_t p_vout );
+int     vout_GGIManage       ( p_vout_thread_t p_vout );
+void    vout_GGIDisplay      ( p_vout_thread_t p_vout );
+void    vout_GGISetPalette   ( p_vout_thread_t p_vout,
+                               u16 *red, u16 *green, u16 *blue, u16 *transp );
+
+/* Interface */
+int     intf_GGICreate       ( p_intf_thread_t p_intf );
+void    intf_GGIDestroy      ( p_intf_thread_t p_intf );
+void    intf_GGIManage       ( p_intf_thread_t p_intf );
 
 /*****************************************************************************
  * GetConfig: get the plugin structure and configuration
@@ -62,36 +77,42 @@ plugin_info_t * GetConfig( void )
     p_info->intf_GetPlugin = intf_GetPlugin;
     p_info->yuv_GetPlugin  = NULL;
 
-    return( p_info );
-}
+    /* if the GGI libraries are there, assume we can enter the
+     * initialization part at least, even if we fail afterwards */
+    p_info->i_score = 0x100;
 
-/*****************************************************************************
- * Test: tests if the plugin can be launched
- *****************************************************************************/
-int Test( void )
-{
-    /* TODO: detect GGI_DISPLAY or whatever */
-    return( 1 );
+    if( TestProgram( "ggivlc" ) )
+    {
+        p_info->i_score += 0x180;
+    }
+
+    /* If this plugin was requested, score it higher */
+    if( TestMethod( VOUT_METHOD_VAR, "ggi" ) )
+    {
+        p_info->i_score += 0x200;
+    }
+
+    return( p_info );
 }
 
 /*****************************************************************************
  * Following functions are only called through the p_info structure
  *****************************************************************************/
 
-void vout_GetPlugin( p_vout_thread_t p_vout )
+static void vout_GetPlugin( p_vout_thread_t p_vout )
 {
-    p_vout->p_sys_create  = vout_SysCreate;
-    p_vout->p_sys_init    = vout_SysInit;
-    p_vout->p_sys_end     = vout_SysEnd;
-    p_vout->p_sys_destroy = vout_SysDestroy;
-    p_vout->p_sys_manage  = vout_SysManage;
-    p_vout->p_sys_display = vout_SysDisplay;
+    p_vout->p_sys_create  = vout_GGICreate;
+    p_vout->p_sys_init    = vout_GGIInit;
+    p_vout->p_sys_end     = vout_GGIEnd;
+    p_vout->p_sys_destroy = vout_GGIDestroy;
+    p_vout->p_sys_manage  = vout_GGIManage;
+    p_vout->p_sys_display = vout_GGIDisplay;
 }
 
-void intf_GetPlugin( p_intf_thread_t p_intf )
+static void intf_GetPlugin( p_intf_thread_t p_intf )
 {
-    p_intf->p_sys_create  = intf_SysCreate;
-    p_intf->p_sys_destroy = intf_SysDestroy;
-    p_intf->p_sys_manage  = intf_SysManage;
+    p_intf->p_sys_create  = intf_GGICreate;
+    p_intf->p_sys_destroy = intf_GGIDestroy;
+    p_intf->p_sys_manage  = intf_GGIManage;
 }
 
index c22d50752ddf41cf3fdb68e27da978b89cfdff80..46f4217d4cb1387089a0fb93a4c9804d5960c747 100644 (file)
@@ -71,9 +71,9 @@ typedef struct intf_sys_s
 ggi_visual_t    vout_SysGetVisual( vout_thread_t *p_vout );
 
 /*****************************************************************************
- * intf_SysCreate: initialize and create GII interface
+ * intf_GGICreate: initialize and create GII interface
  *****************************************************************************/
-int intf_SysCreate( intf_thread_t *p_intf )
+int intf_GGICreate( intf_thread_t *p_intf )
 {
     /* Check that b_video is set */
     if( !p_main->b_video )
@@ -111,9 +111,9 @@ int intf_SysCreate( intf_thread_t *p_intf )
 }
 
 /*****************************************************************************
- * intf_SysDestroy: destroy interface
+ * intf_GGIDestroy: destroy interface
  *****************************************************************************/
-void intf_SysDestroy( intf_thread_t *p_intf )
+void intf_GGIDestroy( intf_thread_t *p_intf )
 {
     /* Close input thread, if any (blocking) */
     if( p_intf->p_input )
@@ -133,9 +133,9 @@ void intf_SysDestroy( intf_thread_t *p_intf )
 
 
 /*****************************************************************************
- * intf_SysManage: event loop
+ * intf_GGIManage: event loop
  *****************************************************************************/
-void intf_SysManage( intf_thread_t *p_intf )
+void intf_GGIManage( intf_thread_t *p_intf )
 {
     int         i_key;                                        /* unicode key */
 
index e3cdd9fff3aa857fb0f02195c35723347d9094da..b1cdd7ff47718b60c80c083cd90492bbbca81a2a 100644 (file)
@@ -65,13 +65,13 @@ static int     GGIOpenDisplay   ( vout_thread_t *p_vout, char *psz_display, void
 static void    GGICloseDisplay  ( vout_thread_t *p_vout );
 
 /*****************************************************************************
- * vout_SysCreate: allocate GGI video thread output method
+ * vout_GGICreate: allocate GGI video thread output method
  *****************************************************************************
  * This function allocate and initialize a GGI vout method. It uses some of the
  * vout properties to choose the correct mode, and change them according to the
  * mode actually used.
  *****************************************************************************/
-int vout_SysCreate( vout_thread_t *p_vout, char *psz_display, int i_root_window, void *p_data )
+int vout_GGICreate( vout_thread_t *p_vout, char *psz_display, int i_root_window, void *p_data )
 {
     /* Allocate structure */
     p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
@@ -92,11 +92,11 @@ int vout_SysCreate( vout_thread_t *p_vout, char *psz_display, int i_root_window,
 }
 
 /*****************************************************************************
- * vout_SysInit: initialize GGI video thread output method
+ * vout_GGIInit: initialize GGI video thread output method
  *****************************************************************************
  * This function initialize the GGI display device.
  *****************************************************************************/
-int vout_SysInit( vout_thread_t *p_vout )
+int vout_GGIInit( vout_thread_t *p_vout )
 {
     /* Acquire first buffer */
     if( p_vout->p_sys->b_must_acquire )
@@ -108,11 +108,11 @@ int vout_SysInit( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_SysEnd: terminate Sys video thread output method
+ * vout_GGIEnd: terminate Sys video thread output method
  *****************************************************************************
- * Terminate an output method created by vout_SysCreate
+ * Terminate an output method created by vout_GGICreate
  *****************************************************************************/
-void vout_SysEnd( vout_thread_t *p_vout )
+void vout_GGIEnd( vout_thread_t *p_vout )
 {
     /* Release buffer */
     if( p_vout->p_sys->b_must_acquire )
@@ -122,35 +122,35 @@ void vout_SysEnd( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_SysDestroy: destroy Sys video thread output method
+ * vout_GGIDestroy: destroy Sys video thread output method
  *****************************************************************************
- * Terminate an output method created by vout_SysCreate
+ * Terminate an output method created by vout_GGICreate
  *****************************************************************************/
-void vout_SysDestroy( vout_thread_t *p_vout )
+void vout_GGIDestroy( vout_thread_t *p_vout )
 {
     GGICloseDisplay( p_vout );
     free( p_vout->p_sys );
 }
 
 /*****************************************************************************
- * vout_SysManage: handle Sys events
+ * vout_GGIManage: handle Sys events
  *****************************************************************************
  * This function should be called regularly by video output thread. It returns
  * a non null value if an error occured.
  *****************************************************************************/
-int vout_SysManage( vout_thread_t *p_vout )
+int vout_GGIManage( vout_thread_t *p_vout )
 {
     /* FIXME: 8bpp: change palette ?? */
     return( 0 );
 }
 
 /*****************************************************************************
- * vout_SysDisplay: displays previously rendered output
+ * vout_GGIDisplay: displays previously rendered output
  *****************************************************************************
  * This function send the currently rendered image to the display, wait until
  * it is displayed and switch the two rendering buffer, preparing next frame.
  *****************************************************************************/
-void vout_SysDisplay( vout_thread_t *p_vout )
+void vout_GGIDisplay( vout_thread_t *p_vout )
 {
     /* Change display frame */
     if( p_vout->p_sys->b_must_acquire )
index cf9ed83569dcebe8213ce1aa2752d4bbf8c5214b..d7fc8273bc3f81b21bc0c282071e97050ebcdac9 100644 (file)
 
 #include <stdlib.h>                                      /* malloc(), free() */
 
+#ifndef __linux__
+#include <conio.h>                                            /* for glide ? */
+#endif
+#include <glide.h>
+
 #include "config.h"
 #include "common.h"                                     /* boolean_t, byte_t */
 #include "threads.h"
 #include "mtime.h"
+#include "tests.h"
 #include "plugins.h"
 
 #include "interface.h"
 #include "video.h"
 #include "video_output.h"
 
-#include "plugins_export.h"
-
 /*****************************************************************************
  * Exported prototypes
  *****************************************************************************/
-void vout_GetPlugin( p_vout_thread_t p_vout );
-void intf_GetPlugin( p_intf_thread_t p_intf );
+static void vout_GetPlugin( p_vout_thread_t p_vout );
+static void intf_GetPlugin( p_intf_thread_t p_intf );
+
+/* Video output */
+int     vout_GlideCreate       ( vout_thread_t *p_vout, char *psz_display,
+                                 int i_root_window, void *p_data );
+int     vout_GlideInit         ( p_vout_thread_t p_vout );
+void    vout_GlideEnd          ( p_vout_thread_t p_vout );
+void    vout_GlideDestroy      ( p_vout_thread_t p_vout );
+int     vout_GlideManage       ( p_vout_thread_t p_vout );
+void    vout_GlideDisplay      ( p_vout_thread_t p_vout );
+void    vout_GlideSetPalette   ( p_vout_thread_t p_vout,
+                                 u16 *red, u16 *green, u16 *blue, u16 *transp );
+
+/* Interface */
+int     intf_GlideCreate       ( p_intf_thread_t p_intf );
+void    intf_GlideDestroy      ( p_intf_thread_t p_intf );
+void    intf_GlideManage       ( p_intf_thread_t p_intf );
 
 /*****************************************************************************
  * GetConfig: get the plugin structure and configuration
@@ -62,36 +82,44 @@ plugin_info_t * GetConfig( void )
     p_info->intf_GetPlugin = intf_GetPlugin;
     p_info->yuv_GetPlugin  = NULL;
 
-    return( p_info );
-}
+    /* We could do a grSstQueryBoards( GrHwConfiguration *hwConfig ) at
+     * this point, but if the user didn't configure his 3dfx card, we
+     * have great chances to segfault here. So we'd better assume
+     * everything is fine and worry only if we really need to use Glide */
+    p_info->i_score = 0x100;
 
-/*****************************************************************************
- * Test: tests if the plugin can be launched
- *****************************************************************************/
-int Test( void )
-{
-    /* TODO: detect a 3dfx card */
-    return( 1 );
+    if( TestProgram( "glidevlc" ) )
+    {
+        p_info->i_score += 0x180;
+    }
+
+    /* If this plugin was requested, score it higher */
+    if( TestMethod( VOUT_METHOD_VAR, "glide" ) )
+    {
+        p_info->i_score += 0x200;
+    }
+
+    return( p_info );
 }
 
 /*****************************************************************************
  * Following functions are only called through the p_info structure
  *****************************************************************************/
 
-void vout_GetPlugin( p_vout_thread_t p_vout )
+static void vout_GetPlugin( p_vout_thread_t p_vout )
 {
-    p_vout->p_sys_create  = vout_SysCreate;
-    p_vout->p_sys_init    = vout_SysInit;
-    p_vout->p_sys_end     = vout_SysEnd;
-    p_vout->p_sys_destroy = vout_SysDestroy;
-    p_vout->p_sys_manage  = vout_SysManage;
-    p_vout->p_sys_display = vout_SysDisplay;
+    p_vout->p_sys_create  = vout_GlideCreate;
+    p_vout->p_sys_init    = vout_GlideInit;
+    p_vout->p_sys_end     = vout_GlideEnd;
+    p_vout->p_sys_destroy = vout_GlideDestroy;
+    p_vout->p_sys_manage  = vout_GlideManage;
+    p_vout->p_sys_display = vout_GlideDisplay;
 }
 
-void intf_GetPlugin( p_intf_thread_t p_intf )
+static void intf_GetPlugin( p_intf_thread_t p_intf )
 {
-    p_intf->p_sys_create  = intf_SysCreate;
-    p_intf->p_sys_destroy = intf_SysDestroy;
-    p_intf->p_sys_manage  = intf_SysManage;
+    p_intf->p_sys_create  = intf_GlideCreate;
+    p_intf->p_sys_destroy = intf_GlideDestroy;
+    p_intf->p_sys_manage  = intf_GlideManage;
 }
 
index acd1ea761c66b493423f2fabd548edcc94f46ddb..c3fbd1a23baaec78013c8164f6235a93dd74394d 100644 (file)
@@ -54,9 +54,9 @@ typedef struct intf_sys_s
 } intf_sys_t;
 
 /*****************************************************************************
- * intf_SysCreate: initialize 3dfx interface
+ * intf_GlideCreate: initialize 3dfx interface
  *****************************************************************************/
-int intf_SysCreate( intf_thread_t *p_intf )
+int intf_GlideCreate( intf_thread_t *p_intf )
 {
     /* Allocate instance and initialize some members */
     p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
@@ -79,9 +79,9 @@ int intf_SysCreate( intf_thread_t *p_intf )
 }
 
 /*****************************************************************************
- * intf_SysDestroy: destroy 3dfx interface
+ * intf_GlideDestroy: destroy 3dfx interface
  *****************************************************************************/
-void intf_SysDestroy( intf_thread_t *p_intf )
+void intf_GlideDestroy( intf_thread_t *p_intf )
 {
     /* Close input thread, if any (blocking) */
     if( p_intf->p_input )
@@ -101,9 +101,9 @@ void intf_SysDestroy( intf_thread_t *p_intf )
 
 
 /*****************************************************************************
- * intf_SysManage: event loop
+ * intf_GlideManage: event loop
  *****************************************************************************/
-void intf_SysManage( intf_thread_t *p_intf )
+void intf_GlideManage( intf_thread_t *p_intf )
 {
     unsigned int buf;
 
index 6d6ff9c761bcef7ea8b77f824045760872e99fe2..de5282a286f2aa2d36f28cecc1b1f354cea70c77 100644 (file)
@@ -74,11 +74,11 @@ static int     GlideOpenDisplay   ( vout_thread_t *p_vout );
 static void    GlideCloseDisplay  ( vout_thread_t *p_vout );
 
 /*****************************************************************************
- * vout_SysCreate: allocates Glide video thread output method
+ * vout_GlideCreate: allocates Glide video thread output method
  *****************************************************************************
  * This function allocates and initializes a Glide vout method.
  *****************************************************************************/
-int vout_SysCreate( vout_thread_t *p_vout, char *psz_display,
+int vout_GlideCreate( vout_thread_t *p_vout, char *psz_display,
                     int i_root_window, void *p_data )
 {
     /* Allocate structure */
@@ -101,50 +101,50 @@ int vout_SysCreate( vout_thread_t *p_vout, char *psz_display,
 }
 
 /*****************************************************************************
- * vout_SysInit: initialize Glide video thread output method
+ * vout_GlideInit: initialize Glide video thread output method
  *****************************************************************************/
-int vout_SysInit( vout_thread_t *p_vout )
+int vout_GlideInit( vout_thread_t *p_vout )
 {
     return( 0 );
 }
 
 /*****************************************************************************
- * vout_SysEnd: terminate Glide video thread output method
+ * vout_GlideEnd: terminate Glide video thread output method
  *****************************************************************************/
-void vout_SysEnd( vout_thread_t *p_vout )
+void vout_GlideEnd( vout_thread_t *p_vout )
 {
     ;
 }
 
 /*****************************************************************************
- * vout_SysDestroy: destroy Glide video thread output method
+ * vout_GlideDestroy: destroy Glide video thread output method
  *****************************************************************************
  * Terminate an output method created by vout_CreateOutputMethod
  *****************************************************************************/
-void vout_SysDestroy( vout_thread_t *p_vout )
+void vout_GlideDestroy( vout_thread_t *p_vout )
 {
     GlideCloseDisplay( p_vout );
     free( p_vout->p_sys );
 }
 
 /*****************************************************************************
- * vout_SysManage: handle Glide events
+ * vout_GlideManage: handle Glide events
  *****************************************************************************
  * This function should be called regularly by video output thread. It manages
  * console events. It returns a non null value on error.
  *****************************************************************************/
-int vout_SysManage( vout_thread_t *p_vout )
+int vout_GlideManage( vout_thread_t *p_vout )
 {
     return 0;
 }
 
 /*****************************************************************************
- * vout_SysDisplay: displays previously rendered output
+ * vout_GlideDisplay: displays previously rendered output
  *****************************************************************************
  * This function send the currently rendered image to Glide image, waits until
  * it is displayed and switch the two rendering buffers, preparing next frame.
  *****************************************************************************/
-void vout_SysDisplay( vout_thread_t *p_vout )
+void vout_GlideDisplay( vout_thread_t *p_vout )
 {
     grLfbUnlock( GR_LFB_WRITE_ONLY, GR_BUFFER_BACKBUFFER );
 
@@ -188,7 +188,8 @@ static int GlideOpenDisplay( vout_thread_t *p_vout )
     p_vout->p_sys->p_video = malloc( p_vout->p_sys->i_page_size * 2 );
     if( (int)p_vout->p_sys->p_video == -1 )
     {
-        intf_ErrMsg( "vout error: can't map video memory (%s)\n", strerror(errno) );
+        intf_ErrMsg( "vout error: can't map video memory (%s)\n",
+                     strerror(errno) );
         return( 1 );
     }
 
index fe626e5657eda1ba2ef862438996e824233418ac..02d9384179a78e6b16a32046c6a55b28d55b2bff 100644 (file)
 
 #include <stdlib.h>                                      /* malloc(), free() */
 
+#include <X11/Xlib.h>
+
 #include "config.h"
 #include "common.h"                                     /* boolean_t, byte_t */
 #include "threads.h"
 #include "mtime.h"
+#include "tests.h"
 #include "plugins.h"
 
 #include "interface.h"
 #include "video.h"
 #include "video_output.h"
 
-#include "plugins_export.h"
+#include "main.h"
 
 /*****************************************************************************
  * Exported prototypes
  *****************************************************************************/
-void vout_GetPlugin( p_vout_thread_t p_vout );
-void intf_GetPlugin( p_intf_thread_t p_intf );
+static void vout_GetPlugin( p_vout_thread_t p_vout );
+static void intf_GetPlugin( p_intf_thread_t p_intf );
+
+/* Video output */
+int     vout_GnomeCreate       ( vout_thread_t *p_vout, char *psz_display,
+                                 int i_root_window, void *p_data );
+int     vout_GnomeInit         ( p_vout_thread_t p_vout );
+void    vout_GnomeEnd          ( p_vout_thread_t p_vout );
+void    vout_GnomeDestroy      ( p_vout_thread_t p_vout );
+int     vout_GnomeManage       ( p_vout_thread_t p_vout );
+void    vout_GnomeDisplay      ( p_vout_thread_t p_vout );
+void    vout_GnomeSetPalette   ( p_vout_thread_t p_vout, u16 *red,
+                                 u16 *green, u16 *blue, u16 *transp );
+
+/* Interface */
+int     intf_GnomeCreate       ( p_intf_thread_t p_intf );
+void    intf_GnomeDestroy      ( p_intf_thread_t p_intf );
+void    intf_GnomeManage       ( p_intf_thread_t p_intf );
 
 /*****************************************************************************
  * GetConfig: get the plugin structure and configuration
  *****************************************************************************/
 plugin_info_t * GetConfig( void )
 {
+    Display *p_display;
     plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
 
     p_info->psz_name    = "Gnome";
@@ -62,39 +82,54 @@ plugin_info_t * GetConfig( void )
     p_info->intf_GetPlugin = intf_GetPlugin;
     p_info->yuv_GetPlugin  = NULL;
 
-    return( p_info );
-}
+    /* Check that we can open the X display */
+    if( (p_display = XOpenDisplay( XDisplayName(
+                         main_GetPszVariable( VOUT_DISPLAY_VAR, NULL ) ) ))
+        == NULL )
+    {
+        p_info->i_score = 0;
+    }
+    else
+    {
+        XCloseDisplay( p_display );
+        p_info->i_score = 0x200;
+    }
+
+    if( TestProgram( "gvlc" ) )
+    {
+        p_info->i_score += 0x180;
+    }
+
+    /* If this plugin was requested, score it higher */
+    if( TestMethod( VOUT_METHOD_VAR, "gnome" ) )
+    {
+        p_info->i_score += 0x200;
+    }
 
-/*****************************************************************************
- * Test: tests if the plugin can be launched
- *****************************************************************************/
-int Test( void )
-{
-    /* TODO: detect an X display or Gnome libs */
-    return( 1 );
+    return( p_info );
 }
 
 /*****************************************************************************
  * Following functions are only called through the p_info structure
  *****************************************************************************/
 
-void vout_GetPlugin( p_vout_thread_t p_vout )
+static void vout_GetPlugin( p_vout_thread_t p_vout )
 {
-    p_vout->p_sys_create  = vout_SysCreate;
-    p_vout->p_sys_init    = vout_SysInit;
-    p_vout->p_sys_end     = vout_SysEnd;
-    p_vout->p_sys_destroy = vout_SysDestroy;
-    p_vout->p_sys_manage  = vout_SysManage;
-    p_vout->p_sys_display = vout_SysDisplay;
+    p_vout->p_sys_create  = vout_GnomeCreate;
+    p_vout->p_sys_init    = vout_GnomeInit;
+    p_vout->p_sys_end     = vout_GnomeEnd;
+    p_vout->p_sys_destroy = vout_GnomeDestroy;
+    p_vout->p_sys_manage  = vout_GnomeManage;
+    p_vout->p_sys_display = vout_GnomeDisplay;
 
     /* optional functions */
-    p_vout->p_set_palette = vout_SetPalette;
+    p_vout->p_set_palette = vout_GnomeSetPalette;
 }
 
-void intf_GetPlugin( p_intf_thread_t p_intf )
+static void intf_GetPlugin( p_intf_thread_t p_intf )
 {
-    p_intf->p_sys_create  = intf_SysCreate;
-    p_intf->p_sys_destroy = intf_SysDestroy;
-    p_intf->p_sys_manage  = intf_SysManage;
+    p_intf->p_sys_create  = intf_GnomeCreate;
+    p_intf->p_sys_destroy = intf_GnomeDestroy;
+    p_intf->p_sys_manage  = intf_GnomeManage;
 }
 
index 0ed936a98435e60d199329ccbef62e7f3f7107b7..6fb12070323ffe99d2357b2c4e6178fc596d2d75 100644 (file)
@@ -62,9 +62,9 @@
 #include "intf_gnome_support.h"
 
 /*****************************************************************************
- * intf_SysCreate: initialize and create window
+ * intf_GnomeCreate: initialize and create window
  *****************************************************************************/
-int intf_SysCreate( intf_thread_t *p_intf )
+int intf_GnomeCreate( intf_thread_t *p_intf )
 {
     char       *psz_display;
 
@@ -143,9 +143,9 @@ int intf_SysCreate( intf_thread_t *p_intf )
 }
 
 /*****************************************************************************
- * intf_SysDestroy: destroy interface window
+ * intf_GnomeDestroy: destroy interface window
  *****************************************************************************/
-void intf_SysDestroy( intf_thread_t *p_intf )
+void intf_GnomeDestroy( intf_thread_t *p_intf )
 {
     /* Enable screen saver */
     GnomeEnableScreenSaver( p_intf );
@@ -181,9 +181,9 @@ void intf_SysDestroy( intf_thread_t *p_intf )
 }
 
 /*****************************************************************************
- * intf_SysManage: event loop
+ * intf_GnomeManage: event loop
  *****************************************************************************/
-void intf_SysManage( intf_thread_t *p_intf )
+void intf_GnomeManage( intf_thread_t *p_intf )
 {
     /* Manage main window */
     GnomeManageWindow( p_intf );
index eec5edac452d3c88586821a9442ad3170606c682..c9335b16d0b1e2787b774b8b401dfb218db15765 100644 (file)
@@ -79,7 +79,8 @@ typedef struct vout_sys_s
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-static int  X11OpenDisplay      ( vout_thread_t *p_vout, char *psz_display, Window root_window, void *p_data );
+static int  X11OpenDisplay      ( vout_thread_t *p_vout, char *psz_display,
+                                  Window root_window, void *p_data );
 static void X11CloseDisplay     ( vout_thread_t *p_vout );
 static int  X11CreateWindow     ( vout_thread_t *p_vout );
 static void X11DestroyWindow    ( vout_thread_t *p_vout );
@@ -91,13 +92,13 @@ static void X11DestroyShmImage  ( vout_thread_t *p_vout, XImage *p_ximage,
                                   XShmSegmentInfo *p_shm_info );
 
 /*****************************************************************************
- * vout_SysCreate: allocate X11 video thread output method
+ * vout_GnomeCreate: allocate X11 video thread output method
  *****************************************************************************
  * This function allocate and initialize a X11 vout method. It uses some of the
  * vout properties to choose the window size, and change them according to the
  * actual properties of the display.
  *****************************************************************************/
-int vout_SysCreate( vout_thread_t *p_vout, char *psz_display,
+int vout_GnomeCreate( vout_thread_t *p_vout, char *psz_display,
                     int i_root_window, void *p_data )
 {
     /* Allocate structure */
@@ -123,12 +124,12 @@ int vout_SysCreate( vout_thread_t *p_vout, char *psz_display,
 }
 
 /*****************************************************************************
- * vout_SysInit: initialize X11 video thread output method
+ * vout_GnomeInit: initialize X11 video thread output method
  *****************************************************************************
  * This function create the XImages needed by the output thread. It is called
  * at the beginning of the thread, but also each time the window is resized.
  *****************************************************************************/
-int vout_SysInit( vout_thread_t *p_vout )
+int vout_GnomeInit( vout_thread_t *p_vout )
 {
     int i_err;
 
@@ -185,12 +186,12 @@ int vout_SysInit( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_SysEnd: terminate X11 video thread output method
+ * vout_GnomeEnd: terminate X11 video thread output method
  *****************************************************************************
  * Destroy the X11 XImages created by vout_SysInit. It is called at the end of
  * the thread, but also each time the window is resized.
  *****************************************************************************/
-void vout_SysEnd( vout_thread_t *p_vout )
+void vout_GnomeEnd( vout_thread_t *p_vout )
 {
     if( p_vout->p_sys->b_shm )                             /* Shm XImages... */
     {
@@ -207,24 +208,24 @@ void vout_SysEnd( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_SysDestroy: destroy X11 video thread output method
+ * vout_GnomeDestroy: destroy X11 video thread output method
  *****************************************************************************
  * Terminate an output method created by vout_CreateOutputMethod
  *****************************************************************************/
-void vout_SysDestroy( vout_thread_t *p_vout )
+void vout_GnomeDestroy( vout_thread_t *p_vout )
 {
     X11CloseDisplay( p_vout );
     free( p_vout->p_sys );
 }
 
 /*****************************************************************************
- * vout_SysManage: handle X11 events
+ * vout_GnomeManage: handle X11 events
  *****************************************************************************
  * This function should be called regularly by video output thread. It manages
  * X11 events and allows window resizing. It returns a non null value on
  * error.
  *****************************************************************************/
-int vout_SysManage( vout_thread_t *p_vout )
+int vout_GnomeManage( vout_thread_t *p_vout )
 {
     /*
      * Color/Grayscale or gamma change: in 8bpp, just change the colormap
@@ -247,10 +248,10 @@ int vout_SysManage( vout_thread_t *p_vout )
                        p_vout->i_width, p_vout->i_height );
 
         /* Destroy XImages to change their size */
-        vout_SysEnd( p_vout );
+        vout_GnomeEnd( p_vout );
 
         /* Recreate XImages. If SysInit failed, the thread can't go on. */
-        if( vout_SysInit( p_vout ) )
+        if( vout_GnomeInit( p_vout ) )
         {
             intf_ErrMsg("error: can't resize display\n");
             return( 1 );
@@ -266,12 +267,12 @@ int vout_SysManage( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_SysDisplay: displays previously rendered output
+ * vout_GnomeDisplay: displays previously rendered output
  *****************************************************************************
  * This function send the currently rendered image to X11 server, wait until
  * it is displayed and switch the two rendering buffer, preparing next frame.
  *****************************************************************************/
-void vout_SysDisplay( vout_thread_t *p_vout )
+void vout_GnomeDisplay( vout_thread_t *p_vout )
 {
     if( p_vout->p_sys->b_shm)                                /* XShm is used */
     {
@@ -299,14 +300,14 @@ void vout_SysDisplay( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_SetPalette: sets an 8 bpp palette
+ * vout_GnomeSetPalette: sets an 8 bpp palette
  *****************************************************************************
  * This function sets the palette given as an argument. It does not return
  * anything, but could later send information on which colors it was unable
  * to set.
  *****************************************************************************/
-void vout_SetPalette( p_vout_thread_t p_vout,
-                      u16 *red, u16 *green, u16 *blue, u16 *transp )
+void vout_GnomeSetPalette( p_vout_thread_t p_vout,
+                           u16 *red, u16 *green, u16 *blue, u16 *transp )
 {
     int i;
     XColor color[255];
index 895f98b3507e91b1440eae041ed89f89382cf719..3cc607ec683439f1885e236d2123bc93bf7f7914 100644 (file)
@@ -90,9 +90,9 @@ static void X11DisableScreenSaver       ( intf_thread_t *p_intf );
 static void X11TogglePointer            ( intf_thread_t *p_intf );
 
 /*****************************************************************************
- * intf_SysCreate: initialize and create window
+ * intf_MGACreate: initialize and create window
  *****************************************************************************/
-int intf_SysCreate( intf_thread_t *p_intf )
+int intf_MGACreate( intf_thread_t *p_intf )
 {
     char       *psz_display;
 
@@ -150,9 +150,9 @@ int intf_SysCreate( intf_thread_t *p_intf )
 }
 
 /*****************************************************************************
- * intf_SysDestroy: destroy interface window
+ * intf_MGADestroy: destroy interface window
  *****************************************************************************/
-void intf_SysDestroy( intf_thread_t *p_intf )
+void intf_MGADestroy( intf_thread_t *p_intf )
 {
     /* Enable screen saver */
     X11EnableScreenSaver( p_intf );
@@ -179,9 +179,9 @@ void intf_SysDestroy( intf_thread_t *p_intf )
 
 
 /*****************************************************************************
- * intf_SysManage: event loop
+ * intf_MGAManage: event loop
  *****************************************************************************/
-void intf_SysManage( intf_thread_t *p_intf )
+void intf_MGAManage( intf_thread_t *p_intf )
 {
     /* Manage main window */
     X11ManageWindow( p_intf );
index 10b480157b9053762a93c3378486a9462907f2fc..b824b78d56fba2006fa548ff919c6f025e1373f1 100644 (file)
 #include "video.h"
 #include "video_output.h"
 
-#include "plugins_export.h"
-
 /*****************************************************************************
  * Exported prototypes
  *****************************************************************************/
-void vout_GetPlugin( p_vout_thread_t p_vout );
-void intf_GetPlugin( p_intf_thread_t p_intf );
+static void vout_GetPlugin( p_vout_thread_t p_vout );
+static void intf_GetPlugin( p_intf_thread_t p_intf );
+
+/* Video output */
+int     vout_MGACreate       ( vout_thread_t *p_vout, char *psz_display,
+                               int i_root_window, void *p_data );
+int     vout_MGAInit         ( p_vout_thread_t p_vout );
+void    vout_MGAEnd          ( p_vout_thread_t p_vout );
+void    vout_MGADestroy      ( p_vout_thread_t p_vout );
+int     vout_MGAManage       ( p_vout_thread_t p_vout );
+void    vout_MGADisplay      ( p_vout_thread_t p_vout );
+void    vout_SetPalette      ( p_vout_thread_t p_vout,
+                               u16 *red, u16 *green, u16 *blue, u16 *transp );
+
+/* Interface */
+int     intf_MGACreate       ( p_intf_thread_t p_intf );
+void    intf_MGADestroy      ( p_intf_thread_t p_intf );
+void    intf_MGAManage       ( p_intf_thread_t p_intf );
 
 /*****************************************************************************
  * GetConfig: get the plugin structure and configuration
@@ -62,36 +76,30 @@ plugin_info_t * GetConfig( void )
     p_info->intf_GetPlugin = intf_GetPlugin;
     p_info->yuv_GetPlugin  = NULL;
 
-    return( p_info );
-}
+    /* The MGA module does not work yet */
+    p_info->i_score = 0x0;
 
-/*****************************************************************************
- * Test: tests if the plugin can be launched
- *****************************************************************************/
-int Test( void )
-{
-    /* TODO: detect an MGA card ? */
-    return( 1 );
+    return( p_info );
 }
 
 /*****************************************************************************
  * Following functions are only called through the p_info structure
  *****************************************************************************/
 
-void vout_GetPlugin( p_vout_thread_t p_vout )
+static void vout_GetPlugin( p_vout_thread_t p_vout )
 {
-    p_vout->p_sys_create  = vout_SysCreate;
-    p_vout->p_sys_init    = vout_SysInit;
-    p_vout->p_sys_end     = vout_SysEnd;
-    p_vout->p_sys_destroy = vout_SysDestroy;
-    p_vout->p_sys_manage  = vout_SysManage;
-    p_vout->p_sys_display = vout_SysDisplay;
+    p_vout->p_sys_create  = vout_MGACreate;
+    p_vout->p_sys_init    = vout_MGAInit;
+    p_vout->p_sys_end     = vout_MGAEnd;
+    p_vout->p_sys_destroy = vout_MGADestroy;
+    p_vout->p_sys_manage  = vout_MGAManage;
+    p_vout->p_sys_display = vout_MGADisplay;
 }
 
-void intf_GetPlugin( p_intf_thread_t p_intf )
+static void intf_GetPlugin( p_intf_thread_t p_intf )
 {
-    p_intf->p_sys_create  = intf_SysCreate;
-    p_intf->p_sys_destroy = intf_SysDestroy;
-    p_intf->p_sys_manage  = intf_SysManage;
+    p_intf->p_sys_create  = intf_MGACreate;
+    p_intf->p_sys_destroy = intf_MGADestroy;
+    p_intf->p_sys_manage  = intf_MGAManage;
 }
 
index a8a59d19297ca3770b6a960031674058f625a8e0..2e3f4e5286b0dd0d592e342d9142711400bc4e9f 100644 (file)
 #include "vout_mga.h"
 
 /*****************************************************************************
- * vout_SysCreate: allocate X11 video thread output method
+ * vout_MGACreate: allocate X11 video thread output method
  *****************************************************************************
  * This function allocate and initialize a X11 vout method. It uses some of the
  * vout properties to choose the window size, and change them according to the
  * actual properties of the display.
  *****************************************************************************/
-int vout_SysCreate( vout_thread_t *p_vout, char *psz_display,
+int vout_MGACreate( vout_thread_t *p_vout, char *psz_display,
                     int i_root_window, void *p_data )
 {
     /* Allocate structure */
@@ -105,12 +105,12 @@ int vout_SysCreate( vout_thread_t *p_vout, char *psz_display,
 }
 
 /*****************************************************************************
- * vout_SysInit: initialize X11 video thread output method
+ * vout_MGAInit: initialize X11 video thread output method
  *****************************************************************************
  * This function create the XImages needed by the output thread. It is called
  * at the beginning of the thread, but also each time the window is resized.
  *****************************************************************************/
-int vout_SysInit( vout_thread_t *p_vout )
+int vout_MGAInit( vout_thread_t *p_vout )
 {
     int i_err;
 
@@ -213,12 +213,12 @@ int vout_SysInit( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_SysEnd: terminate X11 video thread output method
+ * vout_MGAEnd: terminate X11 video thread output method
  *****************************************************************************
- * Destroy the X11 XImages created by vout_SysInit. It is called at the end of
+ * Destroy the X11 XImages created by vout_MGAInit. It is called at the end of
  * the thread, but also each time the window is resized.
  *****************************************************************************/
-void vout_SysEnd( vout_thread_t *p_vout )
+void vout_MGAEnd( vout_thread_t *p_vout )
 {
     if( p_vout->p_sys->b_shm )                             /* Shm XImages... */
     {
@@ -235,11 +235,11 @@ void vout_SysEnd( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_SysDestroy: destroy X11 video thread output method
+ * vout_MGADestroy: destroy X11 video thread output method
  *****************************************************************************
  * Terminate an output method created by vout_CreateOutputMethod
  *****************************************************************************/
-void vout_SysDestroy( vout_thread_t *p_vout )
+void vout_MGADestroy( vout_thread_t *p_vout )
 {
     X11CloseDisplay( p_vout );
 
@@ -251,13 +251,13 @@ void vout_SysDestroy( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_SysManage: handle X11 events
+ * vout_MGAManage: handle X11 events
  *****************************************************************************
  * This function should be called regularly by video output thread. It manages
  * X11 events and allows window resizing. It returns a non null value on
  * error.
  *****************************************************************************/
-int vout_SysManage( vout_thread_t *p_vout )
+int vout_MGAManage( vout_thread_t *p_vout )
 {
     /*
      * Color/Grayscale or gamma change: in 8bpp, just change the colormap
@@ -280,10 +280,10 @@ int vout_SysManage( vout_thread_t *p_vout )
                        p_vout->i_width, p_vout->i_height );
 
         /* Destroy XImages to change their size */
-        vout_SysEnd( p_vout );
+        vout_MGAEnd( p_vout );
 
         /* Recreate XImages. If SysInit failed, the thread can't go on. */
-        if( vout_SysInit( p_vout ) )
+        if( vout_MGAInit( p_vout ) )
         {
             intf_ErrMsg("error: can't resize display\n");
             return( 1 );
@@ -299,12 +299,12 @@ int vout_SysManage( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_SysDisplay: displays previously rendered output
+ * vout_MGADisplay: displays previously rendered output
  *****************************************************************************
  * This function send the currently rendered image to X11 server, wait until
  * it is displayed and switch the two rendering buffer, preparing next frame.
  *****************************************************************************/
-void vout_SysDisplay( vout_thread_t *p_vout )
+void vout_MGADisplay( vout_thread_t *p_vout )
 {
     if( p_vout->p_sys->b_shm)                                /* XShm is used */
     {
index fb544424f843343f4ce36b7e9bc5e51a132dcd5c..6be9c9cbebee57ddfc04a85944d0a834ab3e5ffc 100644 (file)
@@ -91,9 +91,9 @@ static void X11DisableScreenSaver       ( intf_thread_t *p_intf );
 static void X11TogglePointer            ( intf_thread_t *p_intf );
 
 /*****************************************************************************
- * intf_SysCreate: initialize and create window
+ * intf_X11Create: initialize and create window
  *****************************************************************************/
-int intf_SysCreate( intf_thread_t *p_intf )
+int intf_X11Create( intf_thread_t *p_intf )
 {
     char       *psz_display;
 
@@ -153,9 +153,9 @@ int intf_SysCreate( intf_thread_t *p_intf )
 }
 
 /*****************************************************************************
- * intf_SysDestroy: destroy interface window
+ * intf_X11Destroy: destroy interface window
  *****************************************************************************/
-void intf_SysDestroy( intf_thread_t *p_intf )
+void intf_X11Destroy( intf_thread_t *p_intf )
 {
     /* Enable screen saver */
     X11EnableScreenSaver( p_intf );
@@ -182,9 +182,9 @@ void intf_SysDestroy( intf_thread_t *p_intf )
 
 
 /*****************************************************************************
- * intf_SysManage: event loop
+ * intf_X11Manage: event loop
  *****************************************************************************/
-void intf_SysManage( intf_thread_t *p_intf )
+void intf_X11Manage( intf_thread_t *p_intf )
 {
     /* Manage main window */
     X11ManageWindow( p_intf );
index 20031ddd865b5be21612e96ea30996795a048dea..7b95b33f1f54ebccfaf35f9b0eca4d056d23f65b 100644 (file)
@@ -91,13 +91,13 @@ static void X11DestroyShmImage  ( vout_thread_t *p_vout, XImage *p_ximage,
                                   XShmSegmentInfo *p_shm_info );
 
 /*****************************************************************************
- * vout_SysCreate: allocate X11 video thread output method
+ * vout_X11Create: allocate X11 video thread output method
  *****************************************************************************
  * This function allocate and initialize a X11 vout method. It uses some of the
  * vout properties to choose the window size, and change them according to the
  * actual properties of the display.
  *****************************************************************************/
-int vout_SysCreate( vout_thread_t *p_vout, char *psz_display,
+int vout_X11Create( vout_thread_t *p_vout, char *psz_display,
                     int i_root_window, void *p_data )
 {
     /* Allocate structure */
@@ -123,12 +123,12 @@ int vout_SysCreate( vout_thread_t *p_vout, char *psz_display,
 }
 
 /*****************************************************************************
- * vout_SysInit: initialize X11 video thread output method
+ * vout_X11Init: initialize X11 video thread output method
  *****************************************************************************
  * This function create the XImages needed by the output thread. It is called
  * at the beginning of the thread, but also each time the window is resized.
  *****************************************************************************/
-int vout_SysInit( vout_thread_t *p_vout )
+int vout_X11Init( vout_thread_t *p_vout )
 {
     int i_err;
 
@@ -185,12 +185,12 @@ int vout_SysInit( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_SysEnd: terminate X11 video thread output method
+ * vout_X11End: terminate X11 video thread output method
  *****************************************************************************
- * Destroy the X11 XImages created by vout_SysInit. It is called at the end of
+ * Destroy the X11 XImages created by vout_X11Init. It is called at the end of
  * the thread, but also each time the window is resized.
  *****************************************************************************/
-void vout_SysEnd( vout_thread_t *p_vout )
+void vout_X11End( vout_thread_t *p_vout )
 {
     if( p_vout->p_sys->b_shm )                             /* Shm XImages... */
     {
@@ -207,24 +207,24 @@ void vout_SysEnd( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_SysDestroy: destroy X11 video thread output method
+ * vout_X11Destroy: destroy X11 video thread output method
  *****************************************************************************
  * Terminate an output method created by vout_CreateOutputMethod
  *****************************************************************************/
-void vout_SysDestroy( vout_thread_t *p_vout )
+void vout_X11Destroy( vout_thread_t *p_vout )
 {
     X11CloseDisplay( p_vout );
     free( p_vout->p_sys );
 }
 
 /*****************************************************************************
- * vout_SysManage: handle X11 events
+ * vout_X11Manage: handle X11 events
  *****************************************************************************
  * This function should be called regularly by video output thread. It manages
  * X11 events and allows window resizing. It returns a non null value on
  * error.
  *****************************************************************************/
-int vout_SysManage( vout_thread_t *p_vout )
+int vout_X11Manage( vout_thread_t *p_vout )
 {
     /*
      * Color/Grayscale or gamma change: in 8bpp, just change the colormap
@@ -248,10 +248,10 @@ int vout_SysManage( vout_thread_t *p_vout )
                        p_vout->i_width, p_vout->i_height );
 
         /* Destroy XImages to change their size */
-        vout_SysEnd( p_vout );
+        vout_X11End( p_vout );
 
         /* Recreate XImages. If SysInit failed, the thread can't go on. */
-        if( vout_SysInit( p_vout ) )
+        if( vout_X11Init( p_vout ) )
         {
             intf_ErrMsg("error: can't resize display\n");
             return( 1 );
@@ -268,12 +268,12 @@ int vout_SysManage( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_SysDisplay: displays previously rendered output
+ * vout_X11Display: displays previously rendered output
  *****************************************************************************
  * This function send the currently rendered image to X11 server, wait until
  * it is displayed and switch the two rendering buffer, preparing next frame.
  *****************************************************************************/
-void vout_SysDisplay( vout_thread_t *p_vout )
+void vout_X11Display( vout_thread_t *p_vout )
 {
     if( p_vout->p_sys->b_shm)                                /* XShm is used */
     {
@@ -301,14 +301,14 @@ void vout_SysDisplay( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_SetPalette: sets an 8 bpp palette
+ * vout_X11SetPalette: sets an 8 bpp palette
  *****************************************************************************
  * This function sets the palette given as an argument. It does not return
  * anything, but could later send information on which colors it was unable
  * to set.
  *****************************************************************************/
-void vout_SetPalette( p_vout_thread_t p_vout,
-                      u16 *red, u16 *green, u16 *blue, u16 *transp )
+void vout_X11SetPalette( p_vout_thread_t p_vout,
+                         u16 *red, u16 *green, u16 *blue, u16 *transp )
 {
     int i;
     XColor color[255];
index 3a104d331a81809463033aa025afd1fdf85397e0..87d69be63c66cc797cc19e125704f0b446b522eb 100644 (file)
 
 #include <stdlib.h>                                      /* malloc(), free() */
 
+#include <X11/Xlib.h>
+
 #include "config.h"
 #include "common.h"                                     /* boolean_t, byte_t */
 #include "threads.h"
 #include "mtime.h"
+#include "tests.h"
 #include "plugins.h"
 
 #include "interface.h"
 #include "video.h"
 #include "video_output.h"
 
-#include "plugins_export.h"
+#include "main.h"
 
 /*****************************************************************************
  * Exported prototypes
  *****************************************************************************/
-void vout_GetPlugin( p_vout_thread_t p_vout );
-void intf_GetPlugin( p_intf_thread_t p_intf );
+static void vout_GetPlugin( p_vout_thread_t p_vout );
+static void intf_GetPlugin( p_intf_thread_t p_intf );
+
+/* Video output */
+int     vout_X11Create       ( vout_thread_t *p_vout, char *psz_display,
+                               int i_root_window, void *p_data );
+int     vout_X11Init         ( p_vout_thread_t p_vout );
+void    vout_X11End          ( p_vout_thread_t p_vout );
+void    vout_X11Destroy      ( p_vout_thread_t p_vout );
+int     vout_X11Manage       ( p_vout_thread_t p_vout );
+void    vout_X11Display      ( p_vout_thread_t p_vout );
+void    vout_X11SetPalette   ( p_vout_thread_t p_vout,
+                               u16 *red, u16 *green, u16 *blue, u16 *transp );
+
+/* Interface */
+int     intf_X11Create       ( p_intf_thread_t p_intf );
+void    intf_X11Destroy      ( p_intf_thread_t p_intf );
+void    intf_X11Manage       ( p_intf_thread_t p_intf );
 
 /*****************************************************************************
  * GetConfig: get the plugin structure and configuration
  *****************************************************************************/
 plugin_info_t * GetConfig( void )
 {
+    Display *p_display;
     plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
 
     p_info->psz_name    = "X Window System";
@@ -62,39 +82,54 @@ plugin_info_t * GetConfig( void )
     p_info->intf_GetPlugin = intf_GetPlugin;
     p_info->yuv_GetPlugin  = NULL;
 
-    return( p_info );
-}
+    /* check that we can open the X display */
+    if( (p_display = XOpenDisplay( XDisplayName(
+                         main_GetPszVariable( VOUT_DISPLAY_VAR, NULL ) ) ))
+        == NULL )
+    {
+        p_info->i_score = 0x0;
+    }
+    else
+    {
+        XCloseDisplay( p_display );
+        p_info->i_score = 0x200;
+    }
+
+    if( TestProgram( "xvlc" ) )
+    {
+        p_info->i_score += 0x180;
+    }
+
+    /* If this plugin was requested, score it higher */
+    if( TestMethod( VOUT_METHOD_VAR, "x11" ) )
+    {
+        p_info->i_score += 0x200;
+    }
 
-/*****************************************************************************
- * Test: tests if the plugin can be launched
- *****************************************************************************/
-int Test( void )
-{
-    /* TODO: detect an X display */
-    return( 1 );
+    return( p_info );
 }
 
 /*****************************************************************************
  * Following functions are only called through the p_info structure
  *****************************************************************************/
 
-void vout_GetPlugin( p_vout_thread_t p_vout )
+static void vout_GetPlugin( p_vout_thread_t p_vout )
 {
-    p_vout->p_sys_create  = vout_SysCreate;
-    p_vout->p_sys_init    = vout_SysInit;
-    p_vout->p_sys_end     = vout_SysEnd;
-    p_vout->p_sys_destroy = vout_SysDestroy;
-    p_vout->p_sys_manage  = vout_SysManage;
-    p_vout->p_sys_display = vout_SysDisplay;
+    p_vout->p_sys_create  = vout_X11Create;
+    p_vout->p_sys_init    = vout_X11Init;
+    p_vout->p_sys_end     = vout_X11End;
+    p_vout->p_sys_destroy = vout_X11Destroy;
+    p_vout->p_sys_manage  = vout_X11Manage;
+    p_vout->p_sys_display = vout_X11Display;
 
     /* optional functions */
-    p_vout->p_set_palette = vout_SetPalette;
+    p_vout->p_set_palette = vout_X11SetPalette;
 }
 
-void intf_GetPlugin( p_intf_thread_t p_intf )
+static void intf_GetPlugin( p_intf_thread_t p_intf )
 {
-    p_intf->p_sys_create  = intf_SysCreate;
-    p_intf->p_sys_destroy = intf_SysDestroy;
-    p_intf->p_sys_manage  = intf_SysManage;
+    p_intf->p_sys_create  = intf_X11Create;
+    p_intf->p_sys_destroy = intf_X11Destroy;
+    p_intf->p_sys_manage  = intf_X11Manage;
 }
 
index 20a43e2b64900a82eaf4df306427fde317e79a9b..8171ea570d63487ea53008b502406eb36c898b6b 100644 (file)
 
 #include "intf_msg.h"
 
-/*****************************************************************************
- * Constants
- *****************************************************************************/
-
-int     yuv_SysInit     ( vout_thread_t *p_vout );
-int     yuv_SysReset    ( vout_thread_t *p_vout );
-void    yuv_SysEnd      ( vout_thread_t *p_vout );
-
 /*****************************************************************************
  * vout_InitYUV: allocate and initialize translations tables
  *****************************************************************************
  * This function will allocate memory to store translation tables, depending
  * of the screen depth.
  *****************************************************************************/
-int yuv_SysInit( vout_thread_t *p_vout )
+int yuv_CInit( vout_thread_t *p_vout )
 {
     size_t      tables_size;                        /* tables size, in bytes */
 
@@ -113,27 +105,27 @@ int yuv_SysInit( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * yuv_SysReset: re-initialize translations tables
+ * yuv_CEnd: destroy translations tables
  *****************************************************************************
- * This function will initialize the tables allocated by vout_CreateTables and
- * set functions pointers.
+ * Free memory allocated by yuv_CCreate.
  *****************************************************************************/
-int yuv_SysReset( vout_thread_t *p_vout )
+void yuv_CEnd( vout_thread_t *p_vout )
 {
-    yuv_SysEnd( p_vout );
-    return( yuv_SysInit( p_vout ) );
+    free( p_vout->yuv.p_base );
+    free( p_vout->yuv.p_buffer );
+    free( p_vout->yuv.p_offset );
 }
 
 /*****************************************************************************
- * yuv_SysEnd: destroy translations tables
+ * yuv_CReset: re-initialize translations tables
  *****************************************************************************
- * Free memory allocated by yuv_SysCreate.
+ * This function will initialize the tables allocated by vout_CreateTables and
+ * set functions pointers.
  *****************************************************************************/
-void yuv_SysEnd( vout_thread_t *p_vout )
+int yuv_CReset( vout_thread_t *p_vout )
 {
-    free( p_vout->yuv.p_base );
-    free( p_vout->yuv.p_buffer );
-    free( p_vout->yuv.p_offset );
+    yuv_CEnd( p_vout );
+    return( yuv_CInit( p_vout ) );
 }
 
 /* following functions are local */
index 7fec51175f32f024eed118cc2f244b085260b445..c971a21da66c85994dfb43ee5e22309a4c98a3b8 100644 (file)
@@ -73,6 +73,8 @@ void ConvertY4Gray16( YUV_ARGS_16BPP )
     SetOffset( i_width, i_height, i_pic_width, i_pic_height,
                &b_horizontal_scaling, &i_vertical_scaling, p_offset_start );
 
+    p_y = p_v;
+    i_height /= 4;
     /*
      * Perform conversion
      */
index e5350bf01e506c6f24d43688db8cdd00b93b2144..712266250803cf7f1b9abd3f7246de5349e87cfd 100644 (file)
@@ -31,6 +31,7 @@
 #include "common.h"                                     /* boolean_t, byte_t */
 #include "threads.h"
 #include "mtime.h"
+#include "tests.h"
 #include "plugins.h"
 
 #include "interface.h"
 #include "video.h"
 #include "video_output.h"
 
-#include "plugins_export.h"
-
 /*****************************************************************************
  * Exported prototypes
  *****************************************************************************/
-void yuv_GetPlugin( p_vout_thread_t p_vout );
+static void yuv_GetPlugin( p_vout_thread_t p_vout );
+
+/* YUV transformations */
+int     yuv_CInit          ( p_vout_thread_t p_vout );
+int     yuv_CReset         ( p_vout_thread_t p_vout );
+void    yuv_CEnd           ( p_vout_thread_t p_vout );
 
 /*****************************************************************************
  * GetConfig: get the plugin structure and configuration
@@ -61,25 +65,26 @@ plugin_info_t * GetConfig( void )
     p_info->intf_GetPlugin = NULL;
     p_info->yuv_GetPlugin  = yuv_GetPlugin;
 
-    return( p_info );
-}
+    /* The C YUV functions should always work */
+    p_info->i_score = 0x100;
 
-/*****************************************************************************
- * Test: tests if the plugin can be launched
- *****************************************************************************/
-int Test( void )
-{
-    return( 1 );
+    /* If this plugin was requested, score it higher */
+    if( TestMethod( YUV_METHOD_VAR, "nommx" ) )
+    {
+        p_info->i_score += 0x200;
+    }
+
+    return( p_info );
 }
 
 /*****************************************************************************
  * Following functions are only called through the p_info structure
  *****************************************************************************/
 
-void yuv_GetPlugin( p_vout_thread_t p_vout )
+static void yuv_GetPlugin( p_vout_thread_t p_vout )
 {
-    p_vout->p_yuv_init   = yuv_SysInit;
-    p_vout->p_yuv_reset  = yuv_SysReset;
-    p_vout->p_yuv_end    = yuv_SysEnd;
+    p_vout->p_yuv_init   = yuv_CInit;
+    p_vout->p_yuv_reset  = yuv_CReset;
+    p_vout->p_yuv_end    = yuv_CEnd;
 }
 
index 20a43e2b64900a82eaf4df306427fde317e79a9b..4937a19f2c7fcd265e6142df7ed26e087200970d 100644 (file)
 
 #include "intf_msg.h"
 
-/*****************************************************************************
- * Constants
- *****************************************************************************/
-
-int     yuv_SysInit     ( vout_thread_t *p_vout );
-int     yuv_SysReset    ( vout_thread_t *p_vout );
-void    yuv_SysEnd      ( vout_thread_t *p_vout );
-
 /*****************************************************************************
  * vout_InitYUV: allocate and initialize translations tables
  *****************************************************************************
  * This function will allocate memory to store translation tables, depending
  * of the screen depth.
  *****************************************************************************/
-int yuv_SysInit( vout_thread_t *p_vout )
+int yuv_MMXInit( vout_thread_t *p_vout )
 {
     size_t      tables_size;                        /* tables size, in bytes */
 
@@ -113,27 +105,27 @@ int yuv_SysInit( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * yuv_SysReset: re-initialize translations tables
+ * yuv_MMXEnd: destroy translations tables
  *****************************************************************************
- * This function will initialize the tables allocated by vout_CreateTables and
- * set functions pointers.
+ * Free memory allocated by yuv_MMXCreate.
  *****************************************************************************/
-int yuv_SysReset( vout_thread_t *p_vout )
+void yuv_MMXEnd( vout_thread_t *p_vout )
 {
-    yuv_SysEnd( p_vout );
-    return( yuv_SysInit( p_vout ) );
+    free( p_vout->yuv.p_base );
+    free( p_vout->yuv.p_buffer );
+    free( p_vout->yuv.p_offset );
 }
 
 /*****************************************************************************
- * yuv_SysEnd: destroy translations tables
+ * yuv_MMXReset: re-initialize translations tables
  *****************************************************************************
- * Free memory allocated by yuv_SysCreate.
+ * This function will initialize the tables allocated by vout_CreateTables and
+ * set functions pointers.
  *****************************************************************************/
-void yuv_SysEnd( vout_thread_t *p_vout )
+int yuv_MMXReset( vout_thread_t *p_vout )
 {
-    free( p_vout->yuv.p_base );
-    free( p_vout->yuv.p_buffer );
-    free( p_vout->yuv.p_offset );
+    yuv_MMXEnd( p_vout );
+    return( yuv_MMXInit( p_vout ) );
 }
 
 /* following functions are local */
index 19fbb21e4278c1d3e81c6df85d19431a98fdbcff..955ef4a91a2b6b77e9c844036f71afc0c9be4b85 100644 (file)
@@ -31,6 +31,7 @@
 #include "common.h"                                     /* boolean_t, byte_t */
 #include "threads.h"
 #include "mtime.h"
+#include "tests.h"                                              /* TestMMX() */
 #include "plugins.h"
 
 #include "interface.h"
 #include "video.h"
 #include "video_output.h"
 
-#include "plugins_export.h"
-
 /*****************************************************************************
  * Exported prototypes
  *****************************************************************************/
-void yuv_GetPlugin( p_vout_thread_t p_vout );
+static void yuv_GetPlugin( p_vout_thread_t p_vout );
+
+/* YUV transformations */
+int     yuv_MMXInit          ( p_vout_thread_t p_vout );
+int     yuv_MMXReset         ( p_vout_thread_t p_vout );
+void    yuv_MMXEnd           ( p_vout_thread_t p_vout );
 
 /*****************************************************************************
  * GetConfig: get the plugin structure and configuration
@@ -61,25 +65,32 @@ plugin_info_t * GetConfig( void )
     p_info->intf_GetPlugin = NULL;
     p_info->yuv_GetPlugin  = yuv_GetPlugin;
 
-    return( p_info );
-}
+    if( TestMMX() )
+    {
+        p_info->i_score = 0x200;
+    }
+    else
+    {
+        p_info->i_score = 0x0;
+    }
 
-/*****************************************************************************
- * Test: tests if the plugin can be launched
- *****************************************************************************/
-int Test( void )
-{
-    return( 1 );
+    /* If this plugin was requested, score it higher */
+    if( TestMethod( YUV_METHOD_VAR, "mmx" ) )
+    {
+        p_info->i_score += 0x200;
+    }
+
+    return( p_info );
 }
 
 /*****************************************************************************
  * Following functions are only called through the p_info structure
  *****************************************************************************/
 
-void yuv_GetPlugin( p_vout_thread_t p_vout )
+static void yuv_GetPlugin( p_vout_thread_t p_vout )
 {
-    p_vout->p_yuv_init   = yuv_SysInit;
-    p_vout->p_yuv_reset  = yuv_SysReset;
-    p_vout->p_yuv_end    = yuv_SysEnd;
+    p_vout->p_yuv_init   = yuv_MMXInit;
+    p_vout->p_yuv_reset  = yuv_MMXReset;
+    p_vout->p_yuv_end    = yuv_MMXEnd;
 }
 
index 7f08657e796455cc0c0ed727213d3d5e9afb1a07..3b1df4eef2464184ae404d18dc6dc2755caa4c2d 100644 (file)
@@ -82,8 +82,9 @@ aout_thread_t *aout_CreateThread( int *pi_status )
     aout_thread_t * p_aout;                             /* thread descriptor */
     typedef void    ( aout_getplugin_t ) ( aout_thread_t * p_aout );
     int             i_index;
+    int             i_best_index = 0, i_best_score = 0;
 #if 0
-    int             i_status;                                 /* thread status */
+    int             i_status;                               /* thread status */
 #endif
 
     /* Allocate descriptor */
@@ -102,13 +103,27 @@ aout_thread_t *aout_CreateThread( int *pi_status )
             /* ... and if this plugin provides the functions we want ... */
             if( p_main->p_bank->p_info[ i_index ]->aout_GetPlugin != NULL )
             {
-                /* ... then get these functions */
-                ( (aout_getplugin_t *)
-                  p_main->p_bank->p_info[ i_index ]->aout_GetPlugin )( p_aout );
+                /* ... and if this plugin has a good score ... */
+                if( p_main->p_bank->p_info[ i_index ]->i_score > i_best_score )
+                {
+                    /* ... then take it */
+                    i_best_score = p_main->p_bank->p_info[ i_index ]->i_score;
+                    i_best_index = i_index;
+                }
             }
         }
     }
 
+    if( i_best_score == 0 )
+    {
+        free( p_aout );
+        return( NULL );
+    }
+
+    /* Get the plugin functions */
+    ( (aout_getplugin_t *)
+      p_main->p_bank->p_info[ i_best_index ]->aout_GetPlugin )( p_aout );
+
     /*
      * Initialize audio device
      */
index 15ed2a7a6fa610028e47e0eff05dc96a0bb3ba3d..ee4370453e73feb5140a33036857b23898850cd6 100644 (file)
@@ -93,6 +93,7 @@ intf_thread_t* intf_Create( void )
     intf_thread_t * p_intf;
     typedef void    ( intf_getplugin_t ) ( intf_thread_t * p_intf );
     int             i_index;
+    int             i_best_index = 0, i_best_score = 0;
 
     /* Allocate structure */
     p_intf = malloc( sizeof( intf_thread_t ) );
@@ -111,13 +112,27 @@ intf_thread_t* intf_Create( void )
             /* ... and if this plugin provides the functions we want ... */
             if( p_main->p_bank->p_info[ i_index ]->intf_GetPlugin != NULL )
             {
-                /* ... then get these functions */
-                ( (intf_getplugin_t *)
-                  p_main->p_bank->p_info[ i_index ]->intf_GetPlugin )( p_intf );
+                /* ... and if this plugin has a good score ... */
+                if( p_main->p_bank->p_info[ i_index ]->i_score > i_best_score )
+                {
+                    /* ... then take it */
+                    i_best_score = p_main->p_bank->p_info[ i_index ]->i_score;
+                    i_best_index = i_index;
+                }
             }
         }
     }
 
+    if( i_best_score == 0 )
+    {
+        free( p_intf );
+        return( NULL );
+    }
+
+    /* Get the plugin functions */
+    ( (intf_getplugin_t *)
+      p_main->p_bank->p_info[ i_best_index ]->intf_GetPlugin )( p_intf );
+
     /* Initialize structure */
     p_intf->b_die =     0;
     p_intf->p_vout =    NULL;
index bd50e63cbea66e312403b279c42d2c11b242e8d0..e8dacdebb9ee246363561ad102aac7ca45313b71 100644 (file)
@@ -39,6 +39,7 @@
 #include "common.h"
 #include "threads.h"
 #include "mtime.h"
+#include "tests.h"                                              /* TestMMX() */
 #include "plugins.h"
 #include "playlist.h"
 #include "input_vlan.h"
@@ -73,6 +74,7 @@
 #define OPT_WIDTH               163
 #define OPT_HEIGHT              164
 #define OPT_COLOR               165
+#define OPT_YUV                 166
 
 #define OPT_NOVLANS             170
 #define OPT_SERVER              171
@@ -107,6 +109,7 @@ static const struct option longopts[] =
     {   "height",           1,          0,      OPT_HEIGHT },
     {   "grayscale",        0,          0,      'g' },
     {   "color",            0,          0,      OPT_COLOR },
+    {   "yuv",              1,          0,      OPT_YUV },
 
     /* DVD options */
     {   "dvdaudio",         1,          0,      'a' },
@@ -160,17 +163,17 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
 
     p_main = &main_data;                       /* set up the global variable */
 
-#ifdef SYS_BEOS
     /*
      * System specific initialization code
      */
+#ifdef SYS_BEOS
     beos_Create();
 #endif
 
-#ifdef HAVE_MMX
     /*
      * Test if our code is likely to run on this CPU 
      */
+#ifdef HAVE_MMX
     if( !TestMMX() )
     {
         fprintf( stderr, "Sorry, this program needs an MMX processor. "
@@ -196,8 +199,6 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
     if( GetConfiguration( i_argc, ppsz_argv, ppsz_env ) )  /* parse cmd line */
     {
         intf_MsgDestroy();
-        fprintf( stderr, "error: can't read configuration (%s)\n",
-                strerror(errno) );
         return( errno );
     }
 
@@ -259,6 +260,9 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
     {
         InitSignalHandler();             /* prepare signals for interception */
 
+        /*
+         * This is the main loop
+         */
         intf_Run( p_main->p_intf );
 
         intf_Destroy( p_main->p_intf );
@@ -419,6 +423,7 @@ static void SetDefaultConfiguration( void )
 static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
 {
     int c, i_opt;
+    char * p_pointer;
 
     /* Set default configuration and copy arguments */
     p_main->i_argc    = i_argc;
@@ -428,6 +433,20 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
 
     intf_MsgImm( COPYRIGHT_MESSAGE "\n" );
 
+    /* Get the executable name */
+    p_main->psz_arg0 = p_pointer = ppsz_argv[ 0 ];
+    while( *p_pointer )
+    {
+        if( *p_pointer == '/' )
+        {
+            p_main->psz_arg0 = ++p_pointer;
+        }
+        else
+        {
+            ++p_pointer;
+        }
+    }
+
     /* Parse command line options */
     opterr = 0;
     while( ( c = getopt_long( i_argc, ppsz_argv, psz_shortopts, longopts, 0 ) ) != EOF )
@@ -485,6 +504,9 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
         case OPT_COLOR:                                           /* --color */
             main_PutIntVariable( VOUT_GRAYSCALE_VAR, 0 );
             break;
+        case OPT_YUV:                                               /* --yuv */
+            main_PutPszVariable( YUV_METHOD_VAR, optarg );
+            break;
 
         /* DVD options */
         case 'a':
@@ -541,11 +563,13 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
 static void Usage( int i_fashion )
 {
     /* Usage */
-    intf_Msg( "Usage: vlc [options] [parameters] [file]...\n" );
+    intf_Msg( "Usage: %s [options] [parameters] [file]...\n",
+              p_main->psz_arg0 );
 
     if( i_fashion == USAGE )
     {
-        intf_Msg( "Try `vlc --help' for more information.\n" );
+        intf_Msg( "Try `%s --help' for more information.\n",
+                  p_main->psz_arg0 );
         return;
     }
 
@@ -672,82 +696,3 @@ static void SignalHandler( int i_signal )
     p_main->p_intf->b_die = 1;
 }
 
-#ifdef HAVE_MMX
-/*****************************************************************************
- * TestMMX: tests if the processor has MMX support.
- *****************************************************************************
- * This function is called if HAVE_MMX is enabled, to check whether the
- * CPU really supports MMX.
- *****************************************************************************/
-static int TestMMX( void )
-{
-/* FIXME: under beos, gcc does not support the following inline assembly */ 
-#ifdef SYS_BEOS
-    return( 1 );
-#else
-
-    int i_reg, i_dummy = 0;
-
-    /* test for a 386 CPU */
-    asm volatile ( "pushfl
-                    popl %%eax
-                    movl %%eax, %%ecx
-                    xorl $0x40000, %%eax
-                    pushl %%eax
-                    popfl
-                    pushfl
-                    popl %%eax
-                    xorl %%ecx, %%eax
-                    andl $0x40000, %%eax"
-                 : "=a" ( i_reg ) );
-
-    if( !i_reg )
-        return( 0 );
-
-    /* test for a 486 CPU */
-    asm volatile ( "movl %%ecx, %%eax
-                    xorl $0x200000, %%eax
-                    pushl %%eax
-                    popfl
-                    pushfl
-                    popl %%eax
-                    xorl %%ecx, %%eax
-                    pushl %%ecx
-                    popfl
-                    andl $0x200000, %%eax"
-                 : "=a" ( i_reg ) );
-
-    if( !i_reg )
-        return( 0 );
-
-    /* the CPU supports the CPUID instruction - get its level */
-    asm volatile ( "cpuid"
-                 : "=a" ( i_reg ),
-                   "=b" ( i_dummy ),
-                   "=c" ( i_dummy ),
-                   "=d" ( i_dummy )
-                 : "a"  ( 0 ),       /* level 0 */
-                   "b"  ( i_dummy ) ); /* buggy compiler shouldn't complain */
-
-    /* this shouldn't happen on a normal CPU */
-    if( !i_reg )
-        return( 0 );
-
-    /* test for the MMX flag */
-    asm volatile ( "cpuid
-                    andl $0x00800000, %%edx" /* X86_FEATURE_MMX */
-                 : "=a" ( i_dummy ),
-                   "=b" ( i_dummy ),
-                   "=c" ( i_dummy ),
-                   "=d" ( i_reg )
-                 : "a"  ( 1 ),       /* level 1 */
-                   "b"  ( i_dummy ) ); /* buggy compiler shouldn't complain */
-
-    if( !i_reg )
-        return( 0 );
-
-    return( 1 );
-
-#endif
-}
-#endif
index cf8c4de790f0e58f429622c2365c5452ac20da2a..25c3cbe2d35ad4d2144dcaf001051db3e095caef 100644 (file)
@@ -89,9 +89,12 @@ void bank_Init( plugin_bank_t * p_bank )
     SEEK_PLUGIN( "beos" );
     SEEK_PLUGIN( "x11" );
     SEEK_PLUGIN( "dsp" );
+    SEEK_PLUGIN( "esd" );
     SEEK_PLUGIN( "gnome" );
     SEEK_PLUGIN( "ggi" );
     SEEK_PLUGIN( "fb" );
+    SEEK_PLUGIN( "glide" );
+    SEEK_PLUGIN( "mga" );
     SEEK_PLUGIN( "yuvmmx" );
     SEEK_PLUGIN( "yuv" );
     SEEK_PLUGIN( "dummy" );
@@ -108,51 +111,6 @@ void bank_Destroy( plugin_bank_t * p_bank )
  * Following functions are local
  */
 
-int AllocatePlugin( plugin_id_t plugin_id, plugin_bank_t * p_bank,
-                    char * psz_filename )
-{
-    typedef plugin_info_t * ( get_config_t ) ( void );
-    get_config_t * p_func;   
-    int i;
-
-    for( i = 0 ; i < p_bank->i_plugin_count ; i++ )
-    {
-        if( p_bank->p_info[ i ] == NULL )
-        {
-            break;
-        }
-    }
-
-    /* no room to store that plugin, quit */
-    if( i == p_bank->i_plugin_count )
-    {
-        intf_ErrMsg( "plugin bank error: reached max plugin count (%i), "
-                     "increase MAX_PLUGIN_COUNT\n", p_bank->i_plugin_count );
-        return( -1 );
-    }
-
-    /* system-specific dynamic symbol loading */
-    GET_PLUGIN( p_func, plugin_id, "GetConfig" );
-
-    /* if it failed, just quit */
-    if( !p_func )
-    {
-        return( -1 );
-    }
-
-    /* run the plugin function to initialize the structure */
-    p_bank->p_info[ i ]            = p_func( );
-    p_bank->p_info[ i ]->plugin_id = plugin_id;
-
-    /* Tell the world we found it */
-    intf_Msg( "Found plugin: %s (version %s)\n", p_bank->p_info[ i ]->psz_name,
-              p_bank->p_info[ i ]->psz_version );
-
-    /* return nicely */
-    return( 0 );
-}
-
-
 char * TestPlugin ( plugin_id_t *p_plugin_id, char * psz_name )
 {
     int i_count, i_length;
@@ -208,6 +166,53 @@ char * TestPlugin ( plugin_id_t *p_plugin_id, char * psz_name )
     return( NULL );
 }
 
+
+int AllocatePlugin( plugin_id_t plugin_id, plugin_bank_t * p_bank,
+                    char * psz_filename )
+{
+    typedef plugin_info_t * ( get_config_t ) ( void );
+    get_config_t * p_func;   
+    int i;
+
+    for( i = 0 ; i < p_bank->i_plugin_count ; i++ )
+    {
+        if( p_bank->p_info[ i ] == NULL )
+        {
+            break;
+        }
+    }
+
+    /* no room to store that plugin, quit */
+    if( i == p_bank->i_plugin_count )
+    {
+        intf_ErrMsg( "plugin bank error: reached max plugin count (%i), "
+                     "increase MAX_PLUGIN_COUNT\n", p_bank->i_plugin_count );
+        return( -1 );
+    }
+
+    /* system-specific dynamic symbol loading */
+    GET_PLUGIN( p_func, plugin_id, "GetConfig" );
+
+    /* if it failed, just quit */
+    if( !p_func )
+    {
+        return( -1 );
+    }
+
+    /* run the plugin function to initialize the structure */
+    p_bank->p_info[ i ]            = p_func( );
+    p_bank->p_info[ i ]->plugin_id = plugin_id;
+
+    /* Tell the world we found it */
+    intf_Msg( "Plugin %i: %s %s [0x%x]\n", i,
+              p_bank->p_info[ i ]->psz_name,
+              p_bank->p_info[ i ]->psz_version,
+              p_bank->p_info[ i ]->i_score );
+
+    /* return nicely */
+    return( 0 );
+}
+
 #if 0
 void TrashPlugin ( plugin_id_t plugin_id )
 {
diff --git a/src/misc/tests.c b/src/misc/tests.c
new file mode 100644 (file)
index 0000000..c1fe1eb
--- /dev/null
@@ -0,0 +1,139 @@
+/*****************************************************************************
+ * tests.c: several test functions needed by the plugins
+ * Functions are prototyped in tests.h.
+ *****************************************************************************
+ * Copyright (C) 2000 VideoLAN
+ *
+ * Authors: Samuel Hocevar <sam@via.ecp.fr>
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include "defs.h"
+
+#include "config.h"
+#include "common.h"
+
+#include "intf_msg.h"
+#include "tests.h"
+
+#include "main.h"
+
+/*****************************************************************************
+ * TestVersion: tests if the given string equals the current version
+ *****************************************************************************/
+int TestVersion( char * psz_version )
+{
+    return( !strcmp( psz_version, VERSION ) );
+}
+
+/*****************************************************************************
+ * TestProgram: tests if the given string equals the program name
+ *****************************************************************************/
+int TestProgram( char * psz_program )
+{
+    return( !strcmp( psz_program, p_main->psz_arg0 ) );
+}
+
+/*****************************************************************************
+ * TestMethod: tests if the given method was requested
+ *****************************************************************************/
+int TestMethod( char * psz_var, char * psz_method )
+{
+    return( !strcmp( psz_method, main_GetPszVariable( psz_var, "" ) ) );
+}
+
+/*****************************************************************************
+ * TestMMX: tests if the processor has MMX support.
+ *****************************************************************************
+ * This function is called if HAVE_MMX is enabled, to check whether the
+ * CPU really supports MMX.
+ *****************************************************************************/
+int TestMMX( void )
+{
+/* FIXME: under beos, gcc does not support the following inline assembly */ 
+#ifdef SYS_BEOS
+    return( 1 );
+#else
+
+    int i_reg, i_dummy = 0;
+
+    /* test for a 386 CPU */
+    asm volatile ( "pushfl
+                    popl %%eax
+                    movl %%eax, %%ecx
+                    xorl $0x40000, %%eax
+                    pushl %%eax
+                    popfl
+                    pushfl
+                    popl %%eax
+                    xorl %%ecx, %%eax
+                    andl $0x40000, %%eax"
+                 : "=a" ( i_reg ) );
+
+    if( !i_reg )
+        return( 0 );
+
+    /* test for a 486 CPU */
+    asm volatile ( "movl %%ecx, %%eax
+                    xorl $0x200000, %%eax
+                    pushl %%eax
+                    popfl
+                    pushfl
+                    popl %%eax
+                    xorl %%ecx, %%eax
+                    pushl %%ecx
+                    popfl
+                    andl $0x200000, %%eax"
+                 : "=a" ( i_reg ) );
+
+    if( !i_reg )
+        return( 0 );
+
+    /* the CPU supports the CPUID instruction - get its level */
+    asm volatile ( "cpuid"
+                 : "=a" ( i_reg ),
+                   "=b" ( i_dummy ),
+                   "=c" ( i_dummy ),
+                   "=d" ( i_dummy )
+                 : "a"  ( 0 ),       /* level 0 */
+                   "b"  ( i_dummy ) ); /* buggy compiler shouldn't complain */
+
+    /* this shouldn't happen on a normal CPU */
+    if( !i_reg )
+        return( 0 );
+
+    /* test for the MMX flag */
+    asm volatile ( "cpuid
+                    andl $0x00800000, %%edx" /* X86_FEATURE_MMX */
+                 : "=a" ( i_dummy ),
+                   "=b" ( i_dummy ),
+                   "=c" ( i_dummy ),
+                   "=d" ( i_reg )
+                 : "a"  ( 1 ),       /* level 1 */
+                   "b"  ( i_dummy ) ); /* buggy compiler shouldn't complain */
+
+    if( !i_reg )
+        return( 0 );
+
+    return( 1 );
+
+#endif
+}
+
+
index 5293f2e111320d6f5449bf82488f68802a31c733..41136f4c69177595ac6a04d5fb271365b5f3b477 100644 (file)
@@ -94,6 +94,7 @@ vout_thread_t * vout_CreateThread   ( char *psz_display, int i_root_window,
     typedef void    ( vout_getplugin_t ) ( vout_thread_t * p_vout );
     int             i_status;                               /* thread status */
     int             i_index;               /* index for array initialization */
+    int             i_best_index = 0, i_best_score = 0;
 
     /* Allocate descriptor */
     intf_DbgMsg("\n");
@@ -115,13 +116,27 @@ vout_thread_t * vout_CreateThread   ( char *psz_display, int i_root_window,
             /* ... and if this plugin provides the functions we want ... */
             if( p_main->p_bank->p_info[ i_index ]->vout_GetPlugin != NULL )
             {
-                /* ... then get these functions */
-                ( (vout_getplugin_t *)
-                  p_main->p_bank->p_info[ i_index ]->vout_GetPlugin )( p_vout );
+                /* ... and if this plugin has a good score ... */
+                if( p_main->p_bank->p_info[ i_index ]->i_score > i_best_score )
+                {
+                    /* ... then take it */
+                    i_best_score = p_main->p_bank->p_info[ i_index ]->i_score;
+                    i_best_index = i_index;
+                }
             }
         }
     }
 
+    if( i_best_score == 0 )
+    {
+        free( p_vout );
+        return( NULL );
+    }
+
+    /* Get the plugin functions */
+    ( (vout_getplugin_t *)
+      p_main->p_bank->p_info[ i_best_index ]->vout_GetPlugin )( p_vout );
+
     /* Initialize thread properties - thread id and locks will be initialized
      * later */
     p_vout->b_die               = 0;
index b1b732df3529587011ccea8d7f8b2c286d9f8af9..cacf3c993c3bfc82a9a097b0e5a564d0f19edcc6 100644 (file)
@@ -197,6 +197,8 @@ boolean_t vpar_SynchroChoose( vpar_thread_t * p_vpar, int i_coding_type,
 {
     mtime_t i_delay = p_vpar->synchro.i_last_pts - mdate();
 
+    //return (i_coding_type == I_CODING_TYPE);
+
     switch( i_coding_type )
     {
         case I_CODING_TYPE: