mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
Merge pull request #366 from sirotenko/master
Added getFrameCount method to VideoCapture
This commit is contained in:
commit
b740255d91
@ -33,6 +33,7 @@ void VideoCaptureWrap::Init(Local<Object> target) {
|
|||||||
Nan::SetPrototypeMethod(ctor, "setHeight", SetHeight);
|
Nan::SetPrototypeMethod(ctor, "setHeight", SetHeight);
|
||||||
Nan::SetPrototypeMethod(ctor, "setPosition", SetPosition);
|
Nan::SetPrototypeMethod(ctor, "setPosition", SetPosition);
|
||||||
Nan::SetPrototypeMethod(ctor, "getFrameAt", GetFrameAt);
|
Nan::SetPrototypeMethod(ctor, "getFrameAt", GetFrameAt);
|
||||||
|
Nan::SetPrototypeMethod(ctor, "getFrameCount", GetFrameCount);
|
||||||
Nan::SetPrototypeMethod(ctor, "close", Close);
|
Nan::SetPrototypeMethod(ctor, "close", Close);
|
||||||
Nan::SetPrototypeMethod(ctor, "ReadSync", ReadSync);
|
Nan::SetPrototypeMethod(ctor, "ReadSync", ReadSync);
|
||||||
Nan::SetPrototypeMethod(ctor, "grab", Grab);
|
Nan::SetPrototypeMethod(ctor, "grab", Grab);
|
||||||
@ -94,6 +95,15 @@ NAN_METHOD(VideoCaptureWrap::SetWidth) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NAN_METHOD(VideoCaptureWrap::GetFrameCount) {
|
||||||
|
Nan::HandleScope scope;
|
||||||
|
VideoCaptureWrap *v = Nan::ObjectWrap::Unwrap<VideoCaptureWrap>(info.This());
|
||||||
|
|
||||||
|
int cnt = int(v->cap.get(CV_CAP_PROP_FRAME_COUNT));
|
||||||
|
|
||||||
|
info.GetReturnValue().Set(Nan::New<Number>(cnt));
|
||||||
|
}
|
||||||
|
|
||||||
NAN_METHOD(VideoCaptureWrap::SetHeight) {
|
NAN_METHOD(VideoCaptureWrap::SetHeight) {
|
||||||
Nan::HandleScope scope;
|
Nan::HandleScope scope;
|
||||||
VideoCaptureWrap *v = Nan::ObjectWrap::Unwrap<VideoCaptureWrap>(info.This());
|
VideoCaptureWrap *v = Nan::ObjectWrap::Unwrap<VideoCaptureWrap>(info.This());
|
||||||
|
|||||||
@ -23,6 +23,7 @@ public:
|
|||||||
|
|
||||||
// to set frame position
|
// to set frame position
|
||||||
static NAN_METHOD(SetPosition);
|
static NAN_METHOD(SetPosition);
|
||||||
|
static NAN_METHOD(GetFrameCount);
|
||||||
|
|
||||||
static NAN_METHOD(GetFrameAt);
|
static NAN_METHOD(GetFrameAt);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user