Changeset ec9bf58ab3453691a110fcf144d05e18f8b39183
- Timestamp:
- 03/04/00 12:52:48 (8 years ago)
- git-parent:
- Files:
-
- AUTHORS (added)
- COPYING (added)
- Makefile (modified) (17 diffs)
- Makefile.dep (modified) (1 diff)
- README (added)
- include/audio_output.h (modified) (1 diff)
- include/config.h (modified) (1 diff)
- include/input_netlist.h (modified) (2 diffs)
- include/plugins.h (added)
- src/audio_output/audio_output.c (modified) (10 diffs)
- src/input/input_netlist.c (modified) (1 diff)
- src/input/input_network.c (modified) (2 diffs)
- src/interface/interface.c (modified) (7 diffs)
- src/interface/main.c (modified) (11 diffs)
- src/misc/mtime.c (modified) (1 diff)
- src/misc/plugins.c (added)
- src/video_output/video_output.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Makefile
r44bcfed rec9bf58 14 14 #CC=gcc295 15 15 SHELL=/bin/sh 16 INSTALL=install 17 PREFIX=/usr 16 18 17 19 # Audio output settings … … 46 48 47 49 # For x86 architecture, choose MMX support 48 MMX=YES 49 #MMX=NO 50 ARCH += MMX 50 51 # For x86 architecture, optimize for Pentium Pro 51 52 # (choose NO if you get `Invalid instruction' errors) 52 PPRO=YES 53 #PPRO=NO 53 ARCH += PPRO 54 54 55 55 # Decoder choice - ?? old decoder will be removed soon … … 66 66 ################################################################################ 67 67 68 # Program version - may only be changed by the project leader68 # Program version and codename - may only be changed by the project leader 69 69 PROGRAM_VERSION = 0.1.99 70 71 # audio options 72 audio := $(shell echo $(AUDIO) | tr 'A-Z' 'a-z') 73 AUDIO := $(shell echo $(AUDIO) | tr 'a-z' 'A-Z') 74 75 # video options 76 video := $(shell echo $(VIDEO) | tr 'A-Z' 'a-z') 77 VIDEO := $(shell echo $(VIDEO) | tr 'a-z' 'A-Z') 70 PROGRAM_CODENAME = Onatopp 71 72 # audio and video options 73 AUDIO := $(shell echo $(AUDIO) | tr 'A-Z' 'a-z') 74 VIDEO := $(shell echo $(VIDEO) | tr 'A-Z' 'a-z') 78 75 79 76 # PROGRAM_OPTIONS is an identification string of the compilation options 80 PROGRAM_OPTIONS = $( ARCH) $(SYS)77 PROGRAM_OPTIONS = $(SYS) $(ARCH) 81 78 ifeq ($(DEBUG),1) 82 79 PROGRAM_OPTIONS += DEBUG … … 90 87 # DEFINE will contain some of the constants definitions decided in Makefile, 91 88 # including ARCH_xx and SYS_xx. It will be passed to C compiler. 92 DEFINE += -DARCH_$( ARCH)89 DEFINE += -DARCH_$(shell echo $(ARCH) | cut -f1 -d' ') 93 90 DEFINE += -DSYS_$(SYS) 94 DEFINE += -DAUDIO_OPTIONS="\"$(audio)\"" 95 DEFINE += -DVIDEO_OPTIONS="\"$(video)\"" 91 DEFINE += -DPLUGIN_PATH="\"$(PREFIX)/lib/videolan/vlc\"" 96 92 DEFINE += -DPROGRAM_VERSION="\"$(PROGRAM_VERSION)\"" 97 DEFINE += -DPROGRAM_OPTIONS="\"$(PROGRAM_OPTIONS)\"" 93 DEFINE += -DPROGRAM_CODENAME="\"$(PROGRAM_CODENAME)\"" 94 DEFINE += -DPROGRAM_OPTIONS="\"$(shell echo $(PROGRAM_OPTIONS) | tr 'A-Z' 'a-z')\"" 98 95 DEFINE += -DPROGRAM_BUILD="\"$(PROGRAM_BUILD)\"" 99 96 ifeq ($(DEBUG),1) … … 114 111 # Libraries 115 112 # 113 114 ifeq ($(SYS),GNU) 115 LIB += -lthreads -ldl 116 endif 117 118 ifeq ($(SYS),BSD) 119 LIB += -pthread -lgnugetopt 116 120 LIB += -L/usr/local/lib 117 118 ifeq ($(SYS),GNU) 119 LIB += -lthreads 120 else 121 LIB += -lpthread 122 endif 121 endif 122 123 ifeq ($(SYS),LINUX) 124 LIB += -lpthread -ldl 125 endif 126 123 127 LIB += -lm 124 LIB += -ldl125 128 126 129 # … … 138 141 139 142 # Optimizations for x86 familiy 140 if eq ($(ARCH),X86)143 ifneq (,$(findstring X86,$(ARCH))) 141 144 CCFLAGS += -malign-double 142 145 #CCFLAGS += -march=pentium 143 ifeq ($(PPRO), YES) 146 # Eventual Pentium Pro optimizations 147 ifneq (,$(findstring PPRO,$(ARCH))) 144 148 ifneq ($(SYS), BSD) 145 149 CCFLAGS += -march=pentiumpro … … 147 151 endif 148 152 # Eventual MMX optimizations for x86 149 if eq ($(MMX), YES)153 ifneq (,$(findstring MMX,$(ARCH))) 150 154 CFLAGS += -DHAVE_MMX 151 155 endif … … 153 157 154 158 # Optimizations for PowerPC 155 if eq ($(ARCH),PPC)159 ifneq (,$(findstring PPC,$(ARCH))) 156 160 CCFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring 157 161 endif 158 162 159 163 # Optimizations for Sparc 160 if eq ($(ARCH),SPARC)164 ifneq (,$(findstring SPARC,$(ARCH))) 161 165 CCFLAGS += -mhard-float 162 166 endif … … 261 265 misc/rsc_files.o \ 262 266 misc/netutils.o \ 267 misc/plugins.o \ 263 268 misc/decoder_fifo.o 264 269 … … 279 284 # Assembler Objects 280 285 # 281 if eq ($(ARCH),X86)282 if eq ($(MMX), YES)286 ifneq (,$(findstring X86,$(ARCH))) 287 ifneq (,$(findstring MMX,$(ARCH))) 283 288 ifeq ($(DECODER),new) 284 289 ASM_OBJ = video_decoder/vdec_idctmmx.o \ … … 294 299 # Plugins 295 300 # 296 interface_plugin = $( video:%=interface/intf_%.so)297 audio_plugin = $( audio:%=audio_output/aout_%.so)298 video_plugin = $( video:%=video_output/vout_%.so)301 interface_plugin = $(VIDEO:%=interface/intf_%.so) 302 audio_plugin = $(AUDIO:%=audio_output/aout_%.so) 303 video_plugin = $(VIDEO:%=video_output/vout_%.so) 299 304 300 305 PLUGIN_OBJ = $(interface_plugin) $(audio_plugin) $(video_plugin) … … 304 309 # 305 310 sources := $(C_OBJ:%.o=%.c) $(PLUGIN_OBJ:%.so=%.c) 306 dependancies := $(sources:%.c= dep/%.d)311 dependancies := $(sources:%.c=.dep/%.d) 307 312 308 313 # All symbols must be exported … … 324 329 rm -f **/*.o **/*.so **/*~ *.log 325 330 rm -f vlc gmon.out core 326 rm -rf dep 331 rm -rf .dep 332 333 install: 334 $(INSTALL) vlc $(PREFIX)/bin 335 mkdir -p $(PREFIX)/lib/videolan/vlc 336 $(INSTALL) $(PLUGIN_OBJ) $(PREFIX)/lib/videolan/vlc 327 337 328 338 show: … … 348 358 349 359 $(C_OBJ): %.o: Makefile.dep 350 $(C_OBJ): %.o: dep/%.d360 $(C_OBJ): %.o: .dep/%.d 351 361 $(C_OBJ): %.o: %.c 352 362 @echo "compiling $*.o from $*.c" … … 359 369 360 370 $(PLUGIN_OBJ): %.so: Makefile.dep 361 $(PLUGIN_OBJ): %.so: dep/%.d371 $(PLUGIN_OBJ): %.so: .dep/%.d 362 372 363 373 # audio plugins … … 368 378 audio_output/aout_esd.so: %.so: %.c 369 379 @echo "compiling $*.so from $*.c" 380 ifeq ($(SYS), BSD) 381 @$(CC) $(CCFLAGS) $(CFLAGS) -lesd -shared -o $@ $< 382 else 370 383 @$(CC) $(CCFLAGS) $(CFLAGS) -laudiofile -lesd -shared -o $@ $< 384 endif 371 385 372 386 # video plugins … … 394 408 395 409 # Note on dependancies: each .c file is associated with a .d file, which 396 # depends of it. The .o file associated with a .c file depends of the .d, of the 397 # .c itself, and of Makefile. The .d files are stored in a separate dep/410 # depends of it. The .o file associated with a .c file depends of the .d, of the 411 # .c itself, and of Makefile. The .d files are stored in a separate .dep/ 398 412 # directory. 399 413 # The dep directory should be ignored by CVS. 400 414 401 # Note on inclusions: depending of the target, the dependancies files must 415 # Note on inclusions: depending of the target, the dependancies files must 402 416 # or must not be included. The problem is that if we ask make to include a file, 403 # and this file does not exist, it is made before it can be included. In a 404 # general way, a .d file should be included if and only if the corresponding .o 417 # and this file does not exist, it is made before it can be included. In a 418 # general way, a .d file should be included if and only if the corresponding .o 405 419 # needs to be re-made. 406 420 Makefile.dep
rb278b2a rec9bf58 27 27 28 28 -include $(MAKECMDGOALS) 29 $(dependancies): dep/%.d: %.c30 @test -d dep/$(dir $*) || mkdir -pdep/$(dir $*)29 $(dependancies): .dep/%.d: %.c 30 @test -d .dep/$(dir $*) || mkdir -p .dep/$(dir $*) 31 31 @echo "generating dependancies for $*.c" 32 32 @$(SHELL) -ec '$(CC) $(DCFLAGS) $(CFLAGS) $< \ 33 33 | sed '\''s/$(subst .,\.,$(notdir $*))\.o[ :]*/$(subst /,\/,$*).o \ 34 dep\/$(subst /,\/,$*).d : /g'\'' > $@; \34 .dep\/$(subst /,\/,$*).d : /g'\'' > $@; \ 35 35 [ -s $@ ] || rm -f $@' include/audio_output.h
r44bcfed rec9bf58 24 24 /***************************************************************************** 25 25 * Required headers: 26 * - <sys/soundcard.h> ( audio_buf_info )27 26 * - "common.h" ( boolean_t ) 28 27 * - "mtime.h" ( mtime_t ) include/config.h
r44bcfed rec9bf58 42 42 43 43 /* Program version and copyright message */ 44 #define COPYRIGHT_MESSAGE "VideoLAN Client v" PROGRAM_VERSION " - (c)1999-2000 VideoLAN" 45 #define VERSION_MESSAGE "VideoLAN Client - (c)1999-2000 VideoLAN\n" \ 46 "version " PROGRAM_VERSION " ( " PROGRAM_BUILD " )\n" \ 47 "compilation options: " PROGRAM_OPTIONS 44 #define COPYRIGHT_MESSAGE "VideoLAN Client - version " PROGRAM_VERSION \ 45 " " PROGRAM_CODENAME " - (c)1996-2000 VideoLAN" 48 46 49 47 /***************************************************************************** include/input_netlist.h
r44bcfed rec9bf58 64 64 p_input->netlist.i_ts_index--; 65 65 p_input->netlist.p_ts_free[p_input->netlist.i_ts_index].iov_base 66 = p_ts_packet;66 = (void *)p_ts_packet; 67 67 #else /* FIFO */ 68 68 p_input->netlist.p_ts_free[p_input->netlist.i_ts_end].iov_base 69 = p_ts_packet;69 = (void *)p_ts_packet; 70 70 p_input->netlist.i_ts_end++; 71 71 p_input->netlist.i_ts_end &= INPUT_MAX_TS; /* loop */ … … 105 105 #ifdef INPUT_LIFO_TS_NETLIST 106 106 p_input->netlist.i_ts_index--; 107 p_input->netlist.p_ts_free[p_input->netlist.i_ts_index].iov_base = p_ts_packet; 107 p_input->netlist.p_ts_free[p_input->netlist.i_ts_index].iov_base 108 = (void *)p_ts_packet; 108 109 #else /* FIFO */ 109 p_input->netlist.p_ts_free[p_input->netlist.i_ts_end].iov_base = p_ts_packet; 110 p_input->netlist.p_ts_free[p_input->netlist.i_ts_end].iov_base 111 = (void *)p_ts_packet; 110 112 p_input->netlist.i_ts_end++; 111 113 p_input->netlist.i_ts_end &= INPUT_MAX_TS; /* loop */ src/audio_output/audio_output.c
r44bcfed rec9bf58 42 42 #include <stdlib.h> /* calloc(), malloc(), free() */ 43 43 44 #include <dlfcn.h> /* plugins */45 46 44 #include "common.h" 47 45 #include "config.h" 48 46 #include "mtime.h" /* mtime_t, mdate(), msleep() */ 49 47 #include "threads.h" 48 #include "plugins.h" 50 49 51 50 #include "intf_msg.h" /* intf_DbgMsg(), intf_ErrMsg() */ … … 82 81 aout_thread_t * p_aout; /* thread descriptor */ 83 82 char * psz_method; 84 char * psz_plugin;85 83 #if 0 86 84 int i_status; /* thread status */ … … 94 92 } 95 93 96 /* Initialize method-dependent functions*/94 /* Request an interface plugin */ 97 95 psz_method = main_GetPszVariable( AOUT_METHOD_VAR, AOUT_DEFAULT_METHOD ); 98 99 psz_plugin = malloc( sizeof("./audio_output/aout_.so") + strlen(psz_method) ); 100 sprintf( psz_plugin, "./audio_output/aout_%s.so", psz_method ); 101 102 p_aout->p_aout_plugin = dlopen( psz_plugin, RTLD_NOW | RTLD_GLOBAL ); 103 104 if( p_aout->p_aout_plugin == NULL ) 105 { 106 intf_ErrMsg( "error: could not open audio plugin %s\n", psz_plugin ); 107 free( psz_plugin ); 96 p_aout->p_aout_plugin = RequestPlugin( "aout", psz_method ); 97 98 if( !p_aout->p_aout_plugin ) 99 { 100 intf_ErrMsg( "error: could not open audio plugin aout_%s.so\n", psz_method ); 108 101 free( p_aout ); 109 102 return( NULL ); 110 103 } 111 free( psz_plugin );112 104 113 105 /* Get plugins */ 114 p_aout->p_sys_open = dlsym(p_aout->p_aout_plugin, "aout_SysOpen");115 p_aout->p_sys_reset = dlsym(p_aout->p_aout_plugin, "aout_SysReset");116 p_aout->p_sys_setformat = dlsym(p_aout->p_aout_plugin, "aout_SysSetFormat");117 p_aout->p_sys_setchannels = dlsym(p_aout->p_aout_plugin, "aout_SysSetChannels");118 p_aout->p_sys_setrate = dlsym(p_aout->p_aout_plugin, "aout_SysSetRate");119 p_aout->p_sys_getbufinfo = dlsym(p_aout->p_aout_plugin, "aout_SysGetBufInfo");120 p_aout->p_sys_playsamples = dlsym(p_aout->p_aout_plugin, "aout_SysPlaySamples");121 p_aout->p_sys_close = dlsym(p_aout->p_aout_plugin, "aout_SysClose");106 p_aout->p_sys_open = GetPluginFunction( p_aout->p_aout_plugin, "aout_SysOpen" ); 107 p_aout->p_sys_reset = GetPluginFunction( p_aout->p_aout_plugin, "aout_SysReset" ); 108 p_aout->p_sys_setformat = GetPluginFunction( p_aout->p_aout_plugin, "aout_SysSetFormat" ); 109 p_aout->p_sys_setchannels = GetPluginFunction( p_aout->p_aout_plugin, "aout_SysSetChannels" ); 110 p_aout->p_sys_setrate = GetPluginFunction( p_aout->p_aout_plugin, "aout_SysSetRate" ); 111 p_aout->p_sys_getbufinfo = GetPluginFunction( p_aout->p_aout_plugin, "aout_SysGetBufInfo" ); 112 p_aout->p_sys_playsamples = GetPluginFunction( p_aout->p_aout_plugin, "aout_SysPlaySamples" ); 113 p_aout->p_sys_close = GetPluginFunction( p_aout->p_aout_plugin, "aout_SysClose" ); 122 114 123 115 /* … … 126 118 if ( p_aout->p_sys_open( p_aout ) ) 127 119 { 128 dlclose( p_aout->p_aout_plugin );120 TrashPlugin( p_aout->p_aout_plugin ); 129 121 free( p_aout ); 130 122 return( NULL ); … … 137 129 { 138 130 p_aout->p_sys_close( p_aout ); 139 dlclose( p_aout->p_aout_plugin );131 TrashPlugin( p_aout->p_aout_plugin ); 140 132 free( p_aout ); 141 133 return( NULL ); … … 144 136 { 145 137 p_aout->p_sys_close( p_aout ); 146 dlclose( p_aout->p_aout_plugin );138 TrashPlugin( p_aout->p_aout_plugin ); 147 139 free( p_aout ); 148 140 return( NULL ); … … 151 143 { 152 144 p_aout->p_sys_close( p_aout ); 153 dlclose( p_aout->p_aout_plugin );145 TrashPlugin( p_aout->p_aout_plugin ); 154 146 free( p_aout ); 155 147 return( NULL ); … … 158 150 { 159 151 p_aout->p_sys_close( p_aout ); 160 dlclose( p_aout->p_aout_plugin );152 TrashPlugin( p_aout->p_aout_plugin ); 161 153 free( p_aout ); 162 154 return( NULL ); … … 169 161 { 170 162 p_aout->p_sys_close( p_aout ); 171 dlclose( p_aout->p_aout_plugin );163 TrashPlugin( p_aout->p_aout_plugin ); 172 164 free( p_aout ); 173 165 return( NULL ); … … 336 328 337 329 /* Close plugin */ 338 dlclose( p_aout->p_aout_plugin );330 TrashPlugin( p_aout->p_aout_plugin ); 339 331 340 332 /* Free structure */ src/input/input_netlist.c
r44bcfed rec9bf58 103 103 { 104 104 p_input->netlist.p_ts_free[i_base + i_packets].iov_base 105 =(p_input->netlist.p_ts_packets + i_packets);105 = (void *)(p_input->netlist.p_ts_packets + i_packets); 106 106 /* Initialize TS length. */ 107 107 (p_input->netlist.p_ts_packets[i_packets]).i_payload_end = TS_PACKET_SIZE; src/input/input_network.c
r44bcfed rec9bf58 92 92 sizeof( i_socket_option ) ) == (-1) ) 93 93 { 94 intf_ErrMsg("error: can't configure socket ( %s)\n", strerror(errno));94 intf_ErrMsg("error: can't configure socket (SO_REUSEADDR: %s)\n", strerror(errno)); 95 95 close( p_input->i_handle ); 96 96 return( 1 ); … … 106 106 sizeof( i_socket_option ) ) == (-1) ) 107 107 { 108 intf_ErrMsg("error: can't configure socket ( %s)\n", strerror(errno));108 intf_ErrMsg("error: can't configure socket (SO_RCVBUF: %s)\n", strerror(errno)); 109 109 close( p_input->i_handle ); 110 110 return( 1 ); src/interface/interface.c
r44bcfed rec9bf58 28 28 *****************************************************************************/ 29 29 #include <errno.h> /* ENOMEM */ 30 #include <stdio.h> /* sprintf() */31 30 #include <stdlib.h> /* free(), strtol() */ 31 #include <stdio.h> /* FILE */ 32 32 #include <string.h> /* strerror() */ 33 33 #include <sys/types.h> /* on BSD, uio.h needs types.h */ 34 34 #include <sys/uio.h> /* for input.h */ 35 36 #include <dlfcn.h> /* plugins */37 35 38 36 #include "config.h" … … 40 38 #include "mtime.h" 41 39 #include "threads.h" 40 #include "plugins.h" 42 41 #include "input.h" 43 42 … … 90 89 intf_thread_t *p_intf; 91 90 char * psz_method; 92 char * psz_plugin;93 91 94 92 /* Allocate structure */ … … 100 98 } 101 99 102 /* Initialize method-dependent functions*/100 /* Request an interface plugin */ 103 101 psz_method = main_GetPszVariable( VOUT_METHOD_VAR, VOUT_DEFAULT_METHOD ); 104 105 psz_plugin = malloc( sizeof("./interface/intf_.so") + strlen(psz_method) ); 106 sprintf( psz_plugin, "./interface/intf_%s.so", psz_method ); 107 108 p_intf->p_intf_plugin = dlopen( psz_plugin, RTLD_NOW | RTLD_GLOBAL ); 109 110 if( p_intf->p_intf_plugin == NULL ) 111 { 112 intf_ErrMsg( "error: could not open interface plugin %s\n", psz_plugin ); 113 free( psz_plugin ); 102 p_intf->p_intf_plugin = RequestPlugin( "intf", psz_method ); 103 104 if( !p_intf->p_intf_plugin ) 105 { 106 intf_ErrMsg( "error: could not open interface plugin intf_%s.so\n", psz_method ); 114 107 free( p_intf ); 115 108 return( NULL ); 116 109 } 117 free( psz_plugin );118 110 119 111 /* Get plugins */ 120 p_intf->p_sys_create = dlsym(p_intf->p_intf_plugin, "intf_SysCreate");121 p_intf->p_sys_manage = dlsym(p_intf->p_intf_plugin, "intf_SysManage");122 p_intf->p_sys_destroy = dlsym(p_intf->p_intf_plugin, "intf_SysDestroy");112 p_intf->p_sys_create = GetPluginFunction( p_intf->p_intf_plugin, "intf_SysCreate" ); 113 p_intf->p_sys_manage = GetPluginFunction( p_intf->p_intf_plugin, "intf_SysManage" ); 114 p_intf->p_sys_destroy = GetPluginFunction( p_intf->p_intf_plugin, "intf_SysDestroy" ); 123 115 124 116 /* Initialize structure */ … … 137 129 { 138 130 intf_ErrMsg("error: can't create control console\n"); 139 dlclose( p_intf->p_intf_plugin );131 TrashPlugin( p_intf->p_intf_plugin ); 140 132 free( p_intf ); 141 133 return( NULL ); … … 145 137 intf_ErrMsg("error: can't create interface\n"); 146 138 intf_ConsoleDestroy( p_intf->p_console ); 147 dlclose( p_intf->p_intf_plugin );139 TrashPlugin( p_intf->p_intf_plugin ); 148 140 free( p_intf ); 149 141 return( NULL ); … … 211 203 212 204 /* Close plugin */ 213 dlclose( p_intf->p_intf_plugin );205 TrashPlugin( p_intf->p_intf_plugin ); 214 206 215 207 /* Free structure */ src/interface/main.c
r44bcfed rec9bf58 72 72 73 73 /* Usage fashion */ 74 #define SHORT_HELP 0 75 #define LONG_HELP 1 74 #define USAGE 0 75 #define SHORT_HELP 1 76 #define LONG_HELP 2 76 77 77 78 /* Long options */ … … 156 157 if( !p_main->p_msg ) /* start messages interface */ 157 158 { 158 fprintf( stderr, "critical error: can't initialize messages interface (%s)\n",159 strerror(errno) );160 return( errno);159 fprintf( stderr, "critical error: can't initialize messages interface (%s)\n", 160 strerror(errno) ); 161 return( errno ); 161 162 } 162 163 if( GetConfiguration( i_argc, ppsz_argv, ppsz_env ) ) /* parse cmd line */ 163 164 { 164 165 intf_MsgDestroy(); 165 return( errno);166 return( errno ); 166 167 } 167 168 intf_MsgImm( COPYRIGHT_MESSAGE "\n" ); /* print welcome message */ … … 173 174 { 174 175 /* On error during vlans initialization, switch of vlans */ 175 intf_Msg( "Virtual LANs initialization failed : vlans management is deactivated\n");176 intf_Msg( "Virtual LANs initialization failed : vlans management is deactivated\n" ); 176 177 main_data.b_vlans = 0; 177 178 } … … 186 187 { 187 188 /* On error during audio initialization, switch of audio */ 188 intf_Msg( "Audio initialization failed : audio is deactivated\n");189 intf_Msg( "Audio initialization failed : audio is deactivated\n" ); 189 190 main_data.b_audio = 0; 190 191 } … … 280 281 if( psz_env == NULL ) 281 282 { 282 intf_ErrMsg( "error: %s\n", strerror(ENOMEM));283 intf_ErrMsg( "error: %s\n", strerror(ENOMEM) ); 283 284 } 284 285 else … … 287 288 if( putenv( psz_env ) ) 288 289 { 289 intf_ErrMsg( "error: %s\n", strerror(errno));290 intf_ErrMsg( "error: %s\n", strerror(errno) ); 290 291 } 291 292 } … … 303 304 char psz_value[ 256 ]; /* buffer for value */ 304 305 305 sprintf( psz_value, "%d", i_value );306 sprintf( psz_value, "%d", i_value ); 306 307 main_PutPszVariable( psz_name, psz_value ); 307 308 } … … 418 419 case '?': 419 420 default: 420 intf_ErrMsg("intf error: unknown option '%s'\n", ppsz_argv[optind - 1]); 421 intf_ErrMsg( "intf error: unknown option `%s'\n", ppsz_argv[optind - 1] ); 422 Usage( USAGE ); 421 423 return( EINVAL ); 422 424 break; … … 439 441 static void Usage( int i_fashion ) 440 442 { 441 intf_Msg(COPYRIGHT_MESSAGE "\n");442 443 443 /* Usage */ 444 intf_Msg("usage: vlc [options...] [parameters]\n" ); 444 intf_Msg( "Usage: vlc [options] [parameters]\n" ); 445 446 if( i_fashion == USAGE ) 447 { 448 intf_Msg( "Try `vlc --help' for more information.\n" ); 449 return; 450 } 451 452 intf_MsgImm( COPYRIGHT_MESSAGE "\n" ); 445 453 446 454 /* Options */ 447 intf_Msg("Options:\n" \ 448 " -h, --help, -H, --longhelp \tprint short/long usage\n" \ 449 " -v, --version \tprint version information\n"\ 450 " --noaudio, --novideo \tdisable audio/video\n" \ 451 " --aout {" AUDIO_OPTIONS "} \taudio output method\n"\ 452 " --stereo, --mono \tstereo/mono audio\n" \ 453 " --vout {" VIDEO_OPTIONS "} \tvideo output method\n"\ 454 " --display <display> \tdisplay string\n" \ 455 " --width <w>, --height <h> \tdisplay dimensions\n" \ 456 " -g, --grayscale, --color \tgrayscale/color video\n" \ 457 " --novlans \tdisable vlans\n" \ 458 " --server <host>, --port <port> \tvideo server adress\n" \ 459 ); 455 intf_Msg( "\n" 456 "Options:\n" 457 " --noaudio \tdisable audio\n" 458 " --aout <plugin> \taudio output method\n" 459 " --stereo, --mono \tstereo/mono audio\n" 460 "\n" 461 " --novideo \tdisable audio\n" 462 " --vout <plugin> \tvideo output method\n" 463 " --display <display> \tdisplay string\n" 464 " --width <w>, --height <h> \tdisplay dimensions\n" 465 " -g, --grayscale \tgrayscale output\n" 466 " --color \tcolor output\n" 467 "\n" 468 " --novlans \tdisable vlans\n" 469 " --server <host> \tvideo server address\n" 470 " --port <port> \tvideo server port\n" 471 "\n" 472 " -h, --help \tprint help and exit\n" 473 " -H, --longhelp \tprint long help and exit\n" 474 " -v, --version \toutput version information and exit\n" ); 460 475 461 476 if( i_fashion == SHORT_HELP ) … … 463 478 464 479 /* Interface parameters */ 465 intf_Msg( "Interface parameters:\n" \466 " " INTF_INIT_SCRIPT_VAR "=<filename> \tinitialization script\n" \467 " " INTF_CHANNELS_VAR "=<filename> \tchannels list\n"\468 );480 intf_Msg( "\n" 481 "Interface parameters:\n" 482 " " INTF_INIT_SCRIPT_VAR "=<filename> \tinitialization script\n" 483 " " INTF_CHANNELS_VAR "=<filename> \tchannels list\n" ); 469 484 470 485 /* Audio parameters */ 471 intf_Msg( "Audio parameters:\n" \472 " " AOUT_METHOD_VAR "=<method name> \taudio method (" AUDIO_OPTIONS ")\n" \473 " " AOUT_DSP_VAR "=<filename> \tdsp device path\n" \474 " " AOUT_STEREO_VAR "={1|0} \tstereo or mono output\n" \475 " " AOUT_RATE_VAR "=<rate> \toutput rate\n" \476 );486 intf_Msg( "\n" 487 "Audio parameters:\n" 488 " " AOUT_METHOD_VAR "=<method name> \taudio method\n" 489 " " AOUT_DSP_VAR "=<filename> \tdsp device path\n" 490 " " AOUT_STEREO_VAR "={1|0} \tstereo or mono output\n" 491 " " AOUT_RATE_VAR "=<rate> \toutput rate\n" ); 477 492 478 493 /* Video parameters */ 479 intf_Msg( "Video parameters:\n" \480 " " VOUT_METHOD_VAR "=<method name> \tdisplay method (" VIDEO_OPTIONS ")\n" \481 " " VOUT_DISPLAY_VAR "=<display name> \tdisplay used\n" \482 " " VOUT_WIDTH_VAR "=<width> \tdisplay width\n" \483 " " VOUT_HEIGHT_VAR "=<height> \tdislay height\n" \484 " " VOUT_FB_DEV_VAR "=<filename> \tframebuffer device path\n" \485 " " VOUT_GRAYSCALE_VAR "={1|0} \tgrayscale or color output\n" \486 );494 intf_Msg( "\n" 495 "Video parameters:\n" 496 " " VOUT_METHOD_VAR "=<method name> \tdisplay method\n" 497 " " VOUT_DISPLAY_VAR "=<display name> \tdisplay used\n" 498 " " VOUT_WIDTH_VAR "=<width> \tdisplay width\n" 499 " " VOUT_HEIGHT_VAR "=<height> \tdislay height\n" 500 " " VOUT_FB_DEV_VAR "=<filename> \tframebuffer device path\n" 501 " " VOUT_GRAYSCALE_VAR "={1|0} \tgrayscale or color output\n" ); 487 502 488 503 /* Input parameters */ 489 intf_Msg( "Input parameters:\n" \490 " " INPUT_SERVER_VAR "=<hostname> \tvideo server\n" \491 " " INPUT_PORT_VAR "=<port> \tvideo server port\n" \492 " " INPUT_IFACE_VAR "=<interface> \tnetwork interface\n"\493 " " INPUT_VLAN_SERVER_VAR "=<hostname> \tvlan server\n" \494 " " INPUT_VLAN_PORT_VAR "=<port> \tvlan server port\n"\495 );504 intf_Msg( "\n" 505 "Input parameters:\n" 506 " " INPUT_SERVER_VAR "=<hostname> \tvideo server\n" 507 " " INPUT_PORT_VAR "=<port> \tvideo server port\n" 508 " " INPUT_IFACE_VAR "=<interface> \tnetwork interface\n" 509 " " INPUT_VLAN_SERVER_VAR "=<hostname> \tvlan server\n" 510 " " INPUT_VLAN_PORT_VAR "=<port> \tvlan server port\n" ); 496 511 } 497 512 … … 503 518 static void Version( void ) 504 519 { 505 intf_Msg( VERSION_MESSAGE "\n\n");506 intf_Msg("This is free software; see the documentation or contact <videolan@via.ecp.fr>\n" \507 "for use and copying conditions.\n" \508 "\n" \509 "This software is protected by the international copyright laws, and is\n" \510 "provided without any warranty, including the implied warranties of\n" \511 "merchantibility and fitness for a particular purpose.\n" \512 ); 520 intf_Msg( "vlc " PROGRAM_VERSION " " PROGRAM_CODENAME 521 " (" PROGRAM_BUILD ") (" PROGRAM_OPTIONS ")\n" 522 "Copyright 1996-2000 VideoLAN\n" 523 "This program comes with NO WARRANTY, to the extent permitted by law.\n" 524 "You may redistribute it under the terms of the GNU General Public License;\n" 525 "see the file named COPYING for details.\n" 526 "Written by the VideoLAN team at Ecole Centrale, Paris.\n" ); 527 513 528 } 514 529 src/misc/mtime.c
r44bcfed rec9bf58 32 32 *****************************************************************************/ 33 33 #include <stdio.h> /* sprintf() */ 34 #include <unistd.h> /* select() */ 34 35 #include <sys/time.h> 35 36 src/video_output/video_output.c
r44bcfed rec9bf58 33 33 #include <string.h> /* strerror() */ 34 34 35 #include <dlfcn.h> /* plugins */36 37 35 #include "common.h" 38 36 #include "config.h" 39 37 #include "mtime.h" 40 38 #include "threads.h" 39 #include "plugins.h" 41 40 #include "video.h" 42 41 #include "video_output.h" … … 93 92 int i_index; /* index for array initialization */ 94 93 char * psz_method; 95 char * psz_plugin;96 94 97 95 /* Allocate descriptor */ … … 104 102 } 105 103 106 /* Initialize method-dependent functions*/104 /* Request an interface plugin */ 107 105 psz_method = main_GetPszVariable( VOUT_METHOD_VAR, VOUT_DEFAULT_METHOD ); 108 109 psz_plugin = malloc( sizeof("./video_output/vout_.so") + strlen(psz_method) ); 110 sprintf( psz_plugin, "./video_output/vout_%s.so", psz_method ); 111 112 p_vout->p_vout_plugin = dlopen( psz_plugin, RTLD_NOW | RTLD_GLOBAL ); 113 114 if( p_vout->p_vout_plugin == NULL ) 115 { 116 intf_ErrMsg( "error: could not open video plugin %s\n", psz_plugin ); 117 free( psz_plugin ); 106 p_vout->p_vout_plugin = RequestPlugin( "vout", psz_method ); 107 108 if( !p_vout->p_vout_plugin ) 109 { 110 intf_ErrMsg( "error: could not open video plugin vout_%s.so\n", psz_method ); 118 111 free( p_vout ); 119 112 return( NULL ); 120 113 } 121 free( psz_plugin );122 114 123 115 /* Get plugins */ 124 p_vout->p_sys_create = dlsym(p_vout->p_vout_plugin, "vout_SysCreate");125 p_vout->p_sys_init = dlsym(p_vout->p_vout_plugin, "vout_SysInit");126 p_vout->p_sys_end = dlsym(p_vout->p_vout_plugin, "vout_SysEnd");127 p_vout->p_sys_destroy = dlsym(p_vout->p_vout_plugin, "vout_SysDestroy");128 p_vout->p_sys_manage = dlsym(p_vout->p_vout_plugin, "vout_SysManage");129 p_vout->p_sys_display = dlsym(p_vout->p_vout_plugin, "vout_SysDisplay");116 p_vout->p_sys_create = GetPluginFunction( p_vout->p_vout_plugin, "vout_SysCreate" ); 117 p_vout->p_sys_init = GetPluginFunction( p_vout->p_vout_plugin, "vout_SysInit" ); 118 p_vout->p_sys_end = GetPluginFunction( p_vout->p_vout_plugin, "vout_SysEnd" ); 119 p_vout->p_sys_destroy = GetPluginFunction( p_vout->p_vout_plugin, "vout_SysDestroy" ); 120 p_vout->p_sys_manage = GetPluginFunction( p_vout->p_vout_plugin, "vout_SysManage" ); 121 p_vout->p_sys_display = GetPluginFunction( p_vout->p_vout_plugin, "vout_SysDisplay" ); 130 122 131 123 /* Initialize thread properties - thread id and locks will be initialized … … 190 182 if( p_vout->p_sys_create( p_vout, psz_display, i_root_window ) ) 191 183 { 192 dlclose( p_vout->p_vout_plugin );184 TrashPlugin( p_vout->p_vout_plugin ); 193 185 free( p_vout ); 194 186 return( NULL ); … … 216 208 { 217 209 p_vout->p_sys_destroy( p_vout ); 218 dlclose( p_vout->p_vout_plugin );210 TrashPlugin( p_vout->p_vout_plugin ); 219 211 free( p_vout ); 220 212 return( NULL ); … … 225 217 vout_UnloadFont( p_vout->p_default_font ); 226 218 p_vout->p_sys_destroy( p_vout ); 227 dlclose( p_vout->p_vout_plugin );219 TrashPlugin( p_vout->p_vout_plugin ); 228 220 free( p_vout ); 229 221 return( NULL ); … … 241 233 vout_UnloadFont( p_vout->p_large_font ); 242 234 p_vout->p_sys_destroy( p_vout ); 243 dlclose( p_vout->p_vout_plugin );235 TrashPlugin( p_vout->p_vout_plugin ); 244 236 free( p_vout ); 245 237 return( NULL ); … … 1263 1255 1264 1256 /* Close plugin */ 1265 dlclose( p_vout->p_vout_plugin );1257 TrashPlugin( p_vout->p_vout_plugin ); 
