From b0e64682936dfc67e3f2b810f2980ac02fee6f0e Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 8 Feb 2009 04:10:37 +0100 Subject: [PATCH] some testing and debugging --- src/common/guifacade.cpp | 2 +- src/gui/display-service.cpp | 6 ++++++ src/gui/display-service.hpp | 6 +++++- src/lib/handle.hpp | 10 ++++++---- src/proc/play/dummy-image-generator.hpp | 2 +- src/proc/play/dummy-player-service.cpp | 17 ++++++++++++----- src/proc/play/dummy-player-service.hpp | 1 + src/proc/play/tick-service.hpp | 13 ++++++++++--- 8 files changed, 42 insertions(+), 15 deletions(-) diff --git a/src/common/guifacade.cpp b/src/common/guifacade.cpp index a3081e953..8d6f3fb98 100644 --- a/src/common/guifacade.cpp +++ b/src/common/guifacade.cpp @@ -152,13 +152,13 @@ namespace gui { ~GuiSubsysDescriptor() { - FIXME ("ichthyo: when you want to ignore errors, then you have to error_get() them to clear the error state"); if (facade) { WARN (guifacade, "GUI subsystem terminates, but GuiFacade isn't properly closed. " "Closing it forcedly; this indicates broken startup logic and should be fixed."); try { facade.reset (0); } catch(...) { WARN_IF (lumiera_error_peek(), guifacade, "Ignoring error: %s", lumiera_error()); } + lumiera_error(); // clear any remaining error state... } } }; diff --git a/src/gui/display-service.cpp b/src/gui/display-service.cpp index 0db6da3dc..45d38c4dd 100644 --- a/src/gui/display-service.cpp +++ b/src/gui/display-service.cpp @@ -243,6 +243,12 @@ namespace gui { } + DisplayerSlot::~DisplayerSlot() + { + TRACE (gui_dbg, "Displayer Slot closing..."); + } + + void DisplayerSlot::displayCurrentFrame() { diff --git a/src/gui/display-service.hpp b/src/gui/display-service.hpp index 094d2f895..3783b8dfc 100644 --- a/src/gui/display-service.hpp +++ b/src/gui/display-service.hpp @@ -82,6 +82,7 @@ namespace gui { public: DisplayerSlot (FrameDestination const&) ; + ~DisplayerSlot () ; /* Implementation-level API to be used by DisplayService */ @@ -134,7 +135,10 @@ namespace gui { public: DisplayService(); - ~DisplayService() { } + ~DisplayService() { + INFO (proc_dbg, "Display service dying..."); + + } /** open a new display, sending frames to the given output destination diff --git a/src/lib/handle.hpp b/src/lib/handle.hpp index 3c15296a2..54bff4c89 100644 --- a/src/lib/handle.hpp +++ b/src/lib/handle.hpp @@ -70,7 +70,9 @@ namespace lib { class Handle { protected: - std::tr1::shared_ptr smPtr_; + typedef std::tr1::shared_ptr SmPtr; + + SmPtr smPtr_; public: @@ -113,11 +115,11 @@ namespace lib { void close () { smPtr_.reset(); } - typedef std::tr1::shared_ptr Handle::*__unspecified_bool_type; + typedef SmPtr Handle::*__unspecified_bool_type; /** implicit conversion to "bool" */ - operator __unspecified_bool_type() const { return &Handle::smPtr_; } // never throws - bool operator! () const { return !bool(smPtr_); } // dito + operator __unspecified_bool_type() const { return smPtr_? &Handle::smPtr_ : 0; } // never throws + bool operator! () const { return !bool(smPtr_); } // ditto diff --git a/src/proc/play/dummy-image-generator.hpp b/src/proc/play/dummy-image-generator.hpp index 693a6058e..17056997d 100644 --- a/src/proc/play/dummy-image-generator.hpp +++ b/src/proc/play/dummy-image-generator.hpp @@ -63,7 +63,7 @@ namespace proc { public: DummyImageGenerator(uint fps); - ~DummyImageGenerator() { } + ~DummyImageGenerator() { } /** generate the next frame and * occupy the alternate buffer. diff --git a/src/proc/play/dummy-player-service.cpp b/src/proc/play/dummy-player-service.cpp index 52b66cf42..52125c7bb 100644 --- a/src/proc/play/dummy-player-service.cpp +++ b/src/proc/play/dummy-player-service.cpp @@ -291,12 +291,9 @@ namespace proc { { } - DummyPlayer::Process - ProcessImpl::createHandle() + ProcessImpl::~ProcessImpl() { - DummyPlayer::Process handle; - handle.activate(this, &terminate); - return handle; + INFO (proc_dbg, "Playback process halted..."); } @@ -309,6 +306,16 @@ namespace proc { + DummyPlayer::Process + ProcessImpl::createHandle() + { + DummyPlayer::Process handle; + handle.activate(this, &terminate); + return handle; + } + + + void ProcessImpl::setRate (uint fps) { diff --git a/src/proc/play/dummy-player-service.hpp b/src/proc/play/dummy-player-service.hpp index b7d3f5656..55c07e430 100644 --- a/src/proc/play/dummy-player-service.hpp +++ b/src/proc/play/dummy-player-service.hpp @@ -83,6 +83,7 @@ namespace proc { public: ProcessImpl(LumieraDisplaySlot) ; + ~ProcessImpl() ; /* Implementation-level API to be used By DummyPlayerService */ diff --git a/src/proc/play/tick-service.hpp b/src/proc/play/tick-service.hpp index 8c7dcaec7..b27f936a3 100644 --- a/src/proc/play/tick-service.hpp +++ b/src/proc/play/tick-service.hpp @@ -69,13 +69,17 @@ namespace proc { TickService (Tick callback) : Thread("Tick generator (dummy)", bind (&TickService::timerLoop, this, callback)) - { } + { + INFO (proc, "TickService started."); + } ~TickService () { uint curr_tick = timespan_; timespan_ = 0; - usleep (curr_tick); ////TODO actually should wait for timer thread termination + usleep (2*curr_tick); ////TODO actually should wait for timer thread termination + + INFO (proc, "TickService shutdown."); } @@ -106,7 +110,10 @@ namespace proc { periodicFun(); usleep (timespan_); - } } + } + TRACE (proc_dbg, "Tick Thread timer loop exiting..."); + } + };