Logging migration continues ... (#97)

* migrate logging for blackborder and bonjour. fix logging bug in hyperion

* fix kodichecker when kodi is not there
This commit is contained in:
redPanther
2016-07-10 23:14:23 +02:00
committed by brindosch
parent 3ac0781c1f
commit c2e2c26ab2
7 changed files with 76 additions and 67 deletions

View File

@@ -1,12 +1,14 @@
#include <iostream>
#include <utils/Logger.h>
// BlackBorders includes
#include <blackborder/BlackBorderDetector.h>
#include <cmath>
using namespace hyperion;
BlackBorderDetector::BlackBorderDetector(double threshold) :
_blackborderThreshold(calculateThreshold(threshold))
BlackBorderDetector::BlackBorderDetector(double threshold)
: _blackborderThreshold(calculateThreshold(threshold))
{
// empty
}
@@ -21,7 +23,7 @@ uint8_t BlackBorderDetector::calculateThreshold(double threshold)
uint8_t blackborderThreshold = uint8_t(rgbThreshold);
std::cout << "BLACKBORDER INFO: threshold set to " << threshold << " (" << int(blackborderThreshold) << ")" << std::endl;
Info(Logger::getInstance("BLACKBORDER"), "threshold set to %f (%d)", threshold , int(blackborderThreshold));
return blackborderThreshold;
}

View File

@@ -1,8 +1,6 @@
#include <iostream>
/*
#include <iomanip>
using std::setw;
//*/
#include <utils/Logger.h>
// Blackborder includes
#include <blackborder/BlackBorderProcessor.h>
@@ -10,20 +8,19 @@ using std::setw;
using namespace hyperion;
BlackBorderProcessor::BlackBorderProcessor(const Json::Value &blackborderConfig) :
_unknownSwitchCnt(blackborderConfig.get("unknownFrameCnt", 600).asUInt()),
_borderSwitchCnt(blackborderConfig.get("borderFrameCnt", 50).asUInt()),
_maxInconsistentCnt(blackborderConfig.get("maxInconsistentCnt", 10).asUInt()),
_blurRemoveCnt(blackborderConfig.get("blurRemoveCnt", 1).asUInt()),
_detectionMode(blackborderConfig.get("mode", "default").asString()),
_detector(blackborderConfig.get("threshold", 0.01).asDouble()),
_currentBorder({true, -1, -1}),
_previousDetectedBorder({true, -1, -1}),
_consistentCnt(0),
_inconsistentCnt(10)
BlackBorderProcessor::BlackBorderProcessor(const Json::Value &blackborderConfig)
: _unknownSwitchCnt(blackborderConfig.get("unknownFrameCnt", 600).asUInt())
, _borderSwitchCnt(blackborderConfig.get("borderFrameCnt", 50).asUInt())
, _maxInconsistentCnt(blackborderConfig.get("maxInconsistentCnt", 10).asUInt())
, _blurRemoveCnt(blackborderConfig.get("blurRemoveCnt", 1).asUInt())
, _detectionMode(blackborderConfig.get("mode", "default").asString())
, _detector(blackborderConfig.get("threshold", 0.01).asDouble())
, _currentBorder({true, -1, -1})
, _previousDetectedBorder({true, -1, -1})
, _consistentCnt(0)
, _inconsistentCnt(10)
{
std::cout << "BLACKBORDER INFO: mode:" << _detectionMode << std::endl;
// empty
Info(Logger::getInstance("BLACKBORDER"), "mode: %s", _detectionMode.c_str());
}
BlackBorder BlackBorderProcessor::getCurrentBorder() const