From 1d30dc5da0c148982032a2b5a5bdece10b3e80ae Mon Sep 17 00:00:00 2001 From: deva Date: Sat, 8 Oct 2005 16:24:33 +0000 Subject: *** empty log message *** --- 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 +++++++----- 6 files changed, 22 insertions(+), 24 deletions(-) (limited to 'src') 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