summaryrefslogtreecommitdiff
path: root/src/mov_encoder_writer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mov_encoder_writer.cc')
-rw-r--r--src/mov_encoder_writer.cc22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/mov_encoder_writer.cc b/src/mov_encoder_writer.cc
index 717998a..732f9ba 100644
--- a/src/mov_encoder_writer.cc
+++ b/src/mov_encoder_writer.cc
@@ -47,8 +47,8 @@ using namespace std;
#include "multiplexer.h"
MovEncoderWriter::MovEncoderWriter(const char* cpr,
- FramePriorityQueue *v_q, pthread_mutex_t *v_m, sem_t *v_s,
- FramePriorityQueue *a_q, pthread_mutex_t *a_m, sem_t *a_s,
+ ThreadSafeQueuePriority *video_q,
+ ThreadSafeQueuePriority *audio_q,
Info *i)
{
info = i;
@@ -74,23 +74,15 @@ MovEncoderWriter::MovEncoderWriter(const char* cpr,
ltime = localtime(&t);
sprintf(date, "%.4d%.2d%.2d",
ltime->tm_year + 1900,
- ltime->tm_mon,
+ ltime->tm_mon + 1, // Ranging from 0 to 11
ltime->tm_mday);
sprintf(fname, "%s/%s/%s/%s-%s-", server_root->c_str(), birthmonth, cpr, cpr, date);
file = new File(fname, "mpg", info);
- video_queue = v_q;
- video_sem = v_s;
- video_mutex = v_m;
-
- audio_queue = a_q;
- audio_sem = a_s;
- audio_mutex = a_m;
-
- video_frame_number = 0;
- audio_frame_number = 0;
+ video_queue = video_q;
+ audio_queue = audio_q;
running = true;
}
@@ -107,8 +99,8 @@ void MovEncoderWriter::thread_main()
info->info("MovEncoderWriter::run");
Multiplexer multiplexer(file, info, &running,
- video_queue, video_mutex, video_sem,
- audio_queue, audio_mutex, audio_sem);
+ video_queue,
+ audio_queue);
multiplexer.multiplex();
info->info("MovEncoderWriter::stop");