diff options
-rw-r--r-- | src/camera.cc | 11 | ||||
-rw-r--r-- | src/decoder.cc | 15 | ||||
-rw-r--r-- | src/decoder.h | 4 |
3 files changed, 26 insertions, 4 deletions
diff --git a/src/camera.cc b/src/camera.cc index c1720b9..03aa87f 100644 --- a/src/camera.cc +++ b/src/camera.cc @@ -27,6 +27,9 @@ */ /* * $Log$ + * Revision 1.13 2005/05/02 14:06:55 deva + * Added unfreeze to decoder (called from camera). + * * Revision 1.12 2005/05/02 10:35:23 deva * Fixed wrongly showed snapshot thumbnails. * @@ -190,8 +193,12 @@ void Camera::freeze() void Camera::unfreeze() { - if(initialized) player->start(); - else errorstatus->pushError("Camera not initialized."); + if(initialized) { + player->start(); + decoder->unfreeze(); + } else { + errorstatus->pushError("Camera not initialized."); + } } void Camera::snapshot(unsigned char *rgb) diff --git a/src/decoder.cc b/src/decoder.cc index a76105f..34c0185 100644 --- a/src/decoder.cc +++ b/src/decoder.cc @@ -25,6 +25,9 @@ */ /* * $Log$ + * Revision 1.26 2005/05/02 14:06:55 deva + * Added unfreeze to decoder (called from camera). + * * Revision 1.25 2005/05/02 10:52:46 deva * * Fixed bug invoking infinite loop, when snapshot is requested. @@ -173,6 +176,16 @@ void Decoder::freeze() b_freeze = true; } +/* + * Remove frozen frame. + */ +void Decoder::unfreeze() +{ + pthread_mutex_lock(&shot_mutex); + delete shot; + shot = NULL; + pthread_mutex_unlock(&shot_mutex); +} /* * Set shoot bit on current frame. @@ -186,9 +199,7 @@ void Decoder::shoot(unsigned char *rgb) // Wait for shot to be taken while(1) { pthread_mutex_lock(&shot_mutex); - fprintf(stderr, ":"); fflush(stderr); if(shot) { - fprintf(stderr, "."); fflush(stderr); getScreenshot(shot, rgb); delete shot; shot = NULL; diff --git a/src/decoder.h b/src/decoder.h index 13a7f39..a2c4ad8 100644 --- a/src/decoder.h +++ b/src/decoder.h @@ -24,6 +24,9 @@ */ /* * $Log$ + * Revision 1.11 2005/05/02 14:06:55 deva + * Added unfreeze to decoder (called from camera). + * * Revision 1.10 2005/05/02 10:35:23 deva * Fixed wrongly showed snapshot thumbnails. * @@ -66,6 +69,7 @@ public: void run(); void freeze(); + void unfreeze(); void shoot(unsigned char *rgb); void start(); void stop(n_savestate save); |