summaryrefslogtreecommitdiff
path: root/src/mov_encoder.cc
diff options
context:
space:
mode:
authordeva <deva>2005-07-22 15:59:39 +0000
committerdeva <deva>2005-07-22 15:59:39 +0000
commitf9733b615614a990d3e047f251b4ad1ea48a0534 (patch)
treeb73c2304ab5984da394bf382302fd9d9b1c8c60f /src/mov_encoder.cc
parent5d12a7bbc5d935e56afcea2d8af60e08ff82f02f (diff)
*** empty log message ***
Diffstat (limited to 'src/mov_encoder.cc')
-rw-r--r--src/mov_encoder.cc31
1 files changed, 24 insertions, 7 deletions
diff --git a/src/mov_encoder.cc b/src/mov_encoder.cc
index f21cc3a..74f9b90 100644
--- a/src/mov_encoder.cc
+++ b/src/mov_encoder.cc
@@ -39,6 +39,9 @@
/*
* $Log$
+ * Revision 1.36 2005/07/22 15:59:39 deva
+ * *** empty log message ***
+ *
* Revision 1.35 2005/07/07 12:42:19 deva
* *** empty log message ***
*
@@ -150,9 +153,6 @@ MovEncoder::MovEncoder(sem_t *r_sem,
info = i;
info->info("MovEncoder");
- // fame = new LibFAMEWrapper(info);
- // lame = new LibLAMEWrapper(info);
-
running = true;
inputqueue = in;
@@ -170,11 +170,11 @@ MovEncoder::MovEncoder(sem_t *r_sem,
MovEncoder::~MovEncoder()
{
info->info("~MovEncoder");
-
- // delete fame;
- // delete lame;
}
+
+//#define COPY_DV 1
+
// this runs in a thread
void MovEncoder::thread_main()
{
@@ -192,11 +192,15 @@ void MovEncoder::thread_main()
Frame *out_a_frame;
LibFAMEWrapper fame(info);
- LibLAMEWrapper lame(info);
+ // LibLAMEWrapper lame(info);
while(running) {
sem_wait(input_sem);
+ // Make a new instance for every frame sequence (usually 5) to ensure no
+ // frame dependencies are broken when running multithreaded.
+ LibLAMEWrapper lame(info);
+
// Lock inout mutex
pthread_mutex_lock(input_mutex);
item = inputqueue->front();
@@ -211,6 +215,18 @@ void MovEncoder::thread_main()
for(unsigned int cnt = 0; cnt < item->size(); cnt++) {
in_frame = item->at(cnt);
+#ifdef COPY_DV
+
+ // Encode video
+ out_v_frame = new Frame(in_frame->data, in_frame->size);
+ out_v_frame->number = in_frame->number;
+
+ // Encode audio
+ out_a_frame = new Frame(in_frame->data, in_frame->size);
+ out_a_frame->number = in_frame->number + 1;
+
+#else /*COPY_DV*/
+
// Encode video
out_v_frame = fame.encode(in_frame);
out_v_frame->number = in_frame->number;
@@ -219,6 +235,7 @@ void MovEncoder::thread_main()
out_a_frame = lame.encode(in_frame);
out_a_frame->number = in_frame->number + 1;
+#endif /*COPY_DV*/
delete in_frame;
// Lock output mutex