[mousetrap/ng] BugFix parsing True False values



commit 8c2d802f2143d98c63adddbc9691048233a37d61
Author: Flavio Percoco Premoli <flaper87 gmail com>
Date:   Thu Nov 5 23:17:20 2009 +0100

    BugFix parsing True False values

 src/mousetrap/ocvfw/dev/MtpCapture.cpp   |    5 ++++-
 src/mousetrap/ocvfw/dev/PyMtpCapture.cpp |    4 ++--
 2 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/mousetrap/ocvfw/dev/MtpCapture.cpp b/src/mousetrap/ocvfw/dev/MtpCapture.cpp
index 7f6de47..6e129af 100644
--- a/src/mousetrap/ocvfw/dev/MtpCapture.cpp
+++ b/src/mousetrap/ocvfw/dev/MtpCapture.cpp
@@ -38,8 +38,9 @@ void MtpCapture::init(int set_fps, bool set_async, int idx) {
 	fps = set_fps;
 	async = set_async;
 
-	this->syncSlot = sigc::mem_fun(*this, &MtpCapture::sync);
 	this->webcam.startCamera(idx);
+	this->syncSlot = sigc::mem_fun(*this, &MtpCapture::sync);
+
 }
 
 void MtpCapture::set_async(int set_fps, bool set_async) {
@@ -59,6 +60,8 @@ bool MtpCapture::sync() {
 	if (!this->image)
 		return true;
 
+	printf( "%d", this->image->height);
+
 	return true;
 }
 
diff --git a/src/mousetrap/ocvfw/dev/PyMtpCapture.cpp b/src/mousetrap/ocvfw/dev/PyMtpCapture.cpp
index 9adf309..c5f753d 100644
--- a/src/mousetrap/ocvfw/dev/PyMtpCapture.cpp
+++ b/src/mousetrap/ocvfw/dev/PyMtpCapture.cpp
@@ -38,13 +38,13 @@ static void Capture_dealloc(Capture* self) {
 
 static PyObject *
 Capture_set_async(Capture *self, PyObject *args, PyObject *keywds) {
-	int fps = 100, async=1;
+	int fps = 100, async=0;
 
 	static char *kwlist[] = { "fps", "async", NULL };
 
 	PyArg_ParseTupleAndKeywords(args, keywds, "ii", kwlist, &fps, &async);
 
-	cap.set_async(fps, (async == 0) ? true : false);
+	cap.set_async(fps, (async == 0) ? false : true);
 	return Py_None;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]