Skip to content

Commit

Permalink
use NODE_MODULE_INITIALIZER to make module "context-aware" (allow use…
Browse files Browse the repository at this point in the history
… with worker threads)
  • Loading branch information
dturing committed Aug 27, 2021
1 parent 4af4f0f commit 1c946bf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
8 changes: 5 additions & 3 deletions gstreamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
#include "Pipeline.h"


void init(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE exports) {
extern "C" NODE_MODULE_EXPORT void
NODE_MODULE_INITIALIZER(Local<Object> exports,
Local<Value> module,
Local<Context> context) {

gst_init(NULL, NULL);
GObjectWrap::Init();
Pipeline::Init(exports);
}

NODE_MODULE(gstreamer_superficial, init);
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gstreamer-superficial",
"version": "1.6.0",
"version": "1.7.0",
"description": "Superficial GStreamer binding",
"author": {
"name": "Daniel Turing",
Expand Down Expand Up @@ -57,7 +57,7 @@
}
],
"dependencies": {
"nan": "^2.14.0"
"nan": "^2.15.0"
},
"devDependencies": {
"morgan": "^1.9.1"
Expand Down

0 comments on commit 1c946bf

Please sign in to comment.