Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added GetFrameAt back in
  • Loading branch information
fakob committed Oct 15, 2017
commit 892e29f4f47124a71fe9508f8f6991e7445aa3ee
15 changes: 15 additions & 0 deletions src/VideoCaptureWrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ void VideoCaptureWrap::Init(Local<Object> target) {
Nan::SetPrototypeMethod(ctor, "getPosition", GetPosition);
Nan::SetPrototypeMethod(ctor, "getPositionMS", GetPositionMS);
Nan::SetPrototypeMethod(ctor, "setPosition", SetPosition);
Nan::SetPrototypeMethod(ctor, "getFrameAt", GetFrameAt);
Nan::SetPrototypeMethod(ctor, "setPositionMS", SetPositionMS);
Nan::SetPrototypeMethod(ctor, "getFPS", GetFPS);
Nan::SetPrototypeMethod(ctor, "getFourCC", GetFourCC);
Expand Down Expand Up @@ -191,6 +192,20 @@ NAN_METHOD(VideoCaptureWrap::SetPosition) {
return;
}

NAN_METHOD(VideoCaptureWrap::GetFrameAt) {
Nan::HandleScope scope;
VideoCaptureWrap *v = Nan::ObjectWrap::Unwrap<VideoCaptureWrap>(info.This());

if(info.Length() != 1)
return;

int pos = info[0]->IntegerValue();

v->cap.set(CV_CAP_PROP_POS_MSEC, pos);

return;
}

NAN_METHOD(VideoCaptureWrap::SetPositionMS) {
Nan::HandleScope scope;
VideoCaptureWrap *v = Nan::ObjectWrap::Unwrap<VideoCaptureWrap>(info.This());
Expand Down