File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ void VideoCaptureWrap::Init(Local<Object> target) {
33
33
Nan::SetPrototypeMethod (ctor, " setHeight" , SetHeight);
34
34
Nan::SetPrototypeMethod (ctor, " setPosition" , SetPosition);
35
35
Nan::SetPrototypeMethod (ctor, " getFrameAt" , GetFrameAt);
36
+ Nan::SetPrototypeMethod (ctor, " getFrameCount" , GetFrameCount);
36
37
Nan::SetPrototypeMethod (ctor, " close" , Close);
37
38
Nan::SetPrototypeMethod (ctor, " ReadSync" , ReadSync);
38
39
Nan::SetPrototypeMethod (ctor, " grab" , Grab);
@@ -94,6 +95,15 @@ NAN_METHOD(VideoCaptureWrap::SetWidth) {
94
95
return ;
95
96
}
96
97
98
+ NAN_METHOD (VideoCaptureWrap::GetFrameCount) {
99
+ Nan::HandleScope scope;
100
+ VideoCaptureWrap *v = Nan::ObjectWrap::Unwrap<VideoCaptureWrap>(info.This ());
101
+
102
+ int cnt = int (v->cap .get (CV_CAP_PROP_FRAME_COUNT));
103
+
104
+ info.GetReturnValue ().Set (Nan::New<Number>(cnt));
105
+ }
106
+
97
107
NAN_METHOD (VideoCaptureWrap::SetHeight) {
98
108
Nan::HandleScope scope;
99
109
VideoCaptureWrap *v = Nan::ObjectWrap::Unwrap<VideoCaptureWrap>(info.This ());
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ class VideoCaptureWrap: public Nan::ObjectWrap {
23
23
24
24
// to set frame position
25
25
static NAN_METHOD (SetPosition);
26
+ static NAN_METHOD (GetFrameCount);
26
27
27
28
static NAN_METHOD (GetFrameAt);
28
29
You can’t perform that action at this time.
0 commit comments