From 865962c845580a81fd2aad7ae89886a82bb0f0f1 Mon Sep 17 00:00:00 2001 From: Peter Braden Date: Tue, 9 Apr 2013 21:34:00 -0700 Subject: [PATCH] videocapture read now uses err, im convention --- README.md | 5 +++++ examples/camera.js | 2 +- src/VideoCaptureWrap.cc | 7 ++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 72b0040..cbfb31f 100755 --- a/README.md +++ b/README.md @@ -185,6 +185,11 @@ doesn't work for you please get in touch. ## Changelog +#### 0.0.13 + +- V Early support for face recognition - API is _likely_ to change. Have fun! +- *API Change*: VideoCapture.read now calls callback(err, im) instead of callback(im) + #### 0.0.12 - Matrix clone() - NamedWindow Support diff --git a/examples/camera.js b/examples/camera.js index 94aaeb7..866052d 100755 --- a/examples/camera.js +++ b/examples/camera.js @@ -5,7 +5,7 @@ var camera = new cv.VideoCapture(0); setInterval(function() { - camera.read(function(im) { + camera.read(function(err, im) { im.save('/tmp/cam.png'); }); diff --git a/src/VideoCaptureWrap.cc b/src/VideoCaptureWrap.cc index 94c84cc..d28ae50 100755 --- a/src/VideoCaptureWrap.cc +++ b/src/VideoCaptureWrap.cc @@ -116,11 +116,12 @@ void AfterAsyncRead(uv_work_t *req) { mat = baton->im->mat; img->mat = mat; - Local argv[1]; + Local argv[2]; - argv[0] = im_to_return; + argv[0] = Local::New(Null()); + argv[1] = im_to_return; - baton->cb->Call(Context::GetCurrent()->Global(), 1, argv); + baton->cb->Call(Context::GetCurrent()->Global(), 2, argv); baton->cb.Dispose(); delete baton;