diff options
author | deva <deva> | 2005-05-25 13:11:42 +0000 |
---|---|---|
committer | deva <deva> | 2005-05-25 13:11:42 +0000 |
commit | 0e7d7464b0f87ce82fa5c48e350a2d51fcef4882 (patch) | |
tree | db63bd5b36bc437b84485ad463d45bfb5c2f0bcb | |
parent | 30741368102da5e5a8e4f8b897f2502edfa0165b (diff) |
Made unfreeze close connection, when no recording is done.
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/camera.cc | 5 | ||||
-rw-r--r-- | src/decoder.cc | 12 | ||||
-rw-r--r-- | src/decoder.h | 6 | ||||
-rw-r--r-- | src/encoder.cc | 16 | ||||
-rw-r--r-- | src/frame.h | 6 |
6 files changed, 38 insertions, 8 deletions
@@ -7,6 +7,7 @@ May 24 2005 - MIaV version 0.2.3 New Features: - Bug Fixes: + - Made unfreeze close connection, when no recording is done. - Made info (error message system) work correctly. - Free of NULL input queue removed. - Name is overwritten with a message, if non-valid cpr is used. diff --git a/src/camera.cc b/src/camera.cc index 1137ba2..52fe0b8 100644 --- a/src/camera.cc +++ b/src/camera.cc @@ -31,6 +31,10 @@ /* * $Log$ + * Revision 1.17 2005/05/25 13:11:42 deva + * + * Made unfreeze close connection, when no recording is done. + * * Revision 1.16 2005/05/16 16:00:56 deva * * Lots of stuff! @@ -206,7 +210,6 @@ void Camera::freeze() { if(initialized) { player->stop(); - // encoder->freeze(); decoder->freeze(); } else { info->error("Camera not initialized."); diff --git a/src/decoder.cc b/src/decoder.cc index e908b63..db95fe8 100644 --- a/src/decoder.cc +++ b/src/decoder.cc @@ -39,6 +39,10 @@ /* * $Log$ + * Revision 1.29 2005/05/25 13:11:42 deva + * + * Made unfreeze close connection, when no recording is done. + * * Revision 1.28 2005/05/16 16:00:56 deva * * Lots of stuff! @@ -123,7 +127,7 @@ Decoder::~Decoder() void Decoder::decode() { bool local_shoot; - bool local_freeze; + int local_freeze; bool local_record = false; bool old_record; @@ -151,7 +155,7 @@ void Decoder::decode() pthread_mutex_unlock(&shot_mutex); } - if(local_freeze) { + if(local_freeze == 1) { pthread_mutex_lock(&shot_mutex); if(shot) delete shot; shot = new Frame(ptr, DVPACKAGE_SIZE); @@ -204,7 +208,7 @@ void Decoder::run() { */ void Decoder::freeze() { - b_freeze = true; + b_freeze = 1; } /* @@ -212,6 +216,8 @@ void Decoder::freeze() */ void Decoder::unfreeze() { + b_freeze = -1; + pthread_mutex_lock(&shot_mutex); delete shot; shot = NULL; diff --git a/src/decoder.h b/src/decoder.h index 385858e..247124a 100644 --- a/src/decoder.h +++ b/src/decoder.h @@ -38,6 +38,10 @@ /* * $Log$ + * Revision 1.14 2005/05/25 13:11:42 deva + * + * Made unfreeze close connection, when no recording is done. + * * Revision 1.13 2005/05/07 10:25:34 deva * * Removed ffmpeg code from img_encoder and corrected decoding errors in mov_encoder @@ -101,7 +105,7 @@ private: pthread_mutex_t shot_mutex; Frame* shot; - volatile bool b_freeze; + volatile int b_freeze; volatile bool b_shoot; volatile bool b_record; diff --git a/src/encoder.cc b/src/encoder.cc index f0b3324..f16a754 100644 --- a/src/encoder.cc +++ b/src/encoder.cc @@ -39,6 +39,10 @@ /* * $Log$ + * Revision 1.28 2005/05/25 13:11:42 deva + * + * Made unfreeze close connection, when no recording is done. + * * Revision 1.27 2005/05/22 16:34:44 deva * * Fix: Connection is now taken down when taking a sanpshot without recording. @@ -118,6 +122,13 @@ Encoder::Encoder(Info *ginfo, Encoder::~Encoder() { + // If a hanging connection exists, we better close it. + if(s) { + if(n) delete n; + delete s; + s = NULL; + n = NULL; + } } @@ -131,11 +142,12 @@ void Encoder::encode() frame = queue->pop(); if(frame) { - if(frame->freeze) frozen = true; + if(frame->freeze == 1) frozen = true; + if(frame->freeze == -1) frozen = false; if(frame->shoot) frozen = false; if(frame->record || - frame->freeze || + (frame->freeze == 1) || frame->shoot) { // If no connection is present, make a new one diff --git a/src/frame.h b/src/frame.h index 72cfe8e..8734924 100644 --- a/src/frame.h +++ b/src/frame.h @@ -31,6 +31,10 @@ /* * $Log$ + * Revision 1.7 2005/05/25 13:11:42 deva + * + * Made unfreeze close connection, when no recording is done. + * * Revision 1.6 2005/05/22 15:49:22 deva * Added multithreaded encoding support. * @@ -72,7 +76,7 @@ public: unsigned int number; bool shoot; - bool freeze; + int freeze; // 1 is freeze, -1 is unfreeze bool record; }; |