summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Makefile.am10
-rw-r--r--src/audio_encoder.h1
-rw-r--r--src/config.h32
-rw-r--r--src/cprlisten.cc4
-rw-r--r--src/dv.h1
-rw-r--r--src/dvfile.cc1
-rw-r--r--src/dvfile.h1
-rw-r--r--src/file.h1
-rw-r--r--src/font.h1
-rw-r--r--src/frame.cc1
-rw-r--r--src/frame.h1
-rw-r--r--src/frame_stream.h1
-rw-r--r--src/img_encoder.h1
-rw-r--r--src/info.cc1
-rw-r--r--src/info.h1
-rw-r--r--src/iso11172-2.h1
-rw-r--r--src/iso11172-3.h1
-rw-r--r--src/jpeg_mem_dest.cc1
-rw-r--r--src/jpeg_mem_dest.h1
-rw-r--r--src/libfame_wrapper.h1
-rw-r--r--src/liblame_wrapper.h1
-rw-r--r--src/libmplex_wrapper.cc478
-rw-r--r--src/libmplex_wrapper.h52
-rw-r--r--src/mainwindow.cc8
-rw-r--r--src/miav_config.h1
-rw-r--r--src/miav_daemon.cc11
-rw-r--r--src/miav_daemon.h5
-rw-r--r--src/miavd.cc144
-rw-r--r--src/mov_encoder.h1
-rw-r--r--src/mov_encoder_writer.cc8
-rw-r--r--src/mov_encoder_writer.h1
-rw-r--r--src/multicast.h1
-rw-r--r--src/multicast_configuration.h1
-rw-r--r--src/multiplexer.cc1
-rw-r--r--src/multiplexer.h1
-rw-r--r--src/mutex.cc1
-rw-r--r--src/mutex.h1
-rw-r--r--src/network.cc1
-rw-r--r--src/network.h1
-rw-r--r--src/package.h1
-rw-r--r--src/queue.h1
-rw-r--r--src/recedge.h1
-rw-r--r--src/semaphore.cc1
-rw-r--r--src/semaphore.h1
-rw-r--r--src/server_status.h1
-rw-r--r--src/socket.h1
-rw-r--r--src/thread.cc3
-rw-r--r--src/thread.h1
-rw-r--r--src/threadsafe_queue.cc1
-rw-r--r--src/threadsafe_queue.h1
-rw-r--r--src/threadsafe_queue_fifo.cc1
-rw-r--r--src/threadsafe_queue_fifo.h1
-rw-r--r--src/threadsafe_queue_priority.cc1
-rw-r--r--src/threadsafe_queue_priority.h1
-rw-r--r--src/util.cc4
-rw-r--r--src/util.h1
56 files changed, 156 insertions, 647 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index cb37e2c..ac0545c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -19,7 +19,6 @@ miav_LDADD = $(shell ../tools/MocList o) $(QT_LIBS) $(IEC61883_LIBS) \
$(SDL_LIBS) $(DV_LIBS)
miav_SOURCES = \
- $(top_srcdir)/hugin/hugin.c \
aa_socket.cc \
cprlisten.cc \
aboutwindow.cc \
@@ -41,21 +40,24 @@ miav_SOURCES = \
videowidget.cc \
yuv_draw.cc \
\
+ $(top_srcdir)/hugin/hugin.c \
socket.cc \
thread.cc \
util.cc \
miav_config.cc \
network.cc
-
miavd_CXXFLAGS = $(JPEG_CFLAGS) $(FAME_CFLAGS) $(LAME_CFLAGS) $(DV_CFLAGS) \
$(PTHREAD_CFLAGS) -I../include -DETC=\"$(prefix)/etc/miav\" \
- -I$(top_srcdir)/hugin
+ -I$(top_srcdir)/hugin -DWITH_HUG_FILTER
+
+miavd_CFLAGS = -DWITH_HUG_FILTER
miavd_LDADD = $(JPEG_LIBS) $(FAME_LIBS) $(LAME_LIBS) $(DV_LIBS) $(PTHREAD_LIBS)
miavd_SOURCES = \
$(top_srcdir)/hugin/hugin.c \
+ $(top_srcdir)/hugin/hugin_filter.c \
miavd.cc \
audio_encoder.cc \
daemon.cc \
@@ -65,7 +67,6 @@ miavd_SOURCES = \
jpeg_mem_dest.cc \
libfame_wrapper.cc \
liblame_wrapper.cc \
- libmplex_wrapper.cc \
miav_daemon.cc \
miav_config.cc \
mov_encoder.cc \
@@ -114,7 +115,6 @@ EXTRA_DIST = \
jpeg_mem_dest.h \
libfame_wrapper.h \
liblame_wrapper.h \
- libmplex_wrapper.h \
mainwindow.h \
messagebox.h \
miav_config.h \
diff --git a/src/audio_encoder.h b/src/audio_encoder.h
index e84657c..c97124f 100644
--- a/src/audio_encoder.h
+++ b/src/audio_encoder.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAV_AUDIO_ENCODER_H__
#define __MIAV_AUDIO_ENCODER_H__
diff --git a/src/config.h b/src/config.h
deleted file mode 100644
index c662dc4..0000000
--- a/src/config.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/***************************************************************************
- * config.h
- *
- * Thu Jul 28 12:46:38 CEST 2005
- * Copyright 2004 Bent Bisballe
- * deva@aasimon.org
- ****************************************************************************/
-
-/*
- * This file is part of MIaV.
- *
- * MIaV 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.
- *
- * MIaV 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 MIaV; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
- */
-#ifndef __CONFIG_IS_LOADED__
-#define __CONFIG_IS_LOADED__
-
-#include "../config.h"
-
-#endif/*__CONFIG_IS_LOADED__*/
diff --git a/src/cprlisten.cc b/src/cprlisten.cc
index 4cf8670..f37dd7d 100644
--- a/src/cprlisten.cc
+++ b/src/cprlisten.cc
@@ -24,14 +24,14 @@
* along with it; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-
#include "cprlisten.h"
-#include "aa_socket.h"
#include <iostream>
#include <string>
#include <stdio.h>
+#include "aa_socket.h"
+
using namespace std;
#define MAGIC_STOP_STRING "SHUTTHEFUCKUP"
diff --git a/src/dv.h b/src/dv.h
index e346d03..1e30d0d 100644
--- a/src/dv.h
+++ b/src/dv.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAV_DV_H__
#define __MIAV_DV_H__
diff --git a/src/dvfile.cc b/src/dvfile.cc
index fb9a184..b942e42 100644
--- a/src/dvfile.cc
+++ b/src/dvfile.cc
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#include "dvfile.h"
#include <string.h>
diff --git a/src/dvfile.h b/src/dvfile.h
index dc91a14..1052c55 100644
--- a/src/dvfile.h
+++ b/src/dvfile.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAV_DVFILE_H__
#define __MIAV_DVFILE_H__
diff --git a/src/file.h b/src/file.h
index 2083525..c1a757e 100644
--- a/src/file.h
+++ b/src/file.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAV_FILE_H__
#define __MIAV_FILE_H__
diff --git a/src/font.h b/src/font.h
index 64b5723..ee91d3c 100644
--- a/src/font.h
+++ b/src/font.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAV_FONT_H__
#define __MIAV_FONT_H__
diff --git a/src/frame.cc b/src/frame.cc
index 568c46b..9861842 100644
--- a/src/frame.cc
+++ b/src/frame.cc
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include <config.h>
#include "frame.h"
#include <memory.h>
diff --git a/src/frame.h b/src/frame.h
index 988f460..96b0bcf 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __FRAME_H__
#define __FRAME_H__
diff --git a/src/frame_stream.h b/src/frame_stream.h
index bc0b9a2..51240d4 100644
--- a/src/frame_stream.h
+++ b/src/frame_stream.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAV_FRAME_STREAM_H__
#define __MIAV_FRAME_STREAM_H__
diff --git a/src/img_encoder.h b/src/img_encoder.h
index 3f069e0..9f429d7 100644
--- a/src/img_encoder.h
+++ b/src/img_encoder.h
@@ -31,7 +31,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-//#include "config.h"
#ifndef __RTVIDEOREC_IMGENCODER_H
#define __RTVIDEOREC_IMGENCODER_H
diff --git a/src/info.cc b/src/info.cc
index e67f444..011c1ab 100644
--- a/src/info.cc
+++ b/src/info.cc
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include <config.h>
#include "info.h"
#include <time.h>
diff --git a/src/info.h b/src/info.h
index a725e40..a001509 100644
--- a/src/info.h
+++ b/src/info.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAV_INFO_H__
#define __MIAV_INFO_H__
diff --git a/src/iso11172-2.h b/src/iso11172-2.h
index 153d651..61bcfc7 100644
--- a/src/iso11172-2.h
+++ b/src/iso11172-2.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAV_ISO11172_2_H__
#define __MIAV_ISO11172_2_H__
diff --git a/src/iso11172-3.h b/src/iso11172-3.h
index 4b63433..bfd1e52 100644
--- a/src/iso11172-3.h
+++ b/src/iso11172-3.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAV_ISO11172_3_H__
#define __MIAV_ISO11172_3_H__
diff --git a/src/jpeg_mem_dest.cc b/src/jpeg_mem_dest.cc
index 439c9a8..6b5583b 100644
--- a/src/jpeg_mem_dest.cc
+++ b/src/jpeg_mem_dest.cc
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include <config.h>
#include "jpeg_mem_dest.h"
#define OUTPUT_BUF_SIZE 4096 /* choose an efficiently ?? size */
diff --git a/src/jpeg_mem_dest.h b/src/jpeg_mem_dest.h
index b1ff103..e2ee396 100644
--- a/src/jpeg_mem_dest.h
+++ b/src/jpeg_mem_dest.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-//#include "config.h"
#ifndef __MIAV_JPEG_MEM_DEST_H__
#define __MIAV_JPEG_MEM_DEST_H__
diff --git a/src/libfame_wrapper.h b/src/libfame_wrapper.h
index db75880..9766acb 100644
--- a/src/libfame_wrapper.h
+++ b/src/libfame_wrapper.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAV_LIBFAME_WRAPPER_H__
#define __MIAV_LIBFAME_WRAPPER_H__
diff --git a/src/liblame_wrapper.h b/src/liblame_wrapper.h
index a4c56c5..6c69d21 100644
--- a/src/liblame_wrapper.h
+++ b/src/liblame_wrapper.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAV_LIBLAME_WRAPPER_H__
#define __MIAV_LIBLAME_WRAPPER_H__
diff --git a/src/libmplex_wrapper.cc b/src/libmplex_wrapper.cc
deleted file mode 100644
index 542d900..0000000
--- a/src/libmplex_wrapper.cc
+++ /dev/null
@@ -1,478 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/***************************************************************************
- * libmplex_wrapper.cc
- *
- * Sun Oct 30 12:28:47 CET 2005
- * Copyright 2005 Bent Bisballe Nyeng
- * deva@aasimon.org
- ****************************************************************************/
-
-/*
- * This file is part of MIaV.
- *
- * MIaV 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.
- *
- * MIaV 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 MIaV; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
- */
-#include "config.h"
-#include "libmplex_wrapper.h"
-#include "miav_config.h"
-
-#ifdef WITH_LIBMPLEX
-
-#include <mjpeg_types.h>
-#include <mjpeg_logging.h>
-#include <mpegconsts.h>
-
-#include <mplex/interact.hpp>
-#include <mplex/bits.hpp>
-#include <mplex/outputstrm.hpp>
-#include <mplex/multiplexor.hpp>
-
-#include <hugin.hpp>
-
-/**
- * FrameOutputStream - Wraps the File object
- */
-class FrameOutputStream : public OutputStream
-{
-public:
- FrameOutputStream(File *outputfile );
- int Open( );
- void Close();
- off_t SegmentSize( );
- void NextSegment();
- void Write(uint8_t *data, unsigned int len);
-
-private:
- off_t written;
- File *file;
-};
-
-
-
-FrameOutputStream::FrameOutputStream(File *outputfile )
-{
- file = outputfile;
- written = 0;
- DEBUG(frame, "FrameOutputStream - constructor");
-}
-
-int FrameOutputStream::Open()
-{
- // DEBUG(frame, "FrameOutputStream::Open");
- // Nothing to do here!
- return 0;
-}
-
-void FrameOutputStream::Close()
-{
- // DEBUG(frame, "FrameOutputStream::Close");
- // Nothing to do here!
-}
-
-
-off_t FrameOutputStream::SegmentSize()
-{
- // DEBUG(frame, "FrameOutputStream::SegmentSize - return: %d", written);
- return written;
-
- /*
- struct stat stb;
- fstat(fileno(strm), &stb);
- off_t written = stb.st_size;
- return written;
- */
-}
-
-void FrameOutputStream::NextSegment( )
-{
- // DEBUG(frame, "FrameOutputStream::NextSegment");
- // Nothing to do here!
- /*
- auto_ptr<char> prev_filename_buf( new char[strlen(cur_filename)+1] );
- char *prev_filename = prev_filename_buf.get();
- fclose(strm);
- ++segment_num;
- strcpy( prev_filename, cur_filename );
- snprintf( cur_filename, MAXPATHLEN, filename_pat, segment_num );
- if( strcmp( prev_filename, cur_filename ) == 0 ) {
- mjpeg_error_exit1("Need to split output but there appears to be no %%d in the filename pattern %s",
- filename_pat );
- }
- strm = fopen( cur_filename, "wb" );
- if( strm == NULL ) {
- mjpeg_error_exit1( "Could not open for writing: %s", cur_filename );
- }
- */
-}
-
-void FrameOutputStream::Write( uint8_t *buf, unsigned int len )
-{
- unsigned int write;
- write = file->Write(buf, len);
- written += write;
- // DEBUG(frame, "FrameOutputStream::Write - len: %d", len);
-}
-
-/**
- * FrameInputStream - Wraps the ThreadSafeQueuePriority objects, containing
- * the prosessed frames from libfame and liblame.
- */
-class FrameInputStream : public IBitStream
-{
-public:
- FrameInputStream(ThreadSafeQueuePriority *queue );
- ~FrameInputStream();
-
-private:
- Frame *getFrame();
- size_t ReadStreamBytes( uint8_t *buf, size_t size );
- bool EndOfStream();
-
- ThreadSafeQueuePriority *queue;
- bool seen_eof;
- Frame *frame;
- unsigned int read;
-};
-
-FrameInputStream::FrameInputStream(ThreadSafeQueuePriority *queue ) :
- IBitStream()
-{
- this->queue = queue;
- seen_eof = false;
- frame = NULL;
- read = 0;
- streamname = "MIaV Stream\0";
-
- // DEBUG(frame, "FrameInputStream - constructor", seen_eof);
-
- /*
- if ((fileh = fopen(bs_filename, "rb")) == NULL)
- {
- mjpeg_error_exit1( "Unable to open file %s for reading.", bs_filename);
- }
- filename = strcpy( new char[strlen(bs_filename)+1], bs_filename );
- streamname = filename;
-
- SetBufSize(buf_size);
- eobs = false;
- byteidx = 0;
- if (!ReadIntoBuffer())
- {
- if (buffered==0)
- {
- mjpeg_error_exit1( "Unable to read from %s.", bs_filename);
- }
- }
- */
- SetBufSize(BUFFER_SIZE);
- // SetBufSize(buf_size);
- eobs = false;
- byteidx = 0;
- if (!ReadIntoBuffer()) {
- if (buffered==0) {
- ERR(frame, "Unable to read from %s.", streamname);
- }
- }
-
- // DEBUG(frame, "FrameInputStream - leaving constructor", seen_eof);
-}
-
-
-/**
- Destructor: close the device containing the bit stream after a read
- process
-*/
-FrameInputStream::~FrameInputStream()
-{
- // DEBUG(frame, "FrameInputStream - destructor", seen_eof);
- // Nothing to do here!
- /*
- if (fileh)
- {
- fclose(fileh);
- delete filename;
- }
- fileh = 0;
- */
- Release(); // Hmmm.. wonder what this 'Release()' does!?
-}
-
-Frame *FrameInputStream::getFrame()
-{
- read = 0;
- return queue->pop();
-}
-
-bool FrameInputStream::EndOfStream()
-{
- // DEBUG(frame, "FrameInputStream::EndOfStream - return: %d", seen_eof);
- return seen_eof;
-}
-
-size_t FrameInputStream::ReadStreamBytes( uint8_t *buf, size_t size )
-{
- // DEBUG(frame, "FrameInputStream::ReadStreamBytes - size: %d", size);
- unsigned int copied = 0;
-
- while( copied < size ) {
-
- // If we read the entire frame, prepare to get a new one
- if(frame && read == frame->size) {
- delete frame;
- frame = NULL;
- }
-
- // If no frame is in the buffer, get one from the queue
- if(frame == NULL) frame = getFrame();
-
- // check for end of stream
- if( frame->endOfFrameStream == true) {
- seen_eof = true;
- return copied;
- }
-
- // If a frame exists in the buffer copy it to the output buffer
- // (No frame ocurres when *running is set to false)
- if( frame ) {
- unsigned int doread = (size - copied) < (frame->size - read) ?
- size - copied : (frame->size - read);
-
- // DEBUG(frame, "Requested: %d. Read: %d. Doread: %d. In buffer %d", size, (*read), doread, (*frame)->size);
-
- memcpy(buf + copied, frame->data + read, doread);
- read += doread;
- copied += doread;
- }
- }
-
- return copied;
-}
-
-/*******************************
- *
- * Command line job class - sets up a Multiplex Job based on command
- * line and File I/O...
- *
- ******************************/
-
-class MIaVMultiplexJob : public MultiplexJob
-{
-public:
- MIaVMultiplexJob(ThreadSafeQueuePriority *video_queue,
- ThreadSafeQueuePriority *audio_queue);
-
-private:
- bool ParseVideoOpt( const char *optarg );
- bool ParseLpcmOpt( const char *optarg );
-};
-
-MIaVMultiplexJob::MIaVMultiplexJob(ThreadSafeQueuePriority *video_queue,
- ThreadSafeQueuePriority *audio_queue) :
- MultiplexJob()
-{
- // DEBUG(job, "MIaVMultiplexJob - constructor");
- outfile_pattern = "/tmp/aaargh.mpg"; // Output file... or something
-
- verbose = 0; // Level of verbosity. 0 = quiet, 1 = normal 2 = verbose/debug
-
- VBR = config->readInt("video_bitrate") == 0; // Multiplex variable bit-rate video
-
- always_system_headers = true; // Create System header in every pack in generic formats
-
- // Specifies decoder buffers size in kB. [ 20...2000]
- if( ! ParseVideoOpt( "500" ) )
- ERR(job, "Illegal video decoder buffer size(s): %s", "500" );
-
- // --lpcm-params | -L samppersec:chan:bits [, samppersec:chan:bits]
- // if( ! ParseLpcmOpt( "48000:2:16" ) ) ERR(job, "Illegal LPCM option(s): %s", "48000:2:16" );
-
- data_rate = 0; //Specify data rate of output stream in kbit/sec (default 0=Compute from source streams)
- // Convert from kbit/sec (user spec) to 50B/sec units...
- data_rate = (( data_rate * 1000 / 8 + 49) / 50 ) * 50;
-
- audio_offset = 0; //Specify offset of timestamps (video-audio) in mSec
- video_offset = 0; //Specify offset of timestamps (video-audio) in mSec
-
- max_PTS = 0; // Multiplex only num seconds of material (default 0=multiplex all)
-
- packets_per_pack = 5; //Number of packets per pack generic formats [1..100]
-
- mux_format = 3; // Set defaults for particular MPEG profiles:
- // 0 = Generic MPEG1
- // 1 = VCD
- // 2 = user-rate VCD
- // 3 = Generic MPEG2
- // 4 = SVCD
- // 5 = user-rate SVCD
- // 6 = VCD Stills
- // 7 = SVCD Stills
- // 8 = DVD with NAV sectors
- // 9 = DVD
-
- sector_size = 2042; // Specify sector size in bytes for generic formats [256..16384]
-
- //max_segment_size = 0; // Maximum size of output file(s) in Mbyte (default: 0) (no limit)
-
- multifile_segment = true; // Don't switch to a new output file if a sequence end marker
- // is encountered ithe input video
-
- (void)mjpeg_default_handler_verbosity(verbose);
- INFO(mplex, "mplex version %s (%s %s)", VERSION,MPLEX_VER, MPLEX_DATE );
-
- // Connect streams
- vector<IBitStream *> inputs;
- if(video_queue) inputs.push_back(new FrameInputStream(video_queue));
- if(audio_queue) inputs.push_back(new FrameInputStream(audio_queue));
- SetupInputStreams( inputs );
-}
-
-/*************************************************************************
- Usage banner for the command line wrapper.
-*************************************************************************/
-/*
- mjpegtools mplex-2 version VERSION ( MPLEX_VER )
- Usage: %s [params] -o <output filename pattern> <input file>...
- %%d in the output file name is by segment count
- where possible params are:
- --verbose|-v num
- Level of verbosity. 0 = quiet, 1 = normal 2 = verbose/debug
- --format|-f fmt
- Set defaults for particular MPEG profiles
- [0 = Generic MPEG1, 1 = VCD, 2 = user-rate VCD, 3 = Generic MPEG2,
- 4 = SVCD, 5 = user-rate SVCD
- 6 = VCD Stills, 7 = SVCD Stills, 8 = DVD with NAV sectors, 9 = DVD]
- --mux-bitrate|-r num
- Specify data rate of output stream in kbit/sec
- (default 0=Compute from source streams)
- --video-buffer|-b num [, num...]
- Specifies decoder buffers size in kB. [ 20...2000]
- --lpcm-params | -L samppersec:chan:bits [, samppersec:chan:bits]
- --mux-limit|-l num
- Multiplex only num seconds of material (default 0=multiplex all)
- --sync-offset|-O num ms|s|mpt
- Specify offset of timestamps (video-audio) in mSec
- --sector-size|-s num
- Specify sector size in bytes for generic formats [256..16384]
- --vbr|-V
- Multiplex variable bit-rate video
- --packets-per-pack|-p num
- Number of packets per pack generic formats [1..100]
- --system-headers|-h
- Create System header in every pack in generic formats
- --max-segment-size|-S size
- Maximum size of output file(s) in Mbyte (default: 0) (no limit)
- --ignore-seqend-markers|-M
- Don't switch to a new output file if a sequence end marker
- is encountered ithe input video.
- --workaround|-W workaround [, workaround ]
- --help|-?
- Print this lot out!
-*/
-
-
-bool MIaVMultiplexJob::ParseLpcmOpt( const char *optarg )
-{
- char *endptr, *startptr;
- unsigned int samples_sec;
- unsigned int channels;
- unsigned int bits_sample;
- endptr = const_cast<char *>(optarg);
- do {
- startptr = endptr;
- samples_sec = static_cast<unsigned int>(strtol(startptr, &endptr, 10));
- if( startptr == endptr || *endptr != ':' )
- return false;
-
- startptr = endptr+1;
- channels = static_cast<unsigned int>(strtol(startptr, &endptr, 10));
- if(startptr == endptr || *endptr != ':' )
- return false;
-
- startptr = endptr+1;
- bits_sample = static_cast<unsigned int>(strtol(startptr, &endptr, 10));
- if( startptr == endptr )
- return false;
-
- LpcmParams *params = LpcmParams::Checked( samples_sec,
- channels,
- bits_sample );
- if( params == 0 )
- return false;
- lpcm_param.push_back(params);
- if( *endptr == ',' )
- ++endptr;
- } while( *endptr != '\0' );
- return true;
-}
-
-bool MIaVMultiplexJob::ParseVideoOpt( const char *optarg )
-{
- char *endptr, *startptr;
- unsigned int buffer_size;
- endptr = const_cast<char *>(optarg);
- do
- {
- startptr = endptr;
- buffer_size = static_cast<unsigned int>(strtol(startptr, &endptr, 10));
- if( startptr == endptr )
- return false;
-
- VideoParams *params = VideoParams::Checked( buffer_size );
- if( params == 0 )
- return false;
- video_param.push_back(params);
- if( *endptr == ',' )
- ++endptr;
- }
- while( *endptr != '\0' );
- return true;
-}
-
-LibMPlexWrapper::LibMPlexWrapper(File *outputfile,
- ThreadSafeQueuePriority *video_queue,
- ThreadSafeQueuePriority *audio_queue)
-{
- this->outputfile = outputfile;
- this->video_queue = video_queue;
- this->audio_queue = audio_queue;
-}
-
-LibMPlexWrapper::~LibMPlexWrapper()
-{
-}
-
-
-void LibMPlexWrapper::multiplex()
-{
- // DEBUG(mplex, "MPLEX!");
- // sleep(10);
- // DEBUG(mplex, "The road goes ever on and on...");
- MIaVMultiplexJob job(video_queue, audio_queue);
- FrameOutputStream output(outputfile);
- Multiplexor mux(job, output);
- mux.Multiplex();
-}
-
-
-#ifdef LIBMPLEX_WRAPPER_TEST
-int main (int argc, char* argv[])
-{
- LibMPlexWrapper mplex;
- mplex.multiplex();
- return 0;
-}
-#endif/*LIBMPLEX_WRAPPER_TEST*/
-
-#endif/*WITH_LIBMPLEX*/
diff --git a/src/libmplex_wrapper.h b/src/libmplex_wrapper.h
deleted file mode 100644
index 60c80fe..0000000
--- a/src/libmplex_wrapper.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/***************************************************************************
- * libmplex_wrapper.h
- *
- * Sun Oct 30 12:28:47 CET 2005
- * Copyright 2005 Bent Bisballe Nyeng
- * deva@aasimon.org
- ****************************************************************************/
-
-/*
- * This file is part of MIaV.
- *
- * MIaV 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.
- *
- * MIaV 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 MIaV; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
- */
-#include "config.h"
-#ifndef __MIAV_LIBMPLEX_WRAPPER_H__
-#define __MIAV_LIBMPLEX_WRAPPER_H__
-
-#ifdef WITH_LIBMPLEX
-
-#include "file.h"
-#include "threadsafe_queue_priority.h"
-
-class LibMPlexWrapper {
-public:
- LibMPlexWrapper(File *outputfile,
- ThreadSafeQueuePriority *video_queue,
- ThreadSafeQueuePriority *audio_queue);
- ~LibMPlexWrapper();
-
- void multiplex();
-
-private:
- File *outputfile;
- ThreadSafeQueuePriority *video_queue;
- ThreadSafeQueuePriority *audio_queue;
-};
-#endif/*WITH_LIBMPLEX*/
-
-#endif/*__MIAV_LIBMPLEX_WRAPPER_H__*/
diff --git a/src/mainwindow.cc b/src/mainwindow.cc
index 9d1c190..8415796 100644
--- a/src/mainwindow.cc
+++ b/src/mainwindow.cc
@@ -28,7 +28,6 @@
#include <QPainter>
#include <QPicture>
-
#include <QPushButton>
#include <QFont>
#include <QPixmap>
@@ -36,19 +35,14 @@
#include <QImage>
#include <QLayout>
#include <QGroupBox>
-
#include <QStatusBar>
#include <math.h>
-//#include "mgui_alert.h"
-//#include "mgui_datasocket.h"
+#include <config.h>
#include "miav_config.h"
-#include <config.h>
-//"miav-grab.h"
-
// Control fade speed of record bar.
#define SPEED 0.07f
diff --git a/src/miav_config.h b/src/miav_config.h
index b43e001..bdd3fdd 100644
--- a/src/miav_config.h
+++ b/src/miav_config.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAV_MIAV_CONFIG_H__
#define __MIAV_MIAV_CONFIG_H__
diff --git a/src/miav_daemon.cc b/src/miav_daemon.cc
index 06a0e53..d86d448 100644
--- a/src/miav_daemon.cc
+++ b/src/miav_daemon.cc
@@ -31,23 +31,22 @@
#include <stdlib.h>
#include <hugin.hpp>
+#include <config.h>
#include "miav_config.h"
#include "server.h"
#include "socket.h"
-MiavDaemon::MiavDaemon()
-{}
+MiavDaemon::MiavDaemon(int port)
+{
+ this->port = port;
+}
MiavDaemon::~MiavDaemon()
{}
int MiavDaemon::daemon_main()
{
- MiavConfig cfg(ETC"/miav.conf");
- config = new MiavConfig(ETC"/miav.conf");
-
- int port = config->readInt("server_port");
pid_t childpid; // variable to store the child's pid
signal(SIGCLD, SIG_IGN); // Ved SIGCHILD til IGNORE maa wait/waitpid ikke kaldes
diff --git a/src/miav_daemon.h b/src/miav_daemon.h
index 6ab469e..005ed49 100644
--- a/src/miav_daemon.h
+++ b/src/miav_daemon.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAV_MIAV_DAEMON_H__
#define __MIAV_MIAV_DAEMON_H__
@@ -32,11 +31,13 @@
class MiavDaemon: public Daemon {
public:
- MiavDaemon();
+ MiavDaemon(int port);
~MiavDaemon();
private:
int daemon_main();
+
+ int port;
};
#endif/*__MIAV_MIAV_DAEMON_H__*/
diff --git a/src/miavd.cc b/src/miavd.cc
index 2a9b97b..1658648 100644
--- a/src/miavd.cc
+++ b/src/miavd.cc
@@ -24,23 +24,151 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
+#include <stdio.h>
+#include <string.h>
+#include <getopt.h>
+
+#include <hugin.hpp>
+
#include <config.h>
#include "miav_daemon.h"
-
#include "miav_config.h"
-#include <stdio.h>
-#include <string.h>
+static const char version_str[] =
+"Pentominos Dataserver - Miav v" VERSION "\n"
+;
+
+static const char copyright_str[] =
+"Copyright (C) 2006-2007 Bent Bisballe Nyeng - Aasimon.org.\n"
+"This is free software. You may redistribute copies of it under the terms of\n"
+"the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+"\n"
+"Written by Bent Bisballe Nyeng (deva@aasimon.org)\n"
+;
+
+static const char usage_str[] =
+"Usage: %s [options]\n"
+"Options:\n"
+" -c, --config file Read configfile from 'file' (default "ETC"/miav.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"
+" -v, --version Print version information and exit.\n"
+" -h, --help Print this message and exit.\n"
+" -D, --debug ddd Enable debug messages on 'ddd'; see documentation for details\n"
+" -L, --logfile file Write output to file, instead of stderr.\n"
+ /*
+" -P, --pidfile file Write pid of the running daemon to file.\n"
+ */
+;
int main(int argc, char *argv[])
{
- MiavDaemon daemon;
+ const char *hugin_filter = "+all";
+ const char *logfile = NULL;
+ int c;
+ std::string configfile = ETC"/miav.conf";
+ char *user = NULL;
+ char *group = NULL;
+ bool foreground = false;
+ // std::string pidfile;
+
+ unsigned int hugin_flags = 0;
+
+ int option_index = 0;
+ while(1) {
+ // int this_option_optind = optind ? optind : 1;
+ static struct option long_options[] = {
+ {"foreground", no_argument, 0, 'f'},
+ {"config", required_argument, 0, 'c'},
+ {"user", required_argument, 0, 'u'},
+ {"group", required_argument, 0, 'g'},
+ {"help", no_argument, 0, 'h'},
+ {"version", no_argument, 0, 'v'},
+ {"debug", required_argument, 0, 'D'},
+ //{"pidfile", required_argument, 0, 'P'},
+ {"logfile", required_argument, 0, 'L'},
+ {0, 0, 0, 0}
+ };
+
+ c = getopt_long (argc, argv, "hvfc:u:g:D:P:L:",
+ long_options, &option_index);
+
+ if (c == -1)
+ break;
+
+ switch(c) {
+ case 'L':
+ hugin_flags |= HUG_FLAG_OUTPUT_TO_FILE;
+ logfile = strdup(optarg);
+ break;
+
+ case 'c':
+ configfile = optarg;
+ break;
+
+ case 'f':
+ foreground = true;
+ break;
+
+ case 'u':
+ user = strdup(optarg);
+ break;
+
+ case 'g':
+ group = strdup(optarg);
+ break;
+
+ case 'D':
+ hugin_flags |= HUG_FLAG_USE_FILTER;
+ hugin_filter = optarg;
+ break;
+ /*
+ case 'P':
+ pidfile = optarg;
+ break;
+ */
+ case '?':
+ case 'h':
+ printf("%s", version_str);
+ printf(usage_str, argv[0]);
+ return 0;
+
+ case 'v':
+ printf("%s", version_str);
+ printf("%s", copyright_str);
+ return 0;
+
+ default:
+ break;
+ }
+ }
+
+ if(logfile == NULL) hugin_flags |= HUG_FLAG_OUTPUT_TO_STDOUT;
+
+ hug_status_t status = hug_init(hugin_flags,
+ HUG_OPTION_FILTER, hugin_filter,
+ HUG_OPTION_FILENAME, logfile,
+ HUG_OPTION_END);
+ if(status != HUG_STATUS_OK) {
+ printf("Error: %d\n", status);
+ return 1;
+ }
+
+ MiavConfig cfg(configfile.c_str());
+ config = &cfg; // Global config object
+
+ int port = cfg.readInt("server_port");
+
+ MiavDaemon daemon(port);
- MiavConfig cfg(ETC"/miav.conf");
+ const char *cuser = cfg.readString("server_user")->c_str();
+ const char *cgroup = cfg.readString("server_group")->c_str();
- string *user = cfg.readString("server_user");
- string *group = cfg.readString("server_group");
+ if(user) cuser = user;
+ if(group) cgroup = group;
- return daemon.run(user->c_str(), group->c_str(), true);
+ return daemon.run(cuser, cgroup, foreground);
}
diff --git a/src/mov_encoder.h b/src/mov_encoder.h
index 9b99959..18a7b46 100644
--- a/src/mov_encoder.h
+++ b/src/mov_encoder.h
@@ -29,7 +29,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "config.h"
#ifndef __RTVIDEOREC_ENCODER_H
#define __RTVIDEOREC_ENCODER_H
diff --git a/src/mov_encoder_writer.cc b/src/mov_encoder_writer.cc
index 7866995..c3e4c03 100644
--- a/src/mov_encoder_writer.cc
+++ b/src/mov_encoder_writer.cc
@@ -42,7 +42,6 @@ using namespace std;
#include "miav_config.h"
#include "multiplexer.h"
-#include "libmplex_wrapper.h"
#include "multicast_configuration.h"
MovEncoderWriter::MovEncoderWriter(const char *clientip, const char* cpr,
@@ -78,6 +77,7 @@ MovEncoderWriter::MovEncoderWriter(const char *clientip, const char* cpr,
file = new File(fname, "mpg");
+ /* // DISABLE MULTICAST
MulticastConfiguration mcconfig(ETC"/multicast.conf");
mcastconf_t mcclientconf = mcconfig.getConf((char*)clientip);
@@ -91,6 +91,7 @@ MovEncoderWriter::MovEncoderWriter(const char *clientip, const char* cpr,
multicast = NULL;
if(mcclientconf.enabled) multicast = new Multicast(mcclientconf);
+ */
video_queue = video_q;
audio_queue = audio_q;
@@ -109,13 +110,8 @@ void MovEncoderWriter::thread_main()
{
DEBUG(mov, "MovEncoderWriter::run");
-#ifdef WITH_LIBMPLEX
- LibMPlexWrapper mplex(file, video_queue, audio_queue);
- mplex.multiplex();
-#else/*WITH_LIBMPLEX*/
Multiplexer multiplexer(file, multicast, &running, video_queue, audio_queue);
multiplexer.multiplex();
-#endif/*WITH_LIBMPLEX*/
DEBUG(mov, "MovEncoderWriter::stop");
}
diff --git a/src/mov_encoder_writer.h b/src/mov_encoder_writer.h
index 0732f35..c0af266 100644
--- a/src/mov_encoder_writer.h
+++ b/src/mov_encoder_writer.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAV_MOV_ENCODER_WRITER_H__
#define __MIAV_MOV_ENCODER_WRITER_H__
diff --git a/src/multicast.h b/src/multicast.h
index d4fa784..1e4978a 100644
--- a/src/multicast.h
+++ b/src/multicast.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAV_MULTICAST_H__
#define __MIAV_MULTICAST_H__
diff --git a/src/multicast_configuration.h b/src/multicast_configuration.h
index 0de3e29..4b51b5d 100644
--- a/src/multicast_configuration.h
+++ b/src/multicast_configuration.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAV_MULTICAST_CONFIGURATION_H__
#define __MIAV_MULTICAST_CONFIGURATION_H__
diff --git a/src/multiplexer.cc b/src/multiplexer.cc
index ae51139..61ecfa6 100644
--- a/src/multiplexer.cc
+++ b/src/multiplexer.cc
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#include "multiplexer.h"
#include <netinet/in.h>
diff --git a/src/multiplexer.h b/src/multiplexer.h
index 889e7cc..e622145 100644
--- a/src/multiplexer.h
+++ b/src/multiplexer.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAV_MULTIPLEXER_H__
#define __MIAV_MULTIPLEXER_H__
diff --git a/src/mutex.cc b/src/mutex.cc
index 483d71a..5649515 100644
--- a/src/mutex.cc
+++ b/src/mutex.cc
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#include "mutex.h"
Mutex::Mutex()
diff --git a/src/mutex.h b/src/mutex.h
index 0b1f4e7..b898069 100644
--- a/src/mutex.h
+++ b/src/mutex.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAV_MUTEX_H__
#define __MIAV_MUTEX_H__
diff --git a/src/network.cc b/src/network.cc
index 4196cc9..2aca225 100644
--- a/src/network.cc
+++ b/src/network.cc
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include <config.h>
#include "network.h"
#include <stdlib.h>
diff --git a/src/network.h b/src/network.h
index e00dac7..dab6bb9 100644
--- a/src/network.h
+++ b/src/network.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAVLIB_NETWORK_H__
#define __MIAVLIB_NETWORK_H__
diff --git a/src/package.h b/src/package.h
index a16557a..cd557b8 100644
--- a/src/package.h
+++ b/src/package.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAVLIB_PACKAGE_H__
#define __MIAVLIB_PACKAGE_H__
diff --git a/src/queue.h b/src/queue.h
index 3cb6fbc..6efe59f 100644
--- a/src/queue.h
+++ b/src/queue.h
@@ -31,7 +31,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __RTVIDEOREC_QUEUE_H
#define __RTVIDEOREC_QUEUE_H
diff --git a/src/recedge.h b/src/recedge.h
index ecbc37a..d74891d 100644
--- a/src/recedge.h
+++ b/src/recedge.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAV_RECEDGE_H__
#define __MIAV_RECEDGE_H__
diff --git a/src/semaphore.cc b/src/semaphore.cc
index 147bd24..c4a772c 100644
--- a/src/semaphore.cc
+++ b/src/semaphore.cc
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#include "semaphore.h"
Semaphore::Semaphore()
diff --git a/src/semaphore.h b/src/semaphore.h
index 85f4c09..cb32b84 100644
--- a/src/semaphore.h
+++ b/src/semaphore.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAV_SEMAPHORE_H__
#define __MIAV_SEMAPHORE_H__
diff --git a/src/server_status.h b/src/server_status.h
index 82ec8ec..c7f2d13 100644
--- a/src/server_status.h
+++ b/src/server_status.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAV_SERVER_STATUS_H__
#define __MIAV_SERVER_STATUS_H__
diff --git a/src/socket.h b/src/socket.h
index dde4729..49c15b2 100644
--- a/src/socket.h
+++ b/src/socket.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAVLIB_SOCKET_H__
#define __MIAVLIB_SOCKET_H__
diff --git a/src/thread.cc b/src/thread.cc
index 2791c53..0ee3f1c 100644
--- a/src/thread.cc
+++ b/src/thread.cc
@@ -24,9 +24,8 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include <config.h>
-
#include "thread.h"
+
#include <stdio.h>
static void* thread_run(void *data) {
diff --git a/src/thread.h b/src/thread.h
index 6b7a52a..ad6f015 100644
--- a/src/thread.h
+++ b/src/thread.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __THREAD_H__
#define __THREAD_H__
diff --git a/src/threadsafe_queue.cc b/src/threadsafe_queue.cc
index 89f2d6a..69293fd 100644
--- a/src/threadsafe_queue.cc
+++ b/src/threadsafe_queue.cc
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#include "threadsafe_queue.h"
/*
template <typename T>
diff --git a/src/threadsafe_queue.h b/src/threadsafe_queue.h
index b6d5725..81b568a 100644
--- a/src/threadsafe_queue.h
+++ b/src/threadsafe_queue.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAV_THREADSAFE_QUEUE_H__
#define __MIAV_THREADSAFE_QUEUE_H__
diff --git a/src/threadsafe_queue_fifo.cc b/src/threadsafe_queue_fifo.cc
index 6dbcb67..1d9aa79 100644
--- a/src/threadsafe_queue_fifo.cc
+++ b/src/threadsafe_queue_fifo.cc
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#include "threadsafe_queue_fifo.h"
ThreadSafeQueueFIFO::ThreadSafeQueueFIFO()
diff --git a/src/threadsafe_queue_fifo.h b/src/threadsafe_queue_fifo.h
index ee3ac3b..350ed61 100644
--- a/src/threadsafe_queue_fifo.h
+++ b/src/threadsafe_queue_fifo.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAV_THREADSAFE_QUEUE_FIFO_H__
#define __MIAV_THREADSAFE_QUEUE_FIFO_H__
diff --git a/src/threadsafe_queue_priority.cc b/src/threadsafe_queue_priority.cc
index 3ffe027..f32e523 100644
--- a/src/threadsafe_queue_priority.cc
+++ b/src/threadsafe_queue_priority.cc
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#include "threadsafe_queue_priority.h"
#include "util.h"
diff --git a/src/threadsafe_queue_priority.h b/src/threadsafe_queue_priority.h
index a310271..9aaf7da 100644
--- a/src/threadsafe_queue_priority.h
+++ b/src/threadsafe_queue_priority.h
@@ -24,7 +24,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __MIAV_THREADSAFE_QUEUE_PRIORITY_H__
#define __MIAV_THREADSAFE_QUEUE_PRIORITY_H__
diff --git a/src/util.cc b/src/util.cc
index 11f1402..0cbe25b 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -31,7 +31,7 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include <config.h>
+#include "util.h"
#include <stdio.h>
#include <stdlib.h>
@@ -41,8 +41,6 @@
// For nanosleep
#include <time.h>
-#include "util.h"
-
void *xmalloc(size_t s)
{
void *p;
diff --git a/src/util.h b/src/util.h
index ef21e06..385826e 100644
--- a/src/util.h
+++ b/src/util.h
@@ -31,7 +31,6 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#ifndef __RTVIDEOREC_UTIL_H
#define __RTVIDEOREC_UTIL_H