summaryrefslogtreecommitdiff
path: root/src/mov_encoder_thread.cc
diff options
context:
space:
mode:
authordeva <deva>2005-06-14 12:29:40 +0000
committerdeva <deva>2005-06-14 12:29:40 +0000
commit430524810e67d3c223a2ab819f45b882b419c45d (patch)
tree0abb4b2dd3dabc414c755c30e52d0b5022ee8670 /src/mov_encoder_thread.cc
parent0836a6e06f86e366017da3b2b2c132b3a4f2c877 (diff)
Incorporated the use of the Info object everywhere... also using the log functionality.
Diffstat (limited to 'src/mov_encoder_thread.cc')
-rw-r--r--src/mov_encoder_thread.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/mov_encoder_thread.cc b/src/mov_encoder_thread.cc
index 2febb4f..c1d3e56 100644
--- a/src/mov_encoder_thread.cc
+++ b/src/mov_encoder_thread.cc
@@ -31,6 +31,9 @@
/*
* $Log$
+ * Revision 1.10 2005/06/14 12:29:40 deva
+ * Incorporated the use of the Info object everywhere... also using the log functionality.
+ *
* Revision 1.9 2005/05/26 12:48:36 deva
* *** empty log message ***
*
@@ -65,14 +68,16 @@
#include <errno.h>
#include "miav_config.h"
-MovEncoderThread::MovEncoderThread(const char *filename)
+MovEncoderThread::MovEncoderThread(const char *cpr, Info *i)
{
+ info = i;
outputqueue = new FramePriorityQueue();
inputqueue = new FrameVectorQueue();
block = new FrameVector();
num_frames_in_block = config->readString("frame_sequence")->length();
- fprintf(stderr, "Frame sequence length [%d]\n", num_frames_in_block); fflush(stderr);
+
+ info->log("Frame sequence length %d", num_frames_in_block);
threads = config->readInt("encoding_threads");
@@ -86,14 +91,15 @@ MovEncoderThread::MovEncoderThread(const char *filename)
pthread_mutex_init (&input_mutex, NULL);
pthread_mutex_init (&output_mutex, NULL);
- writer = new MovEncoderWriter(filename, outputqueue, &out_sem, &output_mutex);
+ writer = new MovEncoderWriter(cpr, outputqueue, &out_sem, &output_mutex, info);
writer_tid = new pthread_t;
pthread_create (writer_tid, NULL, thread_run, writer);
for(int cnt = 0; cnt < threads; cnt++) {
encs.push_back(new MovEncoder(&read_sem,
inputqueue, &in_sem, &input_mutex,
- outputqueue, &out_sem, &output_mutex));
+ outputqueue, &out_sem, &output_mutex,
+ info));
tids.push_back(new pthread_t);
pthread_create (tids[cnt], NULL, thread_run, encs[cnt]);
}
@@ -148,7 +154,7 @@ MovEncoderThread::~MovEncoderThread()
void MovEncoderThread::encode(Frame* frame)
{
if(frame == NULL) {
- fprintf(stderr, "NULL frame detected.\n");
+ info->log("NULL frame detected, exiting.");
// Terminate
return;
}