Commit 976dfc3e authored by Sam Hocevar's avatar Sam Hocevar

* ALL: new module API. Makes a few things a lot simpler, and we gain

    about 2000 lines of code.

    I could not test everything on every architecture, so please report
    any module breakage (especially on BeOS, OSX and QNX).
parent 8a8c1fca
List of known vlc bugs $Id: BUGS,v 1.14 2002/06/01 12:31:57 sam Exp $
List of known vlc bugs $Id: BUGS,v 1.15 2002/07/31 20:56:50 sam Exp $
Please try to keep this file up to date. Also, grep for FIXME in the
source files for more and more bugs to fix.
......@@ -16,6 +16,9 @@ Input:
* DVD raw device support doesn't seem to work.
* Going to title 0 with the dvdold or dvdread plugins segfaults (tested
with Nausicaa).
Decoders:
......@@ -36,6 +39,10 @@ Video output:
* On-the-fly resizing when using a chroma transformation doesn't work for
all plugins. Currently it is only implemented for x11 and SDL.
* --filter clone gives a slanted picture on axe.mpeg
* --filter transform barfs on rambo.avi
Chroma transformations:
* Most chroma transformation modules completely ignore margins.
......
......@@ -357,7 +357,7 @@ plugins-uninstall:
builtins-install:
mkdir -p $(DESTDIR)$(libdir)/vlc
ifneq (,$(BUILTINS))
$(INSTALL) $(BUILTINS:%=plugins/%.a) $(DESTDIR)$(libdir)/vlc
$(INSTALL) -m 644 $(BUILTINS:%=plugins/%.a) $(DESTDIR)$(libdir)/vlc
endif
builtins-uninstall:
......@@ -564,9 +564,7 @@ src/misc/modules_builtin.h: Makefile.opts Makefile Makefile.config
@rm -f $@ && cp $@.in $@
ifneq (,$(BUILTINS))
@for i in $(BUILTINS) ; do \
echo "int InitModule__MODULE_"$$i"( module_t* );" >>$@; \
echo "int ActivateModule__MODULE_"$$i"( module_t* );" >>$@; \
echo "int DeactivateModule__MODULE_"$$i"( module_t* );" >>$@; \
echo "int vlc_entry__"$$i"( module_t* );" >>$@; \
done
@echo "" >> $@ ;
endif
......@@ -621,10 +619,6 @@ ifeq ($(SYS),beos)
mimeset -f $@
endif
# here are the rules for a dynamic link of libvlc:
#vlc: Makefile.opts Makefile.dep Makefile $(VLC_OBJ) lib/libvlc.so $(BUILTIN_OBJ)
# $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) $(BUILTIN_OBJ) $(LDFLAGS) $(builtins_LDFLAGS) -L./lib -lvlc
#
# Main library target
#
......@@ -633,6 +627,10 @@ lib/libvlc.a: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ)
ar rc $@ $(LIBVLC_OBJ)
$(RANLIB) $@
#
# DO NOT DISTRIBUTE SHARED VERSIONS OF LIBVLC UNTIL THE ABI IS STABLE
# OR BURN IN HELL -- Sam
#
#lib/libvlc.so: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ)
# $(CC) -shared $(LIBVLC_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) -o $@
......
This diff is collapsed.
......@@ -1816,7 +1816,7 @@ AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VideoLAN Client - version ${VERSION} ${CO
AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
VLC_SYMBOL="`echo ${VERSION} | tr .- __`"
AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__MODULE_${VLC_SYMBOL}", [String suffix for module functions])
AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${VLC_SYMBOL}", [String suffix for module functions])
AC_DEFINE_UNQUOTED(MODULE_SYMBOL, ${VLC_SYMBOL}, [Symbol suffix for module functions])
DATA_PATH="${ac_tool_prefix}/share/videolan"
......
......@@ -183,3 +183,13 @@ the Boston strangler is to the woman home alone.
-- Jack Valenti (president of the MPAA) on April 12, 1982
%
<Meuuh> then we need to update download.html
<Meuuh> what do we still have ?
<sam> the mail, freshmeat, the videolan.org news
<sam> cvs tag
<sam> regression tests
<sam> bwaahahahahahAHAHAHA
<Meuuh> mouhahaha
-- #videolan
%
......@@ -2,7 +2,7 @@
* ac3_downmix.h : AC3 downmix types
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: ac3_downmix.h,v 1.5 2002/07/20 18:01:41 sam Exp $
* $Id: ac3_downmix.h,v 1.6 2002/07/31 20:56:50 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Renaud Dartus <reno@videolan.org>
......@@ -31,6 +31,8 @@ struct dm_par_t
struct downmix_t
{
VLC_COMMON_MEMBERS
/* Module used and shortcuts */
module_t * p_module;
void (*pf_downmix_3f_2r_to_2ch)(float *, dm_par_t * dm_par);
......
......@@ -2,7 +2,7 @@
* ac3_imdct.h : AC3 IMDCT types
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: ac3_imdct.h,v 1.9 2002/07/20 18:01:41 sam Exp $
* $Id: ac3_imdct.h,v 1.10 2002/07/31 20:56:50 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Renaud Dartus <reno@videolan.org>
......@@ -32,6 +32,8 @@ struct complex_t
struct imdct_t
{
VLC_COMMON_MEMBERS
complex_t * buf;
void * buf_orig; /* pointer before memalign */
......
......@@ -2,7 +2,7 @@
* audio_output.h : audio output thread interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: audio_output.h,v 1.49 2002/07/20 18:01:41 sam Exp $
* $Id: audio_output.h,v 1.50 2002/07/31 20:56:50 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Cyril Deguet <asmax@via.ecp.fr>
......@@ -120,11 +120,9 @@ struct aout_thread_t
/* Plugin used and shortcuts to access its capabilities */
module_t * p_module;
int ( *pf_open ) ( aout_thread_t * );
int ( *pf_setformat ) ( aout_thread_t * );
int ( *pf_getbufinfo ) ( aout_thread_t * , int );
void ( *pf_play ) ( aout_thread_t * , byte_t *, int );
void ( *pf_close ) ( aout_thread_t * );
void * buffer;
/* The s32 buffer is used to mix all the audio fifos together before
......@@ -185,7 +183,7 @@ struct aout_thread_t
aout_thread_t * aout_CreateThread ( vlc_object_t *, int, int );
void aout_DestroyThread ( aout_thread_t * );
#define aout_CreateFifo(a,b,c,d,e,f) __aout_CreateFifo(CAST_TO_VLC_OBJECT(a),b,c,d,e,f)
#define aout_CreateFifo(a,b,c,d,e,f) __aout_CreateFifo(VLC_OBJECT(a),b,c,d,e,f)
VLC_EXPORT( aout_fifo_t *, __aout_CreateFifo, ( vlc_object_t *, int, int, int, int, void * ) );
VLC_EXPORT( void, aout_DestroyFifo, ( aout_fifo_t *p_fifo ) );
void aout_FreeFifo ( aout_fifo_t *p_fifo );
......
......@@ -4,7 +4,7 @@
* It includes functions allowing to declare, get or set configuration options.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: configuration.h,v 1.16 2002/07/20 18:01:41 sam Exp $
* $Id: configuration.h,v 1.17 2002/07/31 20:56:50 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -49,6 +49,7 @@
struct module_config_t
{
int i_type; /* Configuration type */
char *psz_type; /* Configuration subtype */
char *psz_name; /* Option name */
char i_short; /* Optional short option name */
char *psz_text; /* Short comment on the configuration option */
......@@ -89,16 +90,16 @@ VLC_EXPORT( void, config_Duplicate, ( module_t *, module_config_t * ) );
VLC_EXPORT( void, config_SetCallbacks, ( module_config_t *, module_config_t * ) );
VLC_EXPORT( void, config_UnsetCallbacks, ( module_config_t * ) );
#define config_GetInt(a,b) __config_GetInt(CAST_TO_VLC_OBJECT(a),b)
#define config_PutInt(a,b,c) __config_PutInt(CAST_TO_VLC_OBJECT(a),b,c)
#define config_GetFloat(a,b) __config_GetFloat(CAST_TO_VLC_OBJECT(a),b)
#define config_PutFloat(a,b,c) __config_PutFloat(CAST_TO_VLC_OBJECT(a),b,c)
#define config_GetPsz(a,b) __config_GetPsz(CAST_TO_VLC_OBJECT(a),b)
#define config_PutPsz(a,b,c) __config_PutPsz(CAST_TO_VLC_OBJECT(a),b,c)
#define config_GetInt(a,b) __config_GetInt(VLC_OBJECT(a),b)
#define config_PutInt(a,b,c) __config_PutInt(VLC_OBJECT(a),b,c)
#define config_GetFloat(a,b) __config_GetFloat(VLC_OBJECT(a),b)
#define config_PutFloat(a,b,c) __config_PutFloat(VLC_OBJECT(a),b,c)
#define config_GetPsz(a,b) __config_GetPsz(VLC_OBJECT(a),b)
#define config_PutPsz(a,b,c) __config_PutPsz(VLC_OBJECT(a),b,c)
#define config_LoadCmdLine(a,b,c,d) __config_LoadCmdLine(CAST_TO_VLC_OBJECT(a),b,c,d)
#define config_LoadConfigFile(a,b) __config_LoadConfigFile(CAST_TO_VLC_OBJECT(a),b)
#define config_SaveConfigFile(a,b) __config_SaveConfigFile(CAST_TO_VLC_OBJECT(a),b)
#define config_LoadCmdLine(a,b,c,d) __config_LoadCmdLine(VLC_OBJECT(a),b,c,d)
#define config_LoadConfigFile(a,b) __config_LoadConfigFile(VLC_OBJECT(a),b)
#define config_SaveConfigFile(a,b) __config_SaveConfigFile(VLC_OBJECT(a),b)
/*****************************************************************************
* Macros used to build the configuration structure.
......@@ -113,61 +114,43 @@ VLC_EXPORT( void, config_UnsetCallbacks, ( module_config_t * ) );
* allow for a more user friendly interface.
*****************************************************************************/
#define MODULE_CONFIG_START \
static module_config_t p_config[] = {
#define MODULE_CONFIG_STOP \
{ CONFIG_HINT_END, NULL, '\0' } };
#define ADD_CATEGORY_HINT( text, longtext ) \
{ CONFIG_HINT_CATEGORY, NULL, '\0', text, longtext },
#define ADD_SUBCATEGORY_HINT( text, longtext ) \
{ CONFIG_HINT_SUBCATEGORY, NULL, '\0', text, longtext },
#define END_SUBCATEGORY_HINT \
{ CONFIG_HINT_SUBCATEGORY_END, NULL, '\0' },
#define ADD_USAGE_HINT( text ) \
{ CONFIG_HINT_USAGE, NULL, '\0', text },
#define ADD_STRING( name, psz_value, p_callback, text, longtext ) \
{ CONFIG_ITEM_STRING, name, '\0', text, longtext, psz_value, 0, 0, \
p_callback },
#define ADD_STRING_FROM_LIST( name, psz_value, ppsz_list, p_callback, text, \
#define add_category_hint( text, longtext ) \
p_config[ i_config ] = (module_config_t){ CONFIG_HINT_CATEGORY, NULL, NULL, '\0', text, longtext }; i_config++
#define add_subcategory_hint( text, longtext ) \
p_config[ i_config ] = (module_config_t){ CONFIG_HINT_SUBCATEGORY, NULL, NULL, '\0', text, longtext }; i_config++
#define end_subcategory_hint \
p_config[ i_config ] = (module_config_t){ CONFIG_HINT_SUBCATEGORY_END, NULL, NULL, '\0' }; i_config++
#define add_usage_hint( text ) \
p_config[ i_config ] = (module_config_t){ CONFIG_HINT_USAGE, NULL, NULL, '\0', text }; i_config++
#define add_string( name, psz_value, p_callback, text, longtext ) \
p_config[ i_config ] = (module_config_t){ CONFIG_ITEM_STRING, NULL, name, '\0', text, longtext, psz_value, 0, 0, p_callback }; i_config++
#define add_string_from_list( name, psz_value, ppsz_list, p_callback, text, \
longtext ) \
{ CONFIG_ITEM_STRING, name, '\0', text, longtext, psz_value, 0, 0, \
p_callback, ppsz_list },
#define ADD_FILE( name, psz_value, p_callback, text, longtext ) \
{ CONFIG_ITEM_FILE, name, '\0', text, longtext, psz_value, 0, 0, \
p_callback },
#define ADD_MODULE( name, i_caps, psz_value, p_callback, text, longtext ) \
{ CONFIG_ITEM_MODULE, name, '\0', text, longtext, psz_value, i_caps, 0, \
p_callback },
#define ADD_INTEGER( name, i_value, p_callback, text, longtext ) \
{ CONFIG_ITEM_INTEGER, name, '\0', text, longtext, NULL, i_value, 0, \
p_callback },
#define ADD_FLOAT( name, f_value, p_callback, text, longtext ) \
{ CONFIG_ITEM_FLOAT, name, '\0', text, longtext, NULL, 0, f_value, \
p_callback },
#define ADD_BOOL( name, b_value, p_callback, text, longtext ) \
{ CONFIG_ITEM_BOOL, name, '\0', text, longtext, NULL, b_value, 0, \
p_callback },
p_config[ i_config ] = (module_config_t){ CONFIG_ITEM_STRING, NULL, name, '\0', text, longtext, psz_value, 0, 0, p_callback, ppsz_list }; i_config++
#define add_file( name, psz_value, p_callback, text, longtext ) \
p_config[ i_config ] = (module_config_t){ CONFIG_ITEM_FILE, NULL, name, '\0', text, longtext, psz_value, 0, 0, p_callback }; i_config++
#define add_module( name, psz_caps, psz_value, p_callback, text, longtext ) \
p_config[ i_config ] = (module_config_t){ CONFIG_ITEM_MODULE, psz_caps, name, '\0', text, longtext, psz_value, 0, 0, p_callback }; i_config++
#define add_integer( name, i_value, p_callback, text, longtext ) \
p_config[ i_config ] = (module_config_t){ CONFIG_ITEM_INTEGER, NULL, name, '\0', text, longtext, NULL, i_value, 0, p_callback }; i_config++
#define add_float( name, f_value, p_callback, text, longtext ) \
p_config[ i_config ] = (module_config_t){ CONFIG_ITEM_FLOAT, NULL, name, '\0', text, longtext, NULL, 0, f_value, p_callback }; i_config++
#define add_bool( name, b_value, p_callback, text, longtext ) \
p_config[ i_config ] = (module_config_t){ CONFIG_ITEM_BOOL, NULL, name, '\0', text, longtext, NULL, b_value, 0, p_callback }; i_config++
/* These should be seldom used. They were added just to provide easy shortcuts
* for the command line interface */
#define ADD_STRING_WITH_SHORT( name, ch, psz_value, p_callback, text, ltext ) \
{ CONFIG_ITEM_STRING, name, ch, text, ltext, psz_value, 0, 0, \
p_callback },
#define ADD_FILE_WITH_SHORT( name, ch, psz_value, p_callback, text, ltext ) \
{ CONFIG_ITEM_FILE, name, ch, text, ltext, psz_value, 0, 0, \
p_callback },
#define ADD_MODULE_WITH_SHORT( name, ch, i_capability, psz_value, p_callback, \
#define add_string_with_short( name, ch, psz_value, p_callback, text, ltext ) \
p_config[ i_config ] = (module_config_t){ CONFIG_ITEM_STRING, NULL, name, ch, text, ltext, psz_value, 0, 0, p_callback }; i_config++
#define add_file_with_short( name, ch, psz_value, p_callback, text, ltext ) \
p_config[ i_config ] = (module_config_t){ CONFIG_ITEM_FILE, NULL, name, ch, text, ltext, psz_value, 0, 0, p_callback }; i_config++
#define add_module_with_short( name, ch, psz_caps, psz_value, p_callback, \
text, ltext) \
{ CONFIG_ITEM_MODULE, name, ch, text, ltext, psz_value, i_capability, 0, \
p_callback },
#define ADD_INTEGER_WITH_SHORT( name, ch, i_value, p_callback, text, ltext ) \
{ CONFIG_ITEM_INTEGER, name, ch, text, ltext, NULL, i_value, 0, \
p_callback },
#define ADD_FLOAT_WITH_SHORT( name, ch, f_value, p_callback, text, ltext ) \
{ CONFIG_ITEM_FLOAT, name, ch, text, ltext, NULL, 0, f_value, \
p_callback },
#define ADD_BOOL_WITH_SHORT( name, ch, b_value, p_callback, text, ltext ) \
{ CONFIG_ITEM_BOOL, name, ch, text, ltext, NULL, b_value, 0, \
p_callback },
p_config[ i_config ] = (module_config_t){ CONFIG_ITEM_MODULE, psz_caps, name, ch, text, ltext, psz_value, 0, 0, p_callback }; i_config++
#define add_integer_with_short( name, ch, i_value, p_callback, text, ltext ) \
p_config[ i_config ] = (module_config_t){ CONFIG_ITEM_INTEGER, NULL, name, ch, text, ltext, NULL, i_value, 0, p_callback }; i_config++
#define add_float_with_short( name, ch, f_value, p_callback, text, ltext ) \
p_config[ i_config ] = (module_config_t){ CONFIG_ITEM_FLOAT, NULL, name, ch, text, ltext, NULL, 0, f_value, p_callback }; i_config++
#define add_bool_with_short( name, ch, b_value, p_callback, text, ltext ) \
p_config[ i_config ] = (module_config_t){ CONFIG_ITEM_BOOL, NULL, name, ch, text, ltext, NULL, b_value, 0, p_callback }; i_config++
......@@ -2,7 +2,7 @@
* input_ext-dec.h: structures exported to the VideoLAN decoders
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: input_ext-dec.h,v 1.64 2002/07/23 00:39:16 sam Exp $
* $Id: input_ext-dec.h,v 1.65 2002/07/31 20:56:50 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Kaempf <maxx@via.ecp.fr>
......@@ -118,6 +118,10 @@ struct decoder_fifo_t
vlc_fourcc_t i_fourcc;
void * p_demux_data;
stream_ctrl_t * p_stream_ctrl;
/* Module properties */
module_t * p_module;
int ( * pf_run ) ( decoder_fifo_t * );
};
/*****************************************************************************
......
......@@ -4,7 +4,7 @@
* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-intf.h,v 1.72 2002/07/23 00:39:16 sam Exp $
* $Id: input_ext-intf.h,v 1.73 2002/07/31 20:56:50 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -65,13 +65,9 @@ struct es_descriptor_t
/* Decoder information */
decoder_fifo_t * p_decoder_fifo;
vlc_thread_t thread_id; /* ID of the decoder */
count_t c_packets; /* total packets read */
count_t c_invalid_packets; /* invalid packets read */
/* Module properties */
module_t * p_module;
};
/* Special PID values - note that the PID is only on 13 bits, and that values
......@@ -274,9 +270,7 @@ struct input_thread_t
vlc_bool_t b_eof;
/* Access module */
module_t * p_access_module;
int (* pf_open ) ( input_thread_t * );
void (* pf_close )( input_thread_t * );
module_t * p_access;
ssize_t (* pf_read ) ( input_thread_t *, byte_t *, size_t );
int (* pf_set_program )( input_thread_t *, pgrm_descriptor_t * );
int (* pf_set_area )( input_thread_t *, input_area_t * );
......@@ -285,9 +279,7 @@ struct input_thread_t
size_t i_mtu;
/* Demux module */
module_t * p_demux_module;
int (* pf_init ) ( input_thread_t * );
void (* pf_end ) ( input_thread_t * );
module_t * p_demux;
int (* pf_demux ) ( input_thread_t * );
int (* pf_rewind ) ( input_thread_t * );
/* NULL if we don't support going *
......@@ -347,19 +339,19 @@ struct input_thread_t
/*****************************************************************************
* Prototypes
*****************************************************************************/
#define input_CreateThread(a,b,c) __input_CreateThread(CAST_TO_VLC_OBJECT(a),b,c)
#define input_CreateThread(a,b,c) __input_CreateThread(VLC_OBJECT(a),b,c)
input_thread_t * __input_CreateThread ( vlc_object_t *,
playlist_item_t *, int * );
void input_StopThread ( input_thread_t * );
void input_DestroyThread ( input_thread_t * );
#define input_SetStatus(a,b) __input_SetStatus(CAST_TO_VLC_OBJECT(a),b)
#define input_SetStatus(a,b) __input_SetStatus(VLC_OBJECT(a),b)
VLC_EXPORT( void, __input_SetStatus, ( vlc_object_t *, int ) );
#define input_Seek(a,b,c) __input_Seek(CAST_TO_VLC_OBJECT(a),b,c)
#define input_Seek(a,b,c) __input_Seek(VLC_OBJECT(a),b,c)
VLC_EXPORT( void, __input_Seek, ( vlc_object_t *, off_t, int ) );
#define input_Tell(a,b) __input_Tell(CAST_TO_VLC_OBJECT(a),b)
#define input_Tell(a,b) __input_Tell(VLC_OBJECT(a),b)
VLC_EXPORT( void, __input_Tell, ( vlc_object_t *, stream_position_t * ) );
VLC_EXPORT( void, input_DumpStream, ( input_thread_t * ) );
......@@ -370,6 +362,5 @@ VLC_EXPORT( int, input_ChangeProgram, ( input_thread_t *, u16 ) );
int input_ToggleGrayscale( input_thread_t * );
int input_ToggleMute ( input_thread_t * );
int input_SetSMP ( input_thread_t *, int );
#endif /* "input_ext-intf.h" */
......@@ -3,7 +3,7 @@
* but exported to plug-ins
*****************************************************************************
* Copyright (C) 1999-2002 VideoLAN
* $Id: input_ext-plugins.h,v 1.32 2002/07/21 19:26:13 sigmunau Exp $
* $Id: input_ext-plugins.h,v 1.33 2002/07/31 20:56:50 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -79,7 +79,7 @@ int input_DelInfo( input_thread_t * p_input ); /* no need to export this */
/*****************************************************************************
* Prototypes from input_ext-plugins.h (buffers management)
*****************************************************************************/
#define input_BuffersInit(a) __input_BuffersInit(CAST_TO_VLC_OBJECT(a))
#define input_BuffersInit(a) __input_BuffersInit(VLC_OBJECT(a))
void * __input_BuffersInit( vlc_object_t * );
VLC_EXPORT( void, input_BuffersEnd, ( input_thread_t *, input_buffers_t * ) );
......@@ -282,8 +282,10 @@ struct input_socket_t
/*****************************************************************************
* Prototypes
*****************************************************************************/
VLC_EXPORT( void, input_FDClose, ( input_thread_t * ) );
VLC_EXPORT( void, input_FDNetworkClose, ( input_thread_t * ) );
VLC_EXPORT( void, __input_FDClose, ( vlc_object_t * ) );
#define input_FDClose(a) __input_FDClose(VLC_OBJECT(a))
VLC_EXPORT( void, __input_FDNetworkClose, ( vlc_object_t * ) );
#define input_FDNetworkClose(a) __input_FDNetworkClose(VLC_OBJECT(a))
VLC_EXPORT( ssize_t, input_FDRead, ( input_thread_t *, byte_t *, size_t ) );
VLC_EXPORT( ssize_t, input_FDNetworkRead, ( input_thread_t *, byte_t *, size_t ) );
VLC_EXPORT( void, input_FDSeek, ( input_thread_t *, off_t ) );
......
......@@ -4,7 +4,7 @@
* interface, such as message output.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: interface.h,v 1.32 2002/07/20 18:01:41 sam Exp $
* $Id: interface.h,v 1.33 2002/07/31 20:56:50 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -40,23 +40,20 @@ struct intf_thread_t
intf_console_t * p_console; /* console */
intf_sys_t * p_sys; /* system interface */
/* Plugin used and shortcuts to access its capabilities */
/* Interface module */
module_t * p_module;
int ( *pf_open ) ( intf_thread_t * );
void ( *pf_close ) ( intf_thread_t * );
void ( *pf_run ) ( intf_thread_t * );
/* XXX: new message passing stuff will go here */
vlc_mutex_t change_lock;
vlc_bool_t b_menu_change;
vlc_bool_t b_menu;
};
/*****************************************************************************
* Prototypes
*****************************************************************************/
#define intf_Create(a) __intf_Create(CAST_TO_VLC_OBJECT(a))
#define intf_Create(a) __intf_Create(VLC_OBJECT(a))
VLC_EXPORT( intf_thread_t *, __intf_Create, ( vlc_object_t * ) );
VLC_EXPORT( vlc_error_t, intf_RunThread, ( intf_thread_t * ) );
VLC_EXPORT( void, intf_StopThread, ( intf_thread_t * ) );
......
......@@ -2,7 +2,7 @@
* intf_eject.h: CD/DVD-ROM ejection handling functions
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: intf_eject.h,v 1.4 2002/06/01 18:04:48 sam Exp $
* $Id: intf_eject.h,v 1.5 2002/07/31 20:56:50 sam Exp $
*
* Author: Julien Blache <jb@technologeek.org>
*
......@@ -21,6 +21,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define intf_Eject(a,b) __intf_Eject(CAST_TO_VLC_OBJECT(a),b)
#define intf_Eject(a,b) __intf_Eject(VLC_OBJECT(a),b)
VLC_EXPORT( int, __intf_Eject, ( vlc_object_t *, const char * ) );
......@@ -3,7 +3,7 @@
* Declaration and extern access to global program object.
*****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
* $Id: main.h,v 1.41 2002/07/29 19:05:47 gbazin Exp $
* $Id: main.h,v 1.42 2002/07/31 20:56:50 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -44,7 +44,7 @@ struct vlc_t
char ** ppsz_argv; /* command line arguments */
char * psz_homedir; /* user's home directory */
u32 i_cpu_capabilities; /* CPU extensions */
u32 i_cpu; /* CPU extensions */
/* Generic settings */
vlc_bool_t b_quiet; /* be quiet ? */
......@@ -58,7 +58,7 @@ struct vlc_t
void* ( *pf_memset ) ( void *, int, size_t ); /* FIXME: unimplemented */
/* The module bank */
module_bank_t module_bank;
module_bank_t * p_module_bank;
/* The message bank */
msg_bank_t msg_bank;
......
This diff is collapsed.
This diff is collapsed.
......@@ -4,7 +4,7 @@
* modules.
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: netutils.h,v 1.21 2002/06/01 18:04:48 sam Exp $
* $Id: netutils.h,v 1.22 2002/07/31 20:56:50 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Henri Fallon <henri@videolan.org>
......@@ -33,8 +33,8 @@
struct sockaddr_in;
int network_BuildAddr ( struct sockaddr_in *, char *, int );
#define network_ChannelJoin(a,b) __network_ChannelJoin(CAST_TO_VLC_OBJECT(a),b)
#define network_ChannelCreate(a) __network_ChannelCreate(CAST_TO_VLC_OBJECT(a))
#define network_ChannelJoin(a,b) __network_ChannelJoin(VLC_OBJECT(a),b)
#define network_ChannelCreate(a) __network_ChannelCreate(VLC_OBJECT(a))
VLC_EXPORT( int, __network_ChannelJoin, ( vlc_object_t *, int ) );
VLC_EXPORT( int, __network_ChannelCreate, ( vlc_object_t * ) );
......@@ -4,7 +4,7 @@
* of the reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: stream_control.h,v 1.9 2002/07/20 18:01:41 sam Exp $
* $Id: stream_control.h,v 1.10 2002/07/31 20:56:50 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -43,8 +43,6 @@ struct stream_ctrl_t
vlc_bool_t b_mute;
vlc_bool_t b_grayscale; /* use color or grayscale */
int i_smp; /* number of symmetrical threads to launch
* to decode the video | 0 == disabled */
};
/* Possible status : */
......
......@@ -5,7 +5,7 @@
* thread, and destroy a previously opened video output thread.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video_output.h,v 1.81 2002/07/20 18:01:41 sam Exp $
* $Id: video_output.h,v 1.82 2002/07/31 20:56:50 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
......@@ -47,8 +47,6 @@ typedef struct vout_chroma_t
/* Plugin used and shortcuts to access its capabilities */
module_t * p_module;
int ( * pf_init ) ( vout_thread_t * );
void ( * pf_end ) ( vout_thread_t * );
} vout_chroma_t;
......@@ -102,10 +100,8 @@ struct vout_thread_t
/* Plugin used and shortcuts to access its capabilities */
module_t * p_module;
int ( *pf_create ) ( vout_thread_t * );
int ( *pf_init ) ( vout_thread_t * );
void ( *pf_end ) ( vout_thread_t * );
void ( *pf_destroy ) ( vout_thread_t * );
int ( *pf_manage ) ( vout_thread_t * );
void ( *pf_render ) ( vout_thread_t *, picture_t * );
void ( *pf_display ) ( vout_thread_t *, picture_t * );
......@@ -170,7 +166,7 @@ struct vout_thread_t
/*****************************************************************************
* Prototypes
*****************************************************************************/
#define vout_CreateThread(a,b,c,d,e) __vout_CreateThread(CAST_TO_VLC_OBJECT(a),b,c,d,e)
#define vout_CreateThread(a,b,c,d,e) __vout_CreateThread(VLC_OBJECT(a),b,c,d,e)
VLC_EXPORT( vout_thread_t *, __vout_CreateThread, ( vlc_object_t *, int, int, u32, int ) );
VLC_EXPORT( void, vout_DestroyThread, ( vout_thread_t * ) );
......
......@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc_common.h,v 1.12 2002/07/23 00:39:16 sam Exp $
* $Id: vlc_common.h,v 1.13 2002/07/31 20:56:50 sam Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
......@@ -254,6 +254,9 @@ VLC_DECLARE_STRUCT(input_info_category_t)
vlc_object_t ** pp_children; /* our children */ \
volatile int i_children; \
\
/* Private data */ \
void * p_private; \
\
/* Just a reminder so that people don't cast garbage */ \
int be_sure_to_add_VLC_COMMON_MEMBERS_to_struct; \
......@@ -263,8 +266,8 @@ struct vlc_object_t
VLC_COMMON_MEMBERS
};
/* CAST_TO_VLC_OBJECT: attempt at doing a clever cast */
#define CAST_TO_VLC_OBJECT( x ) \
/* VLC_OBJECT: attempt at doing a clever cast */
#define VLC_OBJECT( x ) \
((vlc_object_t *)(x))+0*(x)->be_sure_to_add_VLC_COMMON_MEMBERS_to_struct
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* cpu.h: CPU type detection
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: vlc_cpu.h,v 1.2 2002/06/01 18:04:48 sam Exp $
* $Id: vlc_cpu.h,v 1.3 2002/07/31 20:56:50 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -21,6 +21,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define CPUCapabilities(a) __CPUCapabilities(CAST_TO_VLC_OBJECT(a))
#define CPUCapabilities(a) __CPUCapabilities(VLC_OBJECT(a))
u32 __CPUCapabilities( vlc_object_t * );
......@@ -4,7 +4,7 @@
* interface, such as message output.
*****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
* $Id: vlc_messages.h,v 1.4 2002/07/20 18:01:42 sam Exp $
* $Id: vlc_messages.h,v 1.5 2002/07/31 20:56:50 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -61,6 +61,8 @@ struct msg_bank_t
{
/* Message queue lock */
vlc_mutex_t lock;
vlc_bool_t b_configured;
vlc_bool_t b_overflow;
/* Message queue */
msg_item_t msg[VLC_MSG_QSIZE]; /* message queue */
......@@ -98,19 +100,19 @@ VLC_EXPORT( void, __msg_Dbg, ( void *, const char *, ... ) );
#ifdef HAVE_VARIADIC_MACROS
# define msg_Info( p_this, psz_format, args... ) \
__msg_Generic( CAST_TO_VLC_OBJECT(p_this), VLC_MSG_INFO, MODULE_STRING, \
__msg_Generic( VLC_OBJECT(p_this), VLC_MSG_INFO, MODULE_STRING, \
psz_format, ## args )
# define msg_Err( p_this, psz_format, args... ) \
__msg_Generic( CAST_TO_VLC_OBJECT(p_this), VLC_MSG_ERR, MODULE_STRING, \
__msg_Generic( VLC_OBJECT(p_this), VLC_MSG_ERR, MODULE_STRING, \
psz_format, ## args )
# define msg_Warn( p_this, psz_format, args... ) \
__msg_Generic( CAST_TO_VLC_OBJECT(p_this), VLC_MSG_WARN, MODULE_STRING, \
__msg_Generic( VLC_OBJECT(p_this), VLC_MSG_WARN, MODULE_STRING, \
psz_format, ## args )
# define msg_Dbg( p_this, psz_format, args... ) \
__msg_Generic( CAST_TO_VLC_OBJECT(p_this), VLC_MSG_DBG, MODULE_STRING, \
__msg_Generic( VLC_OBJECT(p_this), VLC_MSG_DBG, MODULE_STRING, \
psz_format, ## args )
#else /* HAVE_VARIADIC_MACROS */
......@@ -122,15 +124,15 @@ VLC_EXPORT( void, __msg_Dbg, ( void *, const char *, ... ) );
#endif /* HAVE_VARIADIC_MACROS */
#define msg_Create(a) __msg_Create(CAST_TO_VLC_OBJECT(a))
#define msg_Flush(a) __msg_Flush(CAST_TO_VLC_OBJECT(a))
#define msg_Destroy(a) __msg_Destroy(CAST_TO_VLC_OBJECT(a))
#define msg_Create(a) __msg_Create(VLC_OBJECT(a))
#define msg_Flush(a) __msg_Flush(VLC_OBJECT(a))
#define msg_Destroy(a) __msg_Destroy(VLC_OBJECT(a))
void __msg_Create ( vlc_object_t * );
void __msg_Flush ( vlc_object_t * );
void __msg_Destroy ( vlc_object_t * );
#define msg_Subscribe(a) __msg_Subscribe(CAST_TO_VLC_OBJECT(a))
#define msg_Unsubscribe(a,b) __msg_Unsubscribe(CAST_TO_VLC_OBJECT(a),b)
#define msg_Subscribe(a) __msg_Subscribe(VLC_OBJECT(a))
#define msg_Unsubscribe(a,b) __msg_Unsubscribe(VLC_OBJECT(a),b)
VLC_EXPORT( msg_subscription_t*, __msg_Subscribe, ( vlc_object_t * ) );
VLC_EXPORT( void, __msg_Unsubscribe, ( vlc_object_t *, msg_subscription_t * ) );
......@@ -2,7 +2,7 @@
* vlc_objects.h: vlc_object_t definition.
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: vlc_objects.h,v 1.4 2002/06/07 14:59:40 sam Exp $
* $Id: vlc_objects.h,v 1.5 2002/07/31 20:56:50 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -31,7 +31,7 @@
#define VLC_OBJECT_DECODER (-7)
#define VLC_OBJECT_VOUT (-8)
#define VLC_OBJECT_AOUT (-9)
#define VLC_OBJECT_PRIVATE (-666)
#define VLC_OBJECT_GENERIC (-666)
/* Object search mode */
#define FIND_PARENT 0x0001
......@@ -40,6 +40,9 @@
#define FIND_STRICT 0x0010
/* Object cast */
/*****************************************************************************
* Prototypes
*****************************************************************************/
......@@ -58,35 +61,35 @@ VLC_EXPORT( void, __vlc_object_attach, ( vlc_object_t *, vlc_object_t * ) );
VLC_EXPORT( void, __vlc_dumpstructure, ( vlc_object_t * ) );
#define vlc_object_create(a,b) \
__vlc_object_create( CAST_TO_VLC_OBJECT(a), b )
__vlc_object_create( VLC_OBJECT(a), b )
#define vlc_object_destroy(a) do { \
__vlc_object_destroy( CAST_TO_VLC_OBJECT(a) ); \
__vlc_object_destroy( VLC_OBJECT(a) ); \
(a) = NULL; } while(0)
#define vlc_object_find(a,b,c) \
__vlc_object_find( CAST_TO_VLC_OBJECT(a),b,c)
__vlc_object_find( VLC_OBJECT(a),b,c)
#define vlc_object_yield(a) \
__vlc_object_yield( CAST_TO_VLC_OBJECT(a) )
__vlc_object_yield( VLC_OBJECT(a) )
#define vlc_object_release(a) \
__vlc_object_release( CAST_TO_VLC_OBJECT(a) )
__vlc_object_release( VLC_OBJECT(a) )
#define vlc_object_detach(a,b) \
__vlc_object_detach( CAST_TO_VLC_OBJECT(a), CAST_TO_VLC_OBJECT(b) )
__vlc_object_detach( VLC_OBJECT(a), VLC_OBJECT(b) )
#define vlc_object_detach_all(a) \
__vlc_object_detach_all( CAST_TO_VLC_OBJECT(a) )
__vlc_object_detach_all( VLC_OBJECT(a) )
#define vlc_object_attach(a,b) \
__vlc_object_attach( CAST_TO_VLC_OBJECT(a), CAST_TO_VLC_OBJECT(b) )
__vlc_object_attach( VLC_OBJECT(a), VLC_OBJECT(b) )
#if 0
#define vlc_object_setchild(a,b) \
__vlc_object_setchild( CAST_TO_VLC_OBJECT(a), CAST_TO_VLC_OBJECT(b) )
__vlc_object_setchild( VLC_OBJECT(a), VLC_OBJECT(b) )
#endif
#define vlc_dumpstructure(a) \
__vlc_dumpstructure( CAST_TO_VLC_OBJECT(a) )
__vlc_dumpstructure( VLC_OBJECT(a) )
......@@ -2,7 +2,7 @@
* vlc_playlist.h : Playlist functions
*****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
* $Id: vlc_playlist.h,v 1.3 2002/07/20 18:01:42 sam Exp $
* $Id: vlc_playlist.h,v 1.4 2002/07/31 20:56:50 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -54,7 +54,7 @@ struct playlist_t
/*****************************************************************************
* Prototypes
*****************************************************************************/
#define playlist_Create(a) __playlist_Create(CAST_TO_VLC_OBJECT(a))
#define playlist_Create(a) __playlist_Create(VLC_OBJECT(a))
playlist_t * __playlist_Create ( vlc_object_t * );
void playlist_Destroy ( playlist_t * );
......
This diff is collapsed.
......@@ -3,7 +3,7 @@
* This header provides a portable threads implementation.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: vlc_threads.h,v 1.7 2002/07/30 07:56:40 gbazin Exp $
* $Id: vlc_threads.h,v 1.8 2002/07/31 20:56:50 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
......@@ -191,19 +191,19 @@ VLC_EXPORT( void, __vlc_thread_join, ( vlc_object_t *, char *, int ) );
* vlc_threads_init: initialize threads system
*****************************************************************************/
#define vlc_threads_init( P_THIS ) \
__vlc_threads_init( CAST_TO_VLC_OBJECT(P_THIS) )
__vlc_threads_init( VLC_OBJECT(P_THIS) )
/*****************************************************************************
* vlc_threads_end: deinitialize threads system
*****************************************************************************/
#define vlc_threads_end( P_THIS ) \
__vlc_threads_end( CAST_TO_VLC_OBJECT(P_THIS) )
__vlc_threads_end( VLC_OBJECT(P_THIS) )
/*****************************************************************************
* vlc_mutex_init: initialize a mutex
*****************************************************************************/
#define vlc_mutex_init( P_THIS, P_MUTEX ) \
__vlc_mutex_init( CAST_TO_VLC_OBJECT(P_THIS), P_MUTEX )
__vlc_mutex_init( VLC_OBJECT(P_THIS), P_MUTEX )
/*****************************************************************************
* vlc_mutex_lock: lock a mutex
......@@ -344,7 +344,7 @@ static inline int __vlc_mutex_unlock( char * psz_file, int i_line,
* vlc_cond_init: initialize a condition
*****************************************************************************/
#define vlc_cond_init( P_THIS, P_COND ) \
__vlc_cond_init( CAST_TO_VLC_OBJECT(P_THIS), P_COND )
__vlc_cond_init( VLC_OBJECT(P_THIS), P_COND )
/*****************************************************************************
* vlc_cond_signal: start a thread on condition completion
......@@ -731,21 +731,21 @@ static inline int __vlc_cond_wait( char * psz_file, int i_line,
* vlc_thread_create: create a thread
*****************************************************************************/
# define vlc_thread_create( P_THIS, PSZ_NAME, FUNC, WAIT ) \
__vlc_thread_create( CAST_TO_VLC_OBJECT(P_THIS), __FILE__, __LINE__, PSZ_NAME, (void * ( * ) ( void * ))FUNC, WAIT )
__vlc_thread_create( VLC_OBJECT(P_THIS), __FILE__, __LINE__, PSZ_NAME, (void * ( * ) ( void * ))FUNC, WAIT )
/*****************************************************************************
* vlc_thread_ready: tell the parent thread we were successfully spawned
*****************************************************************************/
# define vlc_thread_ready( P_THIS ) \
__vlc_thread_ready( CAST_TO_VLC_OBJECT(P_THIS) )
__vlc_thread_ready( VLC_OBJECT(P_THIS) )
/*****************************************************************************
* vlc_thread_join: wait until a thread exits
*****************************************************************************/
#ifdef DEBUG
# define vlc_thread_join( P_THIS ) \
__vlc_thread_join( CAST_TO_VLC_OBJECT(P_THIS), __FILE__, __LINE__ )
__vlc_thread_join( VLC_OBJECT(P_THIS), __FILE__, __LINE__ )
#else
# define vlc_thread_join( P_THIS ) \
__vlc_thread_join( CAST_TO_VLC_OBJECT(P_THIS), "(unknown)", 0 )
__vlc_thread_join( VLC_OBJECT(P_THIS), "(unknown)", 0 )
#endif
......@@ -4,7 +4,7 @@
* (http://liba52.sf.net/).
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: a52.c,v 1.21 2002/07/23 00:39:16 sam Exp $
* $Id: a52.c,v 1.22 2002/07/31 20:56:50 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -63,8 +63,8 @@ static vlc_bool_t b_liba52_initialized = 0;
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static int decoder_Probe ( vlc_fourcc_t * );
static int decoder_Run ( decoder_fifo_t * );
static int OpenDecoder ( vlc_object_t * );
static int RunDecoder ( decoder_fifo_t * );
static int DecodeFrame ( a52_adec_thread_t * );
static int InitThread ( a52_adec_thread_t * );
static void EndThread ( a52_adec_thread_t * );
......@@ -74,16 +74,7 @@ static void float2s16_2 ( float *, int16_t * );
static inline int16_t convert ( int32_t );
/*****************************************************************************
* Capabilities
*****************************************************************************/
void _M( adec_getfunctions )( function_list_t * p_function_list )
{
p_function_list->functions.dec.pf_probe = decoder_Probe;
p_function_list->functions.dec.pf_run = decoder_Run;
}
/*****************************************************************************
* Build configuration structure.
* Module descriptor
*****************************************************************************/
#define DYNRNG_TEXT N_("A/52 dynamic range compression")
#define DYNRNG_LONGTEXT N_( \
......@@ -93,38 +84,37 @@ void _M( adec_getfunctions )( function_list_t * p_function_list )
"compression the playback will be more adapted to a movie theater or a " \
"listening room.")
MODULE_CONFIG_START
ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
ADD_BOOL ( "a52-dynrng", 1, NULL, DYNRNG_TEXT, DYNRNG_LONGTEXT )
MODULE_CONFIG_STOP
MODULE_INIT_START
SET_DESCRIPTION( _("a52 ATSC A/52 aka AC-3 audio decoder module") )
ADD_CAPABILITY( DECODER, 60 )
MODULE_INIT_STOP
MODULE_ACTIVATE_START
_M( adec_getfunctions )( &p_module->p_functions->dec );
MODULE_ACTIVATE_STOP
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
vlc_module_begin();
add_category_hint( N_("Miscellaneous"), NULL );
add_bool( "a52-dynrng", 1, NULL, DYNRNG_TEXT, DYNRNG_LONGTEXT );
set_description( _("a52 ATSC A/52 aka AC-3 audio decoder module") );
set_capability( "decoder", 60 );
set_callbacks( OpenDecoder, NULL );
vlc_module_end();
/*****************************************************************************
* decoder_Probe: probe the decoder and return score
* OpenDecoder: probe the decoder and return score
*****************************************************************************
* Tries to launch a decoder and return score so that the interface is able
* to choose.
*****************************************************************************/
static int decoder_Probe( vlc_fourcc_t *pi_type )
static int OpenDecoder( vlc_object_t *p_this )
{
return *pi_type == VLC_FOURCC('a','5','2',' ') ? 0 : -1;
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
if( p_fifo->i_fourcc != VLC_FOURCC('a','5','2',' ') )
{
return VLC_EGENERIC;
}
p_fifo->pf_run = RunDecoder;
return VLC_SUCCESS;
}
/*****************************************************************************
* decoder_Run: this function is called just after the thread is created
* RunDecoder: this function is called just after the thread is created
*****************************************************************************/
static int decoder_Run ( decoder_fifo_t *p_fifo )
static int RunDecoder( decoder_fifo_t *p_fifo )
{
a52_adec_thread_t *p_a52_adec;
......
......@@ -2,7 +2,7 @@
* a52_system.c : A52 input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: a52_system.c,v 1.2 2002/07/23 00:39:16 sam Exp $
* $Id: a52_system.c,v 1.3 2002/07/31 20:56:50 sam Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -42,54 +42,25 @@
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static void input_getfunctions( function_list_t * p_function_list );
static int Demux ( struct input_thread_s * );
static int Init ( struct input_thread_s * );
static void End ( struct input_thread_s * );
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
MODULE_CONFIG_START
MODULE_CONFIG_STOP
MODULE_INIT_START
SET_DESCRIPTION( _("A52 input") )
ADD_CAPABILITY( DEMUX, 150 )
ADD_SHORTCUT( "a52sys" )
MODULE_INIT_STOP
MODULE_ACTIVATE_START
input_getfunctions( &p_module->p_functions->demux );
MODULE_ACTIVATE_STOP
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
static int Init ( vlc_object_t * );
static int Demux ( input_thread_t * );
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
* Module descriptor
*****************************************************************************/
static void input_getfunctions( function_list_t * p_function_list )
{
#define input p_function_list->functions.demux
input.pf_init = Init;
input.pf_end = End;
input.pf_demux = Demux;
input.pf_rewind = NULL;
#undef input
}
/*
* Data reading functions
*/
vlc_module_begin();
set_description( "A52 demuxer" );
set_capability( "demux", 150 );
set_callbacks( Init, NULL );
add_shortcut( "a52sys" );
vlc_module_end();
/*****************************************************************************
* Init: initializes ES structures
*****************************************************************************/
static int Init( input_thread_t * p_input )
static int Init( vlc_object_t * p_this )
{
input_thread_t * p_input = (input_thread_t *)p_this;
es_descriptor_t * p_es;
byte_t * p_peek;
......@@ -100,6 +71,9 @@ static int Init( input_thread_t * p_input )
p_input->i_bufsize = INPUT_DEFAULT_BUFSIZE;
}
p_input->pf_demux = Demux;
p_input->pf_rewind = NULL;
/* Have a peep at the show. */
if( input_Peek( p_input, &p_peek, 2 ) < 2 )
{
......@@ -141,13 +115,6 @@ static int Init( input_thread_t * p_input )
return( 0 );
}
/*****************************************************************************
* End: frees unused data
*****************************************************************************/
static void End( input_thread_t * p_input )
{
}
/*****************************************************************************
* Demux: reads and demuxes data packets
*****************************************************************************
......
......@@ -2,7 +2,7 @@
* vout_aa.c: Aa video output display method for testing purposes
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: aa.c,v 1.8 2002/07/23 00:39:16 sam Exp $
* $Id: aa.c,v 1.9 2002/07/31 20:56:50 sam Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
......@@ -35,31 +35,28 @@
#include <vlc/intf.h>
/*****************************************************************************
* Capabilities defined in the other files.
*****************************************************************************/
static void vout_getfunctions ( function_list_t * p_function_list );
/*****************************************************************************
* Build configuration tree.
* Local prototypes
*****************************************************************************/
MODULE_CONFIG_START
MODULE_CONFIG_STOP
MODULE_INIT_START
SET_DESCRIPTION( _("ASCII-art video output module") )
ADD_CAPABILITY( VOUT, 10 )
ADD_SHORTCUT( "aalib" )
MODULE_INIT_STOP
static int Create ( vlc_object_t * );
static void Destroy ( vlc_object_t * );
static int Init ( vout_thread_t * );
static void End ( vout_thread_t * );
static int Manage ( vout_thread_t * );
static void Render ( vout_thread_t *, picture_t * );
static void Display ( vout_thread_t *, picture_t * );
MODULE_ACTIVATE_START
vout_getfunctions( &p_module->p_functions->vout );
MODULE_ACTIVATE_STOP
static void SetPalette ( vout_thread_t *, u16 *, u16 *, u16 * );
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
/*****************************************************************************
* Module descriptor
*****************************************************************************/
vlc_module_begin();
set_description( _("ASCII-art video output module") );
set_capability( "video output", 10 );
add_shortcut( "aalib" );
set_callbacks( Create, Destroy );
vlc_module_end();
/*****************************************************************************
* vout_sys_t: aa video output method descriptor
......@@ -76,40 +73,14 @@ struct vout_sys_t
};
/*****************************************************************************
* Local prototypes
*****************************************************************************/
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_Render ( vout_thread_t *, picture_t * );
static void vout_Display ( vout_thread_t *, picture_t * );
static void SetPalette ( vout_thread_t *, u16 *, u16 *, u16 * );
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
static void vout_getfunctions( function_list_t * p_function_list )
{
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;
}
/*****************************************************************************
* vout_Create: allocates aa video thread output method
* Create: allocates aa video thread output method
*****************************************************************************
* This function allocates and initializes a aa vout method.
*****************************************************************************/
static int vout_Create( vout_thread_t *p_vout )
static int Create( vlc_object_t *p_this )
{
vout_thread_t *p_vout = (vout_thread_t *)p_this;
/* Allocate structure */
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL )
......@@ -127,6 +98,12 @@ static int vout_Create( vout_thread_t *p_vout )
return( 1 );
}
p_vout->pf_init = Init;
p_vout->pf_end = End;
p_vout->pf_manage = Manage;
p_vout->pf_render = Render;
p_vout->pf_display = Display;
p_vout->p_sys->i_width = aa_imgwidth(p_vout->p_sys->aa_context);
p_vout->p_sys->i_height = aa_imgheight(p_vout->p_sys->aa_context);
aa_autoinitkbd( p_vout->p_sys->aa_context, 0 );
......@@ -136,9 +113,9 @@ static int vout_Create( vout_thread_t *p_vout )
}
/*****************************************************************************
* vout_Init: initialize aa video thread output method
* Init: initialize aa video thread output method
*****************************************************************************/
static int vout_Init( vout_thread_t *p_vout )
static int Init( vout_thread_t *p_vout )
{
int i_index;
picture_t *p_pic = NULL;
......@@ -185,31 +162,33 @@ static int vout_Init( vout_thread_t *p_vout )
}
/*****************************************************************************
* vout_End: terminate aa video thread output method
* End: terminate aa video thread output method
*****************************************************************************/
static void vout_End( vout_thread_t *p_vout )
static void End( vout_thread_t *p_vout )
{
;
}
/*****************************************************************************
* vout_Destroy: destroy aa video thread output method
* Destroy: destroy aa video thread output method
*****************************************************************************
* Terminate an output method created by AaCreateOutputMethod
*****************************************************************************/
static void vout_Destroy( vout_thread_t *p_vout )
static void Destroy( vlc_object_t *p_this )
{
vout_thread_t *p_vout = (vout_thread_t *)p_this;
aa_close( p_vout->p_sys->aa_context );
free( p_vout->p_sys );
}
/*****************************************************************************
* vout_Manage: handle aa events
* Manage: handle aa events
*****************************************************************************
* This function should be called regularly by video output thread. It manages
* console events. It returns a non null value on error.
*****************************************************************************/
static int vout_Manage( vout_thread_t *p_vout )
static int Manage( vout_thread_t *p_vout )
{
int event, x, y, b;
event = aa_getevent( p_vout->p_sys->aa_context, 0 );
......@@ -241,9 +220,9 @@ static int vout_Manage( vout_thread_t *p_vout )
}
/*****************************************************************************
* vout_Render: render previously calculated output
* Render: render previously calculated output
*****************************************************************************/
static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
static void Render( vout_thread_t *p_vout, picture_t *p_pic )
{
aa_fastrender( p_vout->p_sys->aa_context, 0, 0,
aa_imgwidth( p_vout->p_sys->aa_context ),
......@@ -251,9 +230,9 @@ static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
}
/*****************************************************************************
* vout_Display: displays previously rendered output
* Display: displays previously rendered output
*****************************************************************************/
static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
static void Display( vout_thread_t *p_vout, picture_t *p_pic )
{
/* No need to do anything, the fake direct buffers stay as they are */
int i_width, i_height, i_x, i_y;
......
......@@ -2,7 +2,7 @@
* ac3_adec.c: ac3 decoder module main file
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: ac3_adec.c,v 1.34 2002/07/23 00:39:16 sam Exp $
* $Id: ac3_adec.c,v 1.35 2002/07/31 20:56:50 sam Exp $
*
* Authors: Michel Lespinasse <walken@zoy.org>
*
......@@ -44,67 +44,51 @@
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static int decoder_Probe ( vlc_fourcc_t * );
static int decoder_Run ( decoder_fifo_t * );
static int OpenDecoder ( vlc_object_t * );
static int RunDecoder ( decoder_fifo_t * );
static int InitThread ( ac3dec_t * p_adec );
static void EndThread ( ac3dec_t * p_adec );
static void BitstreamCallback ( bit_stream_t *p_bit_stream,
vlc_bool_t b_new_pes );
/*****************************************************************************
* Capabilities
* Module descriptor
*****************************************************************************/
void _M( adec_getfunctions )( function_list_t * p_function_list )
{
p_function_list->functions.dec.pf_probe = decoder_Probe;
p_function_list->functions.dec.pf_run = decoder_Run;
}
vlc_module_begin();
add_category_hint( N_("Miscellaneous"), NULL );
add_module ( "ac3-downmix", "downmix", NULL, NULL,
N_("AC3 downmix module"), NULL );
add_module ( "ac3-imdct", "imdct", NULL, NULL,
N_("AC3 IMDCT module"), NULL );
set_description( _("software AC3 decoder") );
set_capability( "decoder", 50 );
set_callbacks( OpenDecoder, NULL );
add_shortcut( "ac3" );
vlc_module_end();
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
/* Variable containing the AC3 downmix method */
#define DOWNMIX_METHOD_VAR "ac3-downmix"
/* Variable containing the AC3 IMDCT method */
#define IMDCT_METHOD_VAR "ac3-imdct"
MODULE_CONFIG_START
ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL)
ADD_MODULE ( DOWNMIX_METHOD_VAR, MODULE_CAPABILITY_DOWNMIX, NULL, NULL,
N_("AC3 downmix module"), NULL )
ADD_MODULE ( IMDCT_METHOD_VAR, MODULE_CAPABILITY_IMDCT, NULL, NULL,
N_("AC3 IMDCT module"), NULL )
MODULE_CONFIG_STOP
MODULE_INIT_START
SET_DESCRIPTION( _("software AC3 decoder") )
ADD_CAPABILITY( DECODER, 50 )
ADD_SHORTCUT( "ac3" )
MODULE_INIT_STOP
MODULE_ACTIVATE_START
_M( adec_getfunctions )( &p_module->p_functions->dec );
MODULE_ACTIVATE_STOP
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
/*****************************************************************************
* decoder_Probe: probe the decoder and return score
* OpenDecoder: probe the decoder and return score
*****************************************************************************
* Tries to launch a decoder and return score so that the interface is able
* to chose.
*****************************************************************************/
static int decoder_Probe( vlc_fourcc_t *pi_type )
static int OpenDecoder( vlc_object_t *p_this )
{
return *pi_type == VLC_FOURCC('a','5','2',' ') ? 0 : -1;
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
if( p_fifo->i_fourcc != VLC_FOURCC('a','5','2',' ') )
{
return VLC_EGENERIC;
}
p_fifo->pf_run = RunDecoder;
return VLC_SUCCESS;
}
/*****************************************************************************
* decoder_Run: this function is called just after the thread is created
* RunDecoder: this function is called just after the thread is created
*****************************************************************************/
static int decoder_Run ( decoder_fifo_t * p_fifo )
static int RunDecoder( decoder_fifo_t *p_fifo )
{
ac3dec_t * p_ac3dec;
void * p_orig; /* pointer before memalign */
......@@ -246,57 +230,43 @@ static int InitThread( ac3dec_t * p_ac3dec )
/*
* Choose the best downmix module
*/
#define DOWNMIX p_ac3dec->downmix
psz_name = config_GetPsz( p_ac3dec->p_fifo, DOWNMIX_METHOD_VAR );
DOWNMIX.p_module = module_Need( p_ac3dec->p_fifo,
MODULE_CAPABILITY_DOWNMIX, psz_name, NULL );
p_ac3dec->p_downmix = vlc_object_create( p_ac3dec->p_fifo,
sizeof( downmix_t ) );
p_ac3dec->p_downmix->psz_object_name = "downmix";
psz_name = config_GetPsz( p_ac3dec->p_downmix, "ac3-downmix" );
p_ac3dec->p_downmix->p_module =
module_Need( p_ac3dec->p_downmix, "downmix", psz_name );
if( psz_name ) free( psz_name );
if( DOWNMIX.p_module == NULL )
if( p_ac3dec->p_downmix->p_module == NULL )
{
msg_Err( p_ac3dec->p_fifo, "no suitable downmix module" );
vlc_object_destroy( p_ac3dec->p_downmix );
return( -1 );
}
#define F DOWNMIX.p_module->p_functions->downmix.functions.downmix
DOWNMIX.pf_downmix_3f_2r_to_2ch = F.pf_downmix_3f_2r_to_2ch;
DOWNMIX.pf_downmix_2f_2r_to_2ch = F.pf_downmix_2f_2r_to_2ch;
DOWNMIX.pf_downmix_3f_1r_to_2ch = F.pf_downmix_3f_1r_to_2ch;
DOWNMIX.pf_downmix_2f_1r_to_2ch = F.pf_downmix_2f_1r_to_2ch;
DOWNMIX.pf_downmix_3f_0r_to_2ch = F.pf_downmix_3f_0r_to_2ch;
DOWNMIX.pf_stream_sample_2ch_to_s16 = F.pf_stream_sample_2ch_to_s16;
DOWNMIX.pf_stream_sample_1ch_to_s16 = F.pf_stream_sample_1ch_to_s16;
#undef F
#undef DOWNMIX
/*
* Choose the best IMDCT module
*/
p_ac3dec->imdct = vlc_memalign( &p_ac3dec->imdct_orig,
16, sizeof(imdct_t) );
p_ac3dec->p_imdct = vlc_object_create( p_ac3dec->p_fifo,
sizeof( imdct_t ) );
#define IMDCT p_ac3dec->imdct
psz_name = config_GetPsz( p_ac3dec->p_fifo, IMDCT_METHOD_VAR );
IMDCT->p_module = module_Need( p_ac3dec->p_fifo,
MODULE_CAPABILITY_IMDCT, psz_name, NULL );
#define IMDCT p_ac3dec->p_imdct
psz_name = config_GetPsz( p_ac3dec->p_fifo, "ac3-imdct" );
p_ac3dec->p_imdct->p_module =
module_Need( p_ac3dec->p_imdct, "imdct", psz_name );
if( psz_name ) free( psz_name );
if( IMDCT->p_module == NULL )
if( p_ac3dec->p_imdct->p_module == NULL )
{
msg_Err( p_ac3dec->p_fifo, "no suitable IMDCT module" );
module_Unneed( p_ac3dec->downmix.p_module );
free( p_ac3dec->imdct_orig );
vlc_object_destroy( p_ac3dec->p_imdct );
module_Unneed( p_ac3dec->p_downmix, p_ac3dec->p_downmix->p_module );
vlc_object_destroy( p_ac3dec->p_downmix );
return( -1 );
}
#define F IMDCT->p_module->p_functions->imdct.functions.imdct
IMDCT->pf_imdct_init = F.pf_imdct_init;
IMDCT->pf_imdct_256 = F.pf_imdct_256;
IMDCT->pf_imdct_256_nol = F.pf_imdct_256_nol;
IMDCT->pf_imdct_512 = F.pf_imdct_512;
IMDCT->pf_imdct_512_nol = F.pf_imdct_512_nol;
#undef F
/* Initialize the ac3 decoder structures */
p_ac3dec->samples = vlc_memalign( &p_ac3dec->samples_orig,
16, 6 * 256 * sizeof(float) );
......@@ -333,7 +303,7 @@ static int InitThread( ac3dec_t * p_ac3dec )
16, 64 * sizeof(complex_t) );
#undef IMDCT
_M( ac3_init )( p_ac3dec );
E_( ac3_init )( p_ac3dec );
/*
* Initialize the output properties
......@@ -366,7 +336,7 @@ static void EndThread (ac3dec_t * p_ac3dec)
}
/* Free allocated structures */
#define IMDCT p_ac3dec->imdct
#define IMDCT p_ac3dec->p_imdct
free( IMDCT->w_1_orig );
free( IMDCT->w_64_orig );
free( IMDCT->w_32_orig );
......@@ -387,8 +357,11 @@ static void EndThread (ac3dec_t * p_ac3dec)
free( p_ac3dec->samples_orig );
/* Unlock the modules */
module_Unneed( p_ac3dec->downmix.p_module );
module_Unneed( p_ac3dec->imdct->p_module );
module_Unneed( p_ac3dec->p_downmix, p_ac3dec->p_downmix->p_module );
vlc_object_destroy( p_ac3dec->p_downmix );
module_Unneed( p_ac3dec->p_imdct, p_ac3dec->p_imdct->p_module );
vlc_object_destroy( p_ac3dec->p_imdct );
/* Free what's left of the decoder */
free( p_ac3dec->imdct_orig );
......
......@@ -2,7 +2,7 @@
* ac3_adec.h : ac3 decoder interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: ac3_adec.h,v 1.4 2002/06/01 12:31:58 sam Exp $
* $Id: ac3_adec.h,v 1.5 2002/07/31 20:56:50 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Renaud Dartus <reno@videolan.org>
......@@ -40,7 +40,7 @@ typedef struct ac3_sync_info_s {
/**** ac3 decoder API - functions publically provided by the ac3 decoder ****/
int _M( ac3_init )(ac3dec_t * p_ac3dec);
int E_( ac3_init )(ac3dec_t * p_ac3dec);
int ac3_sync_frame (ac3dec_t * p_ac3dec, ac3_sync_info_t * p_sync_info);
int ac3_decode_frame (ac3dec_t * p_ac3dec, s16 * buffer);
......@@ -394,7 +394,7 @@ struct ac3dec_s
bit_allocate_t bit_allocate;
mantissa_t mantissa;
downmix_t downmix;
downmix_t * p_downmix;
/*
* Output properties
......@@ -403,7 +403,7 @@ struct ac3dec_s
float * samples;
void * samples_orig; /* pointer before memalign */
imdct_t * imdct;
imdct_t * p_imdct;
void * imdct_orig; /* pointer before memalign */
};
......@@ -2,7 +2,7 @@
* ac3_decoder.c: core ac3 decoder
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: ac3_decoder.c,v 1.8 2002/06/01 12:31:58 sam Exp $
* $Id: ac3_decoder.c,v 1.9 2002/07/31 20:56:50 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Michel Lespinasse <walken@zoy.org>
......@@ -40,10 +40,10 @@
static const float cmixlev_lut[4] = { 0.707, 0.595, 0.500, 0.707 };
static const float smixlev_lut[4] = { 0.707, 0.500, 0.0 , 0.500 };
int _M( ac3_init )(ac3dec_t * p_ac3dec)
int E_( ac3_init )(ac3dec_t * p_ac3dec)
{
p_ac3dec->mantissa.lfsr_state = 1; /* dither_gen initialization */
_M( imdct_init )(p_ac3dec->imdct) ;
E_( imdct_init )(p_ac3dec->p_imdct) ;
return 0;
}
......
......@@ -2,7 +2,7 @@
* ac3_decoder.h : ac3 decoder interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: ac3_decoder.h,v 1.4 2002/04/23 23:44:36 fenrir Exp $
* $Id: ac3_decoder.h,v 1.5 2002/07/31 20:56:50 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Renaud Dartus <reno@videolan.org>
......@@ -35,7 +35,7 @@ typedef struct ac3_sync_info_s {
/**** ac3 decoder API - functions publically provided by the ac3 decoder ****/
int _M( ac3_init )(ac3dec_t * p_ac3dec);
int E_( ac3_init )(ac3dec_t * p_ac3dec);
int ac3_sync_frame (ac3dec_t * p_ac3dec, ac3_sync_info_t * p_sync_info);
int ac3_decode_frame (ac3dec_t * p_ac3dec, s16 * buffer);
......
......@@ -2,7 +2,7 @@
* ac3_imdct.c: ac3 DCT
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: ac3_imdct.c,v 1.9 2002/06/01 12:31:58 sam Exp $
* $Id: ac3_imdct.c,v 1.10 2002/07/31 20:56:50 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Aaron Holtzman <aholtzma@engr.uvic.ca>
......@@ -42,7 +42,7 @@
# define M_PI 3.14159265358979323846
#endif
void _M( imdct_init )(imdct_t * p_imdct)
void E_( imdct_init )(imdct_t * p_imdct)
{
int i;
float scale = 181.019;
......@@ -69,11 +69,11 @@ void imdct (ac3dec_t * p_ac3dec, s16 * buffer)
/* test if dm in frequency is doable */
if (!(doable = p_ac3dec->audblk.blksw[0]))
{
do_imdct = p_ac3dec->imdct->pf_imdct_512;
do_imdct = p_ac3dec->p_imdct->pf_imdct_512;
}
else
{
do_imdct = p_ac3dec->imdct->pf_imdct_256;
do_imdct = p_ac3dec->p_imdct->pf_imdct_256;
}
/* downmix in the frequency domain if all the channels
......@@ -93,19 +93,19 @@ void imdct (ac3dec_t * p_ac3dec, s16 * buffer)
switch(p_ac3dec->bsi.acmod)
{
case 7: /* 3/2 */
p_ac3dec->downmix.pf_downmix_3f_2r_to_2ch (p_ac3dec->samples, &p_ac3dec->dm_par);
p_ac3dec->p_downmix->pf_downmix_3f_2r_to_2ch (p_ac3dec->samples, &p_ac3dec->dm_par);
break;
case 6: /* 2/2 */
p_ac3dec->downmix.pf_downmix_2f_2r_to_2ch (p_ac3dec->samples, &p_ac3dec->dm_par);
p_ac3dec->p_downmix->pf_downmix_2f_2r_to_2ch (p_ac3dec->samples, &p_ac3dec->dm_par);
break;
case 5: /* 3/1 */
p_ac3dec->downmix.pf_downmix_3f_1r_to_2ch (p_ac3dec->samples, &p_ac3dec->dm_par);
p_ac3dec->p_downmix->pf_downmix_3f_1r_to_2ch (p_ac3dec->samples, &p_ac3dec->dm_par);
break;
case 4: /* 2/1 */
p_ac3dec->downmix.pf_downmix_2f_1r_to_2ch (p_ac3dec->samples, &p_ac3dec->dm_par);
p_ac3dec->p_downmix->pf_downmix_2f_1r_to_2ch (p_ac3dec->samples, &p_ac3dec->dm_par);
break;
case 3: /* 3/0 */
p_ac3dec->downmix.pf_downmix_3f_0r_to_2ch (p_ac3dec->samples, &p_ac3dec->dm_par);
p_ac3dec->p_downmix->pf_downmix_3f_0r_to_2ch (p_ac3dec->samples, &p_ac3dec->dm_par);
break;
case 2:
break;
......@@ -114,17 +114,17 @@ void imdct (ac3dec_t * p_ac3dec, s16 * buffer)
center = p_ac3dec->samples;
// else if (p_ac3dec->bsi.acmod == 0)
// center = samples[ac3_config.dual_mono_ch_sel];
do_imdct(p_ac3dec->imdct, center, p_ac3dec->imdct->delay); /* no downmix*/
do_imdct(p_ac3dec->p_imdct, center, p_ac3dec->p_imdct->delay); /* no downmix*/
p_ac3dec->downmix.pf_stream_sample_1ch_to_s16 (buffer, center);
p_ac3dec->p_downmix->pf_stream_sample_1ch_to_s16 (buffer, center);
return;
break;
}
do_imdct (p_ac3dec->imdct, p_ac3dec->samples, p_ac3dec->imdct->delay);
do_imdct (p_ac3dec->imdct, p_ac3dec->samples+256, p_ac3dec->imdct->delay+256);
p_ac3dec->downmix.pf_stream_sample_2ch_to_s16(buffer, p_ac3dec->samples, p_ac3dec->samples+256);
do_imdct (p_ac3dec->p_imdct, p_ac3dec->samples, p_ac3dec->p_imdct->delay);
do_imdct (p_ac3dec->p_imdct, p_ac3dec->samples+256, p_ac3dec->p_imdct->delay+256);
p_ac3dec->p_downmix->pf_stream_sample_2ch_to_s16(buffer, p_ac3dec->samples, p_ac3dec->samples+256);
} else {
/* imdct and then downmix
......@@ -135,13 +135,13 @@ void imdct (ac3dec_t * p_ac3dec, s16 * buffer)
if (p_ac3dec->audblk.blksw[i])
{
/* There is only a C function */
p_ac3dec->imdct->pf_imdct_256_nol( p_ac3dec->imdct,
p_ac3dec->samples+256*i, p_ac3dec->imdct->delay1+256*i );
p_ac3dec->p_imdct->pf_imdct_256_nol( p_ac3dec->p_imdct,
p_ac3dec->samples+256*i, p_ac3dec->p_imdct->delay1+256*i );
}
else
{
p_ac3dec->imdct->pf_imdct_512_nol( p_ac3dec->imdct,
p_ac3dec->samples+256*i, p_ac3dec->imdct->delay1+256*i );
p_ac3dec->p_imdct->pf_imdct_512_nol( p_ac3dec->p_imdct,
p_ac3dec->samples+256*i, p_ac3dec->p_imdct->delay1+256*i );
}
}
......@@ -154,13 +154,13 @@ void imdct (ac3dec_t * p_ac3dec, s16 * buffer)
right = p_ac3dec->samples+2*256;
left_sur = p_ac3dec->samples+3*256;
right_sur = p_ac3dec->samples+4*256;
delay_left = p_ac3dec->imdct->delay;
delay_right = p_ac3dec->imdct->delay+256;
delay1_left = p_ac3dec->imdct->delay1;
delay1_center = p_ac3dec->imdct->delay1+256;
delay1_right = p_ac3dec->imdct->delay1+2*256;
delay1_sl = p_ac3dec->imdct->delay1+3*256;
delay1_sr = p_ac3dec->imdct->delay1+4*256;
delay_left = p_ac3dec->p_imdct->delay;
delay_right = p_ac3dec->p_imdct->delay+256;
delay1_left = p_ac3dec->p_imdct->delay1;
delay1_center = p_ac3dec->p_imdct->delay1+256;
delay1_right = p_ac3dec->p_imdct->delay1+2*256;
delay1_sl = p_ac3dec->p_imdct->delay1+3*256;
delay1_sr = p_ac3dec->p_imdct->delay1+4*256;
for (i = 0; i < 256; i++) {
left_tmp = p_ac3dec->dm_par.unit * *left++ + p_ac3dec->dm_par.clev * *center + p_ac3dec->dm_par.slev * *left_sur++;
......@@ -176,12 +176,12 @@ void imdct (ac3dec_t * p_ac3dec, s16 * buffer)
right = p_ac3dec->samples+256;
left_sur = p_ac3dec->samples+2*256;
right_sur = p_ac3dec->samples+3*256;
delay_left = p_ac3dec->imdct->delay;
delay_right = p_ac3dec->imdct->delay+256;
delay1_left = p_ac3dec->imdct->delay1;
delay1_right = p_ac3dec->imdct->delay1+256;
delay1_sl = p_ac3dec->imdct->delay1+2*256;
delay1_sr = p_ac3dec->imdct->delay1+3*256;
delay_left = p_ac3dec->p_imdct->delay;
delay_right = p_ac3dec->p_imdct->delay+256;
delay1_left = p_ac3dec->p_imdct->delay1;
delay1_right = p_ac3dec->p_imdct->delay1+256;
delay1_sl = p_ac3dec->p_imdct->delay1+2*256;
delay1_sr = p_ac3dec->p_imdct->delay1+3*256;
for (i = 0; i < 256; i++) {
left_tmp = p_ac3dec->dm_par.unit * *left++ + p_ac3dec->dm_par.slev * *left_sur++;
......@@ -197,12 +197,12 @@ void imdct (ac3dec_t * p_ac3dec, s16 * buffer)
center = p_ac3dec->samples+256;
right = p_ac3dec->samples+2*256;
right_sur = p_ac3dec->samples+3*256;
delay_left = p_ac3dec->imdct->delay;
delay_right = p_ac3dec->imdct->delay+256;
delay1_left = p_ac3dec->imdct->delay1;
delay1_center = p_ac3dec->imdct->delay1+256;
delay1_right = p_ac3dec->imdct->delay1+2*256;
delay1_sl = p_ac3dec->imdct->delay1+3*256;
delay_left = p_ac3dec->p_imdct->delay;
delay_right = p_ac3dec->p_imdct->delay+256;
delay1_left = p_ac3dec->p_imdct->delay1;
delay1_center = p_ac3dec->p_imdct->delay1+256;
delay1_right = p_ac3dec->p_imdct->delay1+2*256;
delay1_sl = p_ac3dec->p_imdct->delay1+3*256;
for (i = 0; i < 256; i++) {
left_tmp = p_ac3dec->dm_par.unit * *left++ + p_ac3dec->dm_par.clev * *center - p_ac3dec->dm_par.slev * *right_sur;
......@@ -217,11 +217,11 @@ void imdct (ac3dec_t * p_ac3dec, s16 * buffer)
left = p_ac3dec->samples;
right = p_ac3dec->samples+256;
right_sur = p_ac3dec->samples+2*256;
delay_left = p_ac3dec->imdct->delay;
delay_right = p_ac3dec->imdct->delay+256;
delay1_left = p_ac3dec->imdct->delay1;
delay1_right = p_ac3dec->imdct->delay1+256;
delay1_sl = p_ac3dec->imdct->delay1+2*256;
delay_left = p_ac3dec->p_imdct->delay;
delay_right = p_ac3dec->p_imdct->delay+256;
delay1_left = p_ac3dec->p_imdct->delay1;
delay1_right = p_ac3dec->p_imdct->delay1+256;
delay1_sl = p_ac3dec->p_imdct->delay1+2*256;
for (i = 0; i < 256; i++) {
left_tmp = p_ac3dec->dm_par.unit * *left++ - p_ac3dec->dm_par.slev * *right_sur;
......@@ -236,11 +236,11 @@ void imdct (ac3dec_t * p_ac3dec, s16 * buffer)
left = p_ac3dec->samples;
center = p_ac3dec->samples+256;
right = p_ac3dec->samples+2*256;
delay_left = p_ac3dec->imdct->delay;
delay_right = p_ac3dec->imdct->delay+256;
delay1_left = p_ac3dec->imdct->delay1;
delay1_center = p_ac3dec->imdct->delay1+256;
delay1_right = p_ac3dec->imdct->delay1+2*256;
delay_left = p_ac3dec->p_imdct->delay;
delay_right = p_ac3dec->p_imdct->delay+256;
delay1_left = p_ac3dec->p_imdct->delay1;
delay1_center = p_ac3dec->p_imdct->delay1+256;
delay1_right = p_ac3dec->p_imdct->delay1+2*256;
for (i = 0; i < 256; i++) {
left_tmp = p_ac3dec->dm_par.unit * *left++ + p_ac3dec->dm_par.clev * *center;
......
......@@ -2,7 +2,7 @@
* ac3_internals.h: needed by the ac3 decoder
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: ac3_internal.h,v 1.2 2002/04/23 23:44:36 fenrir Exp $
* $Id: ac3_internal.h,v 1.3 2002/07/31 20:56:50 sam Exp $
*
* Authors: Michel Lespinasse <walken@zoy.org>
*
......@@ -40,7 +40,7 @@ void bit_allocate (ac3dec_t *);
int exponent_unpack (ac3dec_t *);
/* ac3_imdct.c */
void _M( imdct_init )(imdct_t * p_imdct);
void E_( imdct_init )(imdct_t * p_imdct);
void imdct (ac3dec_t * p_ac3dec, s16 * buffer);
/* ac3_mantissa.c */
......
......@@ -2,7 +2,7 @@
* ac3_spdif.c: ac3 pass-through to external decoder with enabled soundcard
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: ac3_spdif.c,v 1.31 2002/07/23 00:39:16 sam Exp $
* $Id: ac3_spdif.c,v 1.32 2002/07/31 20:56:50 sam Exp $
*
* Authors: Stphane Borel <stef@via.ecp.fr>
* Juha Yrjola <jyrjola@cc.hut.fi>
......@@ -42,10 +42,11 @@
#include "ac3_spdif.h"
/****************************************************************************
* Local Prototypes
* Local prototypes
****************************************************************************/
static int decoder_Probe ( vlc_fourcc_t * );
static int decoder_Run ( decoder_fifo_t * );
static int OpenDecoder ( vlc_object_t * );
static int RunDecoder ( decoder_fifo_t * );
static int InitThread ( ac3_spdif_thread_t * );
static void EndThread ( ac3_spdif_thread_t * );
static void BitstreamCallback ( bit_stream_t *, vlc_bool_t );
......@@ -98,52 +99,41 @@ static const frame_size_t p_frame_size_code[64] =
};
/*****************************************************************************
* Capabilities
* Module descriptor
*****************************************************************************/
void _M( adec_getfunctions )( function_list_t * p_function_list )
{
p_function_list->functions.dec.pf_probe = decoder_Probe;
p_function_list->functions.dec.pf_run = decoder_Run;
}
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
MODULE_CONFIG_START
MODULE_CONFIG_STOP
MODULE_INIT_START
SET_DESCRIPTION( _("SPDIF pass-through AC3 decoder") )
ADD_CAPABILITY( DECODER, 0 )
ADD_SHORTCUT( "pass_through" )
ADD_SHORTCUT( "pass" )
MODULE_INIT_STOP
MODULE_ACTIVATE_START
_M( adec_getfunctions )( &p_module->p_functions->dec );
MODULE_ACTIVATE_STOP
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
vlc_module_begin();
set_description( _("SPDIF pass-through AC3 decoder") );
set_capability( "decoder", 0 );
set_callbacks( OpenDecoder, NULL );
add_shortcut( "pass_through" );
add_shortcut( "pass" );
vlc_module_end();
/*****************************************************************************
* decoder_Probe: probe the decoder and return score
* OpenDecoder: probe the decoder and return score
*****************************************************************************
* Tries to launch a decoder and return score so that the interface is able
* to chose.
*****************************************************************************/
static int decoder_Probe( vlc_fourcc_t *pi_type )
{
return( *pi_type == VLC_FOURCC('a','5','2',' ') ) ? 0 : -1;
}
static int OpenDecoder( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
if( p_fifo->i_fourcc != VLC_FOURCC('a','5','2',' ') )
{
return VLC_EGENERIC;
}
p_fifo->pf_run = RunDecoder;
return VLC_SUCCESS;
}
/****************************************************************************
* decoder_Run: the whole thing
* RunDecoder: the whole thing
****************************************************************************
* This function is called just after the thread is launched.
****************************************************************************/
static int decoder_Run( decoder_fifo_t * p_fifo )
static int RunDecoder( decoder_fifo_t *p_fifo )
{
ac3_spdif_thread_t * p_spdif;
mtime_t i_frame_time;
......
......@@ -2,7 +2,7 @@
* file.c: file input (file: access plug-in)
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: file.c,v 1.7 2002/06/01 12:31:58 sam Exp $
* $Id: file.c,v 1.8 2002/07/31 20:56:50 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -41,51 +41,11 @@
#endif
/*****************************************************************************
* Local prototypes
* Open: open the file
*****************************************************************************/
static void input_getfunctions( function_list_t * );
static int FileOpen ( input_thread_t * );
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
MODULE_CONFIG_START
MODULE_CONFIG_STOP
MODULE_INIT_START
SET_DESCRIPTION( _("Standard filesystem file reading") )
ADD_CAPABILITY( ACCESS, 50 )
ADD_SHORTCUT( "stream" )
MODULE_INIT_STOP
MODULE_ACTIVATE_START
input_getfunctions( &p_module->p_functions->access );
MODULE_ACTIVATE_STOP
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
static void input_getfunctions( function_list_t * p_function_list )
{
#define input p_function_list->functions.access
input.pf_open = FileOpen;
input.pf_read = input_FDRead;
input.pf_close = input_FDClose;
input.pf_set_program = input_SetProgram;
input.pf_set_area = NULL;
input.pf_seek = input_FDSeek;
#undef input
}
/*****************************************************************************
* FileOpen: open the file
*****************************************************************************/
static int FileOpen( input_thread_t * p_input )
static int Open( vlc_object_t *p_this )
{
input_thread_t * p_input = (input_thread_t *)p_this;
char * psz_name = p_input->psz_name;
int i_stat;
struct stat stat_info;
......@@ -103,6 +63,11 @@ static int FileOpen( input_thread_t * p_input )
return( -1 );
}
p_input->pf_read = input_FDRead;
p_input->pf_set_program = input_SetProgram;
p_input->pf_set_area = NULL;
p_input->pf_seek = input_FDSeek;
vlc_mutex_lock( &p_input->stream.stream_lock );
if( *p_input->psz_access && !strncmp( p_input->psz_access, "stream", 7 ) )
......@@ -173,3 +138,14 @@ static int FileOpen( input_thread_t * p_input )
return( 0 );
}
/*****************************************************************************
* Module descriptor
*****************************************************************************/
vlc_module_begin();
set_description( _("Standard filesystem file reading") );
set_capability( "access", 50 );
add_shortcut( "stream" );
set_callbacks( Open, __input_FDClose );
vlc_module_end();
......@@ -2,7 +2,7 @@
* http.c: HTTP access plug-in
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: http.c,v 1.18 2002/07/25 21:53:53 sigmunau Exp $
* $Id: http.c,v 1.19 2002/07/31 20:56:50 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -55,47 +55,22 @@
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static void input_getfunctions( function_list_t * );
static int HTTPOpen ( input_thread_t * );
static void HTTPClose ( input_thread_t * );
static int HTTPSetProgram ( input_thread_t *, pgrm_descriptor_t * );
static void HTTPSeek ( input_thread_t *, off_t );
static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
MODULE_CONFIG_START
MODULE_CONFIG_STOP
MODULE_INIT_START
SET_DESCRIPTION( _("HTTP access plug-in") )
ADD_CAPABILITY( ACCESS, 0 )
ADD_SHORTCUT( "http4" )
ADD_SHORTCUT( "http6" )
MODULE_INIT_STOP
MODULE_ACTIVATE_START
input_getfunctions( &p_module->p_functions->access );
MODULE_ACTIVATE_STOP
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
static int SetProgram ( input_thread_t *, pgrm_descriptor_t * );
static void Seek ( input_thread_t *, off_t );
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
* Module descriptor
*****************************************************************************/
static void input_getfunctions( function_list_t * p_function_list )
{
#define input p_function_list->functions.access
input.pf_open = HTTPOpen;
input.pf_read = input_FDNetworkRead;
input.pf_close = HTTPClose;
input.pf_set_program = HTTPSetProgram;
input.pf_set_area = NULL;
input.pf_seek = HTTPSeek;
#undef input
}
vlc_module_begin();
set_description( _("HTTP access module") );
set_capability( "access", 0 );
add_shortcut( "http4" );
add_shortcut( "http6" );
set_callbacks( Open, Close );
vlc_module_end();
/*****************************************************************************
* _input_socket_t: private access plug-in data, modified to add private
......@@ -124,14 +99,13 @@ static int HTTPConnect( input_thread_t * p_input, off_t i_tell )
char * psz_return_alpha;
/* Find an appropriate network module */
p_network = module_Need( p_input, MODULE_CAPABILITY_NETWORK,
p_access_data->psz_network,
&p_access_data->socket_desc );
p_input->p_private = (void*) &p_access_data->socket_desc;
p_network = module_Need( p_input, "network", p_access_data->psz_network );
if( p_network == NULL )
{
return( -1 );
}
module_Unneed( p_network );
module_Unneed( p_input, p_network );
p_access_data->_socket.i_handle = p_access_data->socket_desc.i_handle;
......@@ -166,7 +140,9 @@ static int HTTPConnect( input_thread_t * p_input, off_t i_tell )
/* Prepare the input thread for reading. */
p_input->i_bufsize = INPUT_DEFAULT_BUFSIZE;
/* FIXME: we shouldn't have to do that ! */
/* FIXME: we shouldn't have to do that ! It's UGLY but mandatory because
* input_FillBuffer assumes p_input->pf_read exists */
p_input->pf_read = input_FDNetworkRead;
while( !input_FillBuffer( p_input ) )
......@@ -270,10 +246,11 @@ static int HTTPConnect( input_thread_t * p_input, off_t i_tell )
}
/*****************************************************************************
* HTTPOpen: parse URL and open the remote file at the beginning
* Open: parse URL and open the remote file at the beginning
*****************************************************************************/
static int HTTPOpen( input_thread_t * p_input )
static int Open( vlc_object_t *p_this )
{
input_thread_t * p_input = (input_thread_t *)p_this;
_input_socket_t * p_access_data;
char * psz_name = strdup(p_input->psz_name);
char * psz_parser = psz_name;
......@@ -459,6 +436,11 @@ static int HTTPOpen( input_thread_t * p_input )
msg_Dbg( p_input, "opening server=%s port=%d path=%s",
psz_server_addr, i_server_port, psz_path );
p_input->pf_read = input_FDNetworkRead;
p_input->pf_set_program = SetProgram;
p_input->pf_set_area = NULL;
p_input->pf_seek = Seek;
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.b_pace_control = 1;
p_input->stream.b_seekable = 1;
......@@ -484,10 +466,11 @@ static int HTTPOpen( input_thread_t * p_input )
}
/*****************************************************************************
* HTTPClose: free unused data structures
* Close: free unused data structures
*****************************************************************************/
static void HTTPClose( input_thread_t * p_input )
static void Close( vlc_object_t *p_this )
{
input_thread_t * p_input = (input_thread_t *)p_this;
_input_socket_t * p_access_data =
(_input_socket_t *)p_input->p_access_data;
......@@ -496,18 +479,18 @@ static void HTTPClose( input_thread_t * p_input )
}
/*****************************************************************************
* HTTPSetProgram: do nothing
* SetProgram: do nothing
*****************************************************************************/
static int HTTPSetProgram( input_thread_t * p_input,
pgrm_descriptor_t * p_program )
static int SetProgram( input_thread_t * p_input,
pgrm_descriptor_t * p_program )
{
return( 0 );
}
/*****************************************************************************
* HTTPSeek: close and re-open a connection at the right place
* Seek: close and re-open a connection at the right place
*****************************************************************************/
static void HTTPSeek( input_thread_t * p_input, off_t i_pos )
static void Seek( input_thread_t * p_input, off_t i_pos )
{
_input_socket_t * p_access_data = p_input->p_access_data;
close( p_access_data->_socket.i_handle );
......
......@@ -2,7 +2,7 @@
* udp.c: raw UDP access plug-in
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: udp.c,v 1.11 2002/06/01 12:31:58 sam Exp $
* $Id: udp.c,v 1.12 2002/07/31 20:56:50 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -45,51 +45,26 @@
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static void input_getfunctions( function_list_t * );
static int UDPOpen ( input_thread_t * );
static int Open ( vlc_object_t * );
/*****************************************************************************
* Build configuration tree.
* Module descriptor
*****************************************************************************/
MODULE_CONFIG_START
MODULE_CONFIG_STOP
MODULE_INIT_START
SET_DESCRIPTION( _("Raw UDP access plug-in") )
ADD_CAPABILITY( ACCESS, 0 )
ADD_SHORTCUT( "udpstream" )
ADD_SHORTCUT( "udp4" )
ADD_SHORTCUT( "udp6" )
MODULE_INIT_STOP
MODULE_ACTIVATE_START
input_getfunctions( &p_module->p_functions->access );
MODULE_ACTIVATE_STOP
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
vlc_module_begin();
set_description( _("raw UDP access module") );
set_capability( "access", 0 );
add_shortcut( "udpstream" );
add_shortcut( "udp4" );
add_shortcut( "udp6" );
set_callbacks( Open, __input_FDNetworkClose );
vlc_module_end();
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
* Open: open the socket
*****************************************************************************/
static void input_getfunctions( function_list_t * p_function_list )
{
#define input p_function_list->functions.access
input.pf_open = UDPOpen;
input.pf_read = input_FDNetworkRead;
input.pf_close = input_FDNetworkClose;
input.pf_set_program = input_SetProgram;
input.pf_set_area = NULL;
input.pf_seek = NULL;
#undef input
}
/*****************************************************************************
* UDPOpen: open the socket
*****************************************************************************/
static int UDPOpen( input_thread_t * p_input )
static int Open( vlc_object_t *p_this )
{
input_thread_t * p_input = (input_thread_t *)p_this;
input_socket_t * p_access_data;
module_t * p_network;
char * psz_network = "";
......@@ -217,6 +192,11 @@ static int UDPOpen( input_thread_t * p_input )
}
}
p_input->pf_read = input_FDNetworkRead;
p_input->pf_set_program = input_SetProgram;
p_input->pf_set_area = NULL;
p_input->pf_seek = NULL;
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.b_pace_control = 0;
p_input->stream.b_seekable = 0;
......@@ -248,14 +228,14 @@ static int UDPOpen( input_thread_t * p_input )
socket_desc.i_server_port = i_server_port;
/* Find an appropriate network module */
p_network = module_Need( p_input, MODULE_CAPABILITY_NETWORK,
psz_network, &socket_desc );
p_input->p_private = (void*) &socket_desc;
p_network = module_Need( p_input, "network", psz_network );
free(psz_name);
if( p_network == NULL )
{
return( -1 );
}
module_Unneed( p_network );
module_Unneed( p_input, p_network );
p_access_data = p_input->p_access_data = malloc( sizeof(input_socket_t) );
if( p_access_data == NULL )
......
......@@ -2,7 +2,7 @@
* alsa.c : alsa plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: alsa.c,v 1.20 2002/07/20 18:01:42 sam Exp $
* $Id: alsa.c,v 1.21 2002/07/31 20:56:50 sam Exp $
*
* Authors: Henri Fallon <henri@videolan.org> - Original Author
* Jeffrey Baker <jwbaker@acm.org> - Port to ALSA 1.0 API
......@@ -36,35 +36,27 @@
#include <alsa/asoundlib.h>
/*****************************************************************************
* Capabilities defined in the other files.
* Local prototypes
*****************************************************************************/
static void aout_getfunctions( function_list_t * p_function_list );
static int aout_Open ( aout_thread_t * );
static int aout_SetFormat ( aout_thread_t * );
static void aout_HandleXrun ( aout_thread_t *);
static int aout_GetBufInfo ( aout_thread_t *, int i_buffer_limit );
static void aout_Play ( aout_thread_t *, byte_t *buffer, int i_size );
static void aout_Close ( aout_thread_t * );
static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
static int SetFormat ( aout_thread_t * );
static int GetBufInfo ( aout_thread_t *, int );
static void Play ( aout_thread_t *, byte_t *, int );
static void HandleXrun ( aout_thread_t *);
/*****************************************************************************
* Build configuration tree.
* Module descriptor
*****************************************************************************/
MODULE_CONFIG_START
ADD_CATEGORY_HINT( N_("Device"), NULL )
ADD_STRING( "alsa-device", NULL, NULL, N_("Name"), NULL )
MODULE_CONFIG_STOP
MODULE_INIT_START
SET_DESCRIPTION( _("ALSA audio module") )
ADD_CAPABILITY( AOUT, 50 )
MODULE_INIT_STOP
MODULE_ACTIVATE_START
aout_getfunctions( &p_module->p_functions->aout );
MODULE_ACTIVATE_STOP
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
vlc_module_begin();
add_category_hint( N_("Device"), NULL );
add_string( "alsa-device", NULL, NULL, N_("Name"), NULL );
set_description( _("ALSA audio module") );
set_capability( "audio output", 50 );
set_callbacks( Open, Close );
vlc_module_end();
/*****************************************************************************
* Preamble
......@@ -95,25 +87,14 @@ struct aout_sys_t
};
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
static void aout_getfunctions( function_list_t * p_function_list )
{
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_play = aout_Play;
p_function_list->functions.aout.pf_close = aout_Close;
}
/*****************************************************************************
* aout_Open : creates a handle and opens an alsa device
* Open: create a handle and open an alsa device
*****************************************************************************
* This function opens an alsa device, through the alsa API
*****************************************************************************/
static int aout_Open( aout_thread_t *p_aout )
static int Open( vlc_object_t *p_this )
{
aout_thread_t *p_aout = (aout_thread_t *)p_this;
/* Allows user to choose which ALSA device to use */
char psz_alsadev[128];
char *psz_device, *psz_userdev;
......@@ -127,6 +108,10 @@ static int aout_Open( aout_thread_t *p_aout )
return -1;
}
p_aout->pf_setformat = SetFormat;
p_aout->pf_getbufinfo = GetBufInfo;
p_aout->pf_play = Play;
/* Read in ALSA device preferences from configuration */
psz_userdev = config_GetPsz( p_aout, "alsa-device" );
......@@ -179,12 +164,12 @@ static int aout_Open( aout_thread_t *p_aout )
}
/*****************************************************************************
* aout_SetFormat : sets the alsa output format
* SetFormat : sets the alsa output format
*****************************************************************************
* This function prepares the device, sets the rate, format, the mode
* ( "play as soon as you have data" ), and buffer information.
*****************************************************************************/
static int aout_SetFormat( aout_thread_t *p_aout )
static int SetFormat( aout_thread_t *p_aout )
{
int i_rv;
int i_format;
......@@ -317,12 +302,12 @@ static int aout_SetFormat( aout_thread_t *p_aout )
}
/*****************************************************************************
* aout_HandleXrun : reprepare the output
* HandleXrun : reprepare the output
*****************************************************************************
* When buffer gets empty, the driver goes in "Xrun" state, where it needs
* to be reprepared before playing again
*****************************************************************************/
static void aout_HandleXrun(aout_thread_t *p_aout)
static void HandleXrun(aout_thread_t *p_aout)
{
int i_rv;
......@@ -339,14 +324,14 @@ static void aout_HandleXrun(aout_thread_t *p_aout)
/*****************************************************************************
* aout_BufInfo: buffer status query
* BufInfo: buffer status query
*****************************************************************************
* This function returns the number of used byte in the queue.
* It also deals with errors : indeed if the device comes to run out
* of data to play, it switches to the "underrun" status. It has to
* be flushed and re-prepared
*****************************************************************************/
static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
static int GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
{
snd_pcm_status_t *p_status;
int i_alsa_get_status_returns;
......@@ -366,7 +351,7 @@ static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
switch( snd_pcm_status_get_state( p_status ) )
{
case SND_PCM_STATE_XRUN :
aout_HandleXrun( p_aout );
HandleXrun( p_aout );
break;
case SND_PCM_STATE_OPEN:
......@@ -384,11 +369,11 @@ static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
}
/*****************************************************************************
* aout_Play : plays a sample
* Play : plays a sample
*****************************************************************************
* Plays a sample using the snd_pcm_writei function from the alsa API
*****************************************************************************/
static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
static void Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
snd_pcm_uframes_t tot_frames;
snd_pcm_uframes_t frames_left;
......@@ -415,10 +400,11 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
}
/*****************************************************************************
* aout_Close : close the Alsa device
* Close: close the Alsa device
*****************************************************************************/
static void aout_Close( aout_thread_t *p_aout )
static void Close( vlc_object_t *p_this )
{
aout_thread_t *p_aout = (aout_thread_t *)p_this;
int i_close_returns;
i_close_returns = snd_pcm_close( p_aout->p_sys->p_alsa_handle );
......
......@@ -46,51 +46,30 @@ struct aout_sys_t
};
/*****************************************************************************
* Local prototypes.
* Local prototypes
*****************************************************************************/
static void aout_getfunctions ( function_list_t * );
static int aout_Open ( aout_thread_t * );
static int aout_SetFormat ( aout_thread_t * );
static int aout_GetBufInfo ( aout_thread_t *, int );
static void aout_Play ( aout_thread_t *, byte_t *, int );
static void aout_Close ( aout_thread_t * );
static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
MODULE_CONFIG_START
MODULE_CONFIG_STOP
MODULE_INIT_START
SET_DESCRIPTION( _("aRts audio module") )
ADD_CAPABILITY( AOUT, 50 )
MODULE_INIT_STOP
MODULE_ACTIVATE_START
aout_getfunctions( &p_module->p_functions->aout );
MODULE_ACTIVATE_STOP
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
static int SetFormat ( aout_thread_t * );
static int GetBufInfo ( aout_thread_t *, int );
static void Play ( aout_thread_t *, byte_t *, int );
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
* Module descriptor
*****************************************************************************/
static void aout_getfunctions( function_list_t * p_function_list )
{
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_play = aout_Play;
p_function_list->functions.aout.pf_close = aout_Close;
}
vlc_module_begin();
set_description( _("aRts audio module") );
set_capability( "audio output", 50 );
set_callbacks( Open, Close );
vlc_module_end();
/*****************************************************************************
* aout_Open: initialize arts connection to server
* Open: initialize arts connection to server
*****************************************************************************/
static int aout_Open( aout_thread_t *p_aout )
static int Open( vlc_object_t *p_this )
{
aout_thread_t *p_aout = (aout_thread_t *)p_this;
int i_err = 0;
/* Allocate structure */
......@@ -110,6 +89,10 @@ static int aout_Open( aout_thread_t *p_aout )
return(-1);
}
p_aout->pf_setformat = SetFormat;
p_aout->pf_getbufinfo = GetBufInfo;
p_aout->pf_play = Play;
p_aout->p_sys->stream =
arts_play_stream( p_aout->i_rate, 16, p_aout->i_channels, "vlc" );
......@@ -117,9 +100,9 @@ static int aout_Open( aout_thread_t *p_aout )
}
/*****************************************************************************
* aout_SetFormat: set the output format
* SetFormat: set the output format
*****************************************************************************/
static int aout_SetFormat( aout_thread_t *p_aout )
static int SetFormat( aout_thread_t *p_aout )
{
/*Not ready*/
/* p_aout->i_latency = esd_get_latency(i_fd);*/
......@@ -131,20 +114,20 @@ static int aout_SetFormat( aout_thread_t *p_aout )
}
/*****************************************************************************
* aout_GetBufInfo: buffer status query
* GetBufInfo: buffer status query
*****************************************************************************/
static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
static int GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
{
/* arbitrary value that should be changed */
return( i_buffer_limit );
}
/*****************************************************************************
* aout_Play: play a sound samples buffer
* Play: play a sound samples buffer
*****************************************************************************
* This function writes a buffer of i_length bytes in the socket
*****************************************************************************/
static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
static void Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
int i_err = arts_write( p_aout->p_sys->stream, buffer, i_size );
......@@ -155,10 +138,12 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
}
/*****************************************************************************
* aout_Close: close the Esound socket
* Close: close the Esound socket
*****************************************************************************/
static void aout_Close( aout_thread_t *p_aout )
static void Close( vlc_object_t *p_this )
{
aout_thread_t *p_aout = (aout_thread_t *)p_this;
arts_close_stream( p_aout->p_sys->stream );
free( p_aout->p_sys );
}
......
......@@ -2,7 +2,7 @@
* avi.c : AVI file Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: avi.c,v 1.32 2002/07/23 00:39:16 sam Exp $
* $Id: avi.c,v 1.33 2002/07/31 20:56:50 sam Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -39,43 +39,20 @@
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static void input_getfunctions( function_list_t * );
static int AVIDemux ( input_thread_t * );
static int AVIInit ( input_thread_t * );
static void AVIEnd ( input_thread_t * );
static int AVIInit ( vlc_object_t * );
static void __AVIEnd ( vlc_object_t * );
static int AVIDemux ( input_thread_t * );
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
MODULE_CONFIG_START
MODULE_CONFIG_STOP
MODULE_INIT_START
SET_DESCRIPTION( "RIFF-AVI Stream input" )
ADD_CAPABILITY( DEMUX, 150 )
MODULE_INIT_STOP
MODULE_ACTIVATE_START
input_getfunctions( &p_module->p_functions->demux );
MODULE_ACTIVATE_STOP
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
#define AVIEnd(a) __AVIEnd(VLC_OBJECT(a))
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
* Module descriptor
*****************************************************************************/
static void input_getfunctions( function_list_t * p_function_list )
{
#define input p_function_list->functions.demux
input.pf_init = AVIInit;
input.pf_end = AVIEnd;
input.pf_demux = AVIDemux;
input.pf_rewind = NULL;
#undef input
}
vlc_module_begin();
set_description( "RIFF-AVI demuxer" );
set_capability( "demux", 150 );
set_callbacks( AVIInit, __AVIEnd );
vlc_module_end();
/*****************************************************************************
* Some usefull functions to manipulate memory
......@@ -544,8 +521,9 @@ static void __AVI_UpdateIndexOffset( input_thread_t *p_input )
/*****************************************************************************
* AVIEnd: frees unused data
*****************************************************************************/
static void AVIEnd( input_thread_t *p_input )
static void __AVIEnd ( vlc_object_t * p_this )
{
input_thread_t * p_input = (input_thread_t *)p_this;
int i;
demux_data_avi_file_t *p_avi_demux;
p_avi_demux = (demux_data_avi_file_t*)p_input->p_demux_data ;
......@@ -580,8 +558,9 @@ static void AVIEnd( input_thread_t *p_input )
/*****************************************************************************
* AVIInit: check file and initializes AVI structures
*****************************************************************************/
static int AVIInit( input_thread_t *p_input )
{
static int AVIInit( vlc_object_t * p_this )
{
input_thread_t * p_input = (input_thread_t *)p_this;
riffchunk_t *p_riff,*p_hdrl,*p_movi;
riffchunk_t *p_avih;
riffchunk_t *p_strl,*p_strh,*p_strf;
......@@ -589,6 +568,8 @@ static int AVIInit( input_thread_t *p_input )
es_descriptor_t *p_es = NULL; /* for not warning */
int i;
p_input->pf_demux = AVIDemux;
if( !( p_input->p_demux_data =
p_avi_demux = malloc( sizeof(demux_data_avi_file_t) ) ) )
{
......@@ -1039,7 +1020,7 @@ static int __AVI_SeekAndGetChunk( input_thread_t *p_input,
AVIStreamInfo_t *p_info )
{
pes_packet_t *p_pes;
int i_length;
int i_length, i_ret;
i_length = __MIN( p_info->p_index[p_info->i_idxposc].i_length
- p_info->i_idxposb,
......@@ -1049,10 +1030,9 @@ static int __AVI_SeekAndGetChunk( input_thread_t *p_input,
(off_t)p_info->p_index[p_info->i_idxposc].i_pos +
p_info->i_idxposb + 8);
if( __AVI_GetDataInPES( p_input,
&p_pes,
i_length ,
0) != i_length )
i_ret = __AVI_GetDataInPES( p_input, &p_pes, i_length , 0);
if( i_ret != i_length )
{
return( 0 );
}
......@@ -1532,6 +1512,7 @@ static pes_packet_t *AVI_ReadStreamBytesInPES( input_thread_t *p_input,
{
return( NULL );
}
fprintf(stderr, "blah ibyte %i\n", i_byte);
if( !( p_data = input_NewPacket( p_input->p_method_data, i_byte ) ) )
{
input_DeletePES( p_input->p_method_data, p_pes );
......
......@@ -2,7 +2,7 @@
* aout_beos.cpp: BeOS audio output
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: aout_beos.cpp,v 1.25 2002/07/20 18:01:42 sam Exp $
* $Id: aout_beos.cpp,v 1.26 2002/07/31 20:56:50 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -37,11 +37,8 @@
#include <malloc.h>
#include <string.h>
extern "C"
{
#include <vlc/vlc.h>
#include <vlc/aout.h>
}
/*****************************************************************************
* aout_sys_t: BeOS audio output method descriptor
......@@ -58,37 +55,20 @@ struct aout_sys_t
int i_buffer_pos;
};
extern "C"
{
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
static int aout_Open ( aout_thread_t *p_aout );
static int aout_SetFormat ( aout_thread_t *p_aout );
static int aout_GetBufInfo ( aout_thread_t *p_aout, int i_buffer_info );
static void aout_Play ( aout_thread_t *p_aout,
byte_t *buffer, int i_size );
static void aout_Close ( aout_thread_t *p_aout );
static int SetFormat ( aout_thread_t * );
static int GetBufInfo ( aout_thread_t *, int );
static void Play ( aout_thread_t *, byte_t *, int );
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
* OpenAudio: opens a BPushGameSound
*****************************************************************************/
void _M( aout_getfunctions )( function_list_t * p_function_list )
{
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_play = aout_Play;
p_function_list->functions.aout.pf_close = aout_Close;
}
int E_(OpenAudio) ( vlc_object_t *p_this )
{
aout_thread_t * p_aout = (aout_thread_t *)p_this;
/*****************************************************************************
* aout_Open: opens a BPushGameSound
*****************************************************************************/
static int aout_Open( aout_thread_t *p_aout )
{
/* Allocate structure */
p_aout->p_sys = (aout_sys_t*) malloc( sizeof( aout_sys_t ) );
if( p_aout->p_sys == NULL )
......@@ -114,6 +94,10 @@ static int aout_Open( aout_thread_t *p_aout )
p_aout->p_sys->p_format->buffer_size = 4*8192;
p_aout->p_sys->i_buffer_pos = 0;
p_aout->pf_setformat = SetFormat;
p_aout->pf_getbufinfo = GetBufInfo;
p_aout->pf_play = Play;
/* Allocate BPushGameSound */
p_aout->p_sys->p_sound = new BPushGameSound( 8192,
p_aout->p_sys->p_format,
......@@ -143,17 +127,17 @@ static int aout_Open( aout_thread_t *p_aout )
}
/*****************************************************************************
* aout_SetFormat: sets the dsp output format
* SetFormat: sets the dsp output format
*****************************************************************************/
static int aout_SetFormat( aout_thread_t *p_aout )
static int SetFormat( aout_thread_t *p_aout )
{
return( 0 );
}
/*****************************************************************************
* aout_GetBufInfo: buffer status query
* GetBufInfo: buffer status query
*****************************************************************************/
static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
static int GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
{
/* Each value is 4 bytes long (stereo signed 16 bits) */
int i_hard_pos = 4 * p_aout->p_sys->p_sound->CurrentPosition();
......@@ -168,11 +152,11 @@ static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
}
/*****************************************************************************
* aout_Play: plays a sound samples buffer
* Play: plays a sound samples buffer
*****************************************************************************
* This function writes a buffer of i_length bytes in the dsp
*****************************************************************************/
static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
static void Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
int i_newbuf_pos;
......@@ -202,10 +186,12 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
}
/*****************************************************************************
* aout_Close: closes the dsp audio device
* CloseAudio: closes the dsp audio device
*****************************************************************************/
static void aout_Close( aout_thread_t *p_aout )
{
void E_(CloseAudio) ( vlc_object_t *p_this )
{
aout_thread_t * p_aout = (aout_thread_t *)p_this;
p_aout->p_sys->p_sound->UnlockCyclic();
p_aout->p_sys->p_sound->StopPlaying( );
delete p_aout->p_sys->p_sound;
......@@ -213,5 +199,3 @@ static void aout_Close( aout_thread_t *p_aout )
free( p_aout->p_sys );
}
} /* extern "C" */
......@@ -2,7 +2,7 @@
* beos.cpp : BeOS plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: beos.cpp,v 1.19 2002/06/01 12:31:58 sam Exp $
* $Id: beos.cpp,v 1.20 2002/07/31 20:56:50 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -30,35 +30,31 @@
#include <vlc/vlc.h>
extern "C"
{
/*****************************************************************************
* Capabilities defined in the other files.
* External prototypes
*****************************************************************************/
void _M( aout_getfunctions )( function_list_t * p_function_list );
void _M( vout_getfunctions )( function_list_t * p_function_list );
void _M( intf_getfunctions )( function_list_t * p_function_list );
int E_(OpenIntf) ( vlc_object_t * );
void E_(CloseIntf) ( vlc_object_t * );
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
MODULE_CONFIG_START
MODULE_CONFIG_STOP
MODULE_INIT_START
SET_DESCRIPTION( _("BeOS standard API module") )
ADD_CAPABILITY( INTF, 100 )
ADD_CAPABILITY( VOUT, 100 )
ADD_CAPABILITY( AOUT, 100 )
MODULE_INIT_STOP
int E_(OpenAudio) ( vlc_object_t * );
void E_(CloseAudio) ( vlc_object_t * );
MODULE_ACTIVATE_START
_M( aout_getfunctions )( &p_module->p_functions->aout );
_M( vout_getfunctions )( &p_module->p_functions->vout );
_M( intf_getfunctions )( &p_module->p_functions->intf );
MODULE_ACTIVATE_STOP
int E_(OpenVideo) ( vlc_object_t * );
void E_(CloseVideo) ( vlc_object_t * );
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
/*****************************************************************************
* Module descriptor
*****************************************************************************/
vlc_module_begin();
set_description( _("BeOS standard API module") );
add_submodule();
set_capability( "interface", 100 );
set_callbacks( E_(OpenIntf), E_(CloseIntf) );
add_submodule();
set_capability( "video output", 100 );
set_callbacks( E_(OpenVideo), E_(CloseVideo) );
add_submodule();
set_capability( "audio output", 100 );
set_callbacks( E_(OpenAudio), E_(CloseAudio) );
vlc_module_end();
} /* extern "C" */
......@@ -2,7 +2,7 @@
* intf_beos.cpp: beos interface
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: intf_beos.cpp,v 1.43 2002/07/23 12:42:17 tcastley Exp $
* $Id: intf_beos.cpp,v 1.44 2002/07/31 20:56:50 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -38,32 +38,17 @@
#include "intf_vlc_wrapper.h"
#include "InterfaceWindow.h"
extern "C"
{
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
static int intf_Open ( intf_thread_t *p_intf );
static void intf_Close ( intf_thread_t *p_intf );
static void intf_Run ( intf_thread_t *p_intf );
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
* Local prototype
*****************************************************************************/
void _M( intf_getfunctions )( function_list_t * p_function_list )
{
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;
}
static void Run ( intf_thread_t *p_intf );
/*****************************************************************************
* intf_Open: initialize interface
* OpenIntf: initialize interface
*****************************************************************************/
static int intf_Open( intf_thread_t *p_intf )
{
int E_(OpenIntf) ( vlc_object_t *p_this )
{
intf_thread_t *p_intf = (intf_thread_t*) p_this;
BScreen *screen;
screen = new BScreen();
BRect rect = screen->Frame();
......@@ -83,6 +68,7 @@ static int intf_Open( intf_thread_t *p_intf )
// p_intf->p_sys->p_sub = msg_Subscribe( p_intf );
p_intf->p_sys->p_input = NULL;
p_intf->pf_run = Run;
/* Create the interface window */
p_intf->p_sys->p_window =
......@@ -99,10 +85,12 @@ static int intf_Open( intf_thread_t *p_intf )
}
/*****************************************************************************
* intf_Close: destroy dummy interface
* CloseIntf: destroy interface
*****************************************************************************/
static void intf_Close( intf_thread_t *p_intf )
void E_(CloseIntf) ( vlc_object_t *p_this )
{
intf_thread_t *p_intf = (intf_thread_t*) p_this;
if( p_intf->p_sys->p_input )
{
vlc_object_release( p_intf->p_sys->p_input );
......@@ -120,9 +108,9 @@ static void intf_Close( intf_thread_t *p_intf )
/*****************************************************************************
* intf_Run: event loop
* Run: event loop
*****************************************************************************/
static void intf_Run( intf_thread_t *p_intf )
static void Run( intf_thread_t *p_intf )
{
while( !p_intf->b_die )
{
......@@ -153,5 +141,3 @@ static void intf_Run( intf_thread_t *p_intf )
}
} /* extern "C" */
......@@ -2,7 +2,7 @@
* vout_beos.cpp: beos video output display method
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: vout_beos.cpp,v 1.64 2002/07/28 01:46:26 tcastley Exp $
* $Id: vout_beos.cpp,v 1.65 2002/07/31 20:56:50 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -460,46 +460,26 @@ void VLCView::Draw(BRect updateRect)
FillRect(updateRect);
}
extern "C"
{
/*****************************************************************************
* Local prototypes
*****************************************************************************/
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 * );
static int Init ( vout_thread_t * );
static void End ( vout_thread_t * );
static int Manage ( vout_thread_t * );
static void Display ( vout_thread_t *, picture_t * );
static int BeosOpenDisplay ( vout_thread_t *p_vout );
static void BeosCloseDisplay( vout_thread_t *p_vout );
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
void _M( vout_getfunctions )( function_list_t * p_function_list )
{
p_function_list->functions.vout.pf_create = vout_Create;
p_function_list->functions.vout.pf_init = vout_Init;
p_function_list->functions.vout.pf_end = vout_End;
p_function_list->functions.vout.pf_destroy = vout_Destroy;
p_function_list->functions.vout.pf_manage = vout_Manage;
p_function_list->functions.vout.pf_display = vout_Display;
p_function_list->functions.vout.pf_render = vout_Render;
}
/*****************************************************************************
* vout_Create: allocates BeOS video thread output method
* OpenVideo: allocates BeOS video thread output method
*****************************************************************************
* This function allocates and initializes a BeOS vout method.
*****************************************************************************/
int vout_Create( vout_thread_t *p_vout )
int E_(OpenVideo) ( vlc_object_t *p_this )
{
vout_thread_t * p_vout = (vout_thread_t *)p_this;
/* Allocate structure */
p_vout->p_sys = (vout_sys_t*) malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL )
......@@ -511,13 +491,19 @@ int vout_Create( vout_thread_t *p_vout )
p_vout->p_sys->i_height = p_vout->render.i_height;
p_vout->p_sys->source_chroma = p_vout->render.i_chroma;
p_vout->pf_init = Init;
p_vout->pf_end = End;
p_vout->pf_manage = NULL;
p_vout->pf_render = NULL;
p_vout->pf_display = Display;
return( 0 );
}
/*****************************************************************************
* vout_Init: initialize BeOS video thread output method
* Init: initialize BeOS video thread output method
*****************************************************************************/
int vout_Init( vout_thread_t *p_vout )
int Init( vout_thread_t *p_vout )
{
int i_index;
picture_t *p_pic;
......@@ -583,50 +569,32 @@ int vout_Init( vout_thread_t *p_vout )
}
/*****************************************************************************
* vout_End: terminate BeOS video thread output method
* End: terminate BeOS video thread output method
*****************************************************************************/
void vout_End( vout_thread_t *p_vout )
void End( vout_thread_t *p_vout )
{
BeosCloseDisplay( p_vout );
}
/*****************************************************************************
* vout_Destroy: destroy BeOS video thread output method
* CloseVideo: destroy BeOS video thread output method
*****************************************************************************
* Terminate an output method created by DummyCreateOutputMethod
*****************************************************************************/
void vout_Destroy( vout_thread_t *p_vout )
void E_(CloseVideo) ( vlc_object_t *p_this )
{
free( p_vout->p_sys );
}
vout_thread_t * p_vout = (vout_thread_t *)p_this;
/*****************************************************************************
* vout_Manage: handle BeOS events
*****************************************************************************
* This function should be called regularly by video output thread. It manages
* console events. It returns a non null value on error.
*****************************************************************************/
int vout_Manage( vout_thread_t *p_vout )
{
return( 0 );
}
/*****************************************************************************
* vout_Render: render previously calculated output
*****************************************************************************/
void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
{
;
free( p_vout->p_sys );
}
/*****************************************************************************
* vout_Display: displays previously rendered output
* Display: displays previously rendered output
*****************************************************************************
* This function send the currently rendered image to BeOS image, waits until
* it is displayed and switch the two rendering buffers, preparing next frame.
*****************************************************************************/
void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
void Display( vout_thread_t *p_vout, picture_t *p_pic )
{
VideoWindow * p_win = p_vout->p_sys->p_window;
......@@ -683,6 +651,3 @@ static void BeosCloseDisplay( vout_thread_t *p_vout )
p_win = NULL;
}
} /* extern "C" */
......@@ -2,7 +2,7 @@
* i420_rgb.c : YUV to bitmap RGB conversion module for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: i420_rgb.c,v 1.10 2002/07/23 00:39:16 sam Exp $
* $Id: i420_rgb.c,v 1.11 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -40,10 +40,8 @@
/*****************************************************************************
* Local and extern prototypes.
*****************************************************************************/
static void chroma_getfunctions ( function_list_t * p_function_list );
static int chroma_Init ( vout_thread_t * );
static void chroma_End ( vout_thread_t * );
static int Activate ( vlc_object_t * );
static void Deactivate ( vlc_object_t * );
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
static void SetGammaTable ( int *pi_table, double f_gamma );
......@@ -52,48 +50,30 @@ static void Set8bppPalette ( vout_thread_t *, u8 * );
#endif
/*****************************************************************************
* Build configuration tree.
* Module descriptor.
*****************************************************************************/
MODULE_CONFIG_START
MODULE_CONFIG_STOP
MODULE_INIT_START
vlc_module_begin();
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
SET_DESCRIPTION( _("I420,IYUV,YV12 to "
"RGB,RV15,RV16,RV24,RV32 conversions") )
ADD_CAPABILITY( CHROMA, 80 )
set_description( _("I420,IYUV,YV12 to "
"RGB,RV15,RV16,RV24,RV32 conversions") );
set_capability( "chroma", 80 );
#elif defined (MODULE_NAME_IS_chroma_i420_rgb_mmx)
SET_DESCRIPTION( _( "MMX I420,IYUV,YV12 to "
"RV15,RV16,RV24,RV32 conversions") )
ADD_CAPABILITY( CHROMA, 100 )
ADD_REQUIREMENT( MMX )
set_description( _( "MMX I420,IYUV,YV12 to "
"RV15,RV16,RV24,RV32 conversions") );
set_capability( "chroma", 100 );
add_requirement( MMX );
#endif
MODULE_INIT_STOP
MODULE_ACTIVATE_START
chroma_getfunctions( &p_module->p_functions->chroma );
MODULE_ACTIVATE_STOP
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
static void chroma_getfunctions( function_list_t * p_function_list )
{
p_function_list->functions.chroma.pf_init = chroma_Init;
p_function_list->functions.chroma.pf_end = chroma_End;
}
set_callbacks( Activate, Deactivate );
vlc_module_end();
/*****************************************************************************
* chroma_Init: allocate a chroma function
* Activate: allocate a chroma function
*****************************************************************************
* This function allocates and initializes a chroma function
*****************************************************************************/
static int chroma_Init( vout_thread_t *p_vout )
static int Activate( vlc_object_t *p_this )
{
vout_thread_t *p_vout = (vout_thread_t *)p_this;
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
size_t i_tables_size;
#endif
......@@ -112,20 +92,20 @@ static int chroma_Init( vout_thread_t *p_vout )
{
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
case VLC_FOURCC('R','G','B','2'):
p_vout->chroma.pf_convert = _M( I420_RGB8 );
p_vout->chroma.pf_convert = E_(I420_RGB8);
break;
#endif
case VLC_FOURCC('R','V','1','5'):
p_vout->chroma.pf_convert = _M( I420_RGB15 );
p_vout->chroma.pf_convert = E_(I420_RGB15);
break;
case VLC_FOURCC('R','V','1','6'):
p_vout->chroma.pf_convert = _M( I420_RGB16 );
p_vout->chroma.pf_convert = E_(I420_RGB16);
break;
case VLC_FOURCC('R','V','2','4'):
case VLC_FOURCC('R','V','3','2'):
p_vout->chroma.pf_convert = _M( I420_RGB32 );
p_vout->chroma.pf_convert = E_(I420_RGB32);
break;
default:
......@@ -214,12 +194,14 @@ static int chroma_Init( vout_thread_t *p_vout )
}
/*****************************************************************************
* chroma_End: free the chroma function
* Deactivate: free the chroma function
*****************************************************************************
* This function frees the previously allocated chroma function
*****************************************************************************/
static void chroma_End( vout_thread_t *p_vout )
static void Deactivate( vlc_object_t *p_this )
{
vout_thread_t *p_vout = (vout_thread_t *)p_this;
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
free( p_vout->chroma.p_sys->p_base );
#endif
......
......@@ -2,7 +2,7 @@
* i420_rgb.h : YUV to bitmap RGB conversion module for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: i420_rgb.h,v 1.7 2002/07/20 18:01:42 sam Exp $
* $Id: i420_rgb.h,v 1.8 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -45,11 +45,11 @@ struct chroma_sys_t
* Prototypes
*****************************************************************************/
#ifdef MODULE_NAME_IS_chroma_i420_rgb
void _M( I420_RGB8 ) ( vout_thread_t *, picture_t *, picture_t * );
void E_(I420_RGB8) ( vout_thread_t *, picture_t *, picture_t * );
#endif
void _M( I420_RGB15 )( vout_thread_t *, picture_t *, picture_t * );
void _M( I420_RGB16 )( vout_thread_t *, picture_t *, picture_t * );
void _M( I420_RGB32 )( vout_thread_t *, picture_t *, picture_t * );
void E_(I420_RGB15)( vout_thread_t *, picture_t *, picture_t * );
void E_(I420_RGB16)( vout_thread_t *, picture_t *, picture_t * );
void E_(I420_RGB32)( vout_thread_t *, picture_t *, picture_t * );
/*****************************************************************************
* CONVERT_*_PIXEL: pixel conversion macros
......
......@@ -2,7 +2,7 @@
* i420_rgb16.c : YUV to bitmap RGB conversion module for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: i420_rgb16.c,v 1.9 2002/07/23 00:39:16 sam Exp $
* $Id: i420_rgb16.c,v 1.10 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -50,8 +50,8 @@ static void SetOffset( int, int, int, int, vlc_bool_t *, int *, int * );
* - input: 2 lines (2 Y lines, 1 U/V line)
* - output: 1 line
*****************************************************************************/
void _M( I420_RGB15 )( vout_thread_t *p_vout, picture_t *p_src,
picture_t *p_dest )
void E_(I420_RGB15)( vout_thread_t *p_vout, picture_t *p_src,
picture_t *p_dest )
{
/* We got this one from the old arguments */
u16 *p_pic = (u16*)p_dest->p->p_pixels;
......@@ -178,8 +178,8 @@ void _M( I420_RGB15 )( vout_thread_t *p_vout, picture_t *p_src,
* - input: 2 lines (2 Y lines, 1 U/V line)
* - output: 1 line
*****************************************************************************/
void _M( I420_RGB16 )( vout_thread_t *p_vout, picture_t *p_src,
picture_t *p_dest )
void E_(I420_RGB16)( vout_thread_t *p_vout, picture_t *p_src,
picture_t *p_dest )
{
/* We got this one from the old arguments */
u16 *p_pic = (u16*)p_dest->p->p_pixels;
......@@ -306,8 +306,8 @@ void _M( I420_RGB16 )( vout_thread_t *p_vout, picture_t *p_src,
* - input: 2 lines (2 Y lines, 1 U/V line)
* - output: 1 line
*****************************************************************************/
void _M( I420_RGB32 )( vout_thread_t *p_vout, picture_t *p_src,
picture_t *p_dest )
void E_(I420_RGB32)( vout_thread_t *p_vout, picture_t *p_src,
picture_t *p_dest )
{
/* We got this one from the old arguments */
u32 *p_pic = (u32*)p_dest->p->p_pixels;
......
......@@ -2,7 +2,7 @@
* i420_rgb8.c : YUV to bitmap RGB conversion module for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: i420_rgb8.c,v 1.7 2002/07/23 00:39:16 sam Exp $
* $Id: i420_rgb8.c,v 1.8 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -39,8 +39,7 @@ static void SetOffset( int, int, int, int, vlc_bool_t *, int *, int * );
/*****************************************************************************
* I420_RGB8: color YUV 4:2:0 to RGB 8 bpp
*****************************************************************************/
void _M( I420_RGB8 )( vout_thread_t *p_vout, picture_t *p_src,
picture_t *p_dest )
void E_(I420_RGB8)( vout_thread_t *p_vout, picture_t *p_src, picture_t *p_dest )
{
/* We got this one from the old arguments */
u8 *p_pic = (u8*)p_dest->p->p_pixels;
......
......@@ -2,7 +2,7 @@
* i420_ymga.c : YUV to YUV conversion module for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: i420_ymga.c,v 1.7 2002/07/23 00:39:16 sam Exp $
* $Id: i420_ymga.c,v 1.8 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -37,54 +37,33 @@
/*****************************************************************************
* Local and extern prototypes.
*****************************************************************************/
static void chroma_getfunctions ( function_list_t * p_function_list );
static int chroma_Init ( vout_thread_t *p_vout );
static void chroma_End ( vout_thread_t *p_vout );
static void I420_YMGA ( vout_thread_t *, picture_t *, picture_t * );
static int Activate ( vlc_object_t * );
static void I420_YMGA ( vout_thread_t *, picture_t *, picture_t * );
/*****************************************************************************
* Build configuration tree.
* Module descriptor
*****************************************************************************/
MODULE_CONFIG_START
MODULE_CONFIG_STOP
MODULE_INIT_START
vlc_module_begin();
#if defined (MODULE_NAME_IS_chroma_i420_ymga)
SET_DESCRIPTION( _("conversions from " SRC_FOURCC " to " DEST_FOURCC) )
ADD_CAPABILITY( CHROMA, 80 )
set_description( _("conversions from " SRC_FOURCC " to " DEST_FOURCC) );
set_capability( "chroma", 80 );
#elif defined (MODULE_NAME_IS_chroma_i420_ymga_mmx)
SET_DESCRIPTION( _("MMX conversions from " SRC_FOURCC " to " DEST_FOURCC) )
ADD_CAPABILITY( CHROMA, 100 )
ADD_REQUIREMENT( MMX )
set_description( _("MMX conversions from " SRC_FOURCC " to " DEST_FOURCC) );
set_capability( "chroma", 100 );
add_requirement( MMX );
#endif
MODULE_INIT_STOP
MODULE_ACTIVATE_START
chroma_getfunctions( &p_module->p_functions->chroma );
MODULE_ACTIVATE_STOP
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
set_callbacks( Activate, NULL );
vlc_module_end();
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
static void chroma_getfunctions( function_list_t * p_function_list )
{
p_function_list->functions.chroma.pf_init = chroma_Init;
p_function_list->functions.chroma.pf_end = chroma_End;
}
/*****************************************************************************
* chroma_Init: allocate a chroma function
* Activate: allocate a chroma function
*****************************************************************************
* This function allocates and initializes a chroma function
*****************************************************************************/
static int chroma_Init( vout_thread_t *p_vout )
static int Activate( vlc_object_t *p_this )
{
vout_thread_t *p_vout = (vout_thread_t *)p_this;
if( p_vout->render.i_width & 1 || p_vout->render.i_height & 1 )
{
return -1;
......@@ -113,16 +92,6 @@ static int chroma_Init( vout_thread_t *p_vout )
return 0;
}
/*****************************************************************************
* chroma_End: free the chroma function
*****************************************************************************
* This function frees the previously allocated chroma function
*****************************************************************************/
static void chroma_End( vout_thread_t *p_vout )
{
;
}
/* Following functions are local */
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* i420_yuy2.c : YUV to YUV conversion module for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: i420_yuy2.c,v 1.10 2002/07/23 00:39:16 sam Exp $
* $Id: i420_yuy2.c,v 1.11 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -44,10 +44,7 @@
/*****************************************************************************
* Local and extern prototypes.
*****************************************************************************/
static void chroma_getfunctions ( function_list_t * p_function_list );
static int chroma_Init ( vout_thread_t *p_vout );
static void chroma_End ( vout_thread_t *p_vout );
static int Activate ( vlc_object_t * );
static void I420_YUY2 ( vout_thread_t *, picture_t *, picture_t * );
static void I420_YVYU ( vout_thread_t *, picture_t *, picture_t * );
......@@ -64,49 +61,32 @@ static unsigned long long i_80w;
#endif
/*****************************************************************************
* Build configuration tree.
* Module descriptor.
*****************************************************************************/
MODULE_CONFIG_START
MODULE_CONFIG_STOP
MODULE_INIT_START
vlc_module_begin();
#if defined (MODULE_NAME_IS_chroma_i420_yuy2)
SET_DESCRIPTION( _("conversions from " SRC_FOURCC " to " DEST_FOURCC) )
ADD_CAPABILITY( CHROMA, 80 )
set_description( _("conversions from " SRC_FOURCC " to " DEST_FOURCC) );
set_capability( "chroma", 80 );
#elif defined (MODULE_NAME_IS_chroma_i420_yuy2_mmx)
SET_DESCRIPTION( _("MMX conversions from " SRC_FOURCC " to " DEST_FOURCC) )
ADD_CAPABILITY( CHROMA, 100 )
ADD_REQUIREMENT( MMX )
set_description( _("MMX conversions from " SRC_FOURCC " to " DEST_FOURCC) );
set_capability( "chroma", 100 );
add_requirement( MMX );
/* Initialize MMX-specific constants */
i_00ffw = 0x00ff00ff00ff00ff;
i_80w = 0x0000000080808080;
#endif
MODULE_INIT_STOP
MODULE_ACTIVATE_START
chroma_getfunctions( &p_module->p_functions->chroma );
MODULE_ACTIVATE_STOP
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
static void chroma_getfunctions( function_list_t * p_function_list )
{
p_function_list->functions.chroma.pf_init = chroma_Init;
p_function_list->functions.chroma.pf_end = chroma_End;
}
set_callbacks( Activate, NULL );
vlc_module_end();
/*****************************************************************************
* chroma_Init: allocate a chroma function
* Activate: allocate a chroma function
*****************************************************************************
* This function allocates and initializes a chroma function
*****************************************************************************/
static int chroma_Init( vout_thread_t *p_vout )
static int Activate( vlc_object_t *p_this )
{
vout_thread_t *p_vout = (vout_thread_t *)p_this;
if( p_vout->render.i_width & 1 || p_vout->render.i_height & 1 )
{
return -1;
......@@ -160,16 +140,6 @@ static int chroma_Init( vout_thread_t *p_vout )
return 0;
}
/*****************************************************************************
* chroma_End: free the chroma function
*****************************************************************************
* This function frees the previously allocated chroma function
*****************************************************************************/
static void chroma_End( vout_thread_t *p_vout )
{
;
}
/* Following functions are local */
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* i422_yuy2.c : YUV to YUV conversion module for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: i422_yuy2.c,v 1.7 2002/07/23 00:39:16 sam Exp $
* $Id: i422_yuy2.c,v 1.8 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -43,10 +43,7 @@
/*****************************************************************************
* Local and extern prototypes.
*****************************************************************************/
static void chroma_getfunctions ( function_list_t * p_function_list );
static int chroma_Init ( vout_thread_t *p_vout );
static void chroma_End ( vout_thread_t *p_vout );
static int Activate ( vlc_object_t * );
static void I422_YUY2 ( vout_thread_t *, picture_t *, picture_t * );
static void I422_YVYU ( vout_thread_t *, picture_t *, picture_t * );
......@@ -58,46 +55,29 @@ static void I422_Y211 ( vout_thread_t *, picture_t *, picture_t * );
#endif
/*****************************************************************************
* Build configuration tree.
* Module descriptor
*****************************************************************************/
MODULE_CONFIG_START
MODULE_CONFIG_STOP
MODULE_INIT_START
vlc_module_begin();
#if defined (MODULE_NAME_IS_chroma_i422_yuy2)
SET_DESCRIPTION( _("conversions from " SRC_FOURCC " to " DEST_FOURCC) )
ADD_CAPABILITY( CHROMA, 80 )
set_description( _("conversions from " SRC_FOURCC " to " DEST_FOURCC) );
set_capability( "chroma", 80 );
#elif defined (MODULE_NAME_IS_chroma_i422_yuy2_mmx)
SET_DESCRIPTION( _("MMX conversions from " SRC_FOURCC " to " DEST_FOURCC) )
ADD_CAPABILITY( CHROMA, 100 )
ADD_REQUIREMENT( MMX )
set_description( _("MMX conversions from " SRC_FOURCC " to " DEST_FOURCC) );
set_capability( "chroma", 100 );
add_requirement( MMX );
#endif
MODULE_INIT_STOP
MODULE_ACTIVATE_START
chroma_getfunctions( &p_module->p_functions->chroma );
MODULE_ACTIVATE_STOP
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
static void chroma_getfunctions( function_list_t * p_function_list )
{
p_function_list->functions.chroma.pf_init = chroma_Init;
p_function_list->functions.chroma.pf_end = chroma_End;
}
set_callbacks( Activate, NULL );
vlc_module_end();
/*****************************************************************************
* chroma_Init: allocate a chroma function
* Activate: allocate a chroma function
*****************************************************************************
* This function allocates and initializes a chroma function
*****************************************************************************/
static int chroma_Init( vout_thread_t *p_vout )
static int Activate( vlc_object_t *p_this )
{
vout_thread_t *p_vout = (vout_thread_t *)p_this;
if( p_vout->render.i_width & 1 || p_vout->render.i_height & 1 )
{
return -1;
......@@ -149,16 +129,6 @@ static int chroma_Init( vout_thread_t *p_vout )
return 0;
}
/*****************************************************************************
* chroma_End: free the chroma function
*****************************************************************************
* This function frees the previously allocated chroma function
*****************************************************************************/
static void chroma_End( vout_thread_t *p_vout )
{
;
}
/* Following functions are local */
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* cinepak.c: cinepak video decoder
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: cinepak.c,v 1.4 2002/07/23 17:19:02 fenrir Exp $
* $Id: cinepak.c,v 1.5 2002/07/31 20:56:51 sam Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -45,68 +45,50 @@
#include "vdec_ext-plugins.h"
#include "cinepak.h"
/*
/*****************************************************************************
* Local prototypes
*/
static int decoder_Probe ( vlc_fourcc_t * );
static int decoder_Run ( decoder_fifo_t * );
*****************************************************************************/
static int OpenDecoder ( vlc_object_t * );
static int RunDecoder ( decoder_fifo_t * );
static int InitThread ( videodec_thread_t * );
static void EndThread ( videodec_thread_t * );
static void DecodeThread ( videodec_thread_t * );
/*****************************************************************************
* Capabilities
*****************************************************************************/
void _M( vdec_getfunctions )( function_list_t * p_function_list )
{
p_function_list->functions.dec.pf_probe = decoder_Probe;
p_function_list->functions.dec.pf_run = decoder_Run;
}
/*****************************************************************************
* Build configuration tree.
* Module descriptor
*****************************************************************************/
MODULE_CONFIG_START
MODULE_CONFIG_STOP
MODULE_INIT_START
SET_DESCRIPTION( "Cinepak Video Decoder" )
ADD_CAPABILITY( DECODER, 70 )
MODULE_INIT_STOP
MODULE_ACTIVATE_START
_M( vdec_getfunctions )( &p_module->p_functions->dec );
MODULE_ACTIVATE_STOP
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
vlc_module_begin();
set_description( "Cinepak video decoder" );
set_capability( "decoder", 70 );
set_callbacks( OpenDecoder, NULL );
vlc_module_end();
/*****************************************************************************
* decoder_Probe: probe the decoder and return score
* OpenDecoder: probe the decoder and return score
*****************************************************************************
* Tries to launch a decoder and return score so that the interface is able
* to chose.
*****************************************************************************/
static int decoder_Probe( vlc_fourcc_t *pi_type )
static int OpenDecoder( vlc_object_t *p_this )
{
switch( *pi_type )
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
switch( p_fifo->i_fourcc )
{
case( VLC_FOURCC('c','v','i','d') ):
case( VLC_FOURCC('C','V','I','D') ):
return( 0);
default:
return( -1 );
case VLC_FOURCC('c','v','i','d'):
case VLC_FOURCC('C','V','I','D'):
p_fifo->pf_run = RunDecoder;
return VLC_SUCCESS;
}
return VLC_EGENERIC;
}
/*****************************************************************************
* decoder_Run: this function is called just after the thread is created
* RunDecoder: this function is called just after the thread is created
*****************************************************************************/
static int decoder_Run ( decoder_fifo_t * p_fifo )
{
static int RunDecoder( decoder_fifo_t *p_fifo )
{
videodec_thread_t *p_vdec;
int b_error;
......
......@@ -2,7 +2,7 @@
* aout_directx.c: Windows DirectX audio output method
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: aout_directx.c,v 1.25 2002/07/20 18:01:42 sam Exp $
* $Id: aout_directx.c,v 1.26 2002/07/31 20:56:51 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -93,11 +93,9 @@ struct aout_sys_t
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
static int aout_Open ( aout_thread_t * );
static int aout_SetFormat ( aout_thread_t * );
static int aout_GetBufInfo ( aout_thread_t *, int );
static void aout_Play ( aout_thread_t *, byte_t *, int );
static void aout_Close ( aout_thread_t * );
static int SetFormat ( aout_thread_t * );
static int GetBufInfo ( aout_thread_t *, int );
static void Play ( aout_thread_t *, byte_t *, int );
/* local functions */
static int DirectxCreateSecondaryBuffer ( aout_thread_t * );
......@@ -106,29 +104,17 @@ static int DirectxInitDSound ( aout_thread_t * );
static void DirectSoundThread ( notification_thread_t * );
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
void _M( aout_getfunctions )( function_list_t * p_function_list )
{
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_play = aout_Play;
p_function_list->functions.aout.pf_close = aout_Close;
}
/*****************************************************************************
* aout_Open: open the audio device
* OpenAudio: open the audio device
*****************************************************************************
* This function opens and setups Direct Sound.
*****************************************************************************/
static int aout_Open( aout_thread_t *p_aout )
int E_(OpenAudio) ( vlc_object_t *p_this )
{
aout_thread_t * p_aout = (aout_thread_t *)p_this;
HRESULT dsresult;
DSBUFFERDESC dsbuffer_desc;
msg_Dbg( p_aout, "aout_Open" );
msg_Dbg( p_aout, "Open" );
/* Allocate structure */
p_aout->p_sys = malloc( sizeof( aout_sys_t ) );
......@@ -148,6 +134,9 @@ static int aout_Open( aout_thread_t *p_aout )
p_aout->p_sys->l_data_played_from_beginning = 0;
vlc_mutex_init( p_aout, &p_aout->p_sys->buffer_lock );
p_aout->pf_setformat = SetFormat;
p_aout->pf_getbufinfo = GetBufInfo;
p_aout->pf_play = Play;
/* Initialise DirectSound */
if( DirectxInitDSound( p_aout ) )
......@@ -201,19 +190,19 @@ static int aout_Open( aout_thread_t *p_aout )
}
/*****************************************************************************
* aout_SetFormat: reset the audio device and sets its format
* SetFormat: reset the audio device and sets its format
*****************************************************************************
* This functions set a new audio format.
* For this we need to close the current secondary buffer and create another
* one with the desired format.
*****************************************************************************/
static int aout_SetFormat( aout_thread_t *p_aout )
static int SetFormat( aout_thread_t *p_aout )
{
HRESULT dsresult;
WAVEFORMATEX *p_waveformat;
unsigned long i_size_struct;
msg_Dbg( p_aout, "aout_SetFormat" );
msg_Dbg( p_aout, "SetFormat" );
/* Set the format of Direct Sound primary buffer */
......@@ -272,19 +261,19 @@ static int aout_SetFormat( aout_thread_t *p_aout )
}
/*****************************************************************************
* aout_GetBufInfo: buffer status query
* GetBufInfo: buffer status query
*****************************************************************************
* returns the number of bytes in the audio buffer that have not yet been
* sent to the sound device.
*****************************************************************************/
static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
static int GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
{
long l_play_position, l_notused, l_result;
HRESULT dsresult;
if( p_aout->p_sys->b_buffer_underflown )
{
msg_Warn( p_aout, "aout_GetBufInfo underflow" );
msg_Warn( p_aout, "GetBufInfo underflow" );
return( i_buffer_limit );
}
......@@ -292,7 +281,7 @@ static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
&l_play_position, &l_notused);
if( dsresult != DS_OK )
{
msg_Warn( p_aout, "aout_GetBufInfo cannot get current pos" );
msg_Warn( p_aout, "GetBufInfo cannot get current pos" );
return( i_buffer_limit );
}
......@@ -302,18 +291,18 @@ static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
+ p_aout->p_sys->l_write_position);
#if 0
msg_Dbg( p_aout, "aout_GetBufInfo: %i", i_result);
msg_Dbg( p_aout, "GetBufInfo: %i", i_result);
#endif
return l_result;
}
/*****************************************************************************
* aout_Play: play a sound buffer
* Play: play a sound buffer
*****************************************************************************
* This function writes a buffer of i_length bytes
* Don't forget that DirectSound buffers are circular buffers.
*****************************************************************************/
static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
static void Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
VOID *p_write_position, *p_start_buffer;
long l_bytes1, l_bytes2, l_play_position;
......@@ -336,7 +325,7 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
p_aout->p_sys->l_write_position = 0;
}
msg_Warn( p_aout, "aout_Play underflow" );
msg_Warn( p_aout, "Play underflow" );
/* reinitialise the underflow detection counters */
p_aout->p_sys->b_buffer_underflown = 0;
p_aout->p_sys->l_data_written_from_beginning = 0;
......@@ -382,7 +371,7 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
}
if( dsresult != DS_OK )
{
msg_Warn( p_aout, "aout_Play cannot lock buffer" );
msg_Warn( p_aout, "Play cannot lock buffer" );
vlc_mutex_unlock( &p_aout->p_sys->buffer_lock );
return;
}
......@@ -420,19 +409,20 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
}
if( dsresult != DS_OK )
{
msg_Warn( p_aout, "aout_Play cannot play buffer" );
msg_Warn( p_aout, "Play cannot play buffer" );
return;
}
}
/*****************************************************************************
* aout_Close: close the audio device
* CloseAudio: close the audio device
*****************************************************************************/
static void aout_Close( aout_thread_t *p_aout )
void E_(CloseAudio) ( vlc_object_t *p_this )
{
aout_thread_t * p_aout = (aout_thread_t *)p_this;
msg_Dbg( p_aout, "aout_Close" );
msg_Dbg( p_aout, "Close" );
/* kill the position notification thread, if any */
vlc_object_detach_all( p_aout->p_sys->p_notif );
......@@ -742,7 +732,7 @@ static void DirectSoundThread( notification_thread_t *p_notif )
}
if( dsresult != DS_OK )
{
msg_Warn( p_notif, "aout_Play cannot lock buffer" );
msg_Warn( p_notif, "Play cannot lock buffer" );
vlc_mutex_unlock( &p_aout->p_sys->buffer_lock );
return;
}
......
This diff is collapsed.
This diff is collapsed.
downmix_SOURCES = downmix.c ac3_downmix_c.c
downmixsse_SOURCES = downmixsse.c ac3_downmix_sse.c
downmix3dn_SOURCES = downmix3dn.c ac3_downmix_3dn.c
downmixsse_SOURCES = downmix.c ac3_downmix_sse.c
downmix3dn_SOURCES = downmix.c ac3_downmix_3dn.c
This diff is collapsed.
This diff is collapsed.
......@@ -2,7 +2,7 @@
* ac3_downmix_common.h: ac3 downmix functions headers
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: ac3_downmix_common.h,v 1.1 2001/05/15 16:19:42 sam Exp $
* $Id: ac3_downmix_common.h,v 1.2 2002/07/31 20:56:51 sam Exp $
*
* Authors: Renaud Dartus <reno@videolan.org>
* Aaron Holtzman <aholtzma@engr.uvic.ca>
......@@ -22,11 +22,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
void _M( downmix_3f_2r_to_2ch ) ( float *, dm_par_t * );
void _M( downmix_2f_2r_to_2ch ) ( float *, dm_par_t * );
void _M( downmix_3f_1r_to_2ch ) ( float *, dm_par_t * );
void _M( downmix_2f_1r_to_2ch ) ( float *, dm_par_t * );
void _M( downmix_3f_0r_to_2ch ) ( float *, dm_par_t * );
void _M( stream_sample_2ch_to_s16 ) ( s16 *, float *, float * );
void _M( stream_sample_1ch_to_s16 ) ( s16 *, float * );
void E_( downmix_3f_2r_to_2ch ) ( float *, dm_par_t * );
void E_( downmix_2f_2r_to_2ch ) ( float *, dm_par_t * );
void E_( downmix_3f_1r_to_2ch ) ( float *, dm_par_t * );
void E_( downmix_2f_1r_to_2ch ) ( float *, dm_par_t * );
void E_( downmix_3f_0r_to_2ch ) ( float *, dm_par_t * );
void E_( stream_sample_2ch_to_s16 ) ( s16 *, float *, float * );
void E_( stream_sample_1ch_to_s16 ) ( s16 *, float * );
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment