From cf9ddae7a49ed27535f683ce7422234ba4279acb Mon Sep 17 00:00:00 2001 From: jordiexvision Date: Thu, 12 Jul 2018 16:24:15 +0900 Subject: [PATCH 1/2] fixes to compile OF 1.0 --- example_simpleCapture/addons.make | 4 +++- src/ofxMachineVision.h | 2 +- src/ofxMachineVision/Device/VideoPlayer.cpp | 3 ++- src/ofxMachineVision/Grabber/Simple.h | 3 ++- src/ofxMachineVision/Parameter.h | 2 ++ src/ofxMachineVision/Utils/ActionQueueThread.cpp | 1 + 6 files changed, 11 insertions(+), 4 deletions(-) diff --git a/example_simpleCapture/addons.make b/example_simpleCapture/addons.make index 9fe2b5a..4b1899d 100644 --- a/example_simpleCapture/addons.make +++ b/example_simpleCapture/addons.make @@ -1,2 +1,4 @@ -ofxUVC +ofxLiquidEvent ofxMachineVision +ofxPlugin +ofxSingleton diff --git a/src/ofxMachineVision.h b/src/ofxMachineVision.h index 33edb2e..781759b 100644 --- a/src/ofxMachineVision.h +++ b/src/ofxMachineVision.h @@ -46,7 +46,7 @@ namespace ofxMachineVision { class SimpleGrabber : public Grabber::Simple { public: SimpleGrabber() : Grabber::Simple() { - this->setDevice(make_shared()); + this->setDevice(DevicePtr()); } shared_ptr getDeviceTyped() const { diff --git a/src/ofxMachineVision/Device/VideoPlayer.cpp b/src/ofxMachineVision/Device/VideoPlayer.cpp index b5333be..c48cb99 100644 --- a/src/ofxMachineVision/Device/VideoPlayer.cpp +++ b/src/ofxMachineVision/Device/VideoPlayer.cpp @@ -1,4 +1,5 @@ #include "VideoPlayer.h" +#include "ofSystemUtils.h" namespace ofxMachineVision { namespace Device { @@ -23,7 +24,7 @@ namespace ofxMachineVision { } typedInitialisationSettings->filename = result.filePath; } - if (!ofFile::doesFileExist(typedInitialisationSettings->filename)) { + if (!ofFile::doesFileExist(typedInitialisationSettings->filename.get())) { throw(ofxMachineVision::Exception("File does not exist")); } diff --git a/src/ofxMachineVision/Grabber/Simple.h b/src/ofxMachineVision/Grabber/Simple.h index ebcb754..5a8e36d 100644 --- a/src/ofxMachineVision/Grabber/Simple.h +++ b/src/ofxMachineVision/Grabber/Simple.h @@ -2,6 +2,7 @@ #include "ofBaseTypes.h" #include "ofTexture.h" +#include "ofMath.h" #include "Base.h" #include "ofxMachineVision/Frame.h" @@ -162,7 +163,7 @@ namespace ofxMachineVision { void setFrame(shared_ptr); void clearCachedFrame(); - mutable ofMutex framePointerMutex; + mutable std::mutex framePointerMutex; shared_ptr frame; ofPixels pixels; // every app frame we cache a set of pixels which we can use for simple access. if getPixels() returned from frame, then there would be locking issues. diff --git a/src/ofxMachineVision/Parameter.h b/src/ofxMachineVision/Parameter.h index 858770e..35ff1c2 100644 --- a/src/ofxMachineVision/Parameter.h +++ b/src/ofxMachineVision/Parameter.h @@ -2,6 +2,8 @@ #include "ofParameter.h" +using namespace std; + namespace ofxMachineVision { class AbstractParameter { public: diff --git a/src/ofxMachineVision/Utils/ActionQueueThread.cpp b/src/ofxMachineVision/Utils/ActionQueueThread.cpp index 8099a09..0121f5a 100644 --- a/src/ofxMachineVision/Utils/ActionQueueThread.cpp +++ b/src/ofxMachineVision/Utils/ActionQueueThread.cpp @@ -1,5 +1,6 @@ #include "ActionQueueThread.h" #include "ofAppRunner.h" +#include "ofLog.h" #include "../Constants.h" From 8df698e6775b10039d7242a7662b4944570f203e Mon Sep 17 00:00:00 2001 From: wasawi Date: Thu, 12 Jul 2018 17:42:35 +0900 Subject: [PATCH 2/2] fix pointer cast on setDevice --- src/ofxMachineVision.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ofxMachineVision.h b/src/ofxMachineVision.h index 781759b..416136a 100644 --- a/src/ofxMachineVision.h +++ b/src/ofxMachineVision.h @@ -46,7 +46,7 @@ namespace ofxMachineVision { class SimpleGrabber : public Grabber::Simple { public: SimpleGrabber() : Grabber::Simple() { - this->setDevice(DevicePtr()); + this->setDevice(make_shared()); } shared_ptr getDeviceTyped() const {