mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
added getFPS to VideoCapture
This commit is contained in:
parent
8a9c02a5e4
commit
4b7822b4df
@ -33,6 +33,7 @@ void VideoCaptureWrap::Init(Local<Object> target) {
|
||||
Nan::SetPrototypeMethod(ctor, "setPosition", SetPosition);
|
||||
Nan::SetPrototypeMethod(ctor, "getFrameAt", GetFrameAt);
|
||||
Nan::SetPrototypeMethod(ctor, "getFrameCount", GetFrameCount);
|
||||
Nan::SetPrototypeMethod(ctor, "getFPS", GetFPS);
|
||||
Nan::SetPrototypeMethod(ctor, "release", Release);
|
||||
Nan::SetPrototypeMethod(ctor, "ReadSync", ReadSync);
|
||||
Nan::SetPrototypeMethod(ctor, "grab", Grab);
|
||||
@ -103,6 +104,16 @@ NAN_METHOD(VideoCaptureWrap::GetFrameCount) {
|
||||
info.GetReturnValue().Set(Nan::New<Number>(cnt));
|
||||
}
|
||||
|
||||
|
||||
NAN_METHOD(VideoCaptureWrap::GetFPS) {
|
||||
Nan::HandleScope scope;
|
||||
VideoCaptureWrap *v = Nan::ObjectWrap::Unwrap<VideoCaptureWrap>(info.This());
|
||||
|
||||
int fps = int(v->cap.get(CV_CAP_PROP_FPS));
|
||||
|
||||
info.GetReturnValue().Set(Nan::New<Number>(fps));
|
||||
}
|
||||
|
||||
NAN_METHOD(VideoCaptureWrap::SetHeight) {
|
||||
Nan::HandleScope scope;
|
||||
VideoCaptureWrap *v = Nan::ObjectWrap::Unwrap<VideoCaptureWrap>(info.This());
|
||||
|
||||
@ -25,6 +25,8 @@ public:
|
||||
static NAN_METHOD(SetPosition);
|
||||
static NAN_METHOD(GetFrameCount);
|
||||
|
||||
static NAN_METHOD(GetFPS);
|
||||
|
||||
static NAN_METHOD(GetFrameAt);
|
||||
|
||||
// release the stream
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user