some testing and debugging
This commit is contained in:
parent
73f29f3a6a
commit
b0e6468293
8 changed files with 42 additions and 15 deletions
|
|
@ -152,13 +152,13 @@ namespace gui {
|
||||||
|
|
||||||
~GuiSubsysDescriptor()
|
~GuiSubsysDescriptor()
|
||||||
{
|
{
|
||||||
FIXME ("ichthyo: when you want to ignore errors, then you have to error_get() them to clear the error state");
|
|
||||||
if (facade)
|
if (facade)
|
||||||
{
|
{
|
||||||
WARN (guifacade, "GUI subsystem terminates, but GuiFacade isn't properly closed. "
|
WARN (guifacade, "GUI subsystem terminates, but GuiFacade isn't properly closed. "
|
||||||
"Closing it forcedly; this indicates broken startup logic and should be fixed.");
|
"Closing it forcedly; this indicates broken startup logic and should be fixed.");
|
||||||
try { facade.reset (0); }
|
try { facade.reset (0); }
|
||||||
catch(...) { WARN_IF (lumiera_error_peek(), guifacade, "Ignoring error: %s", lumiera_error()); }
|
catch(...) { WARN_IF (lumiera_error_peek(), guifacade, "Ignoring error: %s", lumiera_error()); }
|
||||||
|
lumiera_error(); // clear any remaining error state...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -243,6 +243,12 @@ namespace gui {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DisplayerSlot::~DisplayerSlot()
|
||||||
|
{
|
||||||
|
TRACE (gui_dbg, "Displayer Slot closing...");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DisplayerSlot::displayCurrentFrame()
|
DisplayerSlot::displayCurrentFrame()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,7 @@ namespace gui {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DisplayerSlot (FrameDestination const&) ;
|
DisplayerSlot (FrameDestination const&) ;
|
||||||
|
~DisplayerSlot () ;
|
||||||
|
|
||||||
/* Implementation-level API to be used by DisplayService */
|
/* Implementation-level API to be used by DisplayService */
|
||||||
|
|
||||||
|
|
@ -134,7 +135,10 @@ namespace gui {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DisplayService();
|
DisplayService();
|
||||||
~DisplayService() { }
|
~DisplayService() {
|
||||||
|
INFO (proc_dbg, "Display service dying...");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/** open a new display, sending frames to the given output destination
|
/** open a new display, sending frames to the given output destination
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,9 @@ namespace lib {
|
||||||
class Handle
|
class Handle
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
std::tr1::shared_ptr<IMP> smPtr_;
|
typedef std::tr1::shared_ptr<IMP> SmPtr;
|
||||||
|
|
||||||
|
SmPtr smPtr_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
@ -113,11 +115,11 @@ namespace lib {
|
||||||
void close () { smPtr_.reset(); }
|
void close () { smPtr_.reset(); }
|
||||||
|
|
||||||
|
|
||||||
typedef std::tr1::shared_ptr<IMP> Handle::*__unspecified_bool_type;
|
typedef SmPtr Handle::*__unspecified_bool_type;
|
||||||
|
|
||||||
/** implicit conversion to "bool" */
|
/** implicit conversion to "bool" */
|
||||||
operator __unspecified_bool_type() const { return &Handle::smPtr_; } // never throws
|
operator __unspecified_bool_type() const { return smPtr_? &Handle::smPtr_ : 0; } // never throws
|
||||||
bool operator! () const { return !bool(smPtr_); } // dito
|
bool operator! () const { return !bool(smPtr_); } // ditto
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ namespace proc {
|
||||||
public:
|
public:
|
||||||
DummyImageGenerator(uint fps);
|
DummyImageGenerator(uint fps);
|
||||||
|
|
||||||
~DummyImageGenerator() { }
|
~DummyImageGenerator() { }
|
||||||
|
|
||||||
/** generate the next frame and
|
/** generate the next frame and
|
||||||
* occupy the alternate buffer.
|
* occupy the alternate buffer.
|
||||||
|
|
|
||||||
|
|
@ -291,12 +291,9 @@ namespace proc {
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
||||||
DummyPlayer::Process
|
ProcessImpl::~ProcessImpl()
|
||||||
ProcessImpl::createHandle()
|
|
||||||
{
|
{
|
||||||
DummyPlayer::Process handle;
|
INFO (proc_dbg, "Playback process halted...");
|
||||||
handle.activate(this, &terminate);
|
|
||||||
return handle;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -309,6 +306,16 @@ namespace proc {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DummyPlayer::Process
|
||||||
|
ProcessImpl::createHandle()
|
||||||
|
{
|
||||||
|
DummyPlayer::Process handle;
|
||||||
|
handle.activate(this, &terminate);
|
||||||
|
return handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ProcessImpl::setRate (uint fps)
|
ProcessImpl::setRate (uint fps)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,7 @@ namespace proc {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ProcessImpl(LumieraDisplaySlot) ;
|
ProcessImpl(LumieraDisplaySlot) ;
|
||||||
|
~ProcessImpl() ;
|
||||||
|
|
||||||
/* Implementation-level API to be used By DummyPlayerService */
|
/* Implementation-level API to be used By DummyPlayerService */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,13 +69,17 @@ namespace proc {
|
||||||
TickService (Tick callback)
|
TickService (Tick callback)
|
||||||
: Thread("Tick generator (dummy)",
|
: Thread("Tick generator (dummy)",
|
||||||
bind (&TickService::timerLoop, this, callback))
|
bind (&TickService::timerLoop, this, callback))
|
||||||
{ }
|
{
|
||||||
|
INFO (proc, "TickService started.");
|
||||||
|
}
|
||||||
|
|
||||||
~TickService ()
|
~TickService ()
|
||||||
{
|
{
|
||||||
uint curr_tick = timespan_;
|
uint curr_tick = timespan_;
|
||||||
timespan_ = 0;
|
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();
|
periodicFun();
|
||||||
|
|
||||||
usleep (timespan_);
|
usleep (timespan_);
|
||||||
} }
|
}
|
||||||
|
TRACE (proc_dbg, "Tick Thread timer loop exiting...");
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue