Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

Commit 2621348

Browse files
Merge pull request justadudewhohacks#293 from justadudewhohacks/justadudewhohacks#290
fixed VideoWriter constructor justadudewhohacks#290
2 parents c79f0bd + e4b2106 commit 2621348

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

cc/modules/io/VideoWriter.cc

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,19 @@ NAN_METHOD(VideoWriter::Release) {
3535
}
3636

3737
NAN_METHOD(VideoWriter::New) {
38-
FF::SyncBinding(
39-
std::make_shared<VideoWriterBindings::NewWorker>(),
40-
"VideoWriter::New",
41-
info
42-
);
38+
FF::TryCatch tryCatch;
39+
VideoWriterBindings::NewWorker worker;
40+
41+
if (worker.applyUnwrappers(info)) {
42+
v8::Local<v8::Value> err = tryCatch.formatCatchedError("VideoWriter::New");
43+
tryCatch.throwNew(err);
44+
return;
45+
}
46+
47+
VideoWriter* self = new VideoWriter();
48+
self->writer.open(worker.fileName, worker.fourccCode, worker.fps, (cv::Size)worker.frameSize, worker.isColor);
49+
self->Wrap(info.Holder());
50+
FF_RETURN(info.Holder());
4351
}
4452

4553
NAN_METHOD(VideoWriter::Fourcc) {

0 commit comments

Comments
 (0)