Finished the amlogic grabber for the 'WeTek Play'

Former-commit-id: e459cdfe6273ad2bfee92d2d190801ebdc691a5c
This commit is contained in:
T.van der Zwan
2015-08-20 09:51:44 +02:00
parent 348e0c1ee8
commit 5497fbf577
11 changed files with 265 additions and 71 deletions

View File

@@ -15,7 +15,7 @@
AmlogicWrapper::AmlogicWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, Hyperion * hyperion) :
_updateInterval_ms(1000/updateRate_Hz),
_timeout_ms(2 * _updateInterval_ms),
_priority(1000),
_priority(999),
_timer(),
_image(grabWidth, grabHeight),
_frameGrabber(new AmlogicGrabber(grabWidth, grabHeight)),
@@ -49,12 +49,17 @@ void AmlogicWrapper::start()
void AmlogicWrapper::action()
{
// Grab frame into the allocated image
_frameGrabber->grabFrame(_image);
if (_frameGrabber->grabFrame(_image) < 0)
{
// Frame grab failed, maybe nothing playing or ....
return;
}
_processor->process(_image, _ledColors);
_hyperion->setColors(_priority, _ledColors, _timeout_ms);
}
void AmlogicWrapper::stop()
{
// Stop the timer, effectivly stopping the process