From 1d30dc5da0c148982032a2b5a5bdece10b3e80ae Mon Sep 17 00:00:00 2001 From: deva Date: Sat, 8 Oct 2005 16:24:33 +0000 Subject: *** empty log message *** --- etc/miav.conf | 10 ++++++++++ src/mov_encoder.cc | 2 +- src/mov_encoder.h | 4 ++-- src/mov_encoder_thread.cc | 3 ++- src/mov_encoder_thread.h | 2 +- src/threadsafe_queue_fifo.cc | 23 +++++++++-------------- src/threadsafe_queue_fifo.h | 12 +++++++----- 7 files changed, 32 insertions(+), 24 deletions(-) diff --git a/etc/miav.conf b/etc/miav.conf index 50d36b7..708b4f6 100644 --- a/etc/miav.conf +++ b/etc/miav.conf @@ -35,6 +35,16 @@ server_group = "miav" server_movie_root = "/home/miav/miav_movie_files" server_image_root = "/home/miav/miav_image_files" +# Multicast adresses: +# 224.0.0.1 All systems on this subnet +# 224.0.0.2 All routers on this subnet +# 224.0.0.5 OSPF routers +# 224.0.0.6 OSPF designated routers +# 224.0.0.12 DHCP server/relay agent +server_multicast = false +server_multicast_addr = "224.0.0.1" +server_multicast_port = 1234 + # 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 diff --git a/src/mov_encoder.cc b/src/mov_encoder.cc index a455f42..1132b63 100644 --- a/src/mov_encoder.cc +++ b/src/mov_encoder.cc @@ -45,7 +45,7 @@ #include "libfame_wrapper.h" MovEncoder::MovEncoder(volatile bool *r, sem_t *r_sem, - ThreadSafeQueueFIFO *in, + ThreadSafeQueueFIFO *in, ThreadSafeQueuePriority *video_out, ThreadSafeQueuePriority *audio_out, Info *i) diff --git a/src/mov_encoder.h b/src/mov_encoder.h index ace016c..8910f4b 100644 --- a/src/mov_encoder.h +++ b/src/mov_encoder.h @@ -54,7 +54,7 @@ using namespace std; class MovEncoder : public Thread { public: MovEncoder(volatile bool *r, sem_t *r_sem, - ThreadSafeQueueFIFO< FrameVector*> *in, + ThreadSafeQueueFIFO *in, ThreadSafeQueuePriority *video_out, ThreadSafeQueuePriority *audio_out, Info *info); @@ -68,7 +68,7 @@ private: Info *info; // Input queue - ThreadSafeQueueFIFO< FrameVector* > *inputqueue; + ThreadSafeQueueFIFO *inputqueue; // Output queues ThreadSafeQueuePriority *video_output_queue; diff --git a/src/mov_encoder_thread.cc b/src/mov_encoder_thread.cc index 7c7f5d9..2e4c16b 100644 --- a/src/mov_encoder_thread.cc +++ b/src/mov_encoder_thread.cc @@ -35,7 +35,8 @@ MovEncoderThread::MovEncoderThread(const char *cpr, Info *i) info->info("MovEncoderThread"); // Queue - inputqueue = new ThreadSafeQueueFIFO(); + // inputqueue = new ThreadSafeQueueFIFO(); + inputqueue = new ThreadSafeQueueFIFO(); // Initialize read semaphore sem_init(&read_sem, 0, 0); diff --git a/src/mov_encoder_thread.h b/src/mov_encoder_thread.h index 8cc24f8..3e7c1aa 100644 --- a/src/mov_encoder_thread.h +++ b/src/mov_encoder_thread.h @@ -58,7 +58,7 @@ private: Info *info; // FrameVectorQueue *inputqueue; - ThreadSafeQueueFIFO< FrameVector* > *inputqueue; + ThreadSafeQueueFIFO *inputqueue; FrameVector *block; //thread stuff diff --git a/src/threadsafe_queue_fifo.cc b/src/threadsafe_queue_fifo.cc index 50c1067..6dbcb67 100644 --- a/src/threadsafe_queue_fifo.cc +++ b/src/threadsafe_queue_fifo.cc @@ -27,43 +27,38 @@ #include "config.h" #include "threadsafe_queue_fifo.h" -template -ThreadSafeQueueFIFO::ThreadSafeQueueFIFO() +ThreadSafeQueueFIFO::ThreadSafeQueueFIFO() { } -template -ThreadSafeQueueFIFO::~ThreadSafeQueueFIFO() +ThreadSafeQueueFIFO::~ThreadSafeQueueFIFO() { } -template -void ThreadSafeQueueFIFO::push(T t) +void ThreadSafeQueueFIFO::push(FrameVector *framevector) { mutex.lock(); - queue.push(t); + queue.push(framevector); mutex.unlock(); semaphore.post(); } -template -T ThreadSafeQueueFIFO::pop() +FrameVector *ThreadSafeQueueFIFO::pop() { semaphore.wait(); - T t; + FrameVector *framevector; mutex.lock(); - t = queue.front(); + framevector = queue.front(); queue.pop(); mutex.unlock(); - return t; + return framevector; } -template -int ThreadSafeQueueFIFO::size() +int ThreadSafeQueueFIFO::size() { int sz; diff --git a/src/threadsafe_queue_fifo.h b/src/threadsafe_queue_fifo.h index 9baf82e..ee3ac3b 100644 --- a/src/threadsafe_queue_fifo.h +++ b/src/threadsafe_queue_fifo.h @@ -29,20 +29,22 @@ #define __MIAV_THREADSAFE_QUEUE_FIFO_H__ #include "threadsafe_queue.h" + +#include "frame.h" + #include -template -class ThreadSafeQueueFIFO: public ThreadSafeQueue { +class ThreadSafeQueueFIFO: public ThreadSafeQueue { public: ThreadSafeQueueFIFO(); ~ThreadSafeQueueFIFO(); - void push(T t); - T pop(); + void push(FrameVector* framevector); + FrameVector* pop(); int size(); private: - std::queue queue; + std::queue queue; }; #endif/*__MIAV_THREADSAFE_QUEUE_FIFO_H__*/ -- cgit v1.2.3