--- /dev/null
+
+ Régis Duchesne <regis@via.ecp.fr>
+ Michel Lespinasse <walken@wrs.com>
+
+ Olivier Baxa <oli@via.ecp.fr>
+ Eric Estievenart <eric@via.ecp.fr>
+
+ Jean-Philippe Grimaldi <jeanphi@via.ecp.fr>
+ Andres Krapf <dae@via.ecp.fr>
+ Christophe Massiot <massiot@via.ecp.fr>
+ Vincent Seguin <seguin@via.ecp.fr>
+ Benoit Steiner <benny@via.ecp.fr>
+
+ Jean-Marc Dressler <polux@via.ecp.fr>
+ Gaël Hendryckx <jimmy@via.ecp.fr>
+ Samuel Hocevar <sam@via.ecp.fr>
+ Michel Kaempf <maxx@via.ecp.fr>
+
+ Stéphane Borel <stef@via.ecp.fr>
+ Renaud Dartus <reno@via.ecp.fr>
+ Henri Fallon <henri@via.ecp.fr>
+
--- /dev/null
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+\f
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+\f
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+\f
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+\f
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+\f
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
CC=egcc
#CC=gcc295
SHELL=/bin/sh
+INSTALL=install
+PREFIX=/usr
# Audio output settings
AUDIO = dsp
#SYS=BEOS
# For x86 architecture, choose MMX support
-MMX=YES
-#MMX=NO
+ARCH += MMX
# For x86 architecture, optimize for Pentium Pro
# (choose NO if you get `Invalid instruction' errors)
-PPRO=YES
-#PPRO=NO
+ARCH += PPRO
# Decoder choice - ?? old decoder will be removed soon
#DECODER=old
# Configuration pre-processing
################################################################################
-# Program version - may only be changed by the project leader
+# Program version and codename - may only be changed by the project leader
PROGRAM_VERSION = 0.1.99
+PROGRAM_CODENAME = Onatopp
-# audio options
-audio := $(shell echo $(AUDIO) | tr 'A-Z' 'a-z')
-AUDIO := $(shell echo $(AUDIO) | tr 'a-z' 'A-Z')
-
-# video options
-video := $(shell echo $(VIDEO) | tr 'A-Z' 'a-z')
-VIDEO := $(shell echo $(VIDEO) | tr 'a-z' 'A-Z')
+# audio and video options
+AUDIO := $(shell echo $(AUDIO) | tr 'A-Z' 'a-z')
+VIDEO := $(shell echo $(VIDEO) | tr 'A-Z' 'a-z')
# PROGRAM_OPTIONS is an identification string of the compilation options
-PROGRAM_OPTIONS = $(ARCH) $(SYS)
+PROGRAM_OPTIONS = $(SYS) $(ARCH)
ifeq ($(DEBUG),1)
PROGRAM_OPTIONS += DEBUG
endif
# DEFINE will contain some of the constants definitions decided in Makefile,
# including ARCH_xx and SYS_xx. It will be passed to C compiler.
-DEFINE += -DARCH_$(ARCH)
+DEFINE += -DARCH_$(shell echo $(ARCH) | cut -f1 -d' ')
DEFINE += -DSYS_$(SYS)
-DEFINE += -DAUDIO_OPTIONS="\"$(audio)\""
-DEFINE += -DVIDEO_OPTIONS="\"$(video)\""
+DEFINE += -DPLUGIN_PATH="\"$(PREFIX)/lib/videolan/vlc\""
DEFINE += -DPROGRAM_VERSION="\"$(PROGRAM_VERSION)\""
-DEFINE += -DPROGRAM_OPTIONS="\"$(PROGRAM_OPTIONS)\""
+DEFINE += -DPROGRAM_CODENAME="\"$(PROGRAM_CODENAME)\""
+DEFINE += -DPROGRAM_OPTIONS="\"$(shell echo $(PROGRAM_OPTIONS) | tr 'A-Z' 'a-z')\""
DEFINE += -DPROGRAM_BUILD="\"$(PROGRAM_BUILD)\""
ifeq ($(DEBUG),1)
DEFINE += -DDEBUG
#
# Libraries
#
-LIB += -L/usr/local/lib
ifeq ($(SYS),GNU)
-LIB += -lthreads
-else
-LIB += -lpthread
+LIB += -lthreads -ldl
+endif
+
+ifeq ($(SYS),BSD)
+LIB += -pthread -lgnugetopt
+LIB += -L/usr/local/lib
endif
+
+ifeq ($(SYS),LINUX)
+LIB += -lpthread -ldl
+endif
+
LIB += -lm
-LIB += -ldl
#
# C compiler flags: compilation
CCFLAGS += -fomit-frame-pointer
# Optimizations for x86 familiy
-ifeq ($(ARCH),X86)
+ifneq (,$(findstring X86,$(ARCH)))
CCFLAGS += -malign-double
#CCFLAGS += -march=pentium
-ifeq ($(PPRO), YES)
+# Eventual Pentium Pro optimizations
+ifneq (,$(findstring PPRO,$(ARCH)))
ifneq ($(SYS), BSD)
CCFLAGS += -march=pentiumpro
endif
endif
# Eventual MMX optimizations for x86
-ifeq ($(MMX), YES)
+ifneq (,$(findstring MMX,$(ARCH)))
CFLAGS += -DHAVE_MMX
endif
endif
# Optimizations for PowerPC
-ifeq ($(ARCH),PPC)
+ifneq (,$(findstring PPC,$(ARCH)))
CCFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
endif
# Optimizations for Sparc
-ifeq ($(ARCH),SPARC)
+ifneq (,$(findstring SPARC,$(ARCH)))
CCFLAGS += -mhard-float
endif
misc_obj = misc/mtime.o \
misc/rsc_files.o \
misc/netutils.o \
+ misc/plugins.o \
misc/decoder_fifo.o
C_OBJ = $(interface_obj) \
#
# Assembler Objects
#
-ifeq ($(ARCH),X86)
-ifeq ($(MMX), YES)
+ifneq (,$(findstring X86,$(ARCH)))
+ifneq (,$(findstring MMX,$(ARCH)))
ifeq ($(DECODER),new)
ASM_OBJ = video_decoder/vdec_idctmmx.o \
video_output/video_yuv_mmx.o
#
# Plugins
#
-interface_plugin = $(video:%=interface/intf_%.so)
-audio_plugin = $(audio:%=audio_output/aout_%.so)
-video_plugin = $(video:%=video_output/vout_%.so)
+interface_plugin = $(VIDEO:%=interface/intf_%.so)
+audio_plugin = $(AUDIO:%=audio_output/aout_%.so)
+video_plugin = $(VIDEO:%=video_output/vout_%.so)
PLUGIN_OBJ = $(interface_plugin) $(audio_plugin) $(video_plugin)
# Other lists of files
#
sources := $(C_OBJ:%.o=%.c) $(PLUGIN_OBJ:%.so=%.c)
-dependancies := $(sources:%.c=dep/%.d)
+dependancies := $(sources:%.c=.dep/%.d)
# All symbols must be exported
export
distclean: clean
rm -f **/*.o **/*.so **/*~ *.log
rm -f vlc gmon.out core
- rm -rf dep
+ rm -rf .dep
+
+install:
+ $(INSTALL) vlc $(PREFIX)/bin
+ mkdir -p $(PREFIX)/lib/videolan/vlc
+ $(INSTALL) $(PLUGIN_OBJ) $(PREFIX)/lib/videolan/vlc
show:
@echo "Command line for C objects:"
@$(MAKE) -s --no-print-directory -f Makefile.dep $@
$(C_OBJ): %.o: Makefile.dep
-$(C_OBJ): %.o: dep/%.d
+$(C_OBJ): %.o: .dep/%.d
$(C_OBJ): %.o: %.c
@echo "compiling $*.o from $*.c"
@$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
@$(CC) $(CFLAGS) -c -o $@ $<
$(PLUGIN_OBJ): %.so: Makefile.dep
-$(PLUGIN_OBJ): %.so: dep/%.d
+$(PLUGIN_OBJ): %.so: .dep/%.d
# audio plugins
audio_output/aout_dummy.so audio_output/aout_dsp.so: %.so: %.c
audio_output/aout_esd.so: %.so: %.c
@echo "compiling $*.so from $*.c"
+ifeq ($(SYS), BSD)
+ @$(CC) $(CCFLAGS) $(CFLAGS) -lesd -shared -o $@ $<
+else
@$(CC) $(CCFLAGS) $(CFLAGS) -laudiofile -lesd -shared -o $@ $<
+endif
# video plugins
interface/intf_dummy.so video_output/vout_dummy.so \
################################################################################
# Note on dependancies: each .c file is associated with a .d file, which
-# depends of it. The .o file associated with a .c file depends of the .d, of the
-# .c itself, and of Makefile. The .d files are stored in a separate dep/
+# depends of it. The .o file associated with a .c file depends of the .d, of the
+# .c itself, and of Makefile. The .d files are stored in a separate .dep/
# directory.
# The dep directory should be ignored by CVS.
-# Note on inclusions: depending of the target, the dependancies files must
+# Note on inclusions: depending of the target, the dependancies files must
# or must not be included. The problem is that if we ask make to include a file,
-# and this file does not exist, it is made before it can be included. In a
-# general way, a .d file should be included if and only if the corresponding .o
+# and this file does not exist, it is made before it can be included. In a
+# general way, a .d file should be included if and only if the corresponding .o
# needs to be re-made.
# Two makefiles are used: the main one (this one) has regular generic rules,
# .c and from itself.
-include $(MAKECMDGOALS)
-$(dependancies): dep/%.d: %.c
- @test -d dep/$(dir $*) || mkdir -p dep/$(dir $*)
+$(dependancies): .dep/%.d: %.c
+ @test -d .dep/$(dir $*) || mkdir -p .dep/$(dir $*)
@echo "generating dependancies for $*.c"
@$(SHELL) -ec '$(CC) $(DCFLAGS) $(CFLAGS) $< \
| sed '\''s/$(subst .,\.,$(notdir $*))\.o[ :]*/$(subst /,\/,$*).o \
- dep\/$(subst /,\/,$*).d : /g'\'' > $@; \
+ .dep\/$(subst /,\/,$*).d : /g'\'' > $@; \
[ -s $@ ] || rm -f $@'
--- /dev/null
+
+ README for vlc, the VideoLAN Client
+
+
+
+... Introduction
+
+[ nothing appropriate yet ]
+
+
+
+... Running VideoLAN
+
+[ nothing appropriate yet ]
+
+
+
+... Troubleshooting
+
+[ nothing appropriate yet ]
+
+
+
+... Resources
+
+[ nothing appropriate yet ]
+
+
+
+... The team
+
+The following teachers were involved in the VideoLAN project :
+
+ Pierre Lecoy, teacher-cum-researcher at ECP,
+ Philippe Boutin, head of the LMI (MicroComputing Laboratory).
+
+The following students were members of the VideoLAN team :
+
+ Pierre Almeras <almeras@via.ecp.fr>
+ Christophe Arnaud <christophe.arnaud@tps.fr>
+ Antoine Brenner <brenner@via.ecp.fr>
+ Régis Duchesne <regis@via.ecp.fr>
+ Alexandre Francois <francois@via.ecp.fr>
+ Hugo Haas <hugo@via.ecp.fr>
+ Mikael Journo <mj32@cornell.edu>
+ Michel Lespinasse <walken@wrs.com>
+ Christophe Ulses <mowgli@laotseu.via.ecp.fr>
+ Pierre Vandecasteele <pabv2@hermes.cam.ac.uk>
+ Guillaume Vergnaud <vergnaud@via.ecp.fr>
+
+ Olivier Baxa <oli@via.ecp.fr>
+ Patrice Bazerque <patrice.bazerque@via.ecp.fr>
+ Etienne Bernard <eb@via.ecp.fr>
+ Arnaud Bienvenu <arnaud.bienvenu@via.ecp.fr>
+ Régis Clément <clement@via.ecp.fr>
+ Alexandre Duret <alex@via.ecp.fr>
+ Eric Estievenart <eric@via.ecp.fr>
+ Sébastien Kurz <seb@tao.via.ecp.fr>
+ Olivier Pomel <pomel@via.ecp.fr>
+
+ Pierre Baillet <octplane@via.ecp.fr>
+ Alban Fonrouge <alban@via.ecp.fr>
+ Jean-Philippe Grimaldi <jeanphi@via.ecp.fr>
+ Andres Krapf <dae@via.ecp.fr>
+ Christophe Massiot <massiot@via.ecp.fr>
+ Mathieu Poumeyrol <kaliban@via.ecp.fr>
+ Etienne Roy <etienne@via.ecp.fr>
+ Vincent Seguin <seguin@via.ecp.fr>
+ Benoit Steiner <benny@via.ecp.fr>
+
+ Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
+ Jean-Marc Dressler <polux@via.ecp.fr>
+ Gaël Hendryckx <jimmy@via.ecp.fr>
+ Samuel Hocevar <sam@via.ecp.fr>
+ Brieuc Jeunhomme <bbp@via.ecp.fr>
+ Michel Kaempf <maxx@via.ecp.fr>
+ Florent Rougon <flo@via.ecp.fr>
+
+ Stéphane Borel <stef@via.ecp.fr>
+ Renaud Dartus <reno@via.ecp.fr>
+ Henri Fallon <henri@via.ecp.fr>
+ Jean-Michel Grimaldi <jm@via.ecp.fr>
+ Damien Lucas <nitrox@via.ecp.fr>
+ Rémi Peyronnet <remi@via.ecp.fr>
+ Laurent Rossier <gunther@via.ecp.fr>
+
/*****************************************************************************
* Required headers:
- * - <sys/soundcard.h> ( audio_buf_info )
* - "common.h" ( boolean_t )
* - "mtime.h" ( mtime_t )
* - "threads.h" ( vlc_thread_t )
*****************************************************************************/
/* Program version and copyright message */
-#define COPYRIGHT_MESSAGE "VideoLAN Client v" PROGRAM_VERSION " - (c)1999-2000 VideoLAN"
-#define VERSION_MESSAGE "VideoLAN Client - (c)1999-2000 VideoLAN\n" \
- "version " PROGRAM_VERSION " ( " PROGRAM_BUILD " )\n" \
- "compilation options: " PROGRAM_OPTIONS
+#define COPYRIGHT_MESSAGE "VideoLAN Client - version " PROGRAM_VERSION \
+ " " PROGRAM_CODENAME " - (c)1996-2000 VideoLAN"
/*****************************************************************************
* General compilation options
#ifdef INPUT_LIFO_TS_NETLIST
p_input->netlist.i_ts_index--;
p_input->netlist.p_ts_free[p_input->netlist.i_ts_index].iov_base
- = p_ts_packet;
+ = (void *)p_ts_packet;
#else /* FIFO */
p_input->netlist.p_ts_free[p_input->netlist.i_ts_end].iov_base
- = p_ts_packet;
+ = (void *)p_ts_packet;
p_input->netlist.i_ts_end++;
p_input->netlist.i_ts_end &= INPUT_MAX_TS; /* loop */
#endif
/* Free the TS structure. */
#ifdef INPUT_LIFO_TS_NETLIST
p_input->netlist.i_ts_index--;
- p_input->netlist.p_ts_free[p_input->netlist.i_ts_index].iov_base = p_ts_packet;
+ p_input->netlist.p_ts_free[p_input->netlist.i_ts_index].iov_base
+ = (void *)p_ts_packet;
#else /* FIFO */
- p_input->netlist.p_ts_free[p_input->netlist.i_ts_end].iov_base = p_ts_packet;
+ p_input->netlist.p_ts_free[p_input->netlist.i_ts_end].iov_base
+ = (void *)p_ts_packet;
p_input->netlist.i_ts_end++;
p_input->netlist.i_ts_end &= INPUT_MAX_TS; /* loop */
#endif
--- /dev/null
+/*****************************************************************************
+ * plugins.h : Dynamic plugin management functions
+ *****************************************************************************
+ * Copyright (C) 1999, 2000 VideoLAN
+ *
+ * Authors:
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *****************************************************************************/
+
+void * RequestPlugin ( char * psz_mask, char * psz_name );
+void TrashPlugin ( void * p_plugin );
+void * GetPluginFunction ( void *plugin, char *name );
+
#include <stdio.h> /* "intf_msg.h" */
#include <stdlib.h> /* calloc(), malloc(), free() */
-#include <dlfcn.h> /* plugins */
-
#include "common.h"
#include "config.h"
#include "mtime.h" /* mtime_t, mdate(), msleep() */
#include "threads.h"
+#include "plugins.h"
#include "intf_msg.h" /* intf_DbgMsg(), intf_ErrMsg() */
{
aout_thread_t * p_aout; /* thread descriptor */
char * psz_method;
- char * psz_plugin;
#if 0
int i_status; /* thread status */
#endif
return( NULL );
}
- /* Initialize method-dependent functions */
+ /* Request an interface plugin */
psz_method = main_GetPszVariable( AOUT_METHOD_VAR, AOUT_DEFAULT_METHOD );
+ p_aout->p_aout_plugin = RequestPlugin( "aout", psz_method );
- psz_plugin = malloc( sizeof("./audio_output/aout_.so") + strlen(psz_method) );
- sprintf( psz_plugin, "./audio_output/aout_%s.so", psz_method );
-
- p_aout->p_aout_plugin = dlopen( psz_plugin, RTLD_NOW | RTLD_GLOBAL );
-
- if( p_aout->p_aout_plugin == NULL )
+ if( !p_aout->p_aout_plugin )
{
- intf_ErrMsg( "error: could not open audio plugin %s\n", psz_plugin );
- free( psz_plugin );
+ intf_ErrMsg( "error: could not open audio plugin aout_%s.so\n", psz_method );
free( p_aout );
return( NULL );
}
- free( psz_plugin );
/* Get plugins */
- p_aout->p_sys_open = dlsym(p_aout->p_aout_plugin, "aout_SysOpen");
- p_aout->p_sys_reset = dlsym(p_aout->p_aout_plugin, "aout_SysReset");
- p_aout->p_sys_setformat = dlsym(p_aout->p_aout_plugin, "aout_SysSetFormat");
- p_aout->p_sys_setchannels = dlsym(p_aout->p_aout_plugin, "aout_SysSetChannels");
- p_aout->p_sys_setrate = dlsym(p_aout->p_aout_plugin, "aout_SysSetRate");
- p_aout->p_sys_getbufinfo = dlsym(p_aout->p_aout_plugin, "aout_SysGetBufInfo");
- p_aout->p_sys_playsamples = dlsym(p_aout->p_aout_plugin, "aout_SysPlaySamples");
- p_aout->p_sys_close = dlsym(p_aout->p_aout_plugin, "aout_SysClose");
+ p_aout->p_sys_open = GetPluginFunction( p_aout->p_aout_plugin, "aout_SysOpen" );
+ p_aout->p_sys_reset = GetPluginFunction( p_aout->p_aout_plugin, "aout_SysReset" );
+ p_aout->p_sys_setformat = GetPluginFunction( p_aout->p_aout_plugin, "aout_SysSetFormat" );
+ p_aout->p_sys_setchannels = GetPluginFunction( p_aout->p_aout_plugin, "aout_SysSetChannels" );
+ p_aout->p_sys_setrate = GetPluginFunction( p_aout->p_aout_plugin, "aout_SysSetRate" );
+ p_aout->p_sys_getbufinfo = GetPluginFunction( p_aout->p_aout_plugin, "aout_SysGetBufInfo" );
+ p_aout->p_sys_playsamples = GetPluginFunction( p_aout->p_aout_plugin, "aout_SysPlaySamples" );
+ p_aout->p_sys_close = GetPluginFunction( p_aout->p_aout_plugin, "aout_SysClose" );
/*
* Initialize audio device
*/
if ( p_aout->p_sys_open( p_aout ) )
{
- dlclose( p_aout->p_aout_plugin );
+ TrashPlugin( p_aout->p_aout_plugin );
free( p_aout );
return( NULL );
}
if ( p_aout->p_sys_reset( p_aout ) )
{
p_aout->p_sys_close( p_aout );
- dlclose( p_aout->p_aout_plugin );
+ TrashPlugin( p_aout->p_aout_plugin );
free( p_aout );
return( NULL );
}
if ( p_aout->p_sys_setformat( p_aout ) )
{
p_aout->p_sys_close( p_aout );
- dlclose( p_aout->p_aout_plugin );
+ TrashPlugin( p_aout->p_aout_plugin );
free( p_aout );
return( NULL );
}
if ( p_aout->p_sys_setchannels( p_aout ) )
{
p_aout->p_sys_close( p_aout );
- dlclose( p_aout->p_aout_plugin );
+ TrashPlugin( p_aout->p_aout_plugin );
free( p_aout );
return( NULL );
}
if ( p_aout->p_sys_setrate( p_aout ) )
{
p_aout->p_sys_close( p_aout );
- dlclose( p_aout->p_aout_plugin );
+ TrashPlugin( p_aout->p_aout_plugin );
free( p_aout );
return( NULL );
}
if( aout_SpawnThread( p_aout ) )
{
p_aout->p_sys_close( p_aout );
- dlclose( p_aout->p_aout_plugin );
+ TrashPlugin( p_aout->p_aout_plugin );
free( p_aout );
return( NULL );
}
intf_DbgMsg("aout debug: audio device (%s) closed\n", p_aout->psz_device);
/* Close plugin */
- dlclose( p_aout->p_aout_plugin );
+ TrashPlugin( p_aout->p_aout_plugin );
/* Free structure */
free( p_aout );
for( i_packets = 0; i_packets < INPUT_MAX_TS + 1; i_packets++ )
{
p_input->netlist.p_ts_free[i_base + i_packets].iov_base
- = (p_input->netlist.p_ts_packets + i_packets);
+ = (void *)(p_input->netlist.p_ts_packets + i_packets);
/* Initialize TS length. */
(p_input->netlist.p_ts_packets[i_packets]).i_payload_end = TS_PACKET_SIZE;
}
&i_socket_option,
sizeof( i_socket_option ) ) == (-1) )
{
- intf_ErrMsg("error: can't configure socket (%s)\n", strerror(errno));
+ intf_ErrMsg("error: can't configure socket (SO_REUSEADDR: %s)\n", strerror(errno));
close( p_input->i_handle );
return( 1 );
}
&i_socket_option,
sizeof( i_socket_option ) ) == (-1) )
{
- intf_ErrMsg("error: can't configure socket (%s)\n", strerror(errno));
+ intf_ErrMsg("error: can't configure socket (SO_RCVBUF: %s)\n", strerror(errno));
close( p_input->i_handle );
return( 1 );
}
* Preamble
*****************************************************************************/
#include <errno.h> /* ENOMEM */
-#include <stdio.h> /* sprintf() */
#include <stdlib.h> /* free(), strtol() */
+#include <stdio.h> /* FILE */
#include <string.h> /* strerror() */
#include <sys/types.h> /* on BSD, uio.h needs types.h */
#include <sys/uio.h> /* for input.h */
-#include <dlfcn.h> /* plugins */
-
#include "config.h"
#include "common.h"
#include "mtime.h"
#include "threads.h"
+#include "plugins.h"
#include "input.h"
#include "intf_msg.h"
{
intf_thread_t *p_intf;
char * psz_method;
- char * psz_plugin;
/* Allocate structure */
p_intf = malloc( sizeof( intf_thread_t ) );
return( NULL );
}
- /* Initialize method-dependent functions */
+ /* Request an interface plugin */
psz_method = main_GetPszVariable( VOUT_METHOD_VAR, VOUT_DEFAULT_METHOD );
+ p_intf->p_intf_plugin = RequestPlugin( "intf", psz_method );
- psz_plugin = malloc( sizeof("./interface/intf_.so") + strlen(psz_method) );
- sprintf( psz_plugin, "./interface/intf_%s.so", psz_method );
-
- p_intf->p_intf_plugin = dlopen( psz_plugin, RTLD_NOW | RTLD_GLOBAL );
-
- if( p_intf->p_intf_plugin == NULL )
+ if( !p_intf->p_intf_plugin )
{
- intf_ErrMsg( "error: could not open interface plugin %s\n", psz_plugin );
- free( psz_plugin );
+ intf_ErrMsg( "error: could not open interface plugin intf_%s.so\n", psz_method );
free( p_intf );
return( NULL );
}
- free( psz_plugin );
/* Get plugins */
- p_intf->p_sys_create = dlsym(p_intf->p_intf_plugin, "intf_SysCreate");
- p_intf->p_sys_manage = dlsym(p_intf->p_intf_plugin, "intf_SysManage");
- p_intf->p_sys_destroy = dlsym(p_intf->p_intf_plugin, "intf_SysDestroy");
+ p_intf->p_sys_create = GetPluginFunction( p_intf->p_intf_plugin, "intf_SysCreate" );
+ p_intf->p_sys_manage = GetPluginFunction( p_intf->p_intf_plugin, "intf_SysManage" );
+ p_intf->p_sys_destroy = GetPluginFunction( p_intf->p_intf_plugin, "intf_SysDestroy" );
/* Initialize structure */
p_intf->b_die = 0;
if( p_intf->p_console == NULL )
{
intf_ErrMsg("error: can't create control console\n");
- dlclose( p_intf->p_intf_plugin );
+ TrashPlugin( p_intf->p_intf_plugin );
free( p_intf );
return( NULL );
}
{
intf_ErrMsg("error: can't create interface\n");
intf_ConsoleDestroy( p_intf->p_console );
- dlclose( p_intf->p_intf_plugin );
+ TrashPlugin( p_intf->p_intf_plugin );
free( p_intf );
return( NULL );
}
UnloadChannels( p_intf );
/* Close plugin */
- dlclose( p_intf->p_intf_plugin );
+ TrashPlugin( p_intf->p_intf_plugin );
/* Free structure */
free( p_intf );
#define OPT_PORT 172
/* Usage fashion */
-#define SHORT_HELP 0
-#define LONG_HELP 1
+#define USAGE 0
+#define SHORT_HELP 1
+#define LONG_HELP 2
/* Long options */
static const struct option longopts[] =
p_main->p_msg = intf_MsgCreate();
if( !p_main->p_msg ) /* start messages interface */
{
- fprintf(stderr, "critical error: can't initialize messages interface (%s)\n",
- strerror(errno));
- return(errno);
+ fprintf( stderr, "critical error: can't initialize messages interface (%s)\n",
+ strerror(errno) );
+ return( errno );
}
if( GetConfiguration( i_argc, ppsz_argv, ppsz_env ) ) /* parse cmd line */
{
intf_MsgDestroy();
- return(errno);
+ return( errno );
}
intf_MsgImm( COPYRIGHT_MESSAGE "\n" ); /* print welcome message */
if( main_data.b_vlans && input_VlanCreate() )
{
/* On error during vlans initialization, switch of vlans */
- intf_Msg("Virtual LANs initialization failed : vlans management is deactivated\n");
+ intf_Msg( "Virtual LANs initialization failed : vlans management is deactivated\n" );
main_data.b_vlans = 0;
}
if( main_data.p_aout == NULL )
{
/* On error during audio initialization, switch of audio */
- intf_Msg("Audio initialization failed : audio is deactivated\n");
+ intf_Msg( "Audio initialization failed : audio is deactivated\n" );
main_data.b_audio = 0;
}
}
psz_env = malloc( strlen(psz_name) + strlen(psz_value) + 2 );
if( psz_env == NULL )
{
- intf_ErrMsg("error: %s\n", strerror(ENOMEM));
+ intf_ErrMsg( "error: %s\n", strerror(ENOMEM) );
}
else
{
sprintf( psz_env, "%s=%s", psz_name, psz_value );
if( putenv( psz_env ) )
{
- intf_ErrMsg("error: %s\n", strerror(errno));
+ intf_ErrMsg( "error: %s\n", strerror(errno) );
}
}
}
{
char psz_value[ 256 ]; /* buffer for value */
- sprintf(psz_value, "%d", i_value );
+ sprintf( psz_value, "%d", i_value );
main_PutPszVariable( psz_name, psz_value );
}
/* Internal error: unknown option */
case '?':
default:
- intf_ErrMsg("intf error: unknown option '%s'\n", ppsz_argv[optind - 1]);
+ intf_ErrMsg( "intf error: unknown option `%s'\n", ppsz_argv[optind - 1] );
+ Usage( USAGE );
return( EINVAL );
break;
}
*****************************************************************************/
static void Usage( int i_fashion )
{
- intf_Msg(COPYRIGHT_MESSAGE "\n");
-
/* Usage */
- intf_Msg("usage: vlc [options...] [parameters]\n" );
+ intf_Msg( "Usage: vlc [options] [parameters]\n" );
+
+ if( i_fashion == USAGE )
+ {
+ intf_Msg( "Try `vlc --help' for more information.\n" );
+ return;
+ }
+
+ intf_MsgImm( COPYRIGHT_MESSAGE "\n" );
/* Options */
- intf_Msg("Options:\n" \
- " -h, --help, -H, --longhelp \tprint short/long usage\n" \
- " -v, --version \tprint version information\n"\
- " --noaudio, --novideo \tdisable audio/video\n" \
- " --aout {" AUDIO_OPTIONS "} \taudio output method\n"\
- " --stereo, --mono \tstereo/mono audio\n" \
- " --vout {" VIDEO_OPTIONS "} \tvideo output method\n"\
- " --display <display> \tdisplay string\n" \
- " --width <w>, --height <h> \tdisplay dimensions\n" \
- " -g, --grayscale, --color \tgrayscale/color video\n" \
- " --novlans \tdisable vlans\n" \
- " --server <host>, --port <port> \tvideo server adress\n" \
- );
+ intf_Msg( "\n"
+ "Options:\n"
+ " --noaudio \tdisable audio\n"
+ " --aout <plugin> \taudio output method\n"
+ " --stereo, --mono \tstereo/mono audio\n"
+ "\n"
+ " --novideo \tdisable audio\n"
+ " --vout <plugin> \tvideo output method\n"
+ " --display <display> \tdisplay string\n"
+ " --width <w>, --height <h> \tdisplay dimensions\n"
+ " -g, --grayscale \tgrayscale output\n"
+ " --color \tcolor output\n"
+ "\n"
+ " --novlans \tdisable vlans\n"
+ " --server <host> \tvideo server address\n"
+ " --port <port> \tvideo server port\n"
+ "\n"
+ " -h, --help \tprint help and exit\n"
+ " -H, --longhelp \tprint long help and exit\n"
+ " -v, --version \toutput version information and exit\n" );
if( i_fashion == SHORT_HELP )
return;
/* Interface parameters */
- intf_Msg("Interface parameters:\n" \
- " " INTF_INIT_SCRIPT_VAR "=<filename> \tinitialization script\n" \
- " " INTF_CHANNELS_VAR "=<filename> \tchannels list\n"\
- );
+ intf_Msg( "\n"
+ "Interface parameters:\n"
+ " " INTF_INIT_SCRIPT_VAR "=<filename> \tinitialization script\n"
+ " " INTF_CHANNELS_VAR "=<filename> \tchannels list\n" );
/* Audio parameters */
- intf_Msg("Audio parameters:\n" \
- " " AOUT_METHOD_VAR "=<method name> \taudio method (" AUDIO_OPTIONS ")\n" \
- " " AOUT_DSP_VAR "=<filename> \tdsp device path\n" \
- " " AOUT_STEREO_VAR "={1|0} \tstereo or mono output\n" \
- " " AOUT_RATE_VAR "=<rate> \toutput rate\n" \
- );
+ intf_Msg( "\n"
+ "Audio parameters:\n"
+ " " AOUT_METHOD_VAR "=<method name> \taudio method\n"
+ " " AOUT_DSP_VAR "=<filename> \tdsp device path\n"
+ " " AOUT_STEREO_VAR "={1|0} \tstereo or mono output\n"
+ " " AOUT_RATE_VAR "=<rate> \toutput rate\n" );
/* Video parameters */
- intf_Msg("Video parameters:\n" \
- " " VOUT_METHOD_VAR "=<method name> \tdisplay method (" VIDEO_OPTIONS ")\n" \
- " " VOUT_DISPLAY_VAR "=<display name> \tdisplay used\n" \
- " " VOUT_WIDTH_VAR "=<width> \tdisplay width\n" \
- " " VOUT_HEIGHT_VAR "=<height> \tdislay height\n" \
- " " VOUT_FB_DEV_VAR "=<filename> \tframebuffer device path\n" \
- " " VOUT_GRAYSCALE_VAR "={1|0} \tgrayscale or color output\n" \
- );
+ intf_Msg( "\n"
+ "Video parameters:\n"
+ " " VOUT_METHOD_VAR "=<method name> \tdisplay method\n"
+ " " VOUT_DISPLAY_VAR "=<display name> \tdisplay used\n"
+ " " VOUT_WIDTH_VAR "=<width> \tdisplay width\n"
+ " " VOUT_HEIGHT_VAR "=<height> \tdislay height\n"
+ " " VOUT_FB_DEV_VAR "=<filename> \tframebuffer device path\n"
+ " " VOUT_GRAYSCALE_VAR "={1|0} \tgrayscale or color output\n" );
/* Input parameters */
- intf_Msg("Input parameters:\n" \
- " " INPUT_SERVER_VAR "=<hostname> \tvideo server\n" \
- " " INPUT_PORT_VAR "=<port> \tvideo server port\n" \
- " " INPUT_IFACE_VAR "=<interface> \tnetwork interface\n"\
- " " INPUT_VLAN_SERVER_VAR "=<hostname> \tvlan server\n" \
- " " INPUT_VLAN_PORT_VAR "=<port> \tvlan server port\n"\
- );
+ intf_Msg( "\n"
+ "Input parameters:\n"
+ " " INPUT_SERVER_VAR "=<hostname> \tvideo server\n"
+ " " INPUT_PORT_VAR "=<port> \tvideo server port\n"
+ " " INPUT_IFACE_VAR "=<interface> \tnetwork interface\n"
+ " " INPUT_VLAN_SERVER_VAR "=<hostname> \tvlan server\n"
+ " " INPUT_VLAN_PORT_VAR "=<port> \tvlan server port\n" );
}
/*****************************************************************************
*****************************************************************************/
static void Version( void )
{
- intf_Msg(VERSION_MESSAGE "\n\n");
- intf_Msg("This is free software; see the documentation or contact <videolan@via.ecp.fr>\n" \
- "for use and copying conditions.\n" \
- "\n" \
- "This software is protected by the international copyright laws, and is\n" \
- "provided without any warranty, including the implied warranties of\n" \
- "merchantibility and fitness for a particular purpose.\n" \
- );
+ intf_Msg( "vlc " PROGRAM_VERSION " " PROGRAM_CODENAME
+ " (" PROGRAM_BUILD ") (" PROGRAM_OPTIONS ")\n"
+ "Copyright 1996-2000 VideoLAN\n"
+ "This program comes with NO WARRANTY, to the extent permitted by law.\n"
+ "You may redistribute it under the terms of the GNU General Public License;\n"
+ "see the file named COPYING for details.\n"
+ "Written by the VideoLAN team at Ecole Centrale, Paris.\n" );
+
}
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <stdio.h> /* sprintf() */
+#include <unistd.h> /* select() */
#include <sys/time.h>
#include "common.h"
--- /dev/null
+/*****************************************************************************
+ * plugins.c : Dynamic plugin management functions
+ *****************************************************************************
+ * Copyright (C) 1999, 2000 VideoLAN
+ *
+ * Authors:
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *****************************************************************************/
+
+#include <stdlib.h> /* free(), strtol() */
+#include <stdio.h> /* sprintf() */
+#include <dlfcn.h> /* dlopen(), dlsym(), dlclose() */
+
+#define PLUGIN_PATH_COUNT 5
+
+void * RequestPlugin ( char * psz_mask, char * psz_name )
+{
+ int i_count, i_length;
+ void * fd;
+ char * psz_plugin;
+ char * psz_plugin_path[ PLUGIN_PATH_COUNT ] =
+ {
+ ".",
+ PLUGIN_PATH,
+ /* these ones should disappear */
+ "./audio_output",
+ "./video_output",
+ "./interface"
+ };
+
+ i_length = strlen( psz_mask ) + strlen( psz_name );
+
+ for ( i_count = 0 ; i_count < PLUGIN_PATH_COUNT ; i_count++ )
+ {
+ psz_plugin = malloc( strlen(psz_plugin_path[i_count]) + i_length + 6 );
+ sprintf( psz_plugin, "%s/%s_%s.so", psz_plugin_path[i_count], psz_mask, psz_name );
+ fd = dlopen( psz_plugin, RTLD_NOW | RTLD_GLOBAL );
+ free( psz_plugin );
+
+ if( fd != NULL )
+ return( fd );
+ }
+
+ return( 0 );
+}
+
+void TrashPlugin ( void * p_plugin )
+{
+ dlclose( p_plugin );
+}
+
+void *GetPluginFunction ( void *p_plugin, char *psz_name )
+{
+ return( dlsym(p_plugin, psz_name) );
+}
+
#include <stdio.h> /* sprintf() */
#include <string.h> /* strerror() */
-#include <dlfcn.h> /* plugins */
-
#include "common.h"
#include "config.h"
#include "mtime.h"
#include "threads.h"
+#include "plugins.h"
#include "video.h"
#include "video_output.h"
#include "video_text.h"
int i_status; /* thread status */
int i_index; /* index for array initialization */
char * psz_method;
- char * psz_plugin;
/* Allocate descriptor */
intf_DbgMsg("\n");
return( NULL );
}
- /* Initialize method-dependent functions */
+ /* Request an interface plugin */
psz_method = main_GetPszVariable( VOUT_METHOD_VAR, VOUT_DEFAULT_METHOD );
+ p_vout->p_vout_plugin = RequestPlugin( "vout", psz_method );
- psz_plugin = malloc( sizeof("./video_output/vout_.so") + strlen(psz_method) );
- sprintf( psz_plugin, "./video_output/vout_%s.so", psz_method );
-
- p_vout->p_vout_plugin = dlopen( psz_plugin, RTLD_NOW | RTLD_GLOBAL );
-
- if( p_vout->p_vout_plugin == NULL )
+ if( !p_vout->p_vout_plugin )
{
- intf_ErrMsg( "error: could not open video plugin %s\n", psz_plugin );
- free( psz_plugin );
+ intf_ErrMsg( "error: could not open video plugin vout_%s.so\n", psz_method );
free( p_vout );
return( NULL );
}
- free( psz_plugin );
/* Get plugins */
- p_vout->p_sys_create = dlsym(p_vout->p_vout_plugin, "vout_SysCreate");
- p_vout->p_sys_init = dlsym(p_vout->p_vout_plugin, "vout_SysInit");
- p_vout->p_sys_end = dlsym(p_vout->p_vout_plugin, "vout_SysEnd");
- p_vout->p_sys_destroy = dlsym(p_vout->p_vout_plugin, "vout_SysDestroy");
- p_vout->p_sys_manage = dlsym(p_vout->p_vout_plugin, "vout_SysManage");
- p_vout->p_sys_display = dlsym(p_vout->p_vout_plugin, "vout_SysDisplay");
+ p_vout->p_sys_create = GetPluginFunction( p_vout->p_vout_plugin, "vout_SysCreate" );
+ p_vout->p_sys_init = GetPluginFunction( p_vout->p_vout_plugin, "vout_SysInit" );
+ p_vout->p_sys_end = GetPluginFunction( p_vout->p_vout_plugin, "vout_SysEnd" );
+ p_vout->p_sys_destroy = GetPluginFunction( p_vout->p_vout_plugin, "vout_SysDestroy" );
+ p_vout->p_sys_manage = GetPluginFunction( p_vout->p_vout_plugin, "vout_SysManage" );
+ p_vout->p_sys_display = GetPluginFunction( p_vout->p_vout_plugin, "vout_SysDisplay" );
/* Initialize thread properties - thread id and locks will be initialized
* later */
* own error messages */
if( p_vout->p_sys_create( p_vout, psz_display, i_root_window ) )
{
- dlclose( p_vout->p_vout_plugin );
+ TrashPlugin( p_vout->p_vout_plugin );
free( p_vout );
return( NULL );
}
if( p_vout->p_default_font == NULL )
{
p_vout->p_sys_destroy( p_vout );
- dlclose( p_vout->p_vout_plugin );
+ TrashPlugin( p_vout->p_vout_plugin );
free( p_vout );
return( NULL );
}
{
vout_UnloadFont( p_vout->p_default_font );
p_vout->p_sys_destroy( p_vout );
- dlclose( p_vout->p_vout_plugin );
+ TrashPlugin( p_vout->p_vout_plugin );
free( p_vout );
return( NULL );
}
vout_UnloadFont( p_vout->p_default_font );
vout_UnloadFont( p_vout->p_large_font );
p_vout->p_sys_destroy( p_vout );
- dlclose( p_vout->p_vout_plugin );
+ TrashPlugin( p_vout->p_vout_plugin );
free( p_vout );
return( NULL );
}
p_vout->p_sys_destroy( p_vout );
/* Close plugin */
- dlclose( p_vout->p_vout_plugin );
+ TrashPlugin( p_vout->p_vout_plugin );
/* Free structure */
free( p_vout );