From 92acb8a9318c3010ecc4d7bd6cd1aa8460fb191e Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Wed, 18 Jun 2014 10:25:33 +0200 Subject: Split server/client config files. --- configure.ac | 204 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ configure.in | 204 -------------------------------------------------------- etc/Makefile.am | 16 ++++- etc/miav.conf | 44 +----------- etc/miavd.conf | 48 +++++++++++++ src/Makefile.am | 4 +- src/miavd.cc | 4 +- 7 files changed, 271 insertions(+), 253 deletions(-) create mode 100644 configure.ac delete mode 100644 configure.in create mode 100644 etc/miavd.conf diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..9180756 --- /dev/null +++ b/configure.ac @@ -0,0 +1,204 @@ +# Filename: configure.in +AC_INIT(src/miav.cc) +AM_INIT_AUTOMAKE( miav, 0.4.0 ) + +AC_PROG_CXX + +AC_PROG_LIBTOOL +AM_PROG_LIBTOOL + +AM_CONFIG_HEADER(config.h) +AC_STDC_HEADERS + +#################### +# Setup debug flags +AC_ARG_WITH(debug, [ --with-debug build with debug support]) +if test x$with_debug == xyes; then + AC_MSG_WARN([*** Building with debug support!]) + CXXFLAGS="$CXXFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector -Wall -Werror -g" + AC_DEFINE_UNQUOTED(WITH_DEBUG, , + [The project is configured to use debug output]) +fi + +dnl ====================== +dnl Init pkg-config +dnl ====================== +PKG_PROG_PKG_CONFIG(0.23) + +AC_ARG_WITH(client, [ --without-client build without client support]) +if test x$with_client != xno && test -z "$CLIENT"; then + dnl ====================== + dnl Check for Qt + dnl ====================== + PKG_CHECK_MODULES(QT, QtCore QtGui QtNetwork >= 4.5) + AC_CHECK_PROGS(QT_MOC, [moc4 moc-qt4 moc], []) + AC_CHECK_PROGS(QT_RCC, [rcc4 rcc-qt4 rcc], []) + AC_CHECK_PROGS(QT_UIC, [uic4 uic-qt4 uic], []) + if (test "$QT_MOC" = ""); then + AC_MSG_ERROR([QT4 moc is required.]) + fi + if (test "$QT_RCC" = ""); then + AC_MSG_ERROR([QT4 rcc is required.]) + fi + if (test "$QT_UIC" = ""); then + AC_MSG_ERROR([QT4 uic is required.]) + fi + + dnl ===================== + dnl Check for SDL library + dnl ===================== + SDL_VERSION=1.2.0 + AM_PATH_SDL($SDL_VERSION,:,AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])) + AC_SUBST(SDL_CFLAGS) + AC_SUBST(SDL_LIBS) + + dnl ====================== + dnl Check for iec61883 library + dnl ====================== + PKG_CHECK_MODULES(IEC61883, libiec61883 >= 1.2) + + dnl ====================== + dnl Check for dv library + dnl ====================== + PKG_CHECK_MODULES(DV, libdv >= 1.0) +else + AC_MSG_WARN([*** Building without client support!]) +fi + +AC_ARG_WITH(server, [ --without-server build without server support]) +if test x$with_server != xno && test -z "$SERVER"; then + dnl ====================== + dnl Check for pthread library + dnl ====================== + tmp_CXXFLAGS="$CXXFLAGS" + tmp_CPPFLAGS="$CPPFLAGS" + tmp_CFLAGS="$CFLAGS" + tmp_LDFLAGS="$LDFLAGS" + tmp_LIBS="$LIBS" + CXXFLAGS="" + CPPFLAGS="" + CFLAGS="" + LDFLAGS="" + LIBS="" + AC_CHECK_HEADER(pthread.h, , AC_MSG_ERROR([*** pthread headers not found!])) + AC_CHECK_LIB(pthread, sem_init, , AC_MSG_ERROR([*** libpthread not found!])) + PTHREAD_CFLAGS="$CXXFLAGS $CPPFLAGS $CFLAGS" + PTHREAD_LIBS="$LDFLAGS $LIBS" + CXXFLAGS="$tmp_CXXFLAGS" + CPPFLAGS="$tmp_CPPFLAGS" + CFLAGS="$tmp_CFLAGS" + LDFLAGS="$tmp_LDFLAGS" + LIBS="$tmp_LIBS" + AC_SUBST(PTHREAD_CFLAGS) + AC_SUBST(PTHREAD_LIBS) + + dnl ====================== + dnl Check for dv library + dnl ====================== + PKG_CHECK_MODULES(DV, libdv >= 1.0) + + dnl ====================== + dnl Check for Jpeg library + dnl ====================== + tmp_CXXFLAGS="$CXXFLAGS" + tmp_CPPFLAGS="$CPPFLAGS" + tmp_CFLAGS="$CFLAGS" + tmp_LDFLAGS="$LDFLAGS" + tmp_LIBS="$LIBS" + CXXFLAGS="" + CPPFLAGS="" + CFLAGS="" + LDFLAGS="" + LIBS="" + AC_CHECK_HEADER(jpeglib.h, , AC_MSG_ERROR([*** libJpeg not found!])) + AC_CHECK_LIB(jpeg, jpeg_start_compress, , AC_MSG_ERROR([*** libJpeg not found!])) + JPEG_CFLAGS="$CXXFLAGS $CPPFLAGS $CFLAGS" + JPEG_LIBS="$LDFLAGS $LIBS" + CXXFLAGS="$tmp_CXXFLAGS" + CPPFLAGS="$tmp_CPPFLAGS" + CFLAGS="$tmp_CFLAGS" + LDFLAGS="$tmp_LDFLAGS" + LIBS="$tmp_LIBS" + AC_SUBST(JPEG_CFLAGS) + AC_SUBST(JPEG_LIBS) + + dnl ====================== + dnl Check for Fame library + dnl ====================== + tmp_CXXFLAGS="$CXXFLAGS" + tmp_CPPFLAGS="$CPPFLAGS" + tmp_CFLAGS="$CFLAGS" + tmp_LDFLAGS="$LDFLAGS" + tmp_LIBS="$LIBS" + CXXFLAGS="" + CPPFLAGS="" + CFLAGS="" + LDFLAGS="" + LIBS="" + AC_CHECK_HEADER(fame.h, , AC_MSG_ERROR([*** libFAME include files not found!])) + AC_CHECK_LIB(fame, fame_init, , AC_MSG_ERROR([*** libFAME not found!])) + FAME_CFLAGS="$CXXFLAGS $CPPFLAGS $CFLAGS" + FAME_LIBS="$LDFLAGS $LIBS" + CXXFLAGS="$tmp_CXXFLAGS" + CPPFLAGS="$tmp_CPPFLAGS" + CFLAGS="$tmp_CFLAGS" + LDFLAGS="$tmp_LDFLAGS" + LIBS="$tmp_LIBS" + AC_SUBST(FAME_CFLAGS) + AC_SUBST(FAME_LIBS) + + dnl ====================== + dnl Check for Lame library + dnl ====================== + tmp_CXXFLAGS="$CXXFLAGS" + tmp_CPPFLAGS="$CPPFLAGS" + tmp_CFLAGS="$CFLAGS" + tmp_LDFLAGS="$LDFLAGS" + tmp_LIBS="$LIBS" + CXXFLAGS="" + CPPFLAGS="" + CFLAGS="" + LDFLAGS="" + LIBS="" + AC_CHECK_HEADER(lame/lame.h, , AC_MSG_ERROR([*** libLAME (libmp3lame) include files not found!])) + AC_CHECK_LIB(mp3lame, lame_init, , AC_MSG_ERROR([*** libLAME (libmp3lame) not found!])) + LAME_CFLAGS="$CXXFLAGS $CPPFLAGS $CFLAGS" + LAME_LIBS="$LDFLAGS $LIBS" + CXXFLAGS="$tmp_CXXFLAGS" + CPPFLAGS="$tmp_CPPFLAGS" + CFLAGS="$tmp_CFLAGS" + LDFLAGS="$tmp_LDFLAGS" + LIBS="$tmp_LIBS" + AC_SUBST(LAME_CFLAGS) + AC_SUBST(LAME_LIBS) +else + AC_MSG_WARN([*** Building without server support!]) +fi + + +################################## +# Check if tests should be built. +AC_ARG_WITH(test, + [ --with-test build tests (default=no)], + [], + [with_test=no]) +if test x$with_test == xyes; then + AM_PATH_CPPUNIT(1.9.6) + AC_CONFIG_FILES(test/Makefile) +fi + +AC_SUBST(CFLAGS) +AC_SUBST(CPPFLAGS) +AC_SUBST(CXXFLAGS) +AC_SUBST(LDFLAGS) + +AM_CONDITIONAL([WITH_CLIENT], [test "x$with_client" = "xyes"]) +AM_CONDITIONAL([WITH_SERVER], [test "x$with_server" = "xyes"]) + +AC_OUTPUT( + Makefile + src/Makefile + tools/Makefile + etc/Makefile + pixmaps/Makefile + man/Makefile) diff --git a/configure.in b/configure.in deleted file mode 100644 index 2dd686d..0000000 --- a/configure.in +++ /dev/null @@ -1,204 +0,0 @@ -# Filename: configure.in -AC_INIT(src/miav.cc) -AM_INIT_AUTOMAKE( miav, 0.4.0 ) - -AC_PROG_CXX - -AC_PROG_LIBTOOL -AM_PROG_LIBTOOL - -AM_CONFIG_HEADER(config.h) -AC_STDC_HEADERS - -#################### -# Setup debug flags -AC_ARG_WITH(debug, [ --with-debug build with debug support]) -if test x$with_debug == xyes; then - AC_MSG_WARN([*** Building with debug support!]) - CXXFLAGS="$CXXFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector -Wall -Werror -g" - AC_DEFINE_UNQUOTED(WITH_DEBUG, , - [The project is configured to use debug output]) -fi - -dnl ====================== -dnl Init pkg-config -dnl ====================== -PKG_PROG_PKG_CONFIG(0.23) - -AC_ARG_WITH(gui, [ --without-gui build without GUI support]) -if test x$with_gui != xno && test -z "$GUI"; then - dnl ====================== - dnl Check for Qt - dnl ====================== - PKG_CHECK_MODULES(QT, QtCore QtGui QtNetwork >= 4.5) - AC_CHECK_PROGS(QT_MOC, [moc4 moc-qt4 moc], []) - AC_CHECK_PROGS(QT_RCC, [rcc4 rcc-qt4 rcc], []) - AC_CHECK_PROGS(QT_UIC, [uic4 uic-qt4 uic], []) - if (test "$QT_MOC" = ""); then - AC_MSG_ERROR([QT4 moc is required.]) - fi - if (test "$QT_RCC" = ""); then - AC_MSG_ERROR([QT4 rcc is required.]) - fi - if (test "$QT_UIC" = ""); then - AC_MSG_ERROR([QT4 uic is required.]) - fi - - dnl ===================== - dnl Check for SDL library - dnl ===================== - SDL_VERSION=1.2.0 - AM_PATH_SDL($SDL_VERSION,:,AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])) - AC_SUBST(SDL_CFLAGS) - AC_SUBST(SDL_LIBS) - - dnl ====================== - dnl Check for iec61883 library - dnl ====================== - PKG_CHECK_MODULES(IEC61883, libiec61883 >= 1.2) - - dnl ====================== - dnl Check for dv library - dnl ====================== - PKG_CHECK_MODULES(DV, libdv >= 1.0) -else - AC_MSG_WARN([*** Building without GUI support!]) -fi - -AC_ARG_WITH(server, [ --without-server build without server support]) -if test x$with_server != xno && test -z "$SERVER"; then - dnl ====================== - dnl Check for pthread library - dnl ====================== - tmp_CXXFLAGS="$CXXFLAGS" - tmp_CPPFLAGS="$CPPFLAGS" - tmp_CFLAGS="$CFLAGS" - tmp_LDFLAGS="$LDFLAGS" - tmp_LIBS="$LIBS" - CXXFLAGS="" - CPPFLAGS="" - CFLAGS="" - LDFLAGS="" - LIBS="" - AC_CHECK_HEADER(pthread.h, , AC_MSG_ERROR([*** pthread headers not found!])) - AC_CHECK_LIB(pthread, sem_init, , AC_MSG_ERROR([*** libpthread not found!])) - PTHREAD_CFLAGS="$CXXFLAGS $CPPFLAGS $CFLAGS" - PTHREAD_LIBS="$LDFLAGS $LIBS" - CXXFLAGS="$tmp_CXXFLAGS" - CPPFLAGS="$tmp_CPPFLAGS" - CFLAGS="$tmp_CFLAGS" - LDFLAGS="$tmp_LDFLAGS" - LIBS="$tmp_LIBS" - AC_SUBST(PTHREAD_CFLAGS) - AC_SUBST(PTHREAD_LIBS) - - dnl ====================== - dnl Check for dv library - dnl ====================== - PKG_CHECK_MODULES(DV, libdv >= 1.0) - - dnl ====================== - dnl Check for Jpeg library - dnl ====================== - tmp_CXXFLAGS="$CXXFLAGS" - tmp_CPPFLAGS="$CPPFLAGS" - tmp_CFLAGS="$CFLAGS" - tmp_LDFLAGS="$LDFLAGS" - tmp_LIBS="$LIBS" - CXXFLAGS="" - CPPFLAGS="" - CFLAGS="" - LDFLAGS="" - LIBS="" - AC_CHECK_HEADER(jpeglib.h, , AC_MSG_ERROR([*** libJpeg not found!])) - AC_CHECK_LIB(jpeg, jpeg_start_compress, , AC_MSG_ERROR([*** libJpeg not found!])) - JPEG_CFLAGS="$CXXFLAGS $CPPFLAGS $CFLAGS" - JPEG_LIBS="$LDFLAGS $LIBS" - CXXFLAGS="$tmp_CXXFLAGS" - CPPFLAGS="$tmp_CPPFLAGS" - CFLAGS="$tmp_CFLAGS" - LDFLAGS="$tmp_LDFLAGS" - LIBS="$tmp_LIBS" - AC_SUBST(JPEG_CFLAGS) - AC_SUBST(JPEG_LIBS) - - dnl ====================== - dnl Check for Fame library - dnl ====================== - tmp_CXXFLAGS="$CXXFLAGS" - tmp_CPPFLAGS="$CPPFLAGS" - tmp_CFLAGS="$CFLAGS" - tmp_LDFLAGS="$LDFLAGS" - tmp_LIBS="$LIBS" - CXXFLAGS="" - CPPFLAGS="" - CFLAGS="" - LDFLAGS="" - LIBS="" - AC_CHECK_HEADER(fame.h, , AC_MSG_ERROR([*** libFAME include files not found!])) - AC_CHECK_LIB(fame, fame_init, , AC_MSG_ERROR([*** libFAME not found!])) - FAME_CFLAGS="$CXXFLAGS $CPPFLAGS $CFLAGS" - FAME_LIBS="$LDFLAGS $LIBS" - CXXFLAGS="$tmp_CXXFLAGS" - CPPFLAGS="$tmp_CPPFLAGS" - CFLAGS="$tmp_CFLAGS" - LDFLAGS="$tmp_LDFLAGS" - LIBS="$tmp_LIBS" - AC_SUBST(FAME_CFLAGS) - AC_SUBST(FAME_LIBS) - - dnl ====================== - dnl Check for Lame library - dnl ====================== - tmp_CXXFLAGS="$CXXFLAGS" - tmp_CPPFLAGS="$CPPFLAGS" - tmp_CFLAGS="$CFLAGS" - tmp_LDFLAGS="$LDFLAGS" - tmp_LIBS="$LIBS" - CXXFLAGS="" - CPPFLAGS="" - CFLAGS="" - LDFLAGS="" - LIBS="" - AC_CHECK_HEADER(lame/lame.h, , AC_MSG_ERROR([*** libLAME (libmp3lame) include files not found!])) - AC_CHECK_LIB(mp3lame, lame_init, , AC_MSG_ERROR([*** libLAME (libmp3lame) not found!])) - LAME_CFLAGS="$CXXFLAGS $CPPFLAGS $CFLAGS" - LAME_LIBS="$LDFLAGS $LIBS" - CXXFLAGS="$tmp_CXXFLAGS" - CPPFLAGS="$tmp_CPPFLAGS" - CFLAGS="$tmp_CFLAGS" - LDFLAGS="$tmp_LDFLAGS" - LIBS="$tmp_LIBS" - AC_SUBST(LAME_CFLAGS) - AC_SUBST(LAME_LIBS) -else - AC_MSG_WARN([*** Building without server support!]) -fi - - -################################## -# Check if tests should be built. -AC_ARG_WITH(test, - [ --with-test build tests (default=no)], - [], - [with_test=no]) -if test x$with_test == xyes; then - AM_PATH_CPPUNIT(1.9.6) - AC_CONFIG_FILES(test/Makefile) -fi - -AC_SUBST(CFLAGS) -AC_SUBST(CPPFLAGS) -AC_SUBST(CXXFLAGS) -AC_SUBST(LDFLAGS) - -AM_CONDITIONAL([WITH_GUI], [test "x$with_gui" = "xyes"]) -AM_CONDITIONAL([WITH_SERVER], [test "x$with_server" = "xyes"]) - -AC_OUTPUT( - Makefile - src/Makefile - tools/Makefile - etc/Makefile - pixmaps/Makefile - man/Makefile) diff --git a/etc/Makefile.am b/etc/Makefile.am index 1e4ee34..507c8e1 100644 --- a/etc/Makefile.am +++ b/etc/Makefile.am @@ -1,9 +1,19 @@ EXTRA_DIST = \ miav.conf \ + miavd.conf \ multicast.conf sysconfdir=${prefix}/etc/miav -dist_sysconf_DATA = \ - miav.conf \ - multicast.conf \ No newline at end of file +dist_sysconf_DATA = + +if WITH_CLIENT +dist_sysconf_DATA += \ + miav.conf +endif + +if WITH_SERVER +dist_sysconf_DATA += \ + miavd.conf \ + multicast.conf +endif diff --git a/etc/miav.conf b/etc/miav.conf index 40a8e18..4e05fc9 100644 --- a/etc/miav.conf +++ b/etc/miav.conf @@ -1,10 +1,9 @@ ############################## -## The MIaV configuration file +## The MIaV client configuration file ## # Log files of the server and the client client_log_file = "/tmp/miav_client.log" -server_log_file = "/tmp/miav_server.log" # Cpr Database configuration cpr_host = "cpr.j.auh.dk" @@ -26,44 +25,5 @@ pixel_height = 768 player_skip_frames = 1 # How and where to connect to the miav server? -server_addr = "192.168.0.10" +server_addr = "127.0.0.1" server_port = 18120 - -# Run the server as the following user: -server_user = "miav" -server_group = "miav" - -# Where to store the files recieved by the server -server_movie_root = "/home/miav/miav_movie_files" -server_image_root = "/home/miav/miav_image_files" -server_later = "/home/miav/miav_movie_files/deathrow" -server_trash = "/home/miav/miav_movie_files/trash" - -# Defines the size of the multicasted upd packages (1500 is normal) -udp_packet_size = 1500 - -# Video output controls. A sequence of I and P, where I is keyframes -# which is fast to create, but uses a lot of discspace. -# B uses changes since last frame, is more cpu intensive, but uses a -# lot less diskspace than I frames -frame_sequence = "IPPPIPPIP" - -# quality in % - 100% is best quality -video_quality = 85 - -# bitrate in kbytes pr. second (0 == vbr) -video_bitrate = 0 - -# mp3 encoding quality settings -mp3_quality = 3 -mp3_bitrate = 112 - -# The number of threads started for parallel encoding on the server -# (for multiprocessor systems) -encoding_threads = 1 - -# Codec is one of the following: -# "mpeg1" For use with mpeg1 encoding. -# "mpeg4" for use with mpeg4 encoding -# default is "mpeg1" -encoding_codec = "mpeg1" diff --git a/etc/miavd.conf b/etc/miavd.conf new file mode 100644 index 0000000..73bb8ba --- /dev/null +++ b/etc/miavd.conf @@ -0,0 +1,48 @@ +############################## +## The MIaV server configuration file +## + +# Log files of the server and the client +server_log_file = "/tmp/miav_server.log" + +# Which port to listen on? +server_port = 18120 + +# Run the server as the following user: +server_user = "miav" +server_group = "miav" + +# Where to store the files recieved by the server +server_movie_root = "/home/miav/miav_movie_files" +server_image_root = "/home/miav/miav_image_files" +server_later = "/home/miav/miav_movie_files/deathrow" +server_trash = "/home/miav/miav_movie_files/trash" + +# Defines the size of the multicasted upd packages (1500 is normal) +udp_packet_size = 1500 + +# Video output controls. A sequence of I and P, where I is keyframes +# which is fast to create, but uses a lot of discspace. +# B uses changes since last frame, is more cpu intensive, but uses a +# lot less diskspace than I frames +frame_sequence = "IPPPIPPIP" + +# quality in % - 100% is best quality +video_quality = 85 + +# bitrate in kbytes pr. second (0 == vbr) +video_bitrate = 0 + +# mp3 encoding quality settings +mp3_quality = 3 +mp3_bitrate = 112 + +# The number of threads started for parallel encoding on the server +# (for multiprocessor systems) +encoding_threads = 1 + +# Codec is one of the following: +# "mpeg1" For use with mpeg1 encoding. +# "mpeg4" for use with mpeg4 encoding +# default is "mpeg1" +encoding_codec = "mpeg1" diff --git a/src/Makefile.am b/src/Makefile.am index 2f01eba..9e77f4f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,6 @@ bin_PROGRAMS = -if WITH_GUI +if WITH_CLIENT bin_PROGRAMS += miav endif @@ -144,7 +144,7 @@ EXTRA_DIST = \ miav.qrc miav_MOC = -if WITH_GUI +if WITH_CLIENT miav_MOC += $(shell if [ $QT_CXXFLAGS ] ; then ../tools/MocList cc; fi ) endif diff --git a/src/miavd.cc b/src/miavd.cc index 1658648..89e8990 100644 --- a/src/miavd.cc +++ b/src/miavd.cc @@ -51,7 +51,7 @@ static const char copyright_str[] = static const char usage_str[] = "Usage: %s [options]\n" "Options:\n" -" -c, --config file Read configfile from 'file' (default "ETC"/miav.conf)\n" +" -c, --config file Read configfile from 'file' (default "ETC"/miavd.conf)\n" " -f, --foreground Run in foreground mode (non-daemon mode)\n" " -u, --user user Run as 'user' (overrides the configfile)\n" " -g, --group group Run as 'group' (overrides the configfile)\n" @@ -69,7 +69,7 @@ int main(int argc, char *argv[]) const char *hugin_filter = "+all"; const char *logfile = NULL; int c; - std::string configfile = ETC"/miav.conf"; + std::string configfile = ETC"/miavd.conf"; char *user = NULL; char *group = NULL; bool foreground = false; -- cgit v1.2.3