If "strict" is true and a module name is provided then module_Need() will only look for the specified module
If "strict" is false, then module_Need() will first look for the specified module and if it wasn't found, will continue with the other modules with the same "capability".
* modules.h : Module management functions.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: modules.h,v 1.65 2003/10/04 12:25:00 sam Exp $
+ * $Id: modules.h,v 1.66 2004/03/03 20:39:51 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#define module_ResetBank(a) __module_ResetBank(VLC_OBJECT(a))
void __module_ResetBank ( vlc_object_t * );
-#define module_Need(a,b,c) __module_Need(VLC_OBJECT(a),b,c)
-VLC_EXPORT( module_t *, __module_Need, ( vlc_object_t *, const char *, const char * ) );
+#define module_Need(a,b,c,d) __module_Need(VLC_OBJECT(a),b,c,d)
+VLC_EXPORT( module_t *, __module_Need, ( vlc_object_t *, const char *, const char *, vlc_bool_t ) );
#define module_Unneed(a,b) __module_Unneed(VLC_OBJECT(a),b)
VLC_EXPORT( void, __module_Unneed, ( vlc_object_t *, module_t * ) );
/* demux.c: DVD demux functions.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: demux.c,v 1.3 2003/09/07 22:49:05 fenrir Exp $
+ * $Id: demux.c,v 1.4 2004/03/03 20:39:51 gbazin Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
}
p_input->p_private = (void*)&p_demux->mpeg;
- p_demux->p_module = module_Need( p_input, "mpeg-system", NULL );
+ p_demux->p_module = module_Need( p_input, "mpeg-system", NULL, 0 );
if( p_demux->p_module == NULL )
{
free( p_input->p_demux_data );
* demux.c: demux functions for dvdplay.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: demux.c,v 1.7 2003/09/07 22:49:05 fenrir Exp $
+ * $Id: demux.c,v 1.8 2004/03/03 20:39:51 gbazin Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
}
p_input->p_private = (void*)&p_demux->mpeg;
- p_demux->p_module = module_Need( p_input, "mpeg-system", NULL );
+ p_demux->p_module = module_Need( p_input, "mpeg-system", NULL, 0 );
if( p_demux->p_module == NULL )
{
free( p_input->p_demux_data );
* It depends on: libdvdread for ifo files and block reading.
*****************************************************************************
* Copyright (C) 2001, 2003 VideoLAN
- * $Id: input.c,v 1.23 2003/09/07 22:49:05 fenrir Exp $
+ * $Id: input.c,v 1.24 2004/03/03 20:39:51 gbazin Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
}
p_input->p_private = (void*)&p_demux->mpeg;
- p_demux->p_module = module_Need( p_input, "mpeg-system", NULL );
+ p_demux->p_module = module_Need( p_input, "mpeg-system", NULL, 0 );
if( p_demux->p_module == NULL )
{
free( p_input->p_demux_data );
* demux.c: demux functions for dvdplay.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: demux.c,v 1.3 2003/12/05 04:24:47 rocky Exp $
+ * $Id: demux.c,v 1.4 2004/03/03 20:39:51 gbazin Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
}
p_input->p_private = (void*)&p_demux->mpeg;
- p_demux->p_module = module_Need( p_input, "mpeg-system", NULL );
+ p_demux->p_module = module_Need( p_input, "mpeg-system", NULL, 0 );
if( p_demux->p_module == NULL )
{
free( p_input->p_demux_data );
* udp.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: udp.c,v 1.22 2004/03/03 10:51:55 massiot Exp $
+ * $Id: udp.c,v 1.23 2004/03/03 20:39:51 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
socket_desc.i_ttl = atoi( psz_val );
}
p_sys->p_thread->p_private = (void*)&socket_desc;
- if( !( p_network = module_Need( p_sys->p_thread, "network", "" ) ) )
+ if( !( p_network = module_Need( p_sys->p_thread, "network", NULL, 0 ) ) )
{
msg_Err( p_access, "failed to open a connection (udp)" );
return VLC_EGENERIC;
* coreaudio.c resampler based on CoreAudio's AudioConverter
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: coreaudio.c,v 1.4 2003/05/11 01:00:26 massiot Exp $
+ * $Id: coreaudio.c,v 1.5 2004/03/03 20:39:51 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Jon Lech Johansen <jon-vl@nanocrew.net>
sizeof(audio_sample_format_t) );
p_sys->p_secondary_resampler->p_module
= module_Need( p_sys->p_secondary_resampler, "audio filter",
- "ugly_resampler" );
+ "ugly_resampler", VLC_TRUE );
if ( p_sys->p_secondary_resampler->p_module == NULL )
{
vlc_object_detach( p_sys->p_secondary_resampler );
* a52.c : raw A/52 stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: a52.c,v 1.7 2004/03/03 11:40:19 fenrir Exp $
+ * $Id: a52.c,v 1.8 2004/03/03 20:39:51 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
VLC_FOURCC( 'a', '5', '2', ' ' ) );
p_sys->p_packetizer->p_module =
- module_Need( p_sys->p_packetizer, "packetizer", NULL );
+ module_Need( p_sys->p_packetizer, "packetizer", NULL, 0 );
if( !p_sys->p_packetizer->p_module )
{
msg_Err( p_demux, "cannot find A52 packetizer" );
* aac.c : Raw aac Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
- * $Id: aac.c,v 1.10 2004/03/03 11:40:19 fenrir Exp $
+ * $Id: aac.c,v 1.11 2004/03/03 20:39:51 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
}
/* skip possible id3 header */
- if( ( p_id3 = module_Need( p_demux, "id3", NULL ) ) )
+ if( ( p_id3 = module_Need( p_demux, "id3", NULL, 0 ) ) )
{
module_Unneed( p_demux, p_id3 );
}
* demuxstream.c: Read an MPEG stream from the satellite and stream it
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: demuxstream.c,v 1.2 2004/01/25 20:05:28 hartman Exp $
+ * $Id: demuxstream.c,v 1.3 2004/03/03 20:39:51 gbazin Exp $
*
* Authors: Henri Fallon <henri@via.ecp.fr>
* Johan Bilien <jobi@via.ecp.fr>
socket_desc.i_bind_port = 0;
socket_desc.i_ttl = 0;
p_input->p_private = (void*)&socket_desc;
- if( !( p_network = module_Need( p_input,
- "network", "" ) ) )
+ if( !( p_network = module_Need( p_input, "network", NULL, 0 ) ) )
{
msg_Err( p_input, "failed to open a connection (udp)" );
return( VLC_EGENERIC );
p_demux->i_handle = socket_desc.i_handle;
p_input->p_private = (void*)&p_demux->mpeg;
- p_demux->p_module = module_Need( p_input, "mpeg-system", NULL );
+ p_demux->p_module = module_Need( p_input, "mpeg-system", NULL, 0 );
if( p_demux->p_module == NULL )
{
free( p_input->p_demux_data );
* dts.c : raw DTS stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: dts.c,v 1.11 2004/03/03 11:40:19 fenrir Exp $
+ * $Id: dts.c,v 1.12 2004/03/03 20:39:51 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
VLC_FOURCC( 'd', 't', 's', ' ' ) );
p_sys->p_packetizer->p_module =
- module_Need( p_sys->p_packetizer, "packetizer", NULL );
+ module_Need( p_sys->p_packetizer, "packetizer", NULL, 0 );
if( !p_sys->p_packetizer->p_module )
{
msg_Err( p_demux, "cannot find DTS packetizer" );
* flac.c : FLAC demux module for vlc
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
- * $Id: flac.c,v 1.12 2004/03/03 11:40:19 fenrir Exp $
+ * $Id: flac.c,v 1.13 2004/03/03 20:39:51 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
STREAMINFO_SIZE + 4 );
p_sys->p_packetizer->p_module =
- module_Need( p_sys->p_packetizer, "packetizer", NULL );
+ module_Need( p_sys->p_packetizer, "packetizer", NULL, 0 );
if( !p_sys->p_packetizer->p_module )
{
if( p_sys->p_packetizer->fmt_in.p_extra )
* m4v.c : MPEG-4 Video demuxer
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
- * $Id: m4v.c,v 1.11 2003/12/22 02:24:52 sam Exp $
+ * $Id: m4v.c,v 1.12 2004/03/03 20:39:52 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
p_sys->p_packetizer->pf_decode_video = NULL;
p_sys->p_packetizer->pf_decode_sub = NULL;
p_sys->p_packetizer->pf_packetize = NULL;
- es_format_Init( &p_sys->p_packetizer->fmt_in, VIDEO_ES, VLC_FOURCC( 'm', 'p', '4', 'v' ) );
+ es_format_Init( &p_sys->p_packetizer->fmt_in, VIDEO_ES,
+ VLC_FOURCC( 'm', 'p', '4', 'v' ) );
es_format_Init( &p_sys->p_packetizer->fmt_out, UNKNOWN_ES, 0 );
p_sys->p_packetizer->p_module =
- module_Need( p_sys->p_packetizer, "packetizer", NULL );
+ module_Need( p_sys->p_packetizer, "packetizer", NULL, 0 );
if( p_sys->p_packetizer->p_module == NULL)
{
* mpga.c : MPEG-I/II Audio input module for vlc
*****************************************************************************
* Copyright (C) 2001-2004 VideoLAN
- * $Id: mpga.c,v 1.17 2004/03/03 11:41:04 fenrir Exp $
+ * $Id: mpga.c,v 1.18 2004/03/03 20:39:52 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
}
/* skip possible id3 header */
- if( ( p_id3 = module_Need( p_demux, "id3", NULL ) ) )
+ if( ( p_id3 = module_Need( p_demux, "id3", NULL, 0 ) ) )
{
module_Unneed( p_demux, p_id3 );
}
* mpgv.c : MPEG-I/II Video demuxer
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
- * $Id: mpgv.c,v 1.5 2004/01/25 20:05:28 hartman Exp $
+ * $Id: mpgv.c,v 1.6 2004/03/03 20:39:52 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
p_sys->p_packetizer->pf_decode_video = NULL;
p_sys->p_packetizer->pf_decode_sub = NULL;
p_sys->p_packetizer->pf_packetize = NULL;
- es_format_Init( &p_sys->p_packetizer->fmt_in, VIDEO_ES, VLC_FOURCC( 'm', 'p', 'g', 'v' ) );
+ es_format_Init( &p_sys->p_packetizer->fmt_in, VIDEO_ES,
+ VLC_FOURCC( 'm', 'p', 'g', 'v' ) );
es_format_Init( &p_sys->p_packetizer->fmt_out, UNKNOWN_ES, 0 );
p_sys->p_packetizer->p_module =
- module_Need( p_sys->p_packetizer, "packetizer", NULL );
+ module_Need( p_sys->p_packetizer, "packetizer", NULL, 0 );
if( p_sys->p_packetizer->p_module == NULL)
{
* ps.c : Program Stream input module for vlc
*****************************************************************************
* Copyright (C) 2000-2004, 2004 VideoLAN
- * $Id: ps.c,v 1.17 2004/01/25 20:05:28 hartman Exp $
+ * $Id: ps.c,v 1.18 2004/03/03 20:39:52 gbazin Exp $
*
* Author: Christophe Massiot <massiot@via.ecp.fr>
*
}
p_input->p_private = (void*)&p_demux->mpeg;
- p_demux->p_module = module_Need( p_input, "mpeg-system", NULL );
+ p_demux->p_module = module_Need( p_input, "mpeg-system", NULL, 0 );
if( p_demux->p_module == NULL )
{
free( p_input->p_demux_data );
* mpeg_ts.c : Transport Stream input module for vlc
*****************************************************************************
* Copyright (C) 2000-2004 VideoLAN
- * $Id: ts.c,v 1.46 2004/01/25 20:05:28 hartman Exp $
+ * $Id: ts.c,v 1.47 2004/03/03 20:39:52 gbazin Exp $
*
* Authors: Henri Fallon <henri@via.ecp.fr>
* Johan Bilien <jobi@via.ecp.fr>
}
p_input->p_private = (void*)&p_demux->mpeg;
- p_demux->p_module = module_Need( p_input, "mpeg-system", NULL );
+ p_demux->p_module = module_Need( p_input, "mpeg-system", NULL, 0 );
if( p_demux->p_module == NULL )
{
free( p_input->p_demux_data );
* sub.h
*****************************************************************************
* Copyright (C) 2001-2004 VideoLAN
- * $Id: sub.h,v 1.19 2004/01/27 13:10:29 fenrir Exp $
+ * $Id: sub.h,v 1.20 2004/03/03 20:39:52 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
p_sub = vlc_object_create( p_input, sizeof( subtitle_demux_t ) );
p_sub->psz_object_name = "subtitle demux";
vlc_object_attach( p_sub, p_input );
- p_sub->p_module = module_Need( p_sub, "subtitle demux", "" );
+ p_sub->p_module = module_Need( p_sub, "subtitle demux", NULL, 0 );
if( p_sub->p_module &&
p_sub->pf_open( p_sub, p_input, psz_name, i_microsecperframe ) >=0 )
* gnome.c : Gnome plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: gnome.c,v 1.17 2004/01/25 18:53:07 gbazin Exp $
+ * $Id: gnome.c,v 1.18 2004/03/03 20:39:52 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
return VLC_ENOMEM;
}
- p_intf->p_sys->p_gtk_main = module_Need( p_this, "gui-helper", "gnome" );
+ p_intf->p_sys->p_gtk_main =
+ module_Need( p_this, "gui-helper", "gnome", VLC_TRUE );
if( p_intf->p_sys->p_gtk_main == NULL )
{
free( p_intf->p_sys );
* gtk.c : Gtk+ plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: gtk.c,v 1.22 2004/01/25 18:53:07 gbazin Exp $
+ * $Id: gtk.c,v 1.23 2004/03/03 20:39:52 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
}
#ifdef NEED_GTK_MAIN
- p_intf->p_sys->p_gtk_main = module_Need( p_this, "gui-helper", "gtk" );
+ p_intf->p_sys->p_gtk_main =
+ module_Need( p_this, "gui-helper", "gtk", VLC_TRUE );
if( p_intf->p_sys->p_gtk_main == NULL )
{
free( p_intf->p_sys );
* gnome2.c : GNOME 2 plugin for vlc
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: gnome2.c,v 1.2 2003/03/30 18:14:37 gbazin Exp $
+ * $Id: gnome2.c,v 1.3 2004/03/03 20:39:52 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
}
#ifdef NEED_GTK2_MAIN
- p_intf->p_sys->p_gui_helper = module_Need( p_this, "gui-helper", "gnome2" );
+ p_intf->p_sys->p_gui_helper =
+ module_Need( p_this, "gui-helper", "gnome2", VLC_TRUE );
if( p_intf->p_sys->p_gui_helper == NULL )
{
free( p_intf->p_sys );
* gtk2.c : Gtk2 plugin for vlc
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: gtk2.c,v 1.2 2003/03/30 18:14:37 gbazin Exp $
+ * $Id: gtk2.c,v 1.3 2004/03/03 20:39:52 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
}
#ifdef NEED_GTK2_MAIN
- p_intf->p_sys->p_gui_helper = module_Need( p_this, "gui-helper", "gtk2" );
+ p_intf->p_sys->p_gui_helper =
+ module_Need( p_this, "gui-helper", "gtk2", VLC_TRUE );
if( p_intf->p_sys->p_gui_helper == NULL )
{
free( p_intf->p_sys );
* pda.c : PDA Gtk2 plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: pda.c,v 1.22 2004/02/29 22:59:59 jpsaman Exp $
+ * $Id: pda.c,v 1.23 2004/03/03 20:39:52 gbazin Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* Marc Ariberti <marcari@videolan.org>
#ifdef NEED_GTK2_MAIN
msg_Dbg( p_intf, "Using gui-helper" );
- p_intf->p_sys->p_gtk_main = module_Need( p_this, "gui-helper", "gtk2" );
+ p_intf->p_sys->p_gtk_main =
+ module_Need( p_this, "gui-helper", "gtk2", VLC_TRUE );
if( p_intf->p_sys->p_gtk_main == NULL )
{
free( p_intf->p_sys );
* dialogs.cpp: Handles all the different dialog boxes we provide.
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: dialogs.cpp,v 1.17 2003/12/11 02:26:03 asmax Exp $
+ * $Id: dialogs.cpp,v 1.18 2004/03/03 20:39:52 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
return;
}
- p_module = module_Need( p_provider, "dialogs provider", NULL );
+ p_module = module_Need( p_provider, "dialogs provider", NULL, 0 );
if( p_module == NULL )
{
msg_Err( p_intf, "no suitable dialogs provider found" );
* dialogs.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: dialogs.cpp,v 1.2 2004/01/25 17:20:19 kuehne Exp $
+ * $Id: dialogs.cpp,v 1.3 2004/03/03 20:39:52 gbazin Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
return false;
}
- m_pModule = module_Need( m_pProvider, "dialogs provider", NULL );
+ m_pModule = module_Need( m_pProvider, "dialogs provider", NULL, 0 );
if( m_pModule == NULL )
{
msg_Err( getIntf(), "No suitable dialogs provider found" );
* sap.c : SAP interface module
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: sap.c,v 1.53 2004/02/23 21:00:37 sigmunau Exp $
+ * $Id: sap.c,v 1.54 2004/03/03 20:39:52 gbazin Exp $
*
* Authors: Arnaud Schauly <gitan@via.ecp.fr>
* Clément Stenac <zorglub@via.ecp.fr>
sock.i_ttl = 0;
p_intf->p_private = (void*) &sock;
- p_network = module_Need( p_intf, "network", "ipv4" );
+ p_network = module_Need( p_intf, "network", "ipv4", VLC_TRUE );
if( p_network )
{
p_sys->fd[0] = sock.i_handle;
sock.i_ttl = 0;
p_intf->p_private = (void*) &sock;
- p_network = module_Need( p_intf, "network", "ipv6" );
+ p_network = module_Need( p_intf, "network", "ipv6", VLC_TRUE );
if( p_network )
{
p_sys->fd[1] = sock.i_handle;
/* Call the network module */
p_sout->p_private = (void*) &socket_desc;
- if( !( p_network = module_Need( p_sout, "network", "ipv4" ) ) )
+ if( !( p_network = module_Need(p_sout, "network", "ipv4", VLC_TRUE) ) )
{
msg_Warn( p_sout, "failed to open a connection (udp)" );
return NULL;
/* Call the network module */
p_sout->p_private = (void *) &socket_desc;
- if( !( p_network = module_Need( p_sout, "network", "ipv6" ) ) )
+ if( !( p_network = module_Need(p_sout, "network", "ipv6", VLC_TRUE) ) )
{
msg_Warn( p_sout, "failed to open a connection (udp)" );
return NULL;
* transcode.c: transcoding stream output module
*****************************************************************************
* Copyright (C) 2003-2004 VideoLAN
- * $Id: transcode.c,v 1.81 2004/03/03 11:29:26 massiot Exp $
+ * $Id: transcode.c,v 1.82 2004/03/03 20:39:52 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
id->p_encoder->fmt_out.i_bitrate = id->f_dst.i_bitrate;
id->p_encoder->p_module =
- module_Need( id->p_encoder, "encoder", NULL );
+ module_Need( id->p_encoder, "encoder", NULL, 0 );
if( !id->p_encoder->p_module )
{
vlc_object_destroy( id->p_encoder );
id->p_vresample = NULL;
id->p_encoder->p_module =
- module_Need( id->p_encoder, "encoder", NULL );
+ module_Need( id->p_encoder, "encoder", NULL, 0 );
if( !id->p_encoder->p_module )
{
id->p_encoder->fmt_out.p_extra = NULL;
id->p_encoder->p_module =
- module_Need( id->p_encoder, "encoder", NULL );
+ module_Need( id->p_encoder, "encoder", NULL, 0 );
if( !id->p_encoder->p_module )
{
vlc_object_destroy( id->p_encoder );
* qte.cpp : QT Embedded plugin for vlc
*****************************************************************************
* Copyright (C) 1998-2003 VideoLAN
- * $Id: qte.cpp,v 1.21 2004/01/26 16:45:02 zorglub Exp $
+ * $Id: qte.cpp,v 1.22 2004/03/03 20:39:52 gbazin Exp $
*
* Authors: Gerald Hansink <gerald.hansink@ordain.nl>
* Jean-Paul Saman <jpsaman@wxs.nl>
p_vout->pf_display = Display;
#ifdef NEED_QTE_MAIN
- p_vout->p_sys->p_qte_main = module_Need( p_this, "gui-helper", "qte" );
+ p_vout->p_sys->p_qte_main =
+ module_Need( p_this, "gui-helper", "qte", VLC_TRUE );
if( p_vout->p_sys->p_qte_main == NULL )
{
free( p_vout->p_sys );
* filters.c : audio output filters management
*****************************************************************************
* Copyright (C) 2002-2004 VideoLAN
- * $Id: filters.c,v 1.19 2004/01/06 12:02:05 zorglub Exp $
+ * $Id: filters.c,v 1.20 2004/03/03 20:39:52 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
memcpy( &p_filter->input, p_input_format, sizeof(audio_sample_format_t) );
memcpy( &p_filter->output, p_output_format,
sizeof(audio_sample_format_t) );
- p_filter->p_module = module_Need( p_filter, "audio filter", NULL );
+ p_filter->p_module = module_Need( p_filter, "audio filter", NULL, 0 );
if ( p_filter->p_module == NULL )
{
vlc_object_detach( p_filter );
* input.c : internal management of input streams for the audio output
*****************************************************************************
* Copyright (C) 2002-2004 VideoLAN
- * $Id: input.c,v 1.43 2004/01/06 12:02:05 zorglub Exp $
+ * $Id: input.c,v 1.44 2004/03/03 20:39:52 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
sizeof(audio_sample_format_t) );
p_filter->p_module =
- module_Need( p_filter,"audio filter", psz_parser );
+ module_Need( p_filter,"audio filter", psz_parser, VLC_TRUE );
if( p_filter->p_module== NULL )
{
memcpy( &p_channel_mixer->output, p_output_format,
sizeof(audio_sample_format_t) );
p_channel_mixer->p_module =
- module_Need( p_channel_mixer,"audio filter", psz_name );
+ module_Need( p_channel_mixer,"audio filter", psz_name, VLC_TRUE );
if( p_channel_mixer->p_module== NULL )
{
msg_Err( p_aout, "cannot add user channel mixer %s", psz_name );
* mixer.c : audio output mixing operations
*****************************************************************************
* Copyright (C) 2002-2004 VideoLAN
- * $Id: mixer.c,v 1.29 2004/01/06 12:02:05 zorglub Exp $
+ * $Id: mixer.c,v 1.30 2004/03/03 20:39:52 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
*****************************************************************************/
int aout_MixerNew( aout_instance_t * p_aout )
{
- p_aout->mixer.p_module = module_Need( p_aout, "audio mixer", NULL );
+ p_aout->mixer.p_module = module_Need( p_aout, "audio mixer", NULL, 0 );
if ( p_aout->mixer.p_module == NULL )
{
msg_Err( p_aout, "no suitable aout mixer" );
* output.c : internal management of output streams for the audio output
*****************************************************************************
* Copyright (C) 2002-2004 VideoLAN
- * $Id: output.c,v 1.43 2004/01/26 21:37:58 hartman Exp $
+ * $Id: output.c,v 1.44 2004/03/03 20:39:52 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
audio_sample_format_t * p_format )
{
/* Retrieve user defaults. */
- char * psz_name = config_GetPsz( p_aout, "aout" );
int i_rate = config_GetInt( p_aout, "aout-rate" );
vlc_value_t val, text;
/* kludge to avoid a fpu error when rate is 0... */
vlc_mutex_lock( &p_aout->output_fifo_lock );
/* Find the best output plug-in. */
- p_aout->output.p_module = module_Need( p_aout, "audio output", psz_name );
- if ( psz_name != NULL ) free( psz_name );
+ p_aout->output.p_module = module_Need( p_aout, "audio output", "$aout", 0);
if ( p_aout->output.p_module == NULL )
{
msg_Err( p_aout, "no suitable aout module" );
* demux.c
*****************************************************************************
* Copyright (C) 1999-2004 VideoLAN
- * $Id: demux.c,v 1.12 2004/03/03 12:01:38 fenrir Exp $
+ * $Id: demux.c,v 1.13 2004/03/03 20:39:53 gbazin Exp $
*
* Author: Laurent Aimar <fenrir@via.ecp.fr>
*
/* Before module_Need (for var_Create...) */
vlc_object_attach( p_demux, p_obj );
- p_demux->p_module = module_Need( p_demux, "demux2", p_demux->psz_demux );
+ p_demux->p_module =
+ module_Need( p_demux, "demux2", p_demux->psz_demux, VLC_TRUE );
if( p_demux->p_module == NULL )
{
vlc_object_detach( p_demux );
* decoders.
*****************************************************************************
* Copyright (C) 1998-2004 VideoLAN
- * $Id: input.c,v 1.291 2004/03/03 11:59:41 fenrir Exp $
+ * $Id: input.c,v 1.292 2004/03/03 20:39:53 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
/* Find and open appropriate access module */
p_input->p_access = module_Need( p_input, "access",
- p_input->psz_access );
+ p_input->psz_access, VLC_TRUE );
#ifndef WIN32 /* Remove this gross hack from the win32 build as colons
* are forbidden in filenames on Win32. */
p_input->psz_dupsource = NULL;
p_input->p_access = module_Need( p_input, "access",
- p_input->psz_access );
+ p_input->psz_access, VLC_TRUE );
}
#endif
p_input->p_demux =
module_Need( p_input, "demux",
(p_input->psz_demux && *p_input->psz_demux) ?
- p_input->psz_demux : "$demux" );
+ p_input->psz_demux : "$demux",
+ (p_input->psz_demux && *p_input->psz_demux) ?
+ VLC_TRUE : VLC_FALSE );
if( p_input->p_demux == NULL )
{
* input_dec.c: Functions for the management of decoders
*****************************************************************************
* Copyright (C) 1999-2004 VideoLAN
- * $Id: input_dec.c,v 1.93 2004/03/03 11:12:08 massiot Exp $
+ * $Id: input_dec.c,v 1.94 2004/03/03 20:39:53 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
return NULL;
}
- p_dec->p_module = module_Need( p_dec, "packetizer", "$packetizer" );
+ p_dec->p_module = module_Need( p_dec, "packetizer", "$packetizer", 0 );
}
else
{
}
/* default Get a suitable decoder module */
- p_dec->p_module = module_Need( p_dec, "decoder", "$codec" );
+ p_dec->p_module = module_Need( p_dec, "decoder", "$codec", 0 );
}
if( !p_dec->p_module )
* interface, such as command line.
*****************************************************************************
* Copyright (C) 1998-2004 VideoLAN
- * $Id: interface.c,v 1.113 2004/02/08 11:23:17 gbazin Exp $
+ * $Id: interface.c,v 1.114 2004/03/03 20:39:53 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
}
/* Choose the best module */
- p_intf->p_module = module_Need( p_intf, "interface", psz_module );
+ p_intf->p_module = module_Need( p_intf, "interface", psz_module, 0 );
if( p_intf->p_module == NULL )
{
/* Make sure the old interface is completely uninitialised */
module_Unneed( p_intf, p_intf->p_module );
- p_intf->p_module = module_Need( p_intf, "interface", psz_intf );
+ p_intf->p_module = module_Need( p_intf, "interface", psz_intf, 0 );
free( psz_intf );
if( p_intf->p_module )
* libvlc.c: main libvlc source
*****************************************************************************
* Copyright (C) 1998-2004 VideoLAN
- * $Id: libvlc.c,v 1.117 2004/02/22 15:41:27 massiot Exp $
+ * $Id: libvlc.c,v 1.118 2004/03/03 20:39:52 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
/*
* Choose the best memcpy module
*/
- p_vlc->p_memcpy_module = module_Need( p_vlc, "memcpy", "$memcpy" );
+ p_vlc->p_memcpy_module = module_Need( p_vlc, "memcpy", "$memcpy", 0 );
if( p_vlc->pf_memcpy == NULL )
{
* modules.c : Builtin and plugin modules management functions
*****************************************************************************
* Copyright (C) 2001-2004 VideoLAN
- * $Id: modules.c,v 1.145 2004/03/03 15:47:08 sigmunau Exp $
+ * $Id: modules.c,v 1.146 2004/03/03 20:39:53 gbazin Exp $
*
* Authors: Sam Hocevar <sam@zoy.org>
* Ethan C. Baldridge <BaldridgeE@cadmus.com>
* This function returns the module that best fits the asked capabilities.
*****************************************************************************/
module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability,
- const char *psz_name )
+ const char *psz_name, vlc_bool_t b_strict )
{
typedef struct module_list_t module_list_t;
/* Count how many different shortcuts were asked for */
if( psz_name && *psz_name )
{
- char *psz_parser;
+ char *psz_parser, *psz_last_shortcut;
/* If the user wants none, give him none. */
if( !strcmp( psz_name, "none" ) )
}
i_shortcuts++;
- psz_shortcuts = strdup( psz_name );
+ psz_shortcuts = psz_last_shortcut = strdup( psz_name );
for( psz_parser = psz_shortcuts; *psz_parser; psz_parser++ )
{
{
*psz_parser = '\0';
i_shortcuts++;
+ psz_last_shortcut = psz_parser + 1;
}
}
+
+ /* Check if the user wants to override the "strict" mode */
+ if( psz_last_shortcut )
+ {
+ if( !strcmp(psz_last_shortcut, "none") ) b_strict = VLC_TRUE;
+ else if( !strcmp(psz_last_shortcut, "any") ) b_strict = VLC_FALSE;
+ }
}
/* Sort the modules and test them */
while( i_short )
{
- /* If the last given shortcut is "none" and we couldn't
+ /* If we are in "strict" mode and we couldn't
* find the module in the list of provided shortcuts,
* then kick the bastard out of here!!! */
- if( (i_short == 1) && !strcmp(psz_name, "none") )
+ if( i_short == 1 && b_strict )
{
b_trash = VLC_TRUE;
break;
* net.c:
*****************************************************************************
* Copyright (C) 2004 VideoLAN
- * $Id: net.c,v 1.9 2004/01/25 17:16:06 zorglub Exp $
+ * $Id: net.c,v 1.10 2004/03/03 20:39:53 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@videolan.org>
*
network_socket_t sock;
module_t *p_network;
-
/* Check if we have force ipv4 or ipv6 */
var_Create( p_this, "ipv4", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Get( p_this, "ipv4", &val );
msg_Dbg( p_this, "net: connecting to '%s:%d'", psz_host, i_port );
private = p_this->p_private;
p_this->p_private = (void*)&sock;
- if( ( p_network = module_Need( p_this, "network", psz_network ) ) == NULL )
+ if( !( p_network = module_Need( p_this, "network", psz_network, 0 ) ) )
{
- msg_Dbg( p_this, "net: connection to '%s:%d' failed", psz_host, i_port );
+ msg_Dbg( p_this, "net: connection to '%s:%d' failed",
+ psz_host, i_port );
return -1;
}
module_Unneed( p_this, p_network );
psz_server, i_server, psz_bind, i_bind );
private = p_this->p_private;
p_this->p_private = (void*)&sock;
- if( ( p_network = module_Need( p_this, "network", psz_network ) ) == NULL )
+ if( !( p_network = module_Need( p_this, "network", psz_network, 0 ) ) )
{
msg_Dbg( p_this, "net: connection to '%s:%d@%s:%d' failed",
psz_server, i_server, psz_bind, i_bind );
* loadsave.c : Playlist loading / saving functions
*****************************************************************************
* Copyright (C) 1999-2004 VideoLAN
- * $Id: loadsave.c,v 1.10 2004/01/29 17:51:08 zorglub Exp $
+ * $Id: loadsave.c,v 1.11 2004/03/03 20:39:53 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
vlc_mutex_lock( &p_playlist->object_lock );
/* And call the module ! All work is done now */
- p_module = module_Need( p_playlist, "playlist export", psz_type);
+ p_module = module_Need( p_playlist, "playlist export", psz_type, VLC_TRUE);
if( !p_module )
{
msg_Warn( p_playlist, "failed to export playlist" );
* stream_output.c : stream output module
*****************************************************************************
* Copyright (C) 2002-2004 VideoLAN
- * $Id: stream_output.c,v 1.40 2004/02/22 16:08:47 fenrir Exp $
+ * $Id: stream_output.c,v 1.41 2004/03/03 20:39:53 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Laurent Aimar <fenrir@via.ecp.fr>
#define sout_stream_url_to_chain( p, s ) _sout_stream_url_to_chain( VLC_OBJECT(p), s )
static char *_sout_stream_url_to_chain( vlc_object_t *, char * );
-#define module_NeedStrict(a,b,c) __module_NeedStrict(VLC_OBJECT(a),b,c)
-static module_t *__module_NeedStrict( vlc_object_t *, const char *, const char * );
-
/*
* Generic MRL parser
*
p_access->pf_write = NULL;
p_access->p_module =
- module_NeedStrict( p_access, "sout access", p_access->psz_access );
+ module_Need( p_access, "sout access", p_access->psz_access, VLC_TRUE );
if( !p_access->p_module )
{
p_mux->p_sys = NULL;
p_mux->p_module =
- module_NeedStrict( p_mux, "sout mux", p_mux->psz_mux );
+ module_Need( p_mux, "sout mux", p_mux->psz_mux, VLC_TRUE );
if( p_mux->p_module == NULL )
{
msg_Dbg( p_sout, "stream=`%s'", p_stream->psz_name );
p_stream->p_module =
- module_NeedStrict( p_stream, "sout stream", p_stream->psz_name );
+ module_Need( p_stream, "sout stream", p_stream->psz_name, VLC_TRUE );
if( !p_stream->p_module )
{
mrl_Clean( &mrl );
return( psz_chain );
}
-
-/*****************************************************************************/
-static module_t *__module_NeedStrict( vlc_object_t *p_obj, const char *psz_capacity, const char *psz_name )
-{
- module_t *p_module;
-
- if( !psz_name || !*psz_name )
- {
- p_module = module_Need( p_obj, psz_capacity, psz_name );
- }
- else
- {
- char *psz_name_strict = malloc( strlen( psz_name ) + 6 );
- strcpy( psz_name_strict, psz_name );
- strcat( psz_name_strict, ",none" );
-
- p_module = module_Need( p_obj, psz_capacity, psz_name_strict );
-
- free( psz_name_strict );
- }
-
- return p_module;
-}
-
-
* thread, and destroy a previously oppened video output thread.
*****************************************************************************
* Copyright (C) 2000-2004 VideoLAN
- * $Id: video_output.c,v 1.245 2004/01/25 17:16:06 zorglub Exp $
+ * $Id: video_output.c,v 1.246 2004/03/03 20:39:53 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
/* Create the vout thread */
p_vout->p_module = module_Need( p_vout,
- ( p_vout->psz_filter_chain &&
- *p_vout->psz_filter_chain ) ?
- "video filter" : "video output",
- psz_plugin );
+ ( p_vout->psz_filter_chain && *p_vout->psz_filter_chain ) ?
+ "video filter" : "video output", psz_plugin, 0 );
if( psz_plugin ) free( psz_plugin );
if( p_vout->p_module == NULL )
return NULL;
}
- p_vout->p_text_renderer_module = module_Need( p_vout, "text renderer",
- NULL );
+ p_vout->p_text_renderer_module =
+ module_Need( p_vout, "text renderer", NULL, 0 );
if( p_vout->p_text_renderer_module == NULL )
{
msg_Warn( p_vout, "no suitable text renderer module" );
p_vout->b_direct = 0;
/* Choose the best module */
- p_vout->chroma.p_module = module_Need( p_vout, "chroma", NULL );
+ p_vout->chroma.p_module = module_Need( p_vout, "chroma", NULL, 0 );
if( p_vout->chroma.p_module == NULL )
{