Builtins are now working.

Default builtins: filechannel netchannel filereader ts2ts ps2ts localinput
Default plugins: dvdreader (if libdvdread present)
parent 64aa76dd
......@@ -2,7 +2,7 @@
# vls (VideoLAN Server) main Makefile
#-------------------------------------------------------------------------------
# (c)1999-2001 VideoLAN
# $Id: Makefile,v 1.75 2001/11/29 11:58:39 bozo Exp $
# $Id: Makefile,v 1.76 2001/11/29 16:11:42 bozo Exp $
################################################################################
......@@ -58,14 +58,23 @@ SERVERSRC= src/server/admin.cpp \
src/server/program.cpp \
src/server/telnet.cpp \
src/server/nativeadmin.cpp \
src/server/vls.cpp \
src/server/tsstreamer.cpp \
src/server/vls.cpp \
#
# Module libraries
#
MODULE_LIST:= dvdreader filechannel filereader local netchannel ps2ts ts2ts
MODULE_LIST:= dvdreader \
filechannel \
filereader \
localinput \
netchannel \
ps2ts \
ts2ts \
BUILTINSTARGETS:=$(BUILTINS:%:bin/%.a)
PLUGINSTARGETS:=$(PLUGINS:%:bin/%.so)
#
......@@ -130,6 +139,7 @@ distclean: clean
rm -f bin/vls
rm -f config*status config*cache config*log
rm -f Makefile.opts src/core/defs.h src/server/config.h
rm -f src/server/vls_builtins.cpp
rm -Rf dep
rm -Rf *.log *.dbg
for module in $(MODULE_LIST) ; do \
......@@ -153,16 +163,37 @@ uninstall:
dep: Makefile.opts $(DEP)
vls: Makefile.opts $(OBJ)
vls: Makefile.opts $(OBJ) $(BUILTINS)
@echo "Linking $@..."
@test -d bin || mkdir -p bin
$(CXX) $(LCFLAGS) -o bin/$@ $(OBJ) $(VLS_LIB)
$(CXX) $(LCFLAGS) -o bin/$@ $(OBJ) $(BUILTINS:%=obj/%.a) $(VLS_LIB)
chmod 755 bin/$@
dep/server/vls.d: src/server/vls_builtins.cpp
src/server/vls_builtins.cpp: Makefile.opts
rm -f $@
for builtin in $(BUILTINS) ; do \
echo "extern C_Module* NewBuiltin_"$$builtin"(handle hLog);" >> $@ ; \
done
echo "" >> $@
echo "void C_Vls::LoadBuiltins()" >> $@
echo "{" >> $@
for builtin in $(BUILTINS) ; do \
echo " C_Module* pModule_"$$builtin" = NewBuiltin_"$$builtin"(m_hLog);" >> $@ ; \
echo " m_pModuleManager->RegisterModule(pModule_"$$builtin");" >> $@ ; \
done
echo "}" >> $@
echo "" >> $@
$(PLUGINS): %: Makefile.opts
$(PLUGINS): %: src/modules/%/Makefile
cd src/modules/$* && $(MAKE) ../../../bin/$*.so
$(BUILTINS): %: Makefile.opts
$(BUILTINS): %: src/modules/%/Makefile
cd src/modules/$* && $(MAKE) ../../../obj/$*.a
$(INPUTS): %: Makefile.opts
$(INPUTS): %: src/inputs/%/Makefile
cd src/inputs/$* && $(MAKE) ../../../bin/$*.so
......
......@@ -17,12 +17,13 @@
#
# Object files
#
OBJ:=$(SRC:%.cpp=obj/%.o)
PLUGIN_OBJ:=$(MODULE_SRC:%.cpp=obj/%.o)
BUILTIN_OBJ:=$(MODULE_SRC:%.cpp=obj/BUILTIN_%.o)
#
# Dependancies
#
DEP:=$(SRC:%.cpp=dep/%.d)
MODULE_DEP:=$(MODULE_SRC:%.cpp=dep/%.d) $(MODULE_SRC:%.cpp=dep/BUILTIN_%.d)
# export symbols for recursive Makefiles
export
......@@ -48,25 +49,38 @@ clean:
distclean: clean
rm -f ../../../bin/$(MODULE).so
rm -f ../../../obj/$(MODULE).a
rm -Rf dep
rm -Rf *.log *.dbg
dep: $(DEP)
../../../bin/$(MODULE).so: $(OBJ)
../../../bin/$(MODULE).so: $(PLUGIN_OBJ)
@echo "Linking $@..."
@test -d ../../../bin || mkdir -p ../../../bin
$(CXX) $(LCFLAGS) $(MODULE_LCFLAGS) -o $@ $^ $(MODULE_LIB)
chmod 755 $@
$(OBJ): obj/%.o: dep/%.d
$(OBJ): obj/%.o: %.cpp
../../../obj/$(MODULE).a: $(BUILTIN_OBJ)
@echo "Linking $@..."
@test -d ../../../obj || mkdir -p ../../../obj
ar r $@ $^
ranlib $@
$(PLUGIN_OBJ): obj/%.o: dep/%.d
$(PLUGIN_OBJ): obj/%.o: %.cpp
@test -d obj/$(dir $*) || mkdir -p obj/$(dir $*)
@echo "Compiling $<..."
$(CXX) $(CCFLAGS) -D__PLUGIN__ $(INCLUDE) -fPIC -o $@ -c $<
$(BUILTIN_OBJ): obj/BUILTIN_%.o: dep/%.d
$(BUILTIN_OBJ): obj/BUILTIN_%.o: %.cpp
@test -d obj/$(dir $*) || mkdir -p obj/$(dir $*)
@echo "Compiling $<..."
$(CXX) $(CCFLAGS) $(INCLUDE) -fPIC -o $@ -c $<
$(CXX) $(CCFLAGS) -D__BUILTIN__ $(INCLUDE) -fPIC -o $@ -c $<
$(DEP): ../../../Makefile.module FORCE
$(DEP): dep/%.d: %.cpp
$(MODULE_DEP): ../../../Makefile.module FORCE
$(MODULE_DEP): dep/%.d: %.cpp
@$(MAKE) -s --no-print-directory -f \
../../../Makefile.module.dep $@
......
......@@ -2,7 +2,7 @@
# vls (VideoLAN Server) input's dependencies makefile
#-------------------------------------------------------------------------------
# (c)1999-2001 VideoLAN
# $Id: Makefile.module.dep,v 1.1 2001/11/22 01:11:45 bozo Exp $
# $Id: Makefile.module.dep,v 1.2 2001/11/29 16:11:42 bozo Exp $
################################################################################
......@@ -46,7 +46,7 @@ default:
-include $(MAKECMDGOALS)
$(DEP): dep/%.d: %.cpp
$(MODULE_DEP): dep/%.d: %.cpp
@test -d dep/$(dir $*) || mkdir -p dep/$(dir $*)
@echo "Generating dependancies for $<..."
@$(SHELL) -ec '$(CXX) $(DCFLAGS) $(INCLUDE) $< \
......
......@@ -2913,7 +2913,7 @@ esac
ARCH=${target_cpu}
PLUGINS="${PLUGINS} filechannel netchannel filereader ts2ts ps2ts local"
BUILTINS="${BUILTINS} filechannel netchannel filereader ts2ts ps2ts localinput"
DEBUG=1
# Check whether --enable-debug or --disable-debug was given.
......
......@@ -222,7 +222,7 @@ ARCH=${target_cpu}
dnl
dnl default modules
dnl
PLUGINS="${PLUGINS} filechannel netchannel filereader ts2ts ps2ts local"
BUILTINS="${BUILTINS} filechannel netchannel filereader ts2ts ps2ts localinput"
dnl
dnl Debugging mode
......
......@@ -2,7 +2,7 @@
# "video" input Makefile
#-------------------------------------------------------------------------------
# (c)1999-2001 VideoLAN
# $Id: Makefile,v 1.2 2001/11/22 01:11:45 bozo Exp $
# $Id: Makefile,v 1.3 2001/11/29 16:11:42 bozo Exp $
################################################################################
......@@ -27,7 +27,7 @@ MODULE=video
#
# Source files
#
SRC= reader.cpp \
MODULE_SRC= reader.cpp \
videoinput.cpp \
converter.cpp \
......
......@@ -2,7 +2,7 @@
# "dvd" reader Makefile
#-------------------------------------------------------------------------------
# (c)1999-2001 VideoLAN
# $Id: Makefile,v 1.2 2001/11/29 11:58:39 bozo Exp $
# $Id: Makefile,v 1.3 2001/11/29 16:11:42 bozo Exp $
################################################################################
......@@ -26,7 +26,7 @@ MODULE=dvdreader
#
# Source files
#
SRC= dvdreader.cpp \
MODULE_SRC= dvdreader.cpp \
MODULE_LIB+=$(DVDREADER_LIB)
......
......@@ -2,7 +2,7 @@
* dvdreader.cpp: DVD reader
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: dvdreader.cpp,v 1.1 2001/11/28 19:32:23 bozo Exp $
* $Id: dvdreader.cpp,v 1.2 2001/11/29 16:11:42 bozo Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -58,7 +58,20 @@
//------------------------------------------------------------------------------
// Library declaration
//------------------------------------------------------------------------------
#ifdef __PLUGIN__
GENERATE_LIB_ARGS(C_DvdMpegReaderModule, handle);
#endif
//------------------------------------------------------------------------------
// Builtin declaration
//------------------------------------------------------------------------------
#ifdef __BUILTIN__
C_Module* NewBuiltin_dvdreader(handle hLog)
{
return new C_DvdMpegReaderModule(hLog);
}
#endif
/*******************************************************************************
......
......@@ -2,7 +2,7 @@
# "file" channel Makefile
#-------------------------------------------------------------------------------
# (c)1999-2001 VideoLAN
# $Id: Makefile,v 1.2 2001/11/22 01:51:12 bozo Exp $
# $Id: Makefile,v 1.3 2001/11/29 16:11:42 bozo Exp $
################################################################################
......@@ -26,8 +26,8 @@ MODULE=filechannel
#
# Source files
#
SRC= filechannel.cpp \
fileoutput.cpp \
MODULE_SRC= filechannel.cpp \
fileoutput.cpp \
################################################################################
......
......@@ -2,7 +2,7 @@
* filechannel.cpp: file channel
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: filechannel.cpp,v 1.2 2001/11/22 01:51:12 bozo Exp $
* $Id: filechannel.cpp,v 1.3 2001/11/29 16:11:42 bozo Exp $
*
* Authors: James Courtier-Dutton <James@superbug.demon.co.uk>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -45,7 +45,20 @@
//------------------------------------------------------------------------------
// Library declaration
//------------------------------------------------------------------------------
#ifdef __PLUGIN__
GENERATE_LIB_ARGS(C_FileChannelModule, handle);
#endif
//------------------------------------------------------------------------------
// Builtin declaration
//------------------------------------------------------------------------------
#ifdef __BUILTIN__
C_Module* NewBuiltin_filechannel(handle hLog)
{
return new C_FileChannelModule(hLog);
}
#endif
//******************************************************************************
......
......@@ -2,7 +2,7 @@
# "file" reader Makefile
#-------------------------------------------------------------------------------
# (c)2001 VideoLAN
# $Id: Makefile,v 1.1 2001/11/28 19:32:23 bozo Exp $
# $Id: Makefile,v 1.2 2001/11/29 16:11:42 bozo Exp $
################################################################################
......@@ -26,7 +26,7 @@ MODULE=filereader
#
# Source files
#
SRC= filereader.cpp \
MODULE_SRC= filereader.cpp \
################################################################################
......
......@@ -2,7 +2,7 @@
* filereader.cpp: file reader
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: filereader.cpp,v 1.1 2001/11/28 19:32:23 bozo Exp $
* $Id: filereader.cpp,v 1.2 2001/11/29 16:11:42 bozo Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -48,7 +48,20 @@
//------------------------------------------------------------------------------
// Library declaration
//------------------------------------------------------------------------------
#ifdef __PLUGIN__
GENERATE_LIB_ARGS(C_FileMpegReaderModule, handle);
#endif
//------------------------------------------------------------------------------
// Builtin declaration
//------------------------------------------------------------------------------
#ifdef __BUILTIN__
C_Module* NewBuiltin_filereader(handle hLog)
{
return new C_FileMpegReaderModule(hLog);
}
#endif
/*******************************************************************************
......
......@@ -2,7 +2,7 @@
# "local" input Makefile
#-------------------------------------------------------------------------------
# (c)1999-2001 VideoLAN
# $Id: Makefile,v 1.1 2001/11/28 19:32:23 bozo Exp $
# $Id: Makefile,v 1.1 2001/11/29 16:11:42 bozo Exp $
################################################################################
......@@ -22,12 +22,12 @@ endif
# Input name
#
MODULE=local
MODULE=localinput
#
# Source files
#
SRC= localinput.cpp \
MODULE_SRC= localinput.cpp \
################################################################################
......
......@@ -2,7 +2,7 @@
* localinput.cpp: Local streams
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: localinput.cpp,v 1.1 2001/11/28 19:32:23 bozo Exp $
* $Id: localinput.cpp,v 1.1 2001/11/29 16:11:42 bozo Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -56,7 +56,20 @@
//------------------------------------------------------------------------------
// Library declaration
//------------------------------------------------------------------------------
#ifdef __PLUGIN__
GENERATE_LIB_ARGS(C_LocalInputModule, handle);
#endif
//------------------------------------------------------------------------------
// Builtin declaration
//------------------------------------------------------------------------------
#ifdef __BUILTIN__
C_Module* NewBuiltin_localinput(handle hLog)
{
return new C_LocalInputModule(hLog);
}
#endif
/*******************************************************************************
......
......@@ -2,7 +2,7 @@
* localinput.h: Local Input class definition
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: localinput.h,v 1.1 2001/11/28 19:32:23 bozo Exp $
* $Id: localinput.h,v 1.1 2001/11/29 16:11:42 bozo Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -79,6 +79,7 @@ private:
// Declaration and implementation of C_LocalInputModule
DECLARE_MODULE(Local, Input, "local", const C_String&);
#else
#error "Multiple inclusions of localinput.h"
#endif
......
......@@ -2,7 +2,7 @@
# "network" channel Makefile
#-------------------------------------------------------------------------------
# (c)1999-2001 VideoLAN
# $Id: Makefile,v 1.2 2001/11/22 01:51:12 bozo Exp $
# $Id: Makefile,v 1.3 2001/11/29 16:11:42 bozo Exp $
################################################################################
......@@ -26,8 +26,8 @@ MODULE=netchannel
#
# Source files
#
SRC= netchannel.cpp \
netoutput.cpp \
MODULE_SRC= netchannel.cpp \
netoutput.cpp \
################################################################################
......
......@@ -2,7 +2,7 @@
* netchannel.cpp: network channel
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: netchannel.cpp,v 1.2 2001/11/22 01:51:12 bozo Exp $
* $Id: netchannel.cpp,v 1.3 2001/11/29 16:11:42 bozo Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -45,7 +45,20 @@
//------------------------------------------------------------------------------
// Library declaration
//------------------------------------------------------------------------------
#ifdef __PLUGIN__
GENERATE_LIB_ARGS(C_NetChannelModule, handle);
#endif
//------------------------------------------------------------------------------
// Builtin declaration
//------------------------------------------------------------------------------
#ifdef __BUILTIN__
C_Module* NewBuiltin_netchannel(handle hLog)
{
return new C_NetChannelModule(hLog);
}
#endif
//******************************************************************************
......
......@@ -2,7 +2,7 @@
# "ps2ts" converter Makefile
#-------------------------------------------------------------------------------
# (c)1999-2001 VideoLAN
# $Id: Makefile,v 1.1 2001/11/28 19:32:23 bozo Exp $
# $Id: Makefile,v 1.2 2001/11/29 16:11:42 bozo Exp $
################################################################################
......@@ -26,7 +26,7 @@ MODULE=ps2ts
#
# Source files
#
SRC= ps2ts.cpp \
MODULE_SRC= ps2ts.cpp \
################################################################################
......
......@@ -2,7 +2,7 @@
* ps2ts.cpp: threaded PS to TS converter
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: ps2ts.cpp,v 1.1 2001/11/28 19:32:23 bozo Exp $
* $Id: ps2ts.cpp,v 1.2 2001/11/29 16:11:42 bozo Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -55,7 +55,20 @@
//------------------------------------------------------------------------------
// Library declaration
//------------------------------------------------------------------------------
#ifdef __PLUGIN__
GENERATE_LIB_ARGS(C_Ps2TsMpegConverterModule, handle);
#endif
//------------------------------------------------------------------------------
// Builtin declaration
//------------------------------------------------------------------------------
#ifdef __BUILTIN__
C_Module* NewBuiltin_ps2ts(handle hLog)
{
return new C_Ps2TsMpegConverterModule(hLog);
}
#endif
/*******************************************************************************
......
......@@ -2,7 +2,7 @@
# "ts2ts" converter Makefile
#-------------------------------------------------------------------------------
# (c)1999-2001 VideoLAN
# $Id: Makefile,v 1.1 2001/11/28 19:32:23 bozo Exp $
# $Id: Makefile,v 1.2 2001/11/29 16:11:42 bozo Exp $
################################################################################
......@@ -26,7 +26,7 @@ MODULE=ts2ts
#
# Source files
#
SRC= ts2ts.cpp \
MODULE_SRC= ts2ts.cpp \
################################################################################
......
......@@ -2,7 +2,7 @@
* ts2ts.cpp: threaded TS to TS converter
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: ts2ts.cpp,v 1.1 2001/11/28 19:32:23 bozo Exp $
* $Id: ts2ts.cpp,v 1.2 2001/11/29 16:11:42 bozo Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -49,7 +49,20 @@
//------------------------------------------------------------------------------
// Library declaration
//------------------------------------------------------------------------------
#ifdef __PLUGIN__
GENERATE_LIB_ARGS(C_Ts2TsMpegConverterModule, handle);
#endif
//------------------------------------------------------------------------------
// Builtin declaration
//------------------------------------------------------------------------------
#ifdef __BUILTIN__
C_Module* NewBuiltin_ts2ts(handle hLog)
{
return new C_Ts2TsMpegConverterModule(hLog);
}
#endif
/*******************************************************************************
......
......@@ -2,7 +2,7 @@
* vls.cpp: vls main file
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: vls.cpp,v 1.3 2001/11/27 16:37:51 bozo Exp $
* $Id: vls.cpp,v 1.4 2001/11/29 16:11:42 bozo Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
*
......@@ -92,6 +92,7 @@ int C_Vls::OnAppInit()
if(!iRc)
{
LoadBuiltins();
m_pModuleManager->BrowseDirectory(".");
m_pModuleManager->BrowseDirectory(PLUGIN_PATH);
}
......@@ -311,7 +312,7 @@ void C_Vls::Usage(const C_String& strProgName)
#include "vls_builtins.cpp"
......
......@@ -2,7 +2,7 @@
* vls.h: vls class definition
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: vls.h,v 1.1 2001/10/06 21:23:37 bozo Exp $
* $Id: vls.h,v 1.2 2001/11/29 16:11:42 bozo Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
*
......@@ -52,7 +52,9 @@ protected:
void Usage(const C_String& strProgName);
int GetConfig(int iArgc, char** paArg, C_String* pstrCfgFile, C_String* pstrLogFile);
private:
private:
void LoadBuiltins();
C_Manager* m_pManager;
C_Admin* m_pAdministrator;
};
......
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