diff --git a/CMakeLists.txt b/CMakeLists.txt index c1b205e..34b0022 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,7 +74,7 @@ endif() ########################################## if(WITH_PTHREADS) - add_definitions(-DWITH_PTHREADS) + add_definitions(-DHAS_MULTITHREADING) endif() if(${OpenCV_VERSION} VERSION_GREATER 2.9.0) diff --git a/include/chilitags.hpp b/include/chilitags.hpp index 0b9749b..fd4e93b 100644 --- a/include/chilitags.hpp +++ b/include/chilitags.hpp @@ -149,7 +149,7 @@ enum DetectionTrigger { */ DETECT_PERIODICALLY, -#ifdef WITH_PTHREADS +#ifdef HAS_MULTITHREADING /** * @brief Runs the detection in the background, with a period * @@ -204,7 +204,7 @@ TagCornerMap find( */ void setDetectionPeriod(int period); -#ifdef WITH_PTHREADS +#ifdef HAS_MULTITHREADING /** * @brief Gets the latest idle time in case of asynchronous detection * diff --git a/src/Chilitags.cpp b/src/Chilitags.cpp index ce6a41f..6864691 100644 --- a/src/Chilitags.cpp +++ b/src/Chilitags.cpp @@ -105,7 +105,7 @@ void setDetectionPeriod(int period) { mCallsBeforeDetection = period; } -#ifdef WITH_PTHREADS +#ifdef HAS_MULTITHREADING float getLatestAsyncDetectionIdleMillis(){ return mDetect.getLatestAsyncIdleMillis(); } @@ -165,7 +165,7 @@ TagCornerMap find( return scaleBy(mFilter(tags), scaleFactor); } -#ifdef WITH_PTHREADS +#ifdef HAS_MULTITHREADING case ASYNC_DETECT_PERIODICALLY: mDetect.launchBackgroundThread(mTrack); mCallsBeforeNextDetection--; @@ -277,7 +277,7 @@ void Chilitags::setMinInputWidth(int minWidth) { mImpl->setMinInputWidth(minWidth); } -#ifdef WITH_PTHREADS +#ifdef HAS_MULTITHREADING float Chilitags::getLatestAsyncDetectionIdleMillis(){ return mImpl->getLatestAsyncDetectionIdleMillis(); } diff --git a/src/Detect.cpp b/src/Detect.cpp index a44ea30..3b2200b 100644 --- a/src/Detect.cpp +++ b/src/Detect.cpp @@ -36,7 +36,7 @@ Detect::Detect() : mDecode(), mFrame(), mTags() -#ifdef WITH_PTHREADS +#ifdef HAS_MULTITHREADING ,mBackgroundThread(), mBackgroundRunning(false), mNeedFrame(true), @@ -84,7 +84,7 @@ void Detect::doDetection(TagCornerMap& tags) void Detect::operator()(cv::Mat const& greyscaleImage, TagCornerMap& tags) { -#ifdef WITH_PTHREADS +#ifdef HAS_MULTITHREADING //Run single threaded if(!mBackgroundRunning){ mFrame = greyscaleImage; @@ -110,7 +110,7 @@ void Detect::operator()(cv::Mat const& greyscaleImage, TagCornerMap& tags) #endif } -#ifdef WITH_PTHREADS +#ifdef HAS_MULTITHREADING void Detect::launchBackgroundThread(Track& track) { if(!mBackgroundRunning){ diff --git a/src/Detect.hpp b/src/Detect.hpp index 11ceee6..b33bd82 100644 --- a/src/Detect.hpp +++ b/src/Detect.hpp @@ -23,7 +23,7 @@ #include -#ifdef WITH_PTHREADS +#ifdef HAS_MULTITHREADING #include #endif @@ -49,7 +49,7 @@ class Detect { void operator()(cv::Mat const& inputImage, TagCornerMap& tags); -#ifdef WITH_PTHREADS +#ifdef HAS_MULTITHREADING float getLatestAsyncIdleMillis(); float getLatestAsyncWorkMillis(); @@ -71,7 +71,7 @@ class Detect { void doDetection(TagCornerMap& tags); -#ifdef WITH_PTHREADS +#ifdef HAS_MULTITHREADING Track* mTrack; pthread_t mBackgroundThread;