of the real _Init or _Create functions. That's 1000 lines of code gained.
* ./src/misc/modules.c: we try not to keep the global lock in module_Need,
which should speed up output spawning.
* ./plugins/dummy/input_dummy.c: fixed vlc:quit command.
* ./plugins/gtk/gtk_playlist.c: compilation fix.
* ./plugins/macosx/*: preliminary fixes for the vout4 port.
Notes on the *_Probe eradication:
o I probably broke the DirectX video output, because of the "must init and
run in the same thread" issue. I'll fix this ASAP.
o Subtitles are broken (or at least, pretty ugly) in RGB mode.
o The input plugins still have *_Probe functions. This will disappear when
meuuh is finished with the access plugins.
o The decoder plugins still have *_Probe functions. This is probably not
going to change, it looks OK to me.
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: common.h,v 1.72 2002/02/14 23:29:17 sam Exp $
+ * $Id: common.h,v 1.73 2002/02/15 13:32:52 sam Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
struct pes_packet_s;
struct input_area_s;
struct bit_stream_s;
-struct probedata_s;
/*****************************************************************************
* Macros and inline functions
char * ( * DecodeLanguage ) ( u16 );
- struct module_s * ( * module_Need ) ( int, char *, struct probedata_s * );
+ struct module_s * ( * module_Need ) ( int, char *, void * );
void ( * module_Unneed ) ( struct module_s * );
} module_symbols_t;
/* Optimization level, from 0 to 2 - 1 is generally a good compromise. Remember
* that raising this level dramatically lengthens the compilation time. */
-#ifdef HAVE_RELEASE
+#if defined( HAVE_RELEASE ) || defined( __pentiumpro__ )
# define VPAR_OPTIM_LEVEL 2
#else
# define VPAR_OPTIM_LEVEL 1
* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_ext-intf.h,v 1.58 2002/01/21 23:57:46 massiot Exp $
+ * $Id: input_ext-intf.h,v 1.59 2002/02/15 13:32:52 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
struct module_s * p_input_module;
/* Init/End */
+ int (* pf_probe)( struct input_thread_s * );
void (* pf_init)( struct input_thread_s * );
void (* pf_open)( struct input_thread_s * );
void (* pf_close)( struct input_thread_s * );
* but exported to plug-ins
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: input_ext-plugins.h,v 1.16 2002/01/21 23:57:46 massiot Exp $
+ * $Id: input_ext-plugins.h,v 1.17 2002/02/15 13:32:52 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
* Prototypes from input_dec.c
*****************************************************************************/
#ifndef PLUGIN
-//decoder_capabilities_s * input_ProbeDecoder( void );
vlc_thread_t input_RunDecoder( struct input_thread_s *,
struct es_descriptor_s * );
void input_EndDecoder( struct input_thread_s *, struct es_descriptor_s * );
* Declaration and extern access to global program object.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: main.h,v 1.28 2002/02/13 22:10:40 sam Exp $
+ * $Id: main.h,v 1.29 2002/02/15 13:32:52 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
mtime_t i_desync; /* relative desync of the audio ouput */
/* Fast memcpy plugin used */
- memcpy_module_t memcpy;
+ module_t * p_memcpy_module;
+ void* ( *pf_memcpy ) ( void *, const void *, size_t );
+ void* ( *pf_memset ) ( void *, int, size_t ); /* FIXME: unimplemented */
/* Unique threads */
p_intf_thread_t p_intf; /* main interface thread */
/*****************************************************************************
* Fast memory operation module
*****************************************************************************/
-#define FAST_MEMCPY p_main->memcpy.pf_memcpy
-#define FAST_MEMSET p_main->memcpy.pf_memset
+#define FAST_MEMCPY p_main->pf_memcpy
+#define FAST_MEMSET p_main->pf_memset
/*****************************************************************************
* Prototypes - these methods are used to get default values for some threads
* modules.h : Module management functions.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: modules.h,v 1.40 2002/01/05 03:49:18 sam Exp $
+ * $Id: modules.h,v 1.41 2002/02/15 13:32:52 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
} module_t;
-/*****************************************
- * FIXME
- * FIXME Capabilities
- * FIXME
- *******************************************/
-typedef struct memcpy_module_s
-{
- struct module_s *p_module;
-
- void* ( *pf_memcpy ) ( void *, const void *, size_t );
-
-} memcpy_module_t;
-
-typedef struct probedata_s
-{
- u8 i_type;
-
- struct
- {
- char * psz_data;
- } aout;
-
- struct
- {
- u32 i_chroma;
- } vout;
-
- struct
- {
- struct picture_heap_s* p_output;
- struct picture_heap_s* p_render;
- } chroma;
-
-} probedata_t;
-
-/* FIXME: find a nicer way to do this. */
+/*****************************************************************************
+ * Module functions description structure
+ *****************************************************************************/
typedef struct function_list_s
{
- int ( * pf_probe ) ( probedata_t * p_data );
-
union
{
/* Interface plugin */
/* Input plugin */
struct
{
+ int ( * pf_probe )( struct input_thread_s * );
void ( * pf_init ) ( struct input_thread_s * );
void ( * pf_open ) ( struct input_thread_s * );
void ( * pf_close )( struct input_thread_s * );
/* Decoder plugins */
struct
{
+ int ( * pf_probe)( u8 * p_es );
int ( * pf_run ) ( struct decoder_config_s * p_config );
} dec;
/* memcpy plugins */
struct
{
- void* ( * fast_memcpy ) ( void *, const void *, size_t );
+ void* ( * pf_memcpy ) ( void *, const void *, size_t );
+ void* ( * pf_memset ) ( void *, int, size_t );
} memcpy;
} functions;
void module_EndBank ( void );
void module_ResetBank ( void );
void module_ManageBank ( void );
-module_t * module_Need ( int, char *, probedata_t * );
+module_t * module_Need ( int, char *, void * );
void module_Unneed ( module_t * p_module );
-int module_NeedMemcpy( memcpy_module_t * );
-void module_UnneedMemcpy( memcpy_module_t * );
-
#else
# define module_Need p_symbols->module_Need
# define module_Unneed p_symbols->module_Unneed
* (http://liba52.sf.net/).
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: a52.c,v 1.2 2002/02/13 21:54:44 gbazin Exp $
+ * $Id: a52.c,v 1.3 2002/02/15 13:32:52 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int decoder_Probe ( probedata_t * );
+static int decoder_Probe ( u8 * );
static int decoder_Run ( decoder_config_t * );
static int DecodeFrame ( a52_adec_thread_t * );
static int InitThread ( a52_adec_thread_t * );
*****************************************************************************/
void _M( adec_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = decoder_Probe;
- p_function_list->functions.dec.pf_run = decoder_Run;
+ p_function_list->functions.dec.pf_probe = decoder_Probe;
+ p_function_list->functions.dec.pf_run = decoder_Run;
}
/*****************************************************************************
* Tries to launch a decoder and return score so that the interface is able
* to choose.
*****************************************************************************/
-static int decoder_Probe( probedata_t *p_data )
+static int decoder_Probe( u8 *pi_type )
{
- return ( p_data->i_type == AC3_AUDIO_ES );
+ return ( *pi_type == AC3_AUDIO_ES ? 0 : -1 );
}
/*****************************************************************************
* ac3_adec.c: ac3 decoder module main file
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: ac3_adec.c,v 1.18 2002/01/28 23:08:31 stef Exp $
+ * $Id: ac3_adec.c,v 1.19 2002/02/15 13:32:52 sam Exp $
*
* Authors: Michel Lespinasse <walken@zoy.org>
*
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int decoder_Probe ( probedata_t * );
+static int decoder_Probe ( u8 * );
static int decoder_Run ( decoder_config_t * );
static int InitThread ( ac3dec_thread_t * p_adec );
static void EndThread ( ac3dec_thread_t * p_adec );
*****************************************************************************/
void _M( adec_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = decoder_Probe;
- p_function_list->functions.dec.pf_run = decoder_Run;
+ p_function_list->functions.dec.pf_probe = decoder_Probe;
+ p_function_list->functions.dec.pf_run = decoder_Run;
}
/*****************************************************************************
* Tries to launch a decoder and return score so that the interface is able
* to chose.
*****************************************************************************/
-static int decoder_Probe( probedata_t *p_data )
+static int decoder_Probe( u8 *pi_type )
{
- return ( p_data->i_type == AC3_AUDIO_ES ) ? 50 : 0;
+ return ( *pi_type == AC3_AUDIO_ES ) ? 0 : -1;
}
* ac3_spdif.c: ac3 pass-through to external decoder with enabled soundcard
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: ac3_spdif.c,v 1.12 2002/01/28 23:08:31 stef Exp $
+ * $Id: ac3_spdif.c,v 1.13 2002/02/15 13:32:52 sam Exp $
*
* Authors: Stéphane Borel <stef@via.ecp.fr>
* Juha Yrjola <jyrjola@cc.hut.fi>
/****************************************************************************
* Local Prototypes
****************************************************************************/
-static int decoder_Probe ( probedata_t * );
+static int decoder_Probe ( u8 * );
static int decoder_Run ( decoder_config_t * );
static int InitThread ( ac3_spdif_thread_t * );
static void EndThread ( ac3_spdif_thread_t * );
*****************************************************************************/
void _M( adec_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = decoder_Probe;
- p_function_list->functions.dec.pf_run = decoder_Run;
+ p_function_list->functions.dec.pf_probe = decoder_Probe;
+ p_function_list->functions.dec.pf_run = decoder_Run;
}
/*****************************************************************************
* Tries to launch a decoder and return score so that the interface is able
* to chose.
*****************************************************************************/
-static int decoder_Probe( probedata_t *p_data )
+static int decoder_Probe( u8 *pi_type )
{
return( ( main_GetIntVariable( AOUT_SPDIF_VAR, 0 )
- && p_data->i_type == AC3_AUDIO_ES ) ? 100 : 0 );
+ && *pi_type == AC3_AUDIO_ES ) ? 0 : -1 );
}
* aout_alsa.c : Alsa functions library
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: aout_alsa.c,v 1.25 2002/01/28 23:08:31 stef Exp $
+ * $Id: aout_alsa.c,v 1.26 2002/02/15 13:32:52 sam Exp $
*
* Authors: Henri Fallon <henri@videolan.org> - Original Author
* Jeffrey Baker <jwbaker@acm.org> - Port to ALSA 1.0 API
unsigned int bytes_per_frame;
} aout_sys_t;
-
-/*****************************************************************************
- * aout_Probe: probes the audio device and return a score
- *****************************************************************************
- * This function tries to open the dps and returns a score to the plugin
- * manager so that it can make its choice.
- *****************************************************************************/
-static int aout_Probe( probedata_t *p_data )
-{
- int i_open_return, i_close_return;
- aout_sys_t local_sys;
-
- /* Open device */
- i_open_return = snd_pcm_open( &(local_sys.p_alsa_handle), "default",
- SND_PCM_STREAM_PLAYBACK, 0 );
- if( i_open_return )
- {
- intf_WarnMsg( 2, "aout info: could not probe ALSA device (%s)",
- snd_strerror( i_open_return ) );
- return ( 0 );
- }
-
- /* Close it */
- i_close_return = snd_pcm_close( local_sys.p_alsa_handle );
-
- if( i_close_return )
- {
- intf_ErrMsg( "aout error: could not close ALSA device (%s)",
- snd_strerror( i_close_return ) );
- return( 0 );
- }
-
- /* And return score */
- return( 100 );
-}
-
/*****************************************************************************
* aout_Open : creates a handle and opens an alsa device
*****************************************************************************
*****************************************************************************/
void _M( aout_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
p_function_list->functions.aout.pf_setformat = aout_SetFormat;
p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static int aout_Probe ( probedata_t *p_data );
static int aout_Open ( aout_thread_t *p_aout );
static int aout_SetFormat ( aout_thread_t *p_aout );
static long aout_GetBufInfo ( aout_thread_t *p_aout, long l_buffer_info );
*****************************************************************************/
void _M( aout_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
p_function_list->functions.aout.pf_setformat = aout_SetFormat;
p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.pf_close = aout_Close;
}
-/*****************************************************************************
- * aout_Probe: probes the audio device and return a score
- *****************************************************************************
- * This function tries to open the dps and returns a score to the plugin
- * manager so that it can
- *****************************************************************************/
-static int aout_Probe( probedata_t *p_data )
-{
- /* We don't have to test anything -- if we managed to open this plugin,
- * it means we have the appropriate libs. */
- return( 50 );
-}
-
/*****************************************************************************
* aout_Open: initialize arts connection to server
*****************************************************************************/
* aout_beos.cpp: BeOS audio output
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: aout_beos.cpp,v 1.20 2002/02/13 22:10:40 sam Exp $
+ * $Id: aout_beos.cpp,v 1.21 2002/02/15 13:32:52 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static int aout_Probe ( probedata_t *p_data );
static int aout_Open ( aout_thread_t *p_aout );
static int aout_SetFormat ( aout_thread_t *p_aout );
static long aout_GetBufInfo ( aout_thread_t *p_aout, long l_buffer_info );
*****************************************************************************/
void _M( aout_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
p_function_list->functions.aout.pf_setformat = aout_SetFormat;
p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.pf_close = aout_Close;
}
-/*****************************************************************************
- * aout_Probe: probe the audio device and return a score
- *****************************************************************************/
-static int aout_Probe( probedata_t *p_data )
-{
- /* We don't test anything since I don't know what to test. However
- * if the module could be loaded it is quite likely to work. */
- return( 100 );
-}
-
/*****************************************************************************
* aout_Open: opens a BPushGameSound
*****************************************************************************/
* intf_beos.cpp: beos interface
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: intf_beos.cpp,v 1.37 2002/01/19 19:54:01 gbazin Exp $
+ * $Id: intf_beos.cpp,v 1.38 2002/02/15 13:32:52 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static int intf_Probe ( probedata_t *p_data );
static int intf_Open ( intf_thread_t *p_intf );
static void intf_Close ( intf_thread_t *p_intf );
static void intf_Run ( intf_thread_t *p_intf );
*****************************************************************************/
void _M( intf_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = intf_Probe;
p_function_list->functions.intf.pf_open = intf_Open;
p_function_list->functions.intf.pf_close = intf_Close;
p_function_list->functions.intf.pf_run = intf_Run;
}
-/*****************************************************************************
- * intf_Probe: probe the interface and return a score
- *****************************************************************************
- * This function tries to initialize Gnome and returns a score to the
- * plugin manager so that it can select the best plugin.
- *****************************************************************************/
-static int intf_Probe( probedata_t *p_data )
-{
- return( 100 );
-}
-
/*****************************************************************************
* intf_Open: initialize interface
*****************************************************************************/
* vout_beos.cpp: beos video output display method
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: vout_beos.cpp,v 1.40 2002/02/13 22:10:40 sam Exp $
+ * $Id: vout_beos.cpp,v 1.41 2002/02/15 13:32:52 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int vout_Probe ( probedata_t *p_data );
static int vout_Create ( vout_thread_t * );
static int vout_Init ( vout_thread_t * );
static void vout_End ( vout_thread_t * );
*****************************************************************************/
void _M( vout_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = vout_Probe;
p_function_list->functions.vout.pf_create = vout_Create;
p_function_list->functions.vout.pf_init = vout_Init;
p_function_list->functions.vout.pf_end = vout_End;
p_function_list->functions.vout.pf_render = vout_Render;
}
-/*****************************************************************************
- * vout_Probe: probe the video driver and return a score
- *****************************************************************************
- * This function tries to initialize SDL and returns a score to the
- * plugin manager so that it can select the best plugin.
- *****************************************************************************/
-static int vout_Probe( probedata_t *p_data )
-{
- return( 100 );
-}
-
/*****************************************************************************
* vout_Create: allocates BeOS video thread output method
*****************************************************************************
* i420_rgb.c : YUV to bitmap RGB conversion module for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: i420_rgb.c,v 1.4 2002/02/08 15:57:29 sam Exp $
+ * $Id: i420_rgb.c,v 1.5 2002/02/15 13:32:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
*****************************************************************************/
static void chroma_getfunctions ( function_list_t * p_function_list );
-static int chroma_Probe ( probedata_t *p_data );
static int chroma_Init ( vout_thread_t *p_vout );
static void chroma_End ( vout_thread_t *p_vout );
*****************************************************************************/
static void chroma_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = chroma_Probe;
p_function_list->functions.chroma.pf_init = chroma_Init;
p_function_list->functions.chroma.pf_end = chroma_End;
}
-/*****************************************************************************
- * chroma_Probe: return a score
- *****************************************************************************
- * This function checks that we can handle the required data
- *****************************************************************************/
-static int chroma_Probe( probedata_t *p_data )
-{
- if( p_data->chroma.p_render->i_width & 1
- || p_data->chroma.p_render->i_height & 1 )
- {
- return 0;
- }
-
- switch( p_data->chroma.p_render->i_chroma )
- {
- case FOURCC_YV12:
- case FOURCC_I420:
- case FOURCC_IYUV:
- switch( p_data->chroma.p_output->i_chroma )
- {
-#if defined (MODULE_NAME_IS_chroma_i420_rgb)
- case FOURCC_BI_RGB:
- break;
-#endif
- case FOURCC_RV15:
- case FOURCC_RV16:
- case FOURCC_RV32:
- break;
-
- default:
- return 0;
- }
- break;
-
- default:
- return 0;
- }
-
- return 100;
-}
-
/*****************************************************************************
* chroma_Init: allocate a chroma function
*****************************************************************************
* i420_ymga.c : YUV to YUV conversion module for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: i420_ymga.c,v 1.1 2002/01/07 02:12:29 sam Exp $
+ * $Id: i420_ymga.c,v 1.2 2002/02/15 13:32:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
*****************************************************************************/
static void chroma_getfunctions ( function_list_t * p_function_list );
-static int chroma_Probe ( probedata_t *p_data );
static int chroma_Init ( vout_thread_t *p_vout );
static void chroma_End ( vout_thread_t *p_vout );
*****************************************************************************/
static void chroma_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = chroma_Probe;
p_function_list->functions.chroma.pf_init = chroma_Init;
p_function_list->functions.chroma.pf_end = chroma_End;
}
-/*****************************************************************************
- * chroma_Probe: return a score
- *****************************************************************************
- * This function checks that we can handle the required data
- *****************************************************************************/
-static int chroma_Probe( probedata_t *p_data )
-{
- if( p_data->chroma.p_render->i_width & 1
- || p_data->chroma.p_render->i_height & 1 )
- {
- return 0;
- }
-
- switch( p_data->chroma.p_render->i_chroma )
- {
- case FOURCC_YV12:
- case FOURCC_I420:
- case FOURCC_IYUV:
- switch( p_data->chroma.p_output->i_chroma )
- {
- case FOURCC_YMGA:
- break;
-
- default:
- return 0;
- }
- break;
-
- default:
- return 0;
- }
-
- return 100;
-}
-
/*****************************************************************************
* chroma_Init: allocate a chroma function
*****************************************************************************
* i420_yuy2.c : YUV to YUV conversion module for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: i420_yuy2.c,v 1.1 2002/01/04 14:01:34 sam Exp $
+ * $Id: i420_yuy2.c,v 1.2 2002/02/15 13:32:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
*****************************************************************************/
static void chroma_getfunctions ( function_list_t * p_function_list );
-static int chroma_Probe ( probedata_t *p_data );
static int chroma_Init ( vout_thread_t *p_vout );
static void chroma_End ( vout_thread_t *p_vout );
*****************************************************************************/
static void chroma_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = chroma_Probe;
p_function_list->functions.chroma.pf_init = chroma_Init;
p_function_list->functions.chroma.pf_end = chroma_End;
}
-/*****************************************************************************
- * chroma_Probe: return a score
- *****************************************************************************
- * This function checks that we can handle the required data
- *****************************************************************************/
-static int chroma_Probe( probedata_t *p_data )
-{
- if( p_data->chroma.p_render->i_width & 1
- || p_data->chroma.p_render->i_height & 1 )
- {
- return 0;
- }
-
- switch( p_data->chroma.p_render->i_chroma )
- {
- case FOURCC_YV12:
- case FOURCC_I420:
- case FOURCC_IYUV:
- switch( p_data->chroma.p_output->i_chroma )
- {
- case FOURCC_YUY2:
- case FOURCC_YUNV:
- break;
-
- case FOURCC_YVYU:
- break;
-
- case FOURCC_UYVY:
- case FOURCC_UYNV:
- case FOURCC_Y422:
- break;
-
- case FOURCC_IUYV:
- break;
-
- case FOURCC_cyuv:
- break;
-
-#if defined (MODULE_NAME_IS_chroma_i420_yuy2)
- case FOURCC_Y211:
- break;
-#endif
-
- default:
- return 0;
- }
- break;
-
- default:
- return 0;
- }
-
- return 100;
-}
-
/*****************************************************************************
* chroma_Init: allocate a chroma function
*****************************************************************************
* i422_yuy2.c : YUV to YUV conversion module for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: i422_yuy2.c,v 1.1 2002/01/04 14:01:34 sam Exp $
+ * $Id: i422_yuy2.c,v 1.2 2002/02/15 13:32:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
*****************************************************************************/
static void chroma_getfunctions ( function_list_t * p_function_list );
-static int chroma_Probe ( probedata_t *p_data );
static int chroma_Init ( vout_thread_t *p_vout );
static void chroma_End ( vout_thread_t *p_vout );
*****************************************************************************/
static void chroma_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = chroma_Probe;
p_function_list->functions.chroma.pf_init = chroma_Init;
p_function_list->functions.chroma.pf_end = chroma_End;
}
-/*****************************************************************************
- * chroma_Probe: return a score
- *****************************************************************************
- * This function checks that we can handle the required data
- *****************************************************************************/
-static int chroma_Probe( probedata_t *p_data )
-{
- if( p_data->chroma.p_render->i_width & 1
- || p_data->chroma.p_render->i_height & 1 )
- {
- return 0;
- }
-
- switch( p_data->chroma.p_render->i_chroma )
- {
- case FOURCC_I422:
- switch( p_data->chroma.p_output->i_chroma )
- {
- case FOURCC_YUY2:
- case FOURCC_YUNV:
- break;
-
- case FOURCC_YVYU:
- break;
-
- case FOURCC_UYVY:
- case FOURCC_UYNV:
- case FOURCC_Y422:
- break;
-
- case FOURCC_IUYV:
- break;
-
- case FOURCC_cyuv:
- break;
-
-#if defined (MODULE_NAME_IS_chroma_i422_yuy2)
- case FOURCC_Y211:
- break;
-#endif
-
- default:
- return 0;
- }
- break;
-
- default:
- return 0;
- }
-
- return 100;
-}
-
/*****************************************************************************
* chroma_Init: allocate a chroma function
*****************************************************************************
* aout_directx.c: Windows DirectX audio output method
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: aout_directx.c,v 1.16 2002/01/28 23:08:31 stef Exp $
+ * $Id: aout_directx.c,v 1.17 2002/02/15 13:32:53 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static int aout_Probe ( probedata_t *p_data );
static int aout_Open ( aout_thread_t *p_aout );
static int aout_SetFormat ( aout_thread_t *p_aout );
static long aout_GetBufInfo ( aout_thread_t *p_aout, long l_buffer_info );
*****************************************************************************/
void _M( aout_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
p_function_list->functions.aout.pf_setformat = aout_SetFormat;
p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.pf_close = aout_Close;
}
-/*****************************************************************************
- * aout_Probe: probe the audio device and return a score
- *****************************************************************************
- * This function tries to probe for a Direct Sound device and returns a
- * score to the plugin manager so that it can select the best plugin.
- *****************************************************************************/
-static int aout_Probe( probedata_t *p_data )
-{
- /* For now just assume the computer has a sound device */
- return( 1 );
-}
-
/*****************************************************************************
* aout_Open: open the audio device
*****************************************************************************
* vout_directx.c: Windows DirectX video output display method
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: vout_directx.c,v 1.20 2002/01/27 22:14:52 gbazin Exp $
+ * $Id: vout_directx.c,v 1.21 2002/02/15 13:32:53 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static int vout_Probe ( probedata_t *p_data );
static int vout_Create ( vout_thread_t * );
static void vout_Destroy ( vout_thread_t * );
static int vout_Init ( vout_thread_t * );
*****************************************************************************/
void _M( vout_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = vout_Probe;
p_function_list->functions.vout.pf_create = vout_Create;
p_function_list->functions.vout.pf_init = vout_Init;
p_function_list->functions.vout.pf_end = vout_End;
p_function_list->functions.vout.pf_display = vout_Display;
}
-/*****************************************************************************
- * vout_Probe: probe the video driver and return a score
- *****************************************************************************
- * This function tries to initialize Windows DirectX and returns a score to
- * the plugin manager so that it can select the best plugin.
- *****************************************************************************/
-static int vout_Probe( probedata_t *p_data )
-{
-
- /* Check that at least DirectX5 is installed on the computer */
- /* Fixme */
-
- return( 400 );
-}
-
/*****************************************************************************
* vout_Create: allocate DirectX video thread output method
*****************************************************************************
* downmix.c : AC3 downmix module
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: downmix.c,v 1.6 2001/12/30 07:09:54 sam Exp $
+ * $Id: downmix.c,v 1.7 2002/02/15 13:32:53 sam Exp $
*
* Authors: Renaud Dartus <reno@via.ecp.fr>
*
* Local and extern prototypes.
*****************************************************************************/
static void downmix_getfunctions( function_list_t * p_function_list );
-static int downmix_Probe ( probedata_t *p_data );
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
static void downmix_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = downmix_Probe;
#define F p_function_list->functions.downmix
F.pf_downmix_3f_2r_to_2ch = _M( downmix_3f_2r_to_2ch );
F.pf_downmix_3f_1r_to_2ch = _M( downmix_3f_1r_to_2ch );
#undef F
}
-/*****************************************************************************
- * downmix_Probe: returns a preference score
- *****************************************************************************/
-static int downmix_Probe( probedata_t *p_data )
-{
- return( 50 );
-}
-
* downmix3dn.c : accelerated 3D Now! AC3 downmix module
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: downmix3dn.c,v 1.7 2001/12/30 07:09:54 sam Exp $
+ * $Id: downmix3dn.c,v 1.8 2002/02/15 13:32:53 sam Exp $
*
* Authors: Renaud Dartus <reno@via.ecp.fr>
*
* Local and extern prototypes.
*****************************************************************************/
static void downmix_getfunctions( function_list_t * p_function_list );
-static int downmix_Probe ( probedata_t *p_data );
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
static void downmix_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = downmix_Probe;
#define F p_function_list->functions.downmix
F.pf_downmix_3f_2r_to_2ch = _M( downmix_3f_2r_to_2ch );
F.pf_downmix_3f_1r_to_2ch = _M( downmix_3f_1r_to_2ch );
#undef F
}
-/*****************************************************************************
- * downmix_Probe: returns a preference score
- *****************************************************************************/
-static int downmix_Probe( probedata_t *p_data )
-{
- return( 200 );
-}
-
* downmixsse.c : accelerated SSE AC3 downmix module
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: downmixsse.c,v 1.7 2001/12/30 07:09:54 sam Exp $
+ * $Id: downmixsse.c,v 1.8 2002/02/15 13:32:53 sam Exp $
*
* Authors: Renaud Dartus <reno@via.ecp.fr>
*
* Local and extern prototypes.
*****************************************************************************/
static void downmix_getfunctions( function_list_t * p_function_list );
-static int downmix_Probe ( probedata_t *p_data );
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
static void downmix_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = downmix_Probe;
#define F p_function_list->functions.downmix
F.pf_downmix_3f_2r_to_2ch = _M( downmix_3f_2r_to_2ch );
F.pf_downmix_3f_1r_to_2ch = _M( downmix_3f_1r_to_2ch );
#undef F
}
-/*****************************************************************************
- * downmix_Probe: returns a preference score
- *****************************************************************************/
-static int downmix_Probe( probedata_t *p_data )
-{
- return( 200 );
-}
-
* aout_dsp.c : dsp functions library
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: aout_dsp.c,v 1.20 2002/01/28 23:08:31 stef Exp $
+ * $Id: aout_dsp.c,v 1.21 2002/02/15 13:32:53 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static int aout_Probe ( probedata_t *p_data );
static int aout_Open ( aout_thread_t *p_aout );
static int aout_SetFormat ( aout_thread_t *p_aout );
static long aout_GetBufInfo ( aout_thread_t *p_aout, long l_buffer_info );
*****************************************************************************/
void _M( aout_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
p_function_list->functions.aout.pf_setformat = aout_SetFormat;
p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.pf_close = aout_Close;
}
-/*****************************************************************************
- * aout_Probe: probe the audio device and return a score
- *****************************************************************************
- * This function tries to open the DSP and returns a score to the plugin
- * manager so that it can choose the most appropriate one.
- *****************************************************************************/
-static int aout_Probe( probedata_t *p_data )
-{
- char * psz_device = main_GetPszVariable( AOUT_DSP_VAR, AOUT_DSP_DEFAULT );
- int i_fd = open( psz_device, O_WRONLY|O_NONBLOCK );
-
- /* If we were unable to open the device, there is no way we can use
- * the plugin. Return a score of 0. */
- if( i_fd < 0 )
- {
- return( 0 );
- }
-
- /* Otherwise, there are good chances we can use this plugin, return 100. */
- close( i_fd );
-
- return( 100 );
-}
-
/*****************************************************************************
* aout_Open: opens the audio device (the digital sound processor)
*****************************************************************************
* aout_dummy.c : dummy audio output plugin
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: aout_dummy.c,v 1.18 2002/01/28 23:08:31 stef Exp $
+ * $Id: aout_dummy.c,v 1.19 2002/02/15 13:32:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static int aout_Probe ( probedata_t *p_data );
static int aout_Open ( aout_thread_t *p_aout );
static int aout_SetFormat ( aout_thread_t *p_aout );
static long aout_GetBufInfo ( aout_thread_t *p_aout, long l_buffer_info );
*****************************************************************************/
void _M( aout_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
p_function_list->functions.aout.pf_setformat = aout_SetFormat;
p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.pf_close = aout_Close;
}
-/*****************************************************************************
- * aout_Probe: probe the audio device and return a score
- *****************************************************************************/
-static int aout_Probe( probedata_t *p_data )
-{
- return( 1 );
-}
-
/*****************************************************************************
* aout_Open: opens a dummy audio device
*****************************************************************************/
* input_dummy.c: dummy input plugin, to manage "vlc:***" special options
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: input_dummy.c,v 1.14 2002/01/10 04:11:25 sam Exp $
+ * $Id: input_dummy.c,v 1.15 2002/02/15 13:32:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int DummyProbe ( probedata_t * );
+static int DummyProbe ( struct input_thread_s * );
static void DummyInit ( struct input_thread_s * );
static void DummyOpen ( struct input_thread_s * );
static void DummyClose ( struct input_thread_s * );
void _M( input_getfunctions )( function_list_t * p_function_list )
{
#define input p_function_list->functions.input
- p_function_list->pf_probe = DummyProbe;
+ input.pf_probe = DummyProbe;
input.pf_init = DummyInit;
input.pf_open = DummyOpen;
input.pf_close = DummyClose;
/*****************************************************************************
* DummyProbe: verifies that the input is a vlc command
*****************************************************************************/
-static int DummyProbe( probedata_t *p_data )
+static int DummyProbe( input_thread_t *p_input )
{
- input_thread_t *p_input = (input_thread_t *)p_data;
char *psz_name = p_input->p_source;
if( ( strlen(psz_name) > 4 ) && !strncasecmp( psz_name, "vlc:", 4 ) )
{
- /* If the user specified "vlc:" then it's probably a file */
- return( 1 );
+ /* If the user specified "vlc:" then it's probably a special command */
+ return 0;
}
- return( 0 );
+ return -1;
}
/*****************************************************************************
switch( p_method->i_command )
{
case COMMAND_QUIT:
- p_input->b_die = 1;
+ p_main->p_intf->b_die = 1;
+ p_input->b_eof = 1;
break;
case COMMAND_LOOP:
* intf_dummy.c: dummy interface plugin
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: intf_dummy.c,v 1.14 2002/01/29 20:11:18 gbazin Exp $
+ * $Id: intf_dummy.c,v 1.15 2002/02/15 13:32:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static int intf_Probe ( probedata_t *p_data );
static int intf_Open ( intf_thread_t *p_intf );
static void intf_Close ( intf_thread_t *p_intf );
static void intf_Run ( intf_thread_t *p_intf );
*****************************************************************************/
void _M( intf_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = intf_Probe;
p_function_list->functions.intf.pf_open = intf_Open;
p_function_list->functions.intf.pf_close = intf_Close;
p_function_list->functions.intf.pf_run = intf_Run;
}
-/*****************************************************************************
- * intf_Probe: probe the interface and return a score
- *****************************************************************************
- * This function tries to initialize Gnome and returns a score to the
- * plugin manager so that it can select the best plugin.
- *****************************************************************************/
-static int intf_Probe( probedata_t *p_data )
-{
- return( 1 );
-}
-
/*****************************************************************************
* intf_Open: initialize dummy interface
*****************************************************************************/
* vout_dummy.c: Dummy video output display method for testing purposes
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: vout_dummy.c,v 1.17 2002/01/12 01:25:57 sam Exp $
+ * $Id: vout_dummy.c,v 1.18 2002/02/15 13:32:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int vout_Probe ( probedata_t *p_data );
static int vout_Create ( struct vout_thread_s * );
static int vout_Init ( struct vout_thread_s * );
static void vout_End ( struct vout_thread_s * );
*****************************************************************************/
void _M( vout_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = vout_Probe;
p_function_list->functions.vout.pf_create = vout_Create;
p_function_list->functions.vout.pf_init = vout_Init;
p_function_list->functions.vout.pf_end = vout_End;
p_function_list->functions.vout.pf_display = vout_Display;
}
-/*****************************************************************************
- * intf_Probe: return a score
- *****************************************************************************/
-static int vout_Probe( probedata_t *p_data )
-{
- return( 1 );
-}
-
/*****************************************************************************
* vout_Create: allocates dummy video thread output method
*****************************************************************************
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: input_dvd.c,v 1.118 2002/01/10 04:11:25 sam Exp $
+ * $Id: input_dvd.c,v 1.119 2002/02/15 13:32:53 sam Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
* Local prototypes
*****************************************************************************/
/* called from outside */
-static int DVDProbe ( probedata_t *p_data );
+static int DVDProbe ( struct input_thread_s * );
static void DVDInit ( struct input_thread_s * );
static void DVDEnd ( struct input_thread_s * );
static void DVDOpen ( struct input_thread_s * );
void _M( input_getfunctions )( function_list_t * p_function_list )
{
#define input p_function_list->functions.input
- p_function_list->pf_probe = DVDProbe;
+ input.pf_probe = DVDProbe;
input.pf_init = DVDInit;
input.pf_open = DVDOpen;
input.pf_close = DVDClose;
/*****************************************************************************
* DVDProbe: verifies that the stream is a PS stream
*****************************************************************************/
-static int DVDProbe( probedata_t *p_data )
+static int DVDProbe( input_thread_t * p_input )
{
- input_thread_t * p_input = (input_thread_t *)p_data;
-
char * psz_name = p_input->p_source;
- int i_score = 0;
if( ( strlen(psz_name) > 4 ) && !strncasecmp( psz_name, "dvd:", 4 ) )
{
/* If the user specified "dvd:" then it's probably a DVD */
- i_score = 100;
- psz_name += 4;
+ return 0;
}
- return( i_score );
+ return -1;
}
/*****************************************************************************
* It depends on: libdvdread for ifo files and block reading.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: input_dvdread.c,v 1.19 2002/01/15 19:01:28 stef Exp $
+ * $Id: input_dvdread.c,v 1.20 2002/02/15 13:32:53 sam Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
* Local prototypes
*****************************************************************************/
/* called from outside */
-static int DvdReadProbe ( probedata_t *p_data );
+static int DvdReadProbe ( struct input_thread_s * );
static void DvdReadInit ( struct input_thread_s * );
static void DvdReadEnd ( struct input_thread_s * );
static void DvdReadOpen ( struct input_thread_s * );
void _M( input_getfunctions )( function_list_t * p_function_list )
{
#define input p_function_list->functions.input
- p_function_list->pf_probe = DvdReadProbe;
+ input.pf_probe = DvdReadProbe;
input.pf_init = DvdReadInit;
input.pf_open = DvdReadOpen;
input.pf_close = DvdReadClose;
/*****************************************************************************
* DvdReadProbe: verifies that the stream is a PS stream
*****************************************************************************/
-static int DvdReadProbe( probedata_t *p_data )
+static int DvdReadProbe( input_thread_t *p_input )
{
- input_thread_t * p_input = (input_thread_t *)p_data;
-
char * psz_name = p_input->p_source;
if((( strlen(psz_name) > 8 ) && !strncasecmp( psz_name, "dvdread:", 8 ))
||(( strlen(psz_name) > 4 ) && !strncasecmp( psz_name, "dvd:", 4 )))
{
- return 1;
+ return 0;
}
- return 0;
+ return -1;
}
/*****************************************************************************
* aout_esd.c : Esound functions library
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: aout_esd.c,v 1.18 2002/01/28 23:08:31 stef Exp $
+ * $Id: aout_esd.c,v 1.19 2002/02/15 13:32:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static int aout_Probe ( probedata_t *p_data );
static int aout_Open ( aout_thread_t *p_aout );
static int aout_SetFormat ( aout_thread_t *p_aout );
static long aout_GetBufInfo ( aout_thread_t *p_aout, long l_buffer_info );
*****************************************************************************/
void _M( aout_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
p_function_list->functions.aout.pf_setformat = aout_SetFormat;
p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.pf_close = aout_Close;
}
-/*****************************************************************************
- * aout_Probe: probes the audio device and return a score
- *****************************************************************************
- * This function tries to open the dps and returns a score to the plugin
- * manager so that it can
- *****************************************************************************/
-static int aout_Probe( probedata_t *p_data )
-{
- /* We don't have to test anything -- if we managed to open this plugin,
- * it means we have the appropriate libs. */
- return( 50 );
-}
-
/*****************************************************************************
* aout_Open: open an esd socket
*****************************************************************************/
* fb.c : framebuffer plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: fb.c,v 1.12 2002/01/12 01:25:57 sam Exp $
+ * $Id: fb.c,v 1.13 2002/02/15 13:32:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
*****************************************************************************/
static void vout_getfunctions( function_list_t * p_function_list );
-static int vout_Probe ( probedata_t *p_data );
static int vout_Create ( vout_thread_t * );
static void vout_Destroy ( vout_thread_t * );
static void vout_Render ( vout_thread_t *, picture_t * );
*****************************************************************************/
static void vout_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = vout_Probe;
p_function_list->functions.vout.pf_create = vout_Create;
p_function_list->functions.vout.pf_init = vout_Init;
p_function_list->functions.vout.pf_end = vout_End;
p_function_list->functions.vout.pf_display = vout_Display;
}
-/*****************************************************************************
- * vout_Probe: probe the video driver and return a score
- *****************************************************************************
- * This function tries to open the framebuffer and returns a score to the
- * plugin manager so that it can select the best plugin.
- *****************************************************************************/
-static int vout_Probe( probedata_t *p_data )
-{
- int i_fd;
-
- i_fd = open( main_GetPszVariable( VOUT_FB_DEV_VAR,
- VOUT_FB_DEV_DEFAULT ), O_RDWR );
- if( i_fd == -1 )
- {
- return( 0 );
- }
- close( i_fd );
-
- return( 30 );
-}
-
/*****************************************************************************
* vout_Create: allocates FB video thread output method
*****************************************************************************
* deinterlace.c : deinterlacer plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: deinterlace.c,v 1.4 2002/01/05 03:49:18 sam Exp $
+ * $Id: deinterlace.c,v 1.5 2002/02/15 13:32:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int vout_Probe ( probedata_t *p_data );
static int vout_Create ( struct vout_thread_s * );
static int vout_Init ( struct vout_thread_s * );
static void vout_End ( struct vout_thread_s * );
*****************************************************************************/
static void vout_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = vout_Probe;
p_function_list->functions.vout.pf_create = vout_Create;
p_function_list->functions.vout.pf_init = vout_Init;
p_function_list->functions.vout.pf_end = vout_End;
p_function_list->functions.vout.pf_display = vout_Display;
}
-/*****************************************************************************
- * intf_Probe: return a score
- *****************************************************************************/
-static int vout_Probe( probedata_t *p_data )
-{
- return( 0 );
-}
-
/*****************************************************************************
* vout_Create: allocates Deinterlace video thread output method
*****************************************************************************
* distort.c : Misc video effects plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: distort.c,v 1.6 2002/01/05 03:49:18 sam Exp $
+ * $Id: distort.c,v 1.7 2002/02/15 13:32:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int vout_Probe ( probedata_t *p_data );
static int vout_Create ( struct vout_thread_s * );
static int vout_Init ( struct vout_thread_s * );
static void vout_End ( struct vout_thread_s * );
*****************************************************************************/
static void vout_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = vout_Probe;
p_function_list->functions.vout.pf_create = vout_Create;
p_function_list->functions.vout.pf_init = vout_Init;
p_function_list->functions.vout.pf_end = vout_End;
p_function_list->functions.vout.pf_display = vout_Display;
}
-/*****************************************************************************
- * intf_Probe: return a score
- *****************************************************************************/
-static int vout_Probe( probedata_t *p_data )
-{
- return( 0 );
-}
-
/*****************************************************************************
* vout_Create: allocates Distort video thread output method
*****************************************************************************
* invert.c : Invert video plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: invert.c,v 1.6 2002/01/05 03:49:18 sam Exp $
+ * $Id: invert.c,v 1.7 2002/02/15 13:32:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int vout_Probe ( probedata_t *p_data );
static int vout_Create ( struct vout_thread_s * );
static int vout_Init ( struct vout_thread_s * );
static void vout_End ( struct vout_thread_s * );
*****************************************************************************/
static void vout_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = vout_Probe;
p_function_list->functions.vout.pf_create = vout_Create;
p_function_list->functions.vout.pf_init = vout_Init;
p_function_list->functions.vout.pf_end = vout_End;
p_function_list->functions.vout.pf_display = vout_Display;
}
-/*****************************************************************************
- * intf_Probe: return a score
- *****************************************************************************/
-static int vout_Probe( probedata_t *p_data )
-{
- return( 0 );
-}
-
/*****************************************************************************
* vout_Create: allocates Invert video thread output method
*****************************************************************************
* transform.c : transform image plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: transform.c,v 1.5 2002/01/05 03:49:18 sam Exp $
+ * $Id: transform.c,v 1.6 2002/02/15 13:32:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int vout_Probe ( probedata_t *p_data );
static int vout_Create ( struct vout_thread_s * );
static int vout_Init ( struct vout_thread_s * );
static void vout_End ( struct vout_thread_s * );
*****************************************************************************/
static void vout_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = vout_Probe;
p_function_list->functions.vout.pf_create = vout_Create;
p_function_list->functions.vout.pf_init = vout_Init;
p_function_list->functions.vout.pf_end = vout_End;
p_function_list->functions.vout.pf_display = vout_Display;
}
-/*****************************************************************************
- * intf_Probe: return a score
- *****************************************************************************/
-static int vout_Probe( probedata_t *p_data )
-{
- return( 0 );
-}
-
/*****************************************************************************
* vout_Create: allocates Transform video thread output method
*****************************************************************************
* wall.c : Wall video plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: wall.c,v 1.11 2002/01/30 00:09:49 sam Exp $
+ * $Id: wall.c,v 1.12 2002/02/15 13:32:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int vout_Probe ( probedata_t *p_data );
static int vout_Create ( vout_thread_t * );
static int vout_Init ( vout_thread_t * );
static void vout_End ( vout_thread_t * );
*****************************************************************************/
static void vout_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = vout_Probe;
p_function_list->functions.vout.pf_create = vout_Create;
p_function_list->functions.vout.pf_init = vout_Init;
p_function_list->functions.vout.pf_end = vout_End;
p_function_list->functions.vout.pf_display = vout_Display;
}
-/*****************************************************************************
- * intf_Probe: return a score
- *****************************************************************************/
-static int vout_Probe( probedata_t *p_data )
-{
- return( 0 );
-}
-
/*****************************************************************************
* vout_Create: allocates Wall video thread output method
*****************************************************************************
"using wall:3x3" );
p_vout->p_sys->i_col = 3;
p_vout->p_sys->i_row = 3;
+ psz_method = NULL;
}
p_vout->p_sys->i_col = MAX( 1, MIN( 15, p_vout->p_sys->i_col ) );
* ggi.c : GGI plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: ggi.c,v 1.12 2002/01/12 01:25:57 sam Exp $
+ * $Id: ggi.c,v 1.13 2002/02/15 13:32:53 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
*****************************************************************************/
static void vout_getfunctions( function_list_t * p_function_list );
-static int vout_Probe ( probedata_t *p_data );
static int vout_Create ( vout_thread_t * );
static int vout_Init ( vout_thread_t * );
static void vout_End ( vout_thread_t * );
*****************************************************************************/
static void vout_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = vout_Probe;
p_function_list->functions.vout.pf_create = vout_Create;
p_function_list->functions.vout.pf_init = vout_Init;
p_function_list->functions.vout.pf_end = vout_End;
p_function_list->functions.vout.pf_display = vout_Display;
}
-/*****************************************************************************
- * vout_Probe: probe the video driver and return a score
- *****************************************************************************
- * This function tries to initialize GGI and returns a score to the
- * plugin manager so that it can select the best plugin.
- *****************************************************************************/
-static int vout_Probe( probedata_t *p_data )
-{
- return( 1 );
-}
-
/*****************************************************************************
* vout_Create: allocate GGI video thread output method
*****************************************************************************
* glide.c : 3dfx Glide plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: glide.c,v 1.11 2002/01/09 02:01:14 sam Exp $
+ * $Id: glide.c,v 1.12 2002/02/15 13:32:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
*****************************************************************************/
static void vout_getfunctions( function_list_t * p_function_list );
-static int vout_Probe ( probedata_t *p_data );
static int vout_Create ( vout_thread_t * );
static int vout_Init ( vout_thread_t * );
static void vout_End ( vout_thread_t * );
*****************************************************************************/
void _M( vout_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = vout_Probe;
p_function_list->functions.vout.pf_create = vout_Create;
p_function_list->functions.vout.pf_init = vout_Init;
p_function_list->functions.vout.pf_end = vout_End;
p_function_list->functions.vout.pf_display = vout_Display;
}
-/*****************************************************************************
- * vout_Probe: probe the video driver and return a score
- *****************************************************************************
- * This function tries to initialize SDL and returns a score to the
- * plugin manager so that it can select the best plugin.
- *****************************************************************************/
-static int vout_Probe( probedata_t *p_data )
-{
- /* 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 */
- return( 1 );
-}
-
/*****************************************************************************
* vout_Create: allocates Glide video thread output method
*****************************************************************************
* gnome.c : Gnome plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: gnome.c,v 1.8 2002/01/15 19:01:28 stef Exp $
+ * $Id: gnome.c,v 1.9 2002/02/15 13:32:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
* Local prototypes.
*****************************************************************************/
static void intf_getfunctions( function_list_t * p_function_list );
-static int intf_Probe ( probedata_t *p_data );
static int intf_Open ( intf_thread_t *p_intf );
static void intf_Close ( intf_thread_t *p_intf );
static void intf_Run ( intf_thread_t *p_intf );
*****************************************************************************/
static void intf_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = intf_Probe;
p_function_list->functions.intf.pf_open = intf_Open;
p_function_list->functions.intf.pf_close = intf_Close;
p_function_list->functions.intf.pf_run = intf_Run;
}
-/*****************************************************************************
- * intf_Probe: probe the interface and return a score
- *****************************************************************************
- * This function tries to initialize Gnome and returns a score to the
- * plugin manager so that it can select the best plugin.
- *****************************************************************************/
-static int intf_Probe( probedata_t *p_data )
-{
-#ifndef WIN32
- if( getenv( "DISPLAY" ) == NULL )
- {
- return( 15 );
- }
-#endif
-
- return( 100 );
-}
-
/*****************************************************************************
* intf_Open: initialize and create window
*****************************************************************************/
* gtk.c : Gtk+ plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: gtk.c,v 1.10 2002/01/15 19:01:28 stef Exp $
+ * $Id: gtk.c,v 1.11 2002/02/15 13:32:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
* Local prototypes.
*****************************************************************************/
static void intf_getfunctions ( function_list_t * p_function_list );
-static int intf_Probe ( probedata_t *p_data );
static int intf_Open ( intf_thread_t *p_intf );
static void intf_Close ( intf_thread_t *p_intf );
static void intf_Run ( intf_thread_t *p_intf );
*****************************************************************************/
static void intf_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = intf_Probe;
p_function_list->functions.intf.pf_open = intf_Open;
p_function_list->functions.intf.pf_close = intf_Close;
p_function_list->functions.intf.pf_run = intf_Run;
}
-/*****************************************************************************
- * intf_Probe: probe the interface and return a score
- *****************************************************************************
- * This function tries to initialize Gtk+ and returns a score to the
- * plugin manager so that it can select the best plugin.
- *****************************************************************************/
-static int intf_Probe( probedata_t *p_data )
-{
-#ifndef WIN32
- if( getenv( "DISPLAY" ) == NULL )
- {
- return( 10 );
- }
-#endif
-
- return( 90 );
-}
-
/*****************************************************************************
* intf_Open: initialize and create window
*****************************************************************************/
* gtk_playlist.c : Interface for the playlist dialog
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: gtk_playlist.c,v 1.28 2002/02/14 23:29:17 sam Exp $
+ * $Id: gtk_playlist.c,v 1.29 2002/02/15 13:32:53 sam Exp $
*
* Authors: Pierre Baillet <oct@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
#include <sys/types.h> /* for readdir and stat stuff */
+#if !defined( WIN32 )
+# include <dirent.h>
+#endif
+
#include <sys/stat.h>
#include <unistd.h>
* idct.c : C IDCT module
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: idct.c,v 1.19 2001/12/30 07:09:55 sam Exp $
+ * $Id: idct.c,v 1.20 2002/02/15 13:32:53 sam Exp $
*
* Author: Gaël Hendryckx <jimmy@via.ecp.fr>
*
/* Following functions are local */
-/*****************************************************************************
- * idct_Probe: returns a preference score
- *****************************************************************************/
-static int idct_Probe( probedata_t *p_data )
-{
- return( 50 );
-}
-
/*****************************************************************************
* NormScan : Unused in this IDCT
*****************************************************************************/
* idct_decl.h : common declarations, must be included at the very end
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: idct_decl.h,v 1.1 2001/09/05 16:07:49 massiot Exp $
+ * $Id: idct_decl.h,v 1.2 2002/02/15 13:32:53 sam Exp $
*
* Author: Christophe Massiot <massiot@via.ecp.fr>
*
*****************************************************************************/
static void idct_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = idct_Probe;
#define F p_function_list->functions.idct
F.pf_idct_init = InitIDCT;
F.pf_norm_scan = NormScan;
* idctaltivec.c : Altivec IDCT module
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: idctaltivec.c,v 1.22 2001/12/30 07:09:55 sam Exp $
+ * $Id: idctaltivec.c,v 1.23 2002/02/15 13:32:53 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
/* Following functions are local */
-/*****************************************************************************
- * idct_Probe: return a preference score
- *****************************************************************************/
-static int idct_Probe( probedata_t *p_data )
-{
- return( 200 );
-}
-
/*****************************************************************************
* NormScan : This IDCT uses reordered coeffs, so we patch the scan table
*****************************************************************************/
*****************************************************************************/
static void idct_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = idct_Probe;
#define F p_function_list->functions.idct
F.pf_idct_init = InitIDCT;
F.pf_norm_scan = NormScan;
* idctclassic.c : Classic IDCT module
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: idctclassic.c,v 1.19 2001/12/30 07:09:55 sam Exp $
+ * $Id: idctclassic.c,v 1.20 2002/02/15 13:32:53 sam Exp $
*
* Authors: Gaël Hendryckx <jimmy@via.ecp.fr>
*
/* Following functions are local */
-/*****************************************************************************
- * idct_Probe: returns a preference score
- *****************************************************************************/
-static int idct_Probe( probedata_t *p_data )
-{
- return( 100 );
-}
-
/*****************************************************************************
* NormScan : Unused in this IDCT
*****************************************************************************/
* idctmmx.c : MMX IDCT module
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: idctmmx.c,v 1.22 2001/12/30 07:09:55 sam Exp $
+ * $Id: idctmmx.c,v 1.23 2002/02/15 13:32:53 sam Exp $
*
* Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* Michel Lespinasse <walken@zoy.org>
/* Following functions are local */
-/*****************************************************************************
- * idct_Probe: return a preference score
- *****************************************************************************/
-static int idct_Probe( probedata_t *p_data )
-{
- return( 150 );
-}
-
/*****************************************************************************
* NormScan : This IDCT uses reordered coeffs, so we patch the scan table
*****************************************************************************/
* idctmmxext.c : MMX EXT IDCT module
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: idctmmxext.c,v 1.19 2001/12/30 07:09:55 sam Exp $
+ * $Id: idctmmxext.c,v 1.20 2002/02/15 13:32:53 sam Exp $
*
* Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* Michel Lespinasse <walken@zoy.org>
/* Following functions are local */
-/*****************************************************************************
- * idct_Probe: return a preference score
- *****************************************************************************/
-static int idct_Probe( probedata_t *p_data )
-{
- return( 200 );
-}
-
/*****************************************************************************
* NormScan : This IDCT uses reordered coeffs, so we patch the scan table
*****************************************************************************/
* imdct.c : IMDCT module
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: imdct.c,v 1.7 2001/12/30 07:09:55 sam Exp $
+ * $Id: imdct.c,v 1.8 2002/02/15 13:32:53 sam Exp $
*
* Authors: Gaël Hendryckx <jimmy@via.ecp.fr>
*
* Local and extern prototypes.
*****************************************************************************/
static void imdct_getfunctions( function_list_t * p_function_list );
-static int imdct_Probe ( probedata_t *p_data );
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
static void imdct_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = imdct_Probe;
#define F p_function_list->functions.imdct
F.pf_imdct_init = _M( imdct_init );
F.pf_imdct_256 = _M( imdct_do_256 );
#undef F
}
-/*****************************************************************************
- * imdct_Probe: returns a preference score
- *****************************************************************************/
-static int imdct_Probe( probedata_t *p_data )
-{
- return( 50 );
-}
-
* imdct3dn.c : accelerated 3D Now! IMDCT module
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: imdct3dn.c,v 1.9 2001/12/30 07:09:55 sam Exp $
+ * $Id: imdct3dn.c,v 1.10 2002/02/15 13:32:53 sam Exp $
*
* Authors: Renaud Dartus <reno@via.ecp.fr>
*
* Local and extern prototypes.
*****************************************************************************/
static void imdct_getfunctions( function_list_t * p_function_list );
-static int imdct_Probe ( probedata_t *p_data );
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
static void imdct_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = imdct_Probe;
#define F p_function_list->functions.imdct
F.pf_imdct_init = _M( imdct_init );
F.pf_imdct_256 = _M( imdct_do_256 );
#undef F
}
-/*****************************************************************************
- * imdct_Probe: returns a preference score
- *****************************************************************************/
-static int imdct_Probe( probedata_t *p_data )
-{
- return( 200 );
-}
-
* imdctsse.c : accelerated SSE IMDCT module
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: imdctsse.c,v 1.10 2001/12/30 07:09:55 sam Exp $
+ * $Id: imdctsse.c,v 1.11 2002/02/15 13:32:53 sam Exp $
*
* Authors: Gaël Hendryckx <jimmy@via.ecp.fr>
*
* Local and extern prototypes.
*****************************************************************************/
static void imdct_getfunctions( function_list_t * p_function_list );
-static int imdct_Probe ( probedata_t *p_data );
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
static void imdct_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = imdct_Probe;
#define F p_function_list->functions.imdct
F.pf_imdct_init = _M( imdct_init );
F.pf_imdct_256 = _M( imdct_do_256 );
#undef F
}
-/*****************************************************************************
- * imdct_Probe: returns a preference score
- *****************************************************************************/
-static int imdct_Probe( probedata_t *p_data )
-{
-#if defined ( __MINGW32__ )
- return 0;
-#else
- return( 200 );
-#endif
-}
-
* lirc.c : lirc plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: lirc.c,v 1.1 2002/02/06 02:37:18 sam Exp $
+ * $Id: lirc.c,v 1.2 2002/02/15 13:32:53 sam Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
*****************************************************************************/
static void intf_getfunctions( function_list_t * p_function_list );
-static int intf_Probe ( probedata_t *p_data );
static int intf_Open ( intf_thread_t *p_intf );
static void intf_Close ( intf_thread_t *p_intf );
static void intf_Run ( intf_thread_t *p_intf );
*****************************************************************************/
static void intf_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = intf_Probe;
p_function_list->functions.intf.pf_open = intf_Open;
p_function_list->functions.intf.pf_close = intf_Close;
p_function_list->functions.intf.pf_run = intf_Run;
}
-/*****************************************************************************
- * intf_Probe: probe the interface and return a score
- *****************************************************************************/
-static int intf_Probe( probedata_t *p_data )
-{
- return( 1 );
-}
-
/*****************************************************************************
* intf_Open: initialize dummy interface
*****************************************************************************/
* lpcm_decoder_thread.c: lpcm decoder thread
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: lpcm_adec.c,v 1.10 2002/01/21 23:57:46 massiot Exp $
+ * $Id: lpcm_adec.c,v 1.11 2002/02/15 13:32:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Henri Fallon <henri@videolan.org>
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int decoder_Probe ( probedata_t * );
+static int decoder_Probe ( u8 * );
static int decoder_Run ( decoder_config_t * );
void DecodeFrame ( lpcmdec_thread_t * );
static int InitThread ( lpcmdec_thread_t * );
*****************************************************************************/
void _M( adec_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = decoder_Probe;
- p_function_list->functions.dec.pf_run = decoder_Run;
+ p_function_list->functions.dec.pf_probe = decoder_Probe;
+ p_function_list->functions.dec.pf_run = decoder_Run;
}
/*****************************************************************************
/*****************************************************************************
* decoder_Probe: probe the decoder and return score
*****************************************************************************/
-static int decoder_Probe( probedata_t *p_data )
+static int decoder_Probe( u8 *pi_type )
{
- return ( p_data->i_type == LPCM_AUDIO_ES ) ? 100 : 0;
+ return ( *pi_type == LPCM_AUDIO_ES ) ? 0 : -1;
}
/*****************************************************************************
* aout_darwin.c : Darwin audio output plugin
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: aout_macosx.c,v 1.11 2002/01/28 23:08:31 stef Exp $
+ * $Id: aout_macosx.c,v 1.12 2002/02/15 13:32:53 sam Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
*
#include "audio_output.h" /* aout_thread_t */
-#include "modules.h"
-
#include <Carbon/Carbon.h>
#include <CoreAudio/AudioHardware.h>
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static int aout_Probe ( probedata_t *p_data );
static int aout_Open ( aout_thread_t *p_aout );
static int aout_SetFormat ( aout_thread_t *p_aout );
static long aout_GetBufInfo ( aout_thread_t *p_aout, long l_buffer_info );
*****************************************************************************/
void _M( aout_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
p_function_list->functions.aout.pf_setformat = aout_SetFormat;
p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.pf_close = aout_Close;
}
-/*****************************************************************************
- * aout_Probe: probe the audio device and return a score
- *****************************************************************************/
-static int aout_Probe( probedata_t *p_data )
-{
- /* This plugin always works under OS X */
- return( 100 );
-}
-
/*****************************************************************************
* aout_Open: opens a HAL audio device
*****************************************************************************/
#include <videolan/vlc.h>
-#include "interface.h"
-
-/* OS specific */
-#import <Cocoa/Cocoa.h>
-
-
-/*****************************************************************************
- * intf_sys_t: description and status of the interface
- *****************************************************************************/
-typedef struct intf_sys_s
-{
- NSAutoreleasePool *o_pool ;
-} intf_sys_t;
+#include "macosx.h"
+#include "interface.h"
+#include "intf_main.h"
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static int intf_Probe ( probedata_t *p_data );
static int intf_Open ( intf_thread_t *p_intf );
static void intf_Close ( intf_thread_t *p_intf );
static void intf_Run ( intf_thread_t *p_intf );
*****************************************************************************/
void _M( intf_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = intf_Probe;
p_function_list->functions.intf.pf_open = intf_Open;
p_function_list->functions.intf.pf_close = intf_Close;
p_function_list->functions.intf.pf_run = intf_Run;
}
-/*****************************************************************************
- * intf_Probe: probe the interface and return a score
- *****************************************************************************
- * This function checks the interface can be run and returns a score to the
- * plugin manager so that it can select the best plugin.
- *****************************************************************************/
-static int intf_Probe( probedata_t *p_data )
-{
- /* Under MacOS X, this plugin always works */
- return( 100 );
-}
-
/*****************************************************************************
* intf_Open: initialize interface
*****************************************************************************/
--- /dev/null
+/*****************************************************************************
+ * intf_main.h: MacOS X interface plugin
+ *****************************************************************************
+ * Copyright (C) 2001 VideoLAN
+ *
+ * Authors: Colin Delacroix <colin@zoy.org>
+ * Florian G. Pflug <fgp@phlo.org>
+ *
+ * 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.
+ *****************************************************************************/
+
+/* OS specific */
+#import <Cocoa/Cocoa.h>
+
+/*****************************************************************************
+ * intf_sys_t: description and status of the interface
+ *****************************************************************************/
+typedef struct intf_sys_s
+{
+ osx_com_t osx_communication ;
+
+ NSAutoreleasePool *o_pool ;
+} intf_sys_t;
+
* intf_vlc_wrapper.c : MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: intf_vlc_wrapper.c,v 1.6 2001/12/30 07:09:55 sam Exp $
+ * $Id: intf_vlc_wrapper.c,v 1.7 2002/02/15 13:32:53 sam Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
*
#include <videolan/vlc.h>
+#include "macosx.h"
+
#include "interface.h"
#include "intf_playlist.h"
-
-#define OSX_COM_STRUCT vout_sys_s
-#define OSX_COM_TYPE vout_sys_t
-#include "macosx.h"
+#include "intf_main.h"
#include "video.h"
#include "video_output.h"
#import "intf_vlc_wrapper.h"
-#define p_area p_main->p_intf->p_input->stream.p_selected_area
-
-@interface Intf_VlcWrapper(Private)
-- (struct vout_thread_s*) lockVout ;
-- (void) unlockVout ;
-@end
+#define p_area p_input_bank->pp_input[0]->stream.p_selected_area
@implementation Intf_VlcWrapper
//Initialization,.....
bool b_resize=FALSE, b_request=FALSE, b_release=FALSE;
bool b_fullscreen=FALSE ;
+printf("start managing\n");
p_main->p_intf->pf_manage( p_main->p_intf ) ;
- if ((p_vout = [self lockVout])) {
- i_width = p_vout->i_width ;
- i_height = p_vout->i_height ;
+ if ((p_vout = p_main->p_intf->p_sys->osx_communication.p_vout)) {
+printf("doing stuff with vout\n");
+ i_width = p_vout->output.i_width ;
+ i_height = p_vout->output.i_height ;
b_fullscreen = !!p_vout->b_fullscreen ;
//Also mange the notifications for the output.
if (p_vout->i_changes & (VOUT_SIZE_CHANGE | VOUT_FULLSCREEN_CHANGE)) b_resize = TRUE ;
- if (p_vout->p_sys->i_changes & OSX_VOUT_INTF_REQUEST_QDPORT) b_request = TRUE ;
- if (p_vout->p_sys->i_changes & OSX_VOUT_INTF_RELEASE_QDPORT) b_release = TRUE ;
-
p_vout->i_changes &= ~(VOUT_SIZE_CHANGE | VOUT_FULLSCREEN_CHANGE) ;
- p_vout->p_sys->i_changes &= ~(OSX_VOUT_INTF_REQUEST_QDPORT | OSX_VOUT_INTF_RELEASE_QDPORT) ;
-
- [self unlockVout] ;
}
if (b_resize) [o_delegate resizeQDPortFullscreen:b_fullscreen] ;
+
+printf(" testing...\n");
+ if (p_main->p_intf->p_sys->osx_communication.i_changes & OSX_VOUT_INTF_REQUEST_QDPORT) b_request = TRUE ;
+printf(" tested : %s\n", b_request ? "YES !!!" : "nope..." );
+ if (p_main->p_intf->p_sys->osx_communication.i_changes & OSX_VOUT_INTF_RELEASE_QDPORT) b_release = TRUE ;
+
+ p_main->p_intf->p_sys->osx_communication.i_changes &= ~(OSX_VOUT_INTF_REQUEST_QDPORT | OSX_VOUT_INTF_RELEASE_QDPORT) ;
+
if (b_release) [o_delegate releaseQDPort] ;
if (b_request) [o_delegate requestQDPortFullscreen:b_fullscreen] ;
+printf("end managing\n\n");
return p_main->p_intf->b_die ;
}
//Function for the GUI.
- (void) setQDPort:(CGrafPtr)p_qdport {
- vout_thread_t *p_vout;
- if ((p_vout = [self lockVout])) {
- p_vout->p_sys->p_qdport = p_qdport ;
- p_vout->p_sys->i_changes |= OSX_INTF_VOUT_QDPORT_CHANGE ;
- [self unlockVout] ;
- }
+printf("setQDPort !!\n");
+ p_main->p_intf->p_sys->osx_communication.p_qdport = p_qdport ;
+ p_main->p_intf->p_sys->osx_communication.i_changes |= OSX_INTF_VOUT_QDPORT_CHANGE ;
}
- (void) sizeChangeQDPort {
- vout_thread_t *p_vout;
- if ((p_vout = [self lockVout])) {
- p_vout->p_sys->i_changes |= OSX_INTF_VOUT_SIZE_CHANGE ;
- [self unlockVout] ;
- }
+printf("sizeChangeQDPort !!\n");
+ p_main->p_intf->p_sys->osx_communication.i_changes |= OSX_INTF_VOUT_SIZE_CHANGE ;
}
- (NSSize) videoSize {
- (NSString *) getTimeAsString {
static char psz_currenttime[ OFFSETTOTIME_MAX_SIZE ] ;
- if (!p_main->p_intf->p_input) return [NSString stringWithCString:"00:00:00"] ;
+ if (!p_input_bank->pp_input[0]) return [NSString stringWithCString:"00:00:00"] ;
- input_OffsetToTime( p_main->p_intf->p_input, psz_currenttime, p_area->i_tell ) ;
+ input_OffsetToTime( p_input_bank->pp_input[0], psz_currenttime, p_area->i_tell ) ;
return [NSString stringWithCString:psz_currenttime] ;
}
- (float) getTimeAsFloat {
- if (!p_main->p_intf->p_input) return 0.0 ;
+ if (!p_input_bank->pp_input[0]) return 0.0 ;
return (float)p_area->i_tell / (float)p_area->i_size ;
}
- (void) setTimeAsFloat:(float) f_position {
- if (!p_main->p_intf->p_input) return ;
+ if (!p_input_bank->pp_input[0]) return ;
- input_Seek(p_main->p_intf->p_input, p_area->i_size * f_position) ;
+ input_Seek(p_input_bank->pp_input[0], p_area->i_size * f_position) ;
}
}
- (bool) playlistPlayCurrent {
- if (p_main->p_intf->p_input) {
+ if (p_input_bank->pp_input[0]) {
switch (e_speed)
{
case SPEED_SLOW:
- input_SetStatus(p_main->p_intf->p_input, INPUT_STATUS_SLOWER) ;
+ input_SetStatus(p_input_bank->pp_input[0], INPUT_STATUS_SLOWER) ;
break ;
case SPEED_NORMAL:
- input_SetStatus(p_main->p_intf->p_input, INPUT_STATUS_PLAY) ;
+ input_SetStatus(p_input_bank->pp_input[0], INPUT_STATUS_PLAY) ;
break ;
case SPEED_FAST:
- input_SetStatus(p_main->p_intf->p_input, INPUT_STATUS_FASTER) ;
+ input_SetStatus(p_input_bank->pp_input[0], INPUT_STATUS_FASTER) ;
break ;
}
p_main->p_playlist->b_stopped = 0 ;
}
- (void) playlistPause {
- if (p_main->p_intf->p_input)
- input_SetStatus(p_main->p_intf->p_input, INPUT_STATUS_PAUSE) ;
+ if (p_input_bank->pp_input[0])
+ input_SetStatus(p_input_bank->pp_input[0], INPUT_STATUS_PAUSE) ;
}
- (void) playlistStop {
- if (p_main->p_intf->p_input) p_main->p_intf->p_input->b_eof = 1 ;
+ if (p_input_bank->pp_input[0]) p_input_bank->pp_input[0]->b_eof = 1 ;
vlc_mutex_lock(&p_main->p_playlist->change_lock) ;
p_main->p_playlist->i_index-- ;
p_main->p_playlist->b_stopped = 1 ;
intf_PlaylistDelete(p_main->p_playlist, i) ;
vlc_mutex_unlock(&p_main->p_playlist->change_lock) ;
}
-
-
-
-
-// Private Functions. This are just some utilities for other functions
- - (struct vout_thread_s*) lockVout {
- vlc_mutex_lock(&p_vout_bank->lock) ;
- if (p_vout_bank->i_count) {
- vlc_mutex_lock(&p_vout_bank->pp_vout[0]->change_lock) ;
- return p_vout_bank->pp_vout[0] ;
- }
- else
- {
- vlc_mutex_unlock(&p_vout_bank->lock) ;
- return NULL ;
- }
- }
-
- - (void) unlockVout {
- vlc_mutex_unlock(&p_vout_bank->pp_vout[0]->change_lock) ;
- vlc_mutex_unlock(&p_vout_bank->lock) ;
- }
@end
* macosx.h : MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: macosx.h,v 1.3 2001/11/29 10:20:56 massiot Exp $
+ * $Id: macosx.h,v 1.4 2002/02/15 13:32:53 sam Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
*
#define OSX_VOUT_INTF_REQUEST_QDPORT 0x0004
#define OSX_VOUT_INTF_RELEASE_QDPORT 0x0008
-/* This struct is included as the _FIRST_ member in vout_sys_t */
-/* That way the interface can cast the vout_sys_t to osx_com_t */
-/* and doesn't need the definition of vout_sys_t */
+/* This struct is included as the _FIRST_ member in intf_sys_t */
+/* That way the video output can cast the intf_sys_t to osx_com_t */
+/* and doesn't need the definition of intf_sys_t */
#ifndef OSX_COM_TYPE
#define OSX_COM_TYPE osx_com_t
#define OSX_COM_STRUCT osx_com_s
#endif
typedef struct OSX_COM_STRUCT {
unsigned int i_changes ;
-
CGrafPtr p_qdport ;
+
+ struct vout_thread_s *p_vout;
} OSX_COM_TYPE ;
+
#include "video.h"
#include "video_output.h"
+#define OSX_COM_STRUCT intf_sys_s
+#define OSX_COM_TYPE intf_sys_t
#include "macosx.h"
#include <QuickTime/QuickTime.h>
* This structure is part of the video output thread descriptor.
* It describes the MacOS X specific properties of an output thread.
*****************************************************************************/
-typedef unsigned int yuv2_data_t ;
typedef struct vout_sys_s
{
- osx_com_t osx_communication ;
-
+ /* QT sequence information */
ImageDescriptionHandle h_img_descr ;
ImageSequence i_seq ;
unsigned int c_codec ;
MatrixRecordPtr p_matrix ;
-
- yuv2_data_t *p_yuv2 ;
- unsigned i_yuv2_size ;
- PlanarPixmapInfoYUV420 s_ppiy420 ;
+
} vout_sys_t;
+typedef struct picture_sys_s
+{
+ void *p_info;
+ unsigned int i_size;
+
+ /* When using I420 output */
+ PlanarPixmapInfoYUV420 pixmap_i420 ;
+
+} picture_sys_t;
+
+#define MAX_DIRECTBUFFERS 10
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int vout_Probe ( probedata_t *p_data );
-static int vout_Create ( struct vout_thread_s * );
-static int vout_Init ( struct vout_thread_s * );
-static void vout_End ( struct vout_thread_s * );
-static void vout_Destroy ( struct vout_thread_s * );
-static int vout_Manage ( struct vout_thread_s * );
-static void vout_Display ( struct vout_thread_s * );
+static int vout_Create ( vout_thread_t * );
+static int vout_Init ( vout_thread_t * );
+static void vout_End ( vout_thread_t * );
+static void vout_Destroy ( vout_thread_t * );
+static int vout_Manage ( vout_thread_t * );
+static void vout_Display ( vout_thread_t *, picture_t * );
+static void vout_Render ( vout_thread_t *, picture_t * );
/* OS Specific */
-static void fillout_PPIYUV420( picture_t *p_y420, PlanarPixmapInfoYUV420 *p_ppiy420 ) ;
-static void fillout_ImageDescription(ImageDescriptionHandle h_descr, unsigned int i_with, unsigned int i_height, unsigned int c_codec) ;
+static int CreateQTSequence ( vout_thread_t *p_vout ) ;
+static void DestroyQTSequence( vout_thread_t *p_vout ) ;
+
+static int NewPicture ( vout_thread_t *, picture_t * );
+static void FreePicture ( vout_thread_t *, picture_t * );
+
+static void fillout_ImageDescription(ImageDescriptionHandle h_descr,
+ unsigned int i_with, unsigned int i_height,
+ unsigned int c_codec) ;
static void fillout_ScalingMatrix( vout_thread_t *p_vout ) ;
-static OSErr new_QTSequence(ImageSequence *i_seq, CGrafPtr p_port, ImageDescriptionHandle h_descr, MatrixRecordPtr p_matrix) ;
-static int create_QTSequenceBestCodec( vout_thread_t *p_vout ) ;
-static void dispose_QTSequence( vout_thread_t *p_vout ) ;
-static void convert_Y420_to_YUV2( picture_t *p_y420, yuv2_data_t *p_yuv2 ) ;
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
*****************************************************************************/
void _M( vout_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = vout_Probe;
p_function_list->functions.vout.pf_create = vout_Create;
p_function_list->functions.vout.pf_init = vout_Init;
p_function_list->functions.vout.pf_end = vout_End;
p_function_list->functions.vout.pf_destroy = vout_Destroy;
p_function_list->functions.vout.pf_manage = vout_Manage;
+ p_function_list->functions.vout.pf_render = vout_Render;
p_function_list->functions.vout.pf_display = vout_Display;
- p_function_list->functions.vout.pf_setpalette = NULL;
-}
-
-/*****************************************************************************
- * intf_Probe: return a score
- *****************************************************************************/
-static int vout_Probe( probedata_t *p_data )
-{
- return( 100 );
}
/*****************************************************************************
intf_ErrMsg( "error: %s", strerror( ENOMEM ) );
return( 1 );
}
+ p_main->p_intf->p_sys->i_changes = 0;
+ p_main->p_intf->p_sys->p_vout = p_vout;
p_vout->p_sys->h_img_descr = (ImageDescriptionHandle)NewHandleClear( sizeof( ImageDescription ) ) ;
p_vout->p_sys->p_matrix = (MatrixRecordPtr)malloc( sizeof( MatrixRecord ) ) ;
- p_vout->p_sys->c_codec = 'NONE' ;
-
EnterMovies() ;
return( 0 );
*****************************************************************************/
static int vout_Init( vout_thread_t *p_vout )
{
- p_vout->b_need_render = 0 ;
- p_vout->i_bytes_per_line = p_vout->i_width ;
- p_vout->p_sys->c_codec = 'NONE' ;
- p_vout->p_sys->osx_communication.i_changes |= OSX_VOUT_INTF_REQUEST_QDPORT ;
-
+ int i_index;
+ picture_t *p_pic;
+
+ I_OUTPUTPICTURES = 0;
+
+ /* Since we can arbitrary scale, stick to the coordinates and aspect. */
+ p_vout->output.i_width = p_vout->render.i_width;
+ p_vout->output.i_height = p_vout->render.i_height;
+ p_vout->output.i_aspect = p_vout->render.i_aspect;
+
+ CreateQTSequence( p_vout ) ;
+
+ switch( p_vout->p_sys->c_codec )
+ {
+ case 'yuv2':
+ p_vout->output.i_chroma = FOURCC_YUY2;
+ break;
+ case 'y420':
+ p_vout->output.i_chroma = FOURCC_I420;
+ break;
+ case 'NONE':
+ intf_ErrMsg( "vout error: no QT codec found" );
+ return 0;
+ default:
+ intf_ErrMsg( "vout error: unknown QT codec" );
+ return 0;
+ }
+
+ /* Try to initialize up to MAX_DIRECTBUFFERS direct buffers */
+ while( I_OUTPUTPICTURES < MAX_DIRECTBUFFERS )
+ {
+ p_pic = NULL;
+
+ /* Find an empty picture slot */
+ for( i_index = 0 ; i_index < VOUT_MAX_PICTURES ; i_index++ )
+ {
+ if( p_vout->p_picture[ i_index ].i_status == FREE_PICTURE )
+ {
+ p_pic = p_vout->p_picture + i_index;
+ break;
+ }
+ }
+
+ /* Allocate the picture */
+ if( p_pic == NULL || NewPicture( p_vout, p_pic ) )
+ {
+ break;
+ }
+
+ p_pic->i_status = DESTROYED_PICTURE;
+ p_pic->i_type = DIRECT_PICTURE;
+
+ PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = p_pic;
+
+ I_OUTPUTPICTURES++;
+ }
+
return 0 ;
}
*****************************************************************************/
static void vout_End( vout_thread_t *p_vout )
{
- dispose_QTSequence( p_vout ) ;
- p_vout->p_sys->osx_communication.i_changes |= OSX_VOUT_INTF_RELEASE_QDPORT ;
+ int i_index;
+
+ DestroyQTSequence( p_vout ) ;
+ p_main->p_intf->p_sys->p_vout = NULL;
+ p_main->p_intf->p_sys->i_changes |= OSX_VOUT_INTF_RELEASE_QDPORT ;
+
+ /* Free the direct buffers we allocated */
+ for( i_index = I_OUTPUTPICTURES ; i_index ; )
+ {
+ i_index--;
+ FreePicture( p_vout, PP_OUTPUTPICTURE[ i_index ] );
+ }
}
/*****************************************************************************
*****************************************************************************/
static int vout_Manage( vout_thread_t *p_vout )
{
- if ( p_vout->p_sys->osx_communication.i_changes & OSX_INTF_VOUT_QDPORT_CHANGE ) {
- dispose_QTSequence( p_vout ) ;
- create_QTSequenceBestCodec( p_vout ) ;
- }
- else if ( p_vout->p_sys->osx_communication.i_changes & OSX_INTF_VOUT_SIZE_CHANGE ) {
- if ( p_vout->p_sys->c_codec != 'NONE' ) {
- fillout_ScalingMatrix( p_vout ) ;
- SetDSequenceMatrix( p_vout->p_sys->i_seq, p_vout->p_sys->p_matrix ) ;
- }
- }
-
- p_vout->p_sys->osx_communication.i_changes &= ~(
- OSX_INTF_VOUT_QDPORT_CHANGE |
- OSX_INTF_VOUT_SIZE_CHANGE
- ) ;
+ if( p_main->p_intf->p_sys->i_changes
+ & OSX_INTF_VOUT_QDPORT_CHANGE )
+ {
+ intf_ErrMsg( "vout error: this change is unhandled yet !" );
+ return 1;
+ }
+ else if( p_main->p_intf->p_sys->i_changes
+ & OSX_INTF_VOUT_SIZE_CHANGE )
+ {
+ if( p_vout->p_sys->c_codec != 'NONE' )
+ {
+ fillout_ScalingMatrix( p_vout ) ;
+ SetDSequenceMatrix( p_vout->p_sys->i_seq,
+ p_vout->p_sys->p_matrix ) ;
+ }
+ }
+
+ /* Clear flags */
+ p_main->p_intf->p_sys->i_changes &= ~(
+ OSX_INTF_VOUT_QDPORT_CHANGE |
+ OSX_INTF_VOUT_SIZE_CHANGE
+ ) ;
return 0 ;
}
/*****************************************************************************
- * vout_OSX_Display: displays previously rendered output
+ * vout_Render: renders previously calculated output
+ *****************************************************************************/
+void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
+{
+ ;
+}
+
+ /*****************************************************************************
+ * vout_Display: displays previously rendered output
*****************************************************************************
* This function send the currently rendered image to image, waits until
* it is displayed and switch the two rendering buffers, preparing next frame.
*****************************************************************************/
-void vout_Display( vout_thread_t *p_vout )
+void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
{
CodecFlags out_flags ;
switch (p_vout->p_sys->c_codec)
{
case 'yuv2':
- convert_Y420_to_YUV2(p_vout->p_rendered_pic, p_vout->p_sys->p_yuv2) ;
- DecompressSequenceFrameS(
- p_vout->p_sys->i_seq,
- (void *)p_vout->p_sys->p_yuv2,
- p_vout->p_sys->i_yuv2_size,
- codecFlagUseScreenBuffer,
- &out_flags,
- nil
- ) ;
- break ;
case 'y420':
- fillout_PPIYUV420(p_vout->p_rendered_pic, &p_vout->p_sys->s_ppiy420) ;
DecompressSequenceFrameS(
p_vout->p_sys->i_seq,
- (void *)&p_vout->p_sys->s_ppiy420,
- sizeof(PlanarPixmapInfoYUV420),
+ p_pic->p_sys->p_info,
+ p_pic->p_sys->i_size,
codecFlagUseScreenBuffer,
&out_flags,
nil
- ) ;
+ ) ;
break ;
- default:
- intf_WarnMsg( 1, "vout_macosx: vout_Display called, but no codec available" ) ;
+ default:
+ intf_WarnMsg( 1, "vout_macosx: vout_Display called, but no codec available" ) ;
+ break;
+ }
+}
+
+static int CreateQTSequence( vout_thread_t *p_vout )
+{
+ p_vout->p_sys->c_codec = 'NONE' ;
+ p_main->p_intf->p_sys->i_changes |= OSX_VOUT_INTF_REQUEST_QDPORT ;
+
+ while ( p_main->p_intf->p_sys->p_qdport == nil
+ && !p_vout->b_die )
+ {
+printf("WAITING for QD port ...\n");
+ if( p_main->p_intf->p_sys->i_changes
+ & OSX_INTF_VOUT_QDPORT_CHANGE )
+ {
+ p_main->p_intf->p_sys->i_changes &= ~( OSX_INTF_VOUT_QDPORT_CHANGE ) ;
+ intf_ErrMsg( "got a QDPORT_CHANGE" );
+ break;
+ }
+ msleep( 300000 );
}
+
+ if ( p_main->p_intf->p_sys->p_qdport == nil)
+ {
+printf("BLAAAAAAAAAAH\n");
+ p_vout->p_sys->c_codec = 'NONE' ;
+ return 1 ;
+ }
+
+ SetPort( p_main->p_intf->p_sys->p_qdport ) ;
+ fillout_ScalingMatrix( p_vout ) ;
+
+ fillout_ImageDescription( p_vout->p_sys->h_img_descr,
+ p_vout->output.i_width, p_vout->output.i_height,
+ 'y420' ) ;
+
+ if( !DecompressSequenceBeginS( &p_vout->p_sys->i_seq,
+ p_vout->p_sys->h_img_descr, NULL, 0,
+ p_main->p_intf->p_sys->p_qdport,
+ NULL, //device to display (is set implicit via the qdPort)
+ NULL, //src-rect
+ p_vout->p_sys->p_matrix, //matrix
+ 0, //just do plain copying
+ NULL, //no mask region
+ codecFlagUseScreenBuffer, codecLosslessQuality,
+ (DecompressorComponent) bestSpeedCodec) )
+ {
+printf("OK !!!\n");
+ p_vout->p_sys->c_codec = 'y420' ;
+ return 0 ;
+ }
+
+#if 0
+ /* For yuv2 */
+ {
+ p_vout->p_sys->c_codec = 'yuv2' ;
+ }
+#endif
+
+printf("FUXK..\n");
+ p_vout->p_sys->c_codec = 'NONE' ;
+ return 1 ;
}
-static void fillout_PPIYUV420( picture_t *p_y420, PlanarPixmapInfoYUV420 *p_ppiy420 )
+static void DestroyQTSequence( vout_thread_t *p_vout )
{
- p_ppiy420->componentInfoY.offset = (void *)p_y420->p_y - (void *)p_ppiy420 ;
- p_ppiy420->componentInfoY.rowBytes = p_y420->i_width ;
- p_ppiy420->componentInfoCb.offset = (void *)p_y420->p_u - (void *)p_ppiy420 ;
- p_ppiy420->componentInfoCb.rowBytes = p_y420->i_width / 2;
- p_ppiy420->componentInfoCr.offset = (void *)p_y420->p_v - (void *)p_ppiy420 ;
- p_ppiy420->componentInfoCr.rowBytes = p_y420->i_width / 2;
+ if (p_vout->p_sys->c_codec == 'NONE')
+ return ;
+
+ CDSequenceEnd( p_vout->p_sys->i_seq ) ;
+ p_vout->p_sys->c_codec = 'NONE' ;
}
p_descr->depth = 24 ;
break ;
case 'y420':
- p_descr->dataSize=i_width * i_height * 1.5 ;
+ p_descr->dataSize=i_width * i_height * 3 / 2 ;
p_descr->depth = 12 ;
break ;
}
Fixed factor_x ;
Fixed factor_y ;
- GetPortBounds( p_vout->p_sys->osx_communication.p_qdport, &s_rect ) ;
+ GetPortBounds( p_main->p_intf->p_sys->p_qdport, &s_rect ) ;
// if (((s_rect.right - s_rect.left) / ((float) p_vout->i_width)) < ((s_rect.bottom - s_rect.top) / ((float) p_vout->i_height)))
- factor_x = FixDiv(Long2Fix(s_rect.right - s_rect.left), Long2Fix(p_vout->i_width)) ;
+ factor_x = FixDiv(Long2Fix(s_rect.right - s_rect.left), Long2Fix(p_vout->output.i_width)) ;
// else
- factor_y = FixDiv(Long2Fix(s_rect.bottom - s_rect.top), Long2Fix(p_vout->i_height)) ;
+ factor_y = FixDiv(Long2Fix(s_rect.bottom - s_rect.top), Long2Fix(p_vout->output.i_height)) ;
SetIdentityMatrix(p_vout->p_sys->p_matrix) ;
ScaleMatrix( p_vout->p_sys->p_matrix, factor_x, factor_y, Long2Fix(0), Long2Fix(0) ) ;
}
-static OSErr new_QTSequence( ImageSequence *i_seq, CGrafPtr p_qdport, ImageDescriptionHandle h_descr, MatrixRecordPtr p_matrix )
+/*****************************************************************************
+ * NewPicture: allocate a picture
+ *****************************************************************************
+ * Returns 0 on success, -1 otherwise
+ *****************************************************************************/
+static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
{
- return DecompressSequenceBeginS(
- i_seq,
- h_descr,
- NULL,
- 0,
- p_qdport,
- NULL, //device to display (is set implicit via the qdPort)
- NULL, //src-rect
- p_matrix, //matrix
- 0, //just do plain copying
- NULL, //no mask region
- codecFlagUseScreenBuffer,
- codecLosslessQuality,
- (DecompressorComponent) bestSpeedCodec
- ) ;
-}
+ /* We know the chroma, allocate a buffer which will be used
+ * directly by the decoder */
+ p_pic->p_sys = malloc( sizeof( picture_sys_t ) );
-static int create_QTSequenceBestCodec( vout_thread_t *p_vout )
-{
- if ( p_vout->p_sys->osx_communication.p_qdport == nil)
+ if( p_pic->p_sys == NULL )
{
- p_vout->p_sys->c_codec = 'NONE' ;
- return 1 ;
+ return -1;
}
- SetPort( p_vout->p_sys->osx_communication.p_qdport ) ;
- fillout_ScalingMatrix( p_vout ) ;
- fillout_ImageDescription(
- p_vout->p_sys->h_img_descr,
- p_vout->i_width,
- p_vout->i_height,
- 'y420'
- ) ;
- if ( !new_QTSequence(
- &p_vout->p_sys->i_seq,
- p_vout->p_sys->osx_communication.p_qdport,
- p_vout->p_sys->h_img_descr,
- p_vout->p_sys->p_matrix
- ) )
+ switch( p_vout->output.i_chroma )
{
- p_vout->p_sys->c_codec = 'y420' ;
- return 0 ;
+ case FOURCC_I420:
+
+ p_pic->p_sys->p_info = (void *)&p_pic->p_sys->pixmap_i420 ;
+ p_pic->p_sys->i_size = sizeof(PlanarPixmapInfoYUV420) ;
+
+ p_pic->Y_PIXELS = memalign( 16, p_vout->output.i_width
+ * p_vout->output.i_height * 3 / 2 );
+ p_pic->p[Y_PLANE].i_lines = p_vout->output.i_height;
+ p_pic->p[Y_PLANE].i_pitch = p_vout->output.i_width;
+ p_pic->p[Y_PLANE].i_pixel_bytes = 1;
+ p_pic->p[Y_PLANE].b_margin = 0;
+
+ p_pic->U_PIXELS = p_pic->Y_PIXELS + p_vout->output.i_width
+ * p_vout->output.i_height;
+ p_pic->p[U_PLANE].i_lines = p_vout->output.i_height / 2;
+ p_pic->p[U_PLANE].i_pitch = p_vout->output.i_width / 2;
+ p_pic->p[U_PLANE].i_pixel_bytes = 1;
+ p_pic->p[U_PLANE].b_margin = 0;
+
+ p_pic->V_PIXELS = p_pic->U_PIXELS + p_vout->output.i_width
+ * p_vout->output.i_height / 4;
+ p_pic->p[V_PLANE].i_lines = p_vout->output.i_height / 2;
+ p_pic->p[V_PLANE].i_pitch = p_vout->output.i_width / 2;
+ p_pic->p[V_PLANE].i_pixel_bytes = 1;
+ p_pic->p[V_PLANE].b_margin = 0;
+
+ p_pic->i_planes = 3;
+
+#define P p_pic->p_sys->pixmap_i420
+ P.componentInfoY.offset = (void *)p_pic->Y_PIXELS
+ - p_pic->p_sys->p_info;
+ P.componentInfoCb.offset = (void *)p_pic->U_PIXELS
+ - p_pic->p_sys->p_info;
+ P.componentInfoCr.offset = (void *)p_pic->V_PIXELS
+ - p_pic->p_sys->p_info;
+
+ P.componentInfoY.rowBytes = p_vout->output.i_width ;
+ P.componentInfoCb.rowBytes = p_vout->output.i_width / 2 ;
+ P.componentInfoCr.rowBytes = p_vout->output.i_width / 2 ;
+#undef P
+
+ break;
+
+ case FOURCC_YUY2:
+
+ /* XXX: TODO */
+ free( p_pic->p_sys );
+ intf_ErrMsg( "vout error: YUV2 not supported yet" );
+ p_pic->i_planes = 0;
+ break;
+
+ default:
+ /* Unknown chroma, tell the guy to get lost */
+ free( p_pic->p_sys );
+ intf_ErrMsg( "vout error: never heard of chroma 0x%.8x (%4.4s)",
+ p_vout->output.i_chroma,
+ (char*)&p_vout->output.i_chroma );
+ p_pic->i_planes = 0;
+ return -1;
}
-
- p_vout->p_sys->c_codec = 'NONE' ;
- return 1 ;
+
+ return 0;
}
-static void dispose_QTSequence( vout_thread_t *p_vout )
+/*****************************************************************************
+ * FreePicture: destroy a picture allocated with NewPicture
+ *****************************************************************************/
+static void FreePicture( vout_thread_t *p_vout, picture_t *p_pic )
{
- if (p_vout->p_sys->c_codec == 'NONE')
- return ;
-
- CDSequenceEnd( p_vout->p_sys->i_seq ) ;
switch (p_vout->p_sys->c_codec)
{
case 'yuv2':
- free( (void *)p_vout->p_sys->p_yuv2 ) ;
- p_vout->p_sys->i_yuv2_size = 0 ;
+ free( p_pic->p_sys->p_info ) ;
+ p_pic->p_sys->i_size = 0 ;
+ break ;
+ case 'y420':
break ;
default:
break ;
}
- p_vout->p_sys->c_codec = 'NONE' ;
-}
-static void convert_Y420_to_YUV2( picture_t *p_y420, yuv2_data_t *p_yuv2 )
-{
- unsigned int width = p_y420->i_width, height = p_y420->i_height ;
- unsigned int x, y ;
-
- for( x=0; x < height; x++ )
- {
- for( y=0; y < (width/2); y++ )
- {
- p_yuv2[(width/2)*x + y] =
- (p_y420->p_y[width*x + 2*y]) << 24 |
- ((p_y420->p_u[(width/2)*(x/2) + y] ^ 0x80) << 16) |
- (p_y420->p_y[width*x + 2*y + 1] << 8) |
- (p_y420->p_v[(width/2)*(x/2) + y] ^ 0x80) ;
- }
- }
+ free( p_pic->p_sys );
}
+
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int decoder_Probe ( probedata_t * );
+static int decoder_Probe ( u8 * );
static int decoder_Run ( decoder_config_t * );
static int InitThread ( mad_adec_thread_t * p_mad_adec );
static void EndThread ( mad_adec_thread_t * p_mad_adec );
*****************************************************************************/
void _M( adec_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = decoder_Probe;
- p_function_list->functions.dec.pf_run = decoder_Run;
+ p_function_list->functions.dec.pf_probe = decoder_Probe;
+ p_function_list->functions.dec.pf_run = decoder_Run;
}
/*****************************************************************************
* Tries to launch a decoder and return score so that the interface is able
* to chose.
*****************************************************************************/
-static int decoder_Probe( probedata_t *p_data )
+static int decoder_Probe( u8 *pi_type )
{
- if( p_data->i_type == MPEG1_AUDIO_ES || p_data->i_type == MPEG2_AUDIO_ES )
+ if( *pi_type == MPEG1_AUDIO_ES || *pi_type == MPEG2_AUDIO_ES )
{
- return( 50 );
- }
- else
- {
- return( 0 );
+ return 0;
}
+
+ return -1;
}
/*****************************************************************************
* memcpy.c : classic memcpy module
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: memcpy.c,v 1.4 2002/01/04 14:01:34 sam Exp $
+ * $Id: memcpy.c,v 1.5 2002/02/15 13:32:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
* Local and extern prototypes.
*****************************************************************************/
static void memcpy_getfunctions( function_list_t * p_function_list );
-static int memcpy_Probe ( probedata_t *p_data );
#ifndef MODULE_NAME_IS_memcpy
void * _M( fast_memcpy ) ( void * to, const void * from, size_t len );
#endif
*****************************************************************************/
static void memcpy_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = memcpy_Probe;
#ifdef MODULE_NAME_IS_memcpy
- p_function_list->functions.memcpy.fast_memcpy = memcpy;
+ p_function_list->functions.memcpy.pf_memcpy = memcpy;
#else
- p_function_list->functions.memcpy.fast_memcpy = _M( fast_memcpy );
+ p_function_list->functions.memcpy.pf_memcpy = _M( fast_memcpy );
#endif
}
-/*****************************************************************************
- * memcpy_Probe: returns a preference score
- *****************************************************************************/
-static int memcpy_Probe( probedata_t *p_data )
-{
- return( 1 );
-}
-
* mga.c : Matrox Graphic Array plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: mga.c,v 1.15 2002/01/07 02:12:29 sam Exp $
+ * $Id: mga.c,v 1.16 2002/02/15 13:32:53 sam Exp $
*
* Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* Samuel Hocevar <sam@zoy.org>
*****************************************************************************/
static void vout_getfunctions( function_list_t * p_function_list );
-static int vout_Probe ( probedata_t *p_data );
static int vout_Create ( vout_thread_t * );
static int vout_Init ( vout_thread_t * );
static void vout_End ( vout_thread_t * );
*****************************************************************************/
static void vout_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = vout_Probe;
p_function_list->functions.vout.pf_create = vout_Create;
p_function_list->functions.vout.pf_init = vout_Init;
p_function_list->functions.vout.pf_end = vout_End;
p_function_list->functions.vout.pf_display = vout_Display;
}
-/*****************************************************************************
- * intf_Probe: return a score
- *****************************************************************************/
-static int vout_Probe( probedata_t *p_data )
-{
- int i_fd;
-
- i_fd = open( "/dev/mga_vid", O_RDWR );
- if( i_fd == -1 )
- {
- return 0;
- }
-
- close( i_fd );
-
- return 10;
-}
-
/*****************************************************************************
* vout_Create: allocates dummy video thread output method
*****************************************************************************
* xmga.c : X11 MGA plugin for vlc
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: xmga.c,v 1.3 2002/01/13 15:07:55 gbazin Exp $
+ * $Id: xmga.c,v 1.4 2002/02/15 13:32:53 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
*****************************************************************************/
static void vout_getfunctions( function_list_t * );
-static int vout_Probe ( probedata_t * );
static int vout_Create ( vout_thread_t * );
static void vout_Destroy ( vout_thread_t * );
static void vout_Render ( vout_thread_t *, picture_t * );
*****************************************************************************/
static void vout_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = vout_Probe;
p_function_list->functions.vout.pf_create = vout_Create;
p_function_list->functions.vout.pf_init = vout_Init;
p_function_list->functions.vout.pf_end = vout_End;
p_function_list->functions.vout.pf_display = vout_Display;
}
-/*****************************************************************************
- * vout_Probe: probe the video driver and return a score
- *****************************************************************************
- * This function tries to initialize SDL and returns a score to the
- * plugin manager so that it can select the best plugin.
- *****************************************************************************/
-static int vout_Probe( probedata_t *p_data )
-{
- Display *p_display; /* display pointer */
- char *psz_display;
-#ifdef MODULE_NAME_IS_xvideo
- int i_xvport, i_dummy;
-#endif
-
- /* Open display, unsing 'vlc_display' or DISPLAY environment variable */
- psz_display = XDisplayName( main_GetPszVariable(VOUT_DISPLAY_VAR, NULL) );
- p_display = XOpenDisplay( psz_display );
- if( p_display == NULL ) /* error */
- {
- intf_WarnMsg( 3, "vout: cannot open display %s", psz_display );
- return( 0 );
- }
-
-#ifdef MODULE_NAME_IS_xvideo
- /* Check that there is an available XVideo port for this format */
- i_xvport = XVideoGetPort( p_display, p_data->vout.i_chroma, &i_dummy );
- if( i_xvport < 0 )
- {
- /* It failed, but it's not completely lost ! We try to open an
- * XVideo port for a YUY2 picture */
- i_xvport = XVideoGetPort( p_display, FOURCC_YUY2, &i_dummy );
- if( i_xvport < 0 )
- {
- /* It failed, but it's not completely lost ! We try to open an
- * XVideo port for a simple 16bpp RGB picture */
- i_xvport = XVideoGetPort( p_display, FOURCC_RV16, &i_dummy );
- if( i_xvport < 0 )
- {
- XCloseDisplay( p_display );
- return( 0 );
- }
- }
- }
- XVideoReleasePort( p_display, i_xvport );
-#endif
-
- /* Clean-up everyting */
- XCloseDisplay( p_display );
-
-#ifdef MODULE_NAME_IS_xvideo
- return( 150 );
-#else
- return( 50 );
-#endif
-}
-
/*****************************************************************************
* vout_Create: allocate X11 video thread output method
*****************************************************************************
* motion.c : C motion compensation module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: motion.c,v 1.13 2001/12/30 07:09:55 sam Exp $
+ * $Id: motion.c,v 1.14 2002/02/15 13:32:53 sam Exp $
*
* Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* Michel Lespinasse <walken@zoy.org>
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
-/*****************************************************************************
- * motion_Probe: tests probe the CPU and return a score
- *****************************************************************************/
-static int motion_Probe( probedata_t *p_data )
-{
- return( 50 );
-}
-
/*****************************************************************************
* Simple motion compensation in C
*****************************************************************************/
}
};
- p_function_list->pf_probe = motion_Probe;
-
#define list p_function_list->functions.motion
memcpy( list.ppppf_motion, ppppf_motion, sizeof( void * ) * 16 );
#undef list
* motion3dnow.c : 3DNow! motion compensation module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: motion3dnow.c,v 1.6 2001/12/30 07:09:55 sam Exp $
+ * $Id: motion3dnow.c,v 1.7 2002/02/15 13:32:53 sam Exp $
*
* Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* Michel Lespinasse <walken@zoy.org>
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
-/*****************************************************************************
- * motion_Probe: tests probe the CPU and return a score
- *****************************************************************************/
-static int motion_Probe( probedata_t *p_data )
-{
- return( 250 );
-}
-
/*****************************************************************************
* Motion compensation in 3DNow (OK I know this does MMXEXT too and it's ugly)
*****************************************************************************/
}
};
- p_function_list->pf_probe = motion_Probe;
-
#define list p_function_list->functions.motion
memcpy( list.ppppf_motion, ppppf_motion, sizeof( void * ) * 16 );
#undef list
* motionaltivec.c : Altivec motion compensation module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: motionaltivec.c,v 1.9 2001/12/30 07:09:55 sam Exp $
+ * $Id: motionaltivec.c,v 1.10 2002/02/15 13:32:53 sam Exp $
*
* Authors: Michel Lespinasse <walken@zoy.org>
* Paul Mackerras <paulus@linuxcare.com.au>
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
-/*****************************************************************************
- * motion_Probe: tests probe the CPU and return a score
- *****************************************************************************/
-static int motion_Probe( probedata_t *p_data )
-{
- return( 150 );
-}
-
/*****************************************************************************
* Motion compensation in Altivec
*****************************************************************************/
}
};
- p_function_list->pf_probe = motion_Probe;
-
#define list p_function_list->functions.motion
memcpy( list.ppppf_motion, ppppf_motion, sizeof( void * ) * 16 );
#undef list
* motionmmx.c : MMX motion compensation module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: motionmmx.c,v 1.14 2001/12/30 07:09:55 sam Exp $
+ * $Id: motionmmx.c,v 1.15 2002/02/15 13:32:53 sam Exp $
*
* Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* Michel Lespinasse <walken@zoy.org>
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
-/*****************************************************************************
- * motion_Probe: tests probe the CPU and return a score
- *****************************************************************************/
-static int motion_Probe( probedata_t *p_data )
-{
- return( 150 );
-}
-
/*****************************************************************************
* Motion compensation in MMX
*****************************************************************************/
}
};
- p_function_list->pf_probe = motion_Probe;
-
#define list p_function_list->functions.motion
memcpy( list.ppppf_motion, ppppf_motion, sizeof( void * ) * 16 );
#undef list
* motionmmxext.c : MMX EXT motion compensation module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: motionmmxext.c,v 1.15 2001/12/30 07:09:55 sam Exp $
+ * $Id: motionmmxext.c,v 1.16 2002/02/15 13:32:53 sam Exp $
*
* Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* Michel Lespinasse <walken@zoy.org>
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
-/*****************************************************************************
- * motion_Probe: tests probe the CPU and return a score
- *****************************************************************************/
-static int motion_Probe( probedata_t *p_data )
-{
- return( 200 );
-}
-
/*****************************************************************************
* Motion compensation in MMXEXT (OK I know this does 3DNow too and it's ugly)
*****************************************************************************/
}
};
- p_function_list->pf_probe = motion_Probe;
-
#define list p_function_list->functions.motion
memcpy( list.ppppf_motion, ppppf_motion, sizeof( void * ) * 16 );
#undef list
* mpeg_adec.c: MPEG audio decoder thread
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: mpeg_adec.c,v 1.17 2002/01/23 12:02:12 asmax Exp $
+ * $Id: mpeg_adec.c,v 1.18 2002/02/15 13:32:53 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr>
/*****************************************************************************
* Local Prototypes
*****************************************************************************/
-static int decoder_Probe ( probedata_t * );
+static int decoder_Probe ( u8 * );
static int decoder_Run ( decoder_config_t * );
static void EndThread ( adec_thread_t * );
static void DecodeThread ( adec_thread_t * );
*****************************************************************************/
void _M( adec_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = decoder_Probe;
- p_function_list->functions.dec.pf_run = decoder_Run;
+ p_function_list->functions.dec.pf_probe = decoder_Probe;
+ p_function_list->functions.dec.pf_run = decoder_Run;
}
/*****************************************************************************
/*****************************************************************************
* decoder_Probe: probe the decoder and return score
*****************************************************************************/
-static int decoder_Probe( probedata_t *p_data )
+static int decoder_Probe( u8 *pi_type )
{
- return( ( p_data->i_type == MPEG1_AUDIO_ES
- || p_data->i_type == MPEG2_AUDIO_ES ) ? 100 : 0 );
+ return( ( *pi_type == MPEG1_AUDIO_ES
+ || *pi_type == MPEG2_AUDIO_ES ) ? 0 : -1 );
}
/*****************************************************************************
* input_es.c: Elementary Stream demux and packet management
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: input_es.c,v 1.12 2002/01/21 23:57:46 massiot Exp $
+ * $Id: input_es.c,v 1.13 2002/02/15 13:32:53 sam Exp $
*
* Author: Christophe Massiot <massiot@via.ecp.fr>
*
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int ESProbe ( probedata_t * );
+static int ESProbe ( struct input_thread_s * );
static int ESRead ( struct input_thread_s *, data_packet_t ** );
static void ESInit ( struct input_thread_s * );
static void ESEnd ( struct input_thread_s * );
void _M( input_getfunctions )( function_list_t * p_function_list )
{
#define input p_function_list->functions.input
- p_function_list->pf_probe = ESProbe;
+ input.pf_probe = ESProbe;
input.pf_init = ESInit;
input.pf_open = NULL;
input.pf_close = NULL;
/*****************************************************************************
* ESProbe: verifies that the stream is a ES stream
*****************************************************************************/
-static int ESProbe( probedata_t *p_data )
+static int ESProbe( input_thread_t *p_input )
{
- int i_score = 5;
-
- return( i_score );
+ return 0;
}
/*****************************************************************************
* input_ps.c: PS demux and packet management
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: input_ps.c,v 1.11 2001/12/30 07:09:55 sam Exp $
+ * $Id: input_ps.c,v 1.12 2002/02/15 13:32:53 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Cyril Deguet <asmax@via.ecp.fr>
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int PSProbe ( probedata_t * );
+static int PSProbe ( struct input_thread_s * );
static int PSRead ( struct input_thread_s *, data_packet_t ** );
static void PSInit ( struct input_thread_s * );
static void PSEnd ( struct input_thread_s * );
void _M( input_getfunctions )( function_list_t * p_function_list )
{
#define input p_function_list->functions.input
- p_function_list->pf_probe = PSProbe;
+ input.pf_probe = PSProbe;
input.pf_init = PSInit;
input.pf_open = NULL;
input.pf_close = NULL;
/*****************************************************************************
* PSProbe: verifies that the stream is a PS stream
*****************************************************************************/
-static int PSProbe( probedata_t *p_data )
+static int PSProbe( input_thread_t *p_input )
{
- input_thread_t * p_input = (input_thread_t *)p_data;
-
char * psz_name = p_input->p_source;
- int i_score = 10;
if( ( strlen(psz_name) > 5 ) && (!strncasecmp( psz_name, "file:", 5 )
|| !strncasecmp( psz_name, "http:", 5 )) )
{
/* If the user specified "file:" or "http:" then it's probably a
* PS file */
- i_score = 100;
- psz_name += 5;
+ return 0;
}
- return( i_score );
+ /* Oh, we load it anyway */
+ return 0;
}
/*****************************************************************************
* input_ts.c: TS demux and netlist management
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: input_ts.c,v 1.12 2002/01/09 23:32:40 stef Exp $
+ * $Id: input_ts.c,v 1.13 2002/02/15 13:32:53 sam Exp $
*
* Authors: Henri Fallon <henri@videolan.org>
*
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int TSProbe ( probedata_t * );
+static int TSProbe ( struct input_thread_s * );
static void TSInit ( struct input_thread_s * );
static void TSEnd ( struct input_thread_s * );
static int TSRead ( struct input_thread_s *, data_packet_t ** );
void _M( input_getfunctions )( function_list_t * p_function_list )
{
#define input p_function_list->functions.input
- p_function_list->pf_probe = TSProbe;
+ input.pf_probe = TSProbe;
input.pf_init = TSInit;
input.pf_open = NULL;
input.pf_close = NULL;
/*****************************************************************************
* TSProbe: verifies that the stream is a TS stream
*****************************************************************************/
-static int TSProbe( probedata_t * p_data )
+static int TSProbe( input_thread_t * p_input )
{
- input_thread_t * p_input = (input_thread_t *)p_data;
-
char * psz_name = p_input->p_source;
- int i_score = 0;
if( ( strlen(psz_name) >= 10 && !strncasecmp( psz_name, "udpstream:", 10 ) )
|| ( strlen(psz_name) >= 4 && !strncasecmp( psz_name, "udp:", 4 ) ) )
{
/* If the user specified "udp:" then it's probably a network stream */
- return( 999 );
+ return 0;
}
if( ( strlen(psz_name) > 5 ) && !strncasecmp( psz_name, "file:", 5 ) )
!strncasecmp( psz_name+strlen(psz_name)-3, ".ts", 3) )
{
/* If it is a ".ts" file it's probably a TS file ... */
- return( 900 );
+ return 0;
}
- return( i_score );
+ return -1;
}
/*****************************************************************************
* mpeg_es.c : Elementary Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: mpeg_es.c,v 1.2 2001/12/30 07:09:55 sam Exp $
+ * $Id: mpeg_es.c,v 1.3 2002/02/15 13:32:53 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
MODULE_INIT_START
SET_DESCRIPTION( "ISO 13818-1 MPEG Elementary Stream input" )
- ADD_CAPABILITY( INPUT, 50 )
+ ADD_CAPABILITY( INPUT, 5 )
ADD_SHORTCUT( "es" )
MODULE_INIT_STOP
* mpeg_ps.c : Program Stream input module for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: mpeg_ps.c,v 1.2 2001/12/30 07:09:55 sam Exp $
+ * $Id: mpeg_ps.c,v 1.3 2002/02/15 13:32:53 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
MODULE_INIT_START
SET_DESCRIPTION( "ISO 13818-1 MPEG Program Stream input" )
- ADD_CAPABILITY( INPUT, 100 )
+ ADD_CAPABILITY( INPUT, 10 )
ADD_SHORTCUT( "ps" )
MODULE_INIT_STOP
* video_parser.c : video parser thread
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: video_parser.c,v 1.12 2002/01/21 23:57:46 massiot Exp $
+ * $Id: video_parser.c,v 1.13 2002/02/15 13:32:53 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
/*
* Local prototypes
*/
-static int decoder_Probe ( probedata_t * );
+static int decoder_Probe ( u8 * );
static int decoder_Run ( decoder_config_t * );
static int InitThread ( vpar_thread_t * );
static void EndThread ( vpar_thread_t * );
*****************************************************************************/
void _M( vdec_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = decoder_Probe;
- p_function_list->functions.dec.pf_run = decoder_Run;
+ p_function_list->functions.dec.pf_probe = decoder_Probe;
+ p_function_list->functions.dec.pf_run = decoder_Run;
}
/*****************************************************************************
* Tries to launch a decoder and return score so that the interface is able
* to chose.
*****************************************************************************/
-static int decoder_Probe( probedata_t *p_data )
+static int decoder_Probe( u8 *pi_type )
{
- return( ( p_data->i_type == MPEG1_VIDEO_ES
- || p_data->i_type == MPEG2_VIDEO_ES ) ? 50 : 0 );
+ return( ( *pi_type == MPEG1_VIDEO_ES
+ || *pi_type == MPEG2_VIDEO_ES ) ? 0 : -1 );
}
/*****************************************************************************
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int aout_Probe ( probedata_t *p_data );
static int aout_Open ( aout_thread_t *p_aout );
static int aout_SetFormat ( aout_thread_t *p_aout );
static long aout_GetBufInfo ( aout_thread_t *p_aout, long l_buffer_info );
*****************************************************************************/
void _M( aout_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
p_function_list->functions.aout.pf_setformat = aout_SetFormat;
p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.pf_close = aout_Close;
}
-/*****************************************************************************
- * aout_Probe: probes the audio device and return a score
- *****************************************************************************
- * This function tries to open the dps and returns a score to the plugin
- * manager so that it can make its choice.
- *****************************************************************************/
-static int aout_Probe( probedata_t *p_data )
-{
- int i_ret;
- aout_sys_t adev;
-
- /* open audio device */
- if( ( i_ret = snd_pcm_open_preferred( &adev.p_pcm_handle,
- &adev.i_card, &adev.i_device,
- SND_PCM_OPEN_PLAYBACK ) ) < 0 )
- {
- intf_WarnMsg( 2, "aout error: unable to open audio device (%s)",
- snd_strerror( i_ret ) );
- return( 0 );
- }
-
- /* close audio device */
- if( ( i_ret = snd_pcm_close( adev.p_pcm_handle ) ) < 0 )
- {
- intf_WarnMsg( 2, "aout error: unable to close audio device (%s)",
- snd_strerror( i_ret ) );
- return( 0 );
- }
-
- /* return score */
- return( 50 );
-}
-
/*****************************************************************************
* aout_Open : creates a handle and opens an alsa device
*****************************************************************************
{
intf_ErrMsg( "aout error: unable to open audio device (%s)",
snd_strerror( i_ret ) );
+ free( p_aout->p_sys );
return( 1 );
}
intf_ErrMsg( "aout error: unable to disable mmap (%s)",
snd_strerror( i_ret ) );
aout_Close( p_aout );
+ free( p_aout->p_sys );
return( 1 );
}
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int vout_Probe ( probedata_t *p_data );
static int vout_Create ( struct vout_thread_s * );
static int vout_Init ( struct vout_thread_s * );
static void vout_End ( struct vout_thread_s * );
*****************************************************************************/
void _M( vout_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = vout_Probe;
p_function_list->functions.vout.pf_create = vout_Create;
p_function_list->functions.vout.pf_init = vout_Init;
p_function_list->functions.vout.pf_end = vout_End;
p_function_list->functions.vout.pf_setpalette = NULL;
}
-/*****************************************************************************
- * vout_Probe: probe the video driver and return a score
- *****************************************************************************
- * This function tries to initialize SDL and returns a score to the
- * plugin manager so that it can select the best plugin.
- *****************************************************************************/
-static int vout_Probe( probedata_t *p_data )
-{
- return( 100 );
-}
-
/*****************************************************************************
* vout_Create: allocate QNX video thread output method
*****************************************************************************
* intf_qt.cpp: Qt interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: intf_qt.cpp,v 1.11 2002/01/07 02:12:29 sam Exp $
+ * $Id: intf_qt.cpp,v 1.12 2002/02/15 13:32:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static int intf_Probe ( probedata_t *p_data );
static int intf_Open ( intf_thread_t *p_intf );
static void intf_Close ( intf_thread_t *p_intf );
static void intf_Run ( intf_thread_t *p_intf );
void _M( intf_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = intf_Probe;
p_function_list->functions.intf.pf_open = intf_Open;
p_function_list->functions.intf.pf_close = intf_Close;
p_function_list->functions.intf.pf_run = intf_Run;
}
-/*****************************************************************************
- * intf_Probe: probe the interface and return a score
- *****************************************************************************
- * This function tries to initialize Qt and returns a score to the
- * plugin manager so that it can select the best plugin.
- *****************************************************************************/
-static int intf_Probe( probedata_t *p_data )
-{
- return( 80 );
-}
-
/*****************************************************************************
* intf_Open: initialize and create window
*****************************************************************************/
* aout_sdl.c : audio sdl functions library
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: aout_sdl.c,v 1.24 2002/01/28 23:08:31 stef Exp $
+ * $Id: aout_sdl.c,v 1.25 2002/02/15 13:32:53 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static int aout_Probe ( probedata_t *p_data );
static int aout_Open ( aout_thread_t *p_aout );
static int aout_SetFormat ( aout_thread_t *p_aout );
static long aout_GetBufInfo ( aout_thread_t *p_aout, long l_buffer_info );
*****************************************************************************/
void _M( aout_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
p_function_list->functions.aout.pf_setformat = aout_SetFormat;
p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.pf_close = aout_Close;
}
-/*****************************************************************************
- * aout_Probe: probe the audio device and return a score
- *****************************************************************************
- * This function tries to initialize SDL audio and returns a score to the
- * plugin manager so that it can select the best plugin.
- *****************************************************************************/
-static int aout_Probe( probedata_t *p_data )
-{
-#if 0
- SDL_AudioSpec desired, obtained;
-#endif
-
- if( SDL_WasInit( SDL_INIT_AUDIO ) != 0 )
- {
- return( 0 );
- }
-
-#if 0
- /* Start AudioSDL */
- if( SDL_Init(SDL_INIT_AUDIO | SDL_INIT_NOPARACHUTE) != 0 )
- {
- intf_DbgMsg( "aout: SDL_Init failed (%s)", SDL_GetError() );
- return( 0 );
- }
-
- desired.freq = 11025; /* frequency */
- desired.format = AUDIO_U8; /* unsigned 8 bits */
- desired.channels = 2; /* mono */
- desired.callback = aout_SDLCallback; /* callback function mandatory */
- desired.userdata = NULL; /* null parm for callback */
- desired.samples = 4096;
-
- /* If we were unable to open the device, there is no way we can use
- * the plugin. Return a score of 0. */
- if( SDL_OpenAudio( &desired, &obtained ) < 0 )
- {
- intf_DbgMsg( "aout: SDL_OpenAudio failed (%s)", SDL_GetError() );
- return( 0 );
- }
-
- /* Otherwise, there are good chances we can use this plugin, return 100. */
- intf_DbgMsg( "aout: SDL_OpenAudio successfully run" );
- SDL_CloseAudio();
-#endif
-
- return( 40 );
-}
-
/*****************************************************************************
* aout_Open: open the audio device
*****************************************************************************
if( SDL_WasInit( SDL_INIT_AUDIO ) != 0 )
{
- return( 0 );
+ return( 1 );
}
/* Allocate structure */
* vout_sdl.c: SDL video output display method
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: vout_sdl.c,v 1.80 2002/01/12 01:25:57 sam Exp $
+ * $Id: vout_sdl.c,v 1.81 2002/02/15 13:32:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Pierre Baillet <oct@zoy.org>
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static int vout_Probe ( probedata_t *p_data );
static int vout_Create ( struct vout_thread_s * );
static int vout_Init ( struct vout_thread_s * );
static void vout_End ( struct vout_thread_s * );
*****************************************************************************/
void _M( vout_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = vout_Probe;
p_function_list->functions.vout.pf_create = vout_Create;
p_function_list->functions.vout.pf_init = vout_Init;
p_function_list->functions.vout.pf_end = vout_End;
p_function_list->functions.vout.pf_display = vout_Display;
}
-/*****************************************************************************
- * vout_Probe: probe the video driver and return a score
- *****************************************************************************
- * This function tries to initialize SDL and returns a score to the
- * plugin manager so that it can select the best plugin.
- *****************************************************************************/
-static int vout_Probe( probedata_t *p_data )
-{
- if( SDL_WasInit( SDL_INIT_VIDEO ) != 0 )
- {
- return( 0 );
- }
-
- return( 100 );
-}
-
/*****************************************************************************
* vout_Create: allocate SDL video thread output method
*****************************************************************************
* spu_decoder.c : spu decoder thread
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: spu_decoder.c,v 1.8 2002/01/21 23:57:46 massiot Exp $
+ * $Id: spu_decoder.c,v 1.9 2002/02/15 13:32:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int decoder_Probe ( probedata_t * );
+static int decoder_Probe ( u8 * );
static int decoder_Run ( decoder_config_t * );
static int InitThread ( spudec_thread_t * );
static void EndThread ( spudec_thread_t * );
*****************************************************************************/
void _M( spudec_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = decoder_Probe;
- p_function_list->functions.dec.pf_run = decoder_Run;
+ p_function_list->functions.dec.pf_probe = decoder_Probe;
+ p_function_list->functions.dec.pf_run = decoder_Run;
}
/*****************************************************************************
* Tries to launch a decoder and return score so that the interface is able
* to chose.
*****************************************************************************/
-static int decoder_Probe( probedata_t *p_data )
+static int decoder_Probe( u8 *pi_type )
{
- return ( p_data->i_type == DVD_SPU_ES ) ? 50 : 0;
+ return ( *pi_type == DVD_SPU_ES ) ? 0 : -1;
}
/*****************************************************************************
* ncurses.c : NCurses plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: ncurses.c,v 1.10 2002/01/04 14:01:34 sam Exp $
+ * $Id: ncurses.c,v 1.11 2002/02/15 13:32:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
* Local prototypes.
*****************************************************************************/
static void intf_getfunctions ( function_list_t * p_function_list );
-static int intf_Probe ( probedata_t *p_data );
static int intf_Open ( intf_thread_t *p_intf );
static void intf_Close ( intf_thread_t *p_intf );
static void intf_Run ( intf_thread_t *p_intf );
*****************************************************************************/
static void intf_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = intf_Probe;
p_function_list->functions.intf.pf_open = intf_Open;
p_function_list->functions.intf.pf_close = intf_Close;
p_function_list->functions.intf.pf_run = intf_Run;
}
-/*****************************************************************************
- * intf_Probe: probe the interface and return a score
- *****************************************************************************
- * This function tries to initialize ncurses and returns a score to the
- * plugin manager so that it can select the best plugin.
- *****************************************************************************/
-static int intf_Probe( probedata_t *p_data )
-{
- return( 40 );
-}
-
/*****************************************************************************
* intf_Open: initialize and create window
*****************************************************************************/
* rc.c : remote control stdin/stdout plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: rc.c,v 1.9 2002/01/07 02:12:29 sam Exp $
+ * $Id: rc.c,v 1.10 2002/02/15 13:32:53 sam Exp $
*
* Authors: Peter Surda <shurdeek@panorama.sth.ac.at>
*
* Local prototypes.
*****************************************************************************/
static void intf_getfunctions ( function_list_t * p_function_list );
-static int intf_Probe ( probedata_t *p_data );
static int intf_Open ( intf_thread_t *p_intf );
static void intf_Close ( intf_thread_t *p_intf );
static void intf_Run ( intf_thread_t *p_intf );
*****************************************************************************/
static void intf_getfunctions( function_list_t * p_function_list )
{
- p_function_list->pf_probe = intf_Probe;
p_function_list->functions.intf.pf_open = intf_Open;
p_function_list->functions.intf.pf_close = intf_Close;
p_function_list->functions.intf.pf_run = intf_Run;
}
-/*****************************************************************************
- * intf_Probe: probe the interface and return a score
- *****************************************************************************
- * This function tries to initialize rc and returns a score to the
- * plugin manager so that it can select the best plugin.
- *****************************************************************************/
-static int intf_Probe( probedata_t *p_data )
-{
- return( 20 );
-}
-
/*****************************************************************************
* intf_Open: initialize and create stuff
*****************************************************************************/
* Local prototypes
*****************************************************************************/
/* called from outside */
-static int VCDProbe ( probedata_t *p_data );
+static int VCDProbe ( struct input_thread_s * );
static void VCDInit ( struct input_thread_s * );
static int VCDRead ( struct input_thread_s *, data_packet_t ** );
static int VCDSetArea ( struct input_thread_s *, struct input_area_s * );
void _M( input_getfunctions )( function_list_t * p_function_list )
{
#define input p_function_list->functions.input
- p_function_list->pf_probe = VCDProbe;
+ input.pf_probe = VCDProbe;
input.pf_init = VCDInit;
input.pf_open = VCDOpen;
input.pf_close = VCDClose;
/*****************************************************************************
* VCDProbe: verifies that the stream is a PS stream
*****************************************************************************/
-static int VCDProbe( probedata_t *p_data )
+static int VCDProbe( input_thread_t * p_input )
{
- input_thread_t * p_input = (input_thread_t *)p_data;
-
char * psz_name = p_input->p_source;
- int i_score = 0;
if( ( strlen(psz_name) > 4 ) && !strncasecmp( psz_name, "vcd:", 4 ) )
{
/* If the user specified "vcd:" then it's probably a VCD */
- i_score = 100;
- psz_name += 4;
+ return 0;
}
- return( i_score );
+ return -1;
}
/*****************************************************************************
* vcd.c : VCD input module for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: vcd.c,v 1.4 2001/12/30 07:09:56 sam Exp $
+ * $Id: vcd.c,v 1.5 2002/02/15 13:32:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
*****************************************************************************/
void _M( input_getfunctions )( function_list_t * p_function_list );
-/*****************************************************************************
- * Local prototypes.
- *****************************************************************************/
-
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
* aout_waveout.c: Windows waveOut audio output method
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: aout_waveout.c,v 1.2 2002/01/28 23:08:31 stef Exp $
+ * $Id: aout_waveout.c,v 1.3 2002/02/15 13:32:53 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static int aout_Probe ( probedata_t *p_data );
static int aout_Open ( aout_thread_t *p_aout );
static int aout_SetFormat ( aout_thread_t *p_aout );
static long aout_GetBufInfo ( aout_thread_t *p_aout, long l_buffer_info );
*****************************************************************************/
void _M( aout_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
p_function_list->functions.aout.pf_setformat = aout_SetFormat;
p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.pf_close = aout_Close;
}
-/*****************************************************************************
- * aout_Probe: probe the audio device and return a score
- *****************************************************************************
- * This function tries to probe for a waveOut sound device and returns a
- * score to the plugin manager so it can select the best plugin.
- *****************************************************************************/
-static int aout_Probe( probedata_t *p_data )
-{
- HWAVEOUT h_waveout;
- WAVEFORMATEX waveformat;
- MMRESULT result;
-
- /* Set a common sound format */
- waveformat.wFormatTag = WAVE_FORMAT_PCM;
- waveformat.nChannels = 2;
- waveformat.nSamplesPerSec = 44100;
- waveformat.wBitsPerSample = 16;
- waveformat.nBlockAlign = waveformat.wBitsPerSample / 8 * 2;
- waveformat.nAvgBytesPerSec = waveformat.nSamplesPerSec *
- waveformat.nBlockAlign;
-
- /* Open the device */
- result = waveOutOpen( &h_waveout, WAVE_MAPPER, &waveformat,
- 0 /*callback*/, 0 /*callback data*/, CALLBACK_NULL );
- if( result != MMSYSERR_NOERROR )
- {
- return( 0 );
- }
- waveOutClose( h_waveout );
-
- return( 150 );
-}
-
/*****************************************************************************
* aout_Open: open the audio device
*****************************************************************************
* xcommon.c: Functions common to the X11 and XVideo plugins
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: xcommon.c,v 1.15 2002/01/28 16:51:22 sam Exp $
+ * $Id: xcommon.c,v 1.16 2002/02/15 13:32:54 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int vout_Probe ( probedata_t * );
static int vout_Create ( vout_thread_t * );
static void vout_Destroy ( vout_thread_t * );
static void vout_Render ( vout_thread_t *, picture_t * );
*****************************************************************************/
void _M( vout_getfunctions )( function_list_t * p_function_list )
{
- p_function_list->pf_probe = vout_Probe;
p_function_list->functions.vout.pf_create = vout_Create;
p_function_list->functions.vout.pf_init = vout_Init;
p_function_list->functions.vout.pf_end = vout_End;
p_function_list->functions.vout.pf_display = vout_Display;
}
-/*****************************************************************************
- * vout_Probe: probe the video driver and return a score
- *****************************************************************************
- * This function tries to initialize SDL and returns a score to the
- * plugin manager so that it can select the best plugin.
- *****************************************************************************/
-static int vout_Probe( probedata_t *p_data )
-{
- Display *p_display; /* display pointer */
- char *psz_display;
-#ifdef MODULE_NAME_IS_xvideo
- int i_xvport, i_dummy;
-#endif
-
- /* Open display, unsing 'vlc_display' or DISPLAY environment variable */
- psz_display = XDisplayName( main_GetPszVariable(VOUT_DISPLAY_VAR, NULL) );
- p_display = XOpenDisplay( psz_display );
- if( p_display == NULL ) /* error */
- {
- intf_WarnMsg( 3, "vout: cannot open display %s", psz_display );
- return( 0 );
- }
-
-#ifdef MODULE_NAME_IS_xvideo
- /* Check that there is an available XVideo port for this format */
- i_xvport = XVideoGetPort( p_display, p_data->vout.i_chroma, &i_dummy );
- if( i_xvport < 0 )
- {
- /* It failed, but it's not completely lost ! We try to open an
- * XVideo port for a YUY2 picture */
- i_xvport = XVideoGetPort( p_display, FOURCC_YUY2, &i_dummy );
- if( i_xvport < 0 )
- {
- /* It failed, but it's not completely lost ! We try to open an
- * XVideo port for a simple 16bpp RGB picture */
- i_xvport = XVideoGetPort( p_display, FOURCC_RV16, &i_dummy );
- if( i_xvport < 0 )
- {
- XCloseDisplay( p_display );
- return( 0 );
- }
- }
- }
- XVideoReleasePort( p_display, i_xvport );
-#endif
-
- /* Clean-up everyting */
- XCloseDisplay( p_display );
-
-#ifdef MODULE_NAME_IS_xvideo
- return( 150 );
-#else
- return( 50 );
-#endif
-}
-
/*****************************************************************************
* vout_Create: allocate X11 video thread output method
*****************************************************************************
* aout_ext-dec.c : exported fifo management functions
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: aout_ext-dec.c,v 1.11 2002/01/21 23:57:46 massiot Exp $
+ * $Id: aout_ext-dec.c,v 1.12 2002/02/15 13:32:54 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Cyril Deguet <asmax@via.ecp.fr>
aout_thread_t *p_aout;
int i_fifo;
- intf_WarnMsg( 3, "aout_CreateFifo: type == %d, channels == %d, rate == %d, units == %d, frame_size == %d, buffer == %x",
- i_type, i_channels, l_rate, l_units, l_frame_size, p_buffer );
+ intf_WarnMsg( 3, "aout info: fifo type %d, %d channels, rate %d, "
+ "%d units, frame size %d",
+ i_type, i_channels, l_rate, l_units, l_frame_size );
/* Spawn an audio output if there is none */
vlc_mutex_lock( &p_aout_bank->lock );
* audio_output.c : audio output thread
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: audio_output.c,v 1.75 2002/01/28 23:08:31 stef Exp $
+ * $Id: audio_output.c,v 1.76 2002/02/15 13:32:54 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Cyril Deguet <asmax@via.ecp.fr>
p_aout->i_channels = 1 + main_GetIntVariable( AOUT_STEREO_VAR,
i_channels - 1 );
- intf_WarnMsg( 3, "aout_CreateThread: channels == %d, rate == %d",
- p_aout->i_channels,
- p_aout->l_rate );
+ intf_WarnMsg( 3, "aout info: thread created, channels %d, rate %d",
+ p_aout->i_channels, p_aout->l_rate );
/* Maybe we should pass this setting in argument */
p_aout->i_format = AOUT_FORMAT_DEFAULT;
/* Choose the best module */
p_aout->p_module = module_Need( MODULE_CAPABILITY_AOUT,
main_GetPszVariable( AOUT_METHOD_VAR, NULL ),
- NULL );
+ (void *)p_aout );
if( p_aout->p_module == NULL )
{
/*
* Initialize audio device
*/
- if ( p_aout->pf_open( p_aout ) )
- {
- module_Unneed( p_aout->p_module );
- free( p_aout );
- return( NULL );
- }
-
if ( p_aout->pf_setformat( p_aout ) )
{
p_aout->pf_close( p_aout );
* decoders.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: input.c,v 1.173 2002/01/21 23:57:46 massiot Exp $
+ * $Id: input.c,v 1.174 2002/02/15 13:32:54 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
/* Find appropriate module. */
p_input->p_input_module = module_Need( MODULE_CAPABILITY_INPUT,
main_GetPszVariable( INPUT_METHOD_VAR, NULL ),
- (probedata_t *)p_input );
+ (void *)p_input );
if( p_input->p_input_module == NULL )
{
}
#define f p_input->p_input_module->p_functions->input.functions.input
+ p_input->pf_probe = f.pf_probe;
p_input->pf_init = f.pf_init;
p_input->pf_end = f.pf_end;
p_input->pf_read = f.pf_read;
* input_dec.c: Functions for the management of decoders
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: input_dec.c,v 1.25 2002/02/05 21:46:41 gbazin Exp $
+ * $Id: input_dec.c,v 1.26 2002/02/15 13:32:54 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
vlc_thread_t input_RunDecoder( input_thread_t * p_input,
es_descriptor_t * p_es )
{
- probedata_t probedata;
vlc_thread_t thread_id;
char * psz_plugin = NULL;
- /* Get a suitable module */
- probedata.i_type = p_es->i_type;
-
if( p_es->i_type == MPEG1_AUDIO_ES || p_es->i_type == MPEG2_AUDIO_ES )
{
psz_plugin = main_GetPszVariable( ADEC_MPEG_VAR, NULL );
psz_plugin = main_GetPszVariable( ADEC_AC3_VAR, NULL );
}
- p_es->p_module = module_Need( MODULE_CAPABILITY_DECODER, psz_plugin, &probedata );
+ /* Get a suitable module */
+ p_es->p_module = module_Need( MODULE_CAPABILITY_DECODER, psz_plugin,
+ (void *)&p_es->i_type );
if( p_es->p_module == NULL )
{
intf_ErrMsg( "input error: no suitable decoder module for type 0x%x",
* interface, such as command line.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: interface.c,v 1.87 2002/01/09 02:01:14 sam Exp $
+ * $Id: interface.c,v 1.88 2002/02/15 13:32:54 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
/* Choose the best module */
p_intf->p_module = module_Need( MODULE_CAPABILITY_INTF,
main_GetPszVariable( INTF_METHOD_VAR, NULL ),
- NULL );
+ (void *)p_intf );
if( p_intf->p_module == NULL )
{
p_intf->b_menu = 0;
p_intf->b_menu_change = 0;
- if( p_intf->pf_open( p_intf ) )
- {
- intf_ErrMsg("intf error: cannot create interface");
- module_Unneed( p_intf->p_module );
- free( p_intf );
- return( NULL );
- }
-
/* Initialize mutexes */
vlc_mutex_init( &p_intf->change_lock );
* and spawn threads.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: main.c,v 1.150 2002/02/14 23:29:17 sam Exp $
+ * $Id: main.c,v 1.151 2002/02/15 13:32:54 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
/*
* Choose the best memcpy module
*/
- if( module_NeedMemcpy( &p_main->memcpy ) )
+ p_main->p_memcpy_module = module_Need( MODULE_CAPABILITY_MEMCPY, NULL,
+ NULL );
+ if( p_main->p_memcpy_module == NULL )
{
intf_ErrMsg( "intf error: no suitable memcpy module, "
"using libc default" );
- p_main->memcpy.pf_memcpy = memcpy;
+ p_main->pf_memcpy = memcpy;
+ }
+ else
+ {
+ p_main->pf_memcpy = p_main->p_memcpy_module->p_functions
+ ->memcpy.functions.memcpy.pf_memcpy;
}
/*
network_ChannelCreate() )
{
/* On error during Channels initialization, switch off channels */
- intf_Msg( "Channels initialization failed : "
- "Channel management is deactivated" );
+ intf_ErrMsg( "intf error: channels initialization failed, "
+ "deactivating channels" );
main_PutIntVariable( INPUT_NETWORK_CHANNEL_VAR, 0 );
}
/*
* Free memcpy module if it was allocated
*/
- if( p_main->memcpy.p_module != NULL )
+ if( p_main->p_memcpy_module != NULL )
{
- module_UnneedMemcpy( &p_main->memcpy );
+ module_Unneed( p_main->p_memcpy_module );
}
/*
* modules.c : Built-in and plugin modules management functions
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: modules.c,v 1.51 2002/02/04 09:58:59 sam Exp $
+ * $Id: modules.c,v 1.52 2002/02/15 13:32:54 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Ethan C. Baldridge <BaldridgeE@cadmus.com>
return;
}
-int module_NeedMemcpy( memcpy_module_t *p_memcpy )
-{
- p_memcpy->p_module = module_Need( MODULE_CAPABILITY_MEMCPY, NULL, NULL );
-
- if( p_memcpy->p_module == NULL )
- {
- return -1;
- }
-
- p_memcpy->pf_memcpy = p_memcpy->p_module->p_functions->memcpy.functions.memcpy.fast_memcpy;
-
- return 0;
-}
-
-void module_UnneedMemcpy( memcpy_module_t *p_memcpy )
-{
- module_Unneed( p_memcpy->p_module );
-}
-
-#if 0
-int module_NeedIntf( intf_module_t *p_intf )
-{
- p_intf->p_module = module_Need( MODULE_CAPABILITY_INTF, NULL );
-
- if( p_intf->p_module == NULL )
- {
- return -1;
- }
-
- p_intf->pf_open = p_intf->p_module->p_functions->intf.functions.intf.pf_open;
- p_intf->pf_run = p_intf->p_module->p_functions->intf.functions.intf.pf_run;
- p_intf->pf_close = p_intf->p_module->p_functions->intf.functions.intf.pf_close;
-
- return 0;
-}
-#endif
-
/*****************************************************************************
* module_Need: return the best module function, given a capability list.
*****************************************************************************
* This function returns the module that best fits the asked capabilities.
*****************************************************************************/
-module_t * module_Need( int i_capability, char *psz_name, probedata_t *p_data )
+module_t * module_Need( int i_capability, char *psz_name, void *p_data )
{
typedef struct module_list_s
{
} module_list_t;
struct module_list_s *p_list, *p_first;
- int i_score = 0;
- int i_index = 0;
+ int i_ret, i_index = 0;
module_t *p_module;
char *psz_realname = NULL;
/* Store this new module */
p_list[ i_index ].p_module = p_module;
+ /* Lock it */
+ LockModule( p_module );
+
if( i_index == 0 )
{
p_list[ i_index ].p_next = NULL;
else
{
while( p_newlist->p_next != NULL
- && p_newlist->p_next
- ->p_module->pi_score[i_capability]
+ && p_newlist->p_next->p_module->pi_score[i_capability]
>= p_module->pi_score[i_capability] )
{
p_newlist = p_newlist->p_next;
i_index++;
}
+ /* We can release the global lock, module refcount were incremented */
+ vlc_mutex_unlock( &p_module_bank->lock );
+
/* Parse the linked list and use the first successful module */
while( p_first != NULL )
{
- LockModule( p_first->p_module );
-
/* Test the requested capability */
- i_score += ((function_list_t *)p_first->p_module->p_functions)
- [i_capability].pf_probe( p_data );
+ switch( i_capability )
+ {
+ case MODULE_CAPABILITY_INPUT:
+ i_ret = p_first->p_module->p_functions->input.functions.
+ input.pf_probe( (input_thread_t *)p_data );
+ break;
+
+ case MODULE_CAPABILITY_DECODER:
+ i_ret = p_first->p_module->p_functions->dec.functions.
+ dec.pf_probe( (u8 *)p_data );
+ break;
+
+ case MODULE_CAPABILITY_INTF:
+ i_ret = p_first->p_module->p_functions->intf.functions.
+ intf.pf_open( (intf_thread_t *)p_data );
+ break;
+
+ case MODULE_CAPABILITY_AOUT:
+ i_ret = p_first->p_module->p_functions->aout.functions.
+ aout.pf_open( (aout_thread_t *)p_data );
+ break;
+
+ case MODULE_CAPABILITY_VOUT:
+ i_ret = p_first->p_module->p_functions->vout.functions.
+ vout.pf_create( (vout_thread_t *)p_data );
+ break;
+
+ case MODULE_CAPABILITY_CHROMA:
+ i_ret = p_first->p_module->p_functions->chroma.functions.
+ chroma.pf_init( (vout_thread_t *)p_data );
+ break;
+
+ case MODULE_CAPABILITY_IDCT:
+ case MODULE_CAPABILITY_IMDCT:
+ case MODULE_CAPABILITY_MOTION:
+ case MODULE_CAPABILITY_DOWNMIX:
+ case MODULE_CAPABILITY_MEMCPY:
+ /* This one always works */
+ i_ret = 0;
+ break;
+
+ default:
+ intf_ErrMsg( "module error: if you can read this, sam fucked up something very bad... fuck him with a chainsaw on vlc-devel" );
+ i_ret = -1;
+ break;
+ }
/* If the high score was broken, we have a new champion */
- if( i_score )
+ if( i_ret == 0 )
{
break;
}
+ else
+ {
+ UnlockModule( p_first->p_module );
+ }
- UnlockModule( p_first->p_module );
+ p_first = p_first->p_next;
+ }
+ /* Store the locked module value */
+ if( p_first != NULL )
+ {
+ p_module = p_first->p_module;
p_first = p_first->p_next;
}
+ else
+ {
+ p_module = NULL;
+ }
- p_module = (p_first == NULL) ? NULL : p_first->p_module;
- free( p_list );
+ /* Unlock the remaining modules */
+ while( p_first != NULL )
+ {
+ UnlockModule( p_first->p_module );
+ p_first = p_first->p_next;
+ }
- /* We can release the global lock, module refcount was incremented */
- vlc_mutex_unlock( &p_module_bank->lock );
+ free( p_list );
if( p_module != NULL )
{
free( psz_realname );
}
- /* Don't forget that the module is still locked if bestmodule != NULL */
+ /* Don't forget that the module is still locked */
return( p_module );
}
* thread, and destroy a previously oppened video output thread.
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: video_output.c,v 1.157 2002/01/13 15:07:55 gbazin Exp $
+ * $Id: video_output.c,v 1.158 2002/02/15 13:32:54 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
int i_status; /* thread status */
int i_index; /* loop variable */
char * psz_plugin;
- probedata_t data;
/* Allocate descriptor */
p_vout = (vout_thread_t *) malloc( sizeof(vout_thread_t) );
psz_plugin = main_GetPszVariable( VOUT_METHOD_VAR, "" );
}
- data.vout.i_chroma = i_chroma;
- p_vout->p_module
- = module_Need( MODULE_CAPABILITY_VOUT, psz_plugin, &data );
-
- if( p_vout->p_module == NULL )
- {
- intf_ErrMsg( "vout error: no suitable vout module" );
- free( p_vout );
- return( NULL );
- }
-
-#define f p_vout->p_module->p_functions->vout.functions.vout
- p_vout->pf_create = f.pf_create;
- p_vout->pf_init = f.pf_init;
- p_vout->pf_end = f.pf_end;
- p_vout->pf_destroy = f.pf_destroy;
- p_vout->pf_manage = f.pf_manage;
- p_vout->pf_render = f.pf_render;
- p_vout->pf_display = f.pf_display;
-#undef f
-
/* Initialize thread properties - thread id and locks will be initialized
* later */
p_vout->b_die = 0;
if( main_GetIntVariable( VOUT_FULLSCREEN_VAR, VOUT_FULLSCREEN_DEFAULT ) )
p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
+ p_vout->p_module
+ = module_Need( MODULE_CAPABILITY_VOUT, psz_plugin, (void *)p_vout );
+
+ if( p_vout->p_module == NULL )
+ {
+ intf_ErrMsg( "vout error: no suitable vout module" );
+ free( p_vout );
+ return( NULL );
+ }
+
+#define f p_vout->p_module->p_functions->vout.functions.vout
+ p_vout->pf_create = f.pf_create;
+ p_vout->pf_init = f.pf_init;
+ p_vout->pf_end = f.pf_end;
+ p_vout->pf_destroy = f.pf_destroy;
+ p_vout->pf_manage = f.pf_manage;
+ p_vout->pf_render = f.pf_render;
+ p_vout->pf_display = f.pf_display;
+#undef f
+
/* Create thread and set locks */
vlc_mutex_init( &p_vout->picture_lock );
vlc_mutex_init( &p_vout->subpicture_lock );
static int InitThread( vout_thread_t *p_vout )
{
int i, i_pgcd;
- probedata_t data;
/* Update status */
*p_vout->pi_status = THREAD_START;
p_vout->b_direct = 0;
/* Choose the best module */
- data.chroma.p_render = &p_vout->render;
- data.chroma.p_output = &p_vout->output;
p_vout->chroma.p_module
- = module_Need( MODULE_CAPABILITY_CHROMA, NULL, &data );
+ = module_Need( MODULE_CAPABILITY_CHROMA, NULL, (void *)p_vout );
if( p_vout->chroma.p_module == NULL )
{
subpicture_t * p_subpic; /* subpicture pointer */
- /* Create and initialize system-dependant method - this function issues its
- * own error messages */
- if( p_vout->pf_create( p_vout ) )
- {
- DestroyThread( p_vout, THREAD_ERROR );
- return;
- }
-
/*
* Initialize thread
*/
* vout_pictures.c : picture management functions
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: vout_pictures.c,v 1.14 2002/02/13 22:10:40 sam Exp $
+ * $Id: vout_pictures.c,v 1.15 2002/02/15 13:32:54 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
/* Picture is not in a direct buffer, and needs to be converted to
* another size/chroma. Then the subtitles need to be rendered as
- * well. */
-
- /* This usually means software YUV, or hardware YUV with a
+ * well. This usually means software YUV, or hardware YUV with a
* different chroma. */
- /* We render subtitles and convert image to the first direct buffer */
- vout_RenderSubPictures( p_vout, p_pic, p_subpic );
+ /* Convert image to the first direct buffer */
p_vout->chroma.pf_convert( p_vout, p_pic, &p_vout->p_picture[0] );
+ /* Render subpictures on the first direct buffer */
+ vout_RenderSubPictures( p_vout, &p_vout->p_picture[0], p_subpic );
+
return &p_vout->p_picture[0];
}