grandi 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/NOTICE +21 -0
- package/README.md +402 -0
- package/binding.gyp +200 -0
- package/lib/.clang-format +297 -0
- package/lib/grandi.cc +96 -0
- package/lib/grandi_find.cc +365 -0
- package/lib/grandi_find.h +41 -0
- package/lib/grandi_receive.cc +1155 -0
- package/lib/grandi_receive.h +63 -0
- package/lib/grandi_routing.cc +460 -0
- package/lib/grandi_routing.h +37 -0
- package/lib/grandi_send.cc +960 -0
- package/lib/grandi_send.h +45 -0
- package/lib/grandi_util.cc +323 -0
- package/lib/grandi_util.h +137 -0
- package/package.json +84 -0
- package/prebuilds/darwin-arm64/grandi.node +0 -0
- package/prebuilds/darwin-arm64/libndi.dylib +0 -0
- package/prebuilds/darwin-x64/grandi.node +0 -0
- package/prebuilds/darwin-x64/libndi.dylib +0 -0
- package/prebuilds/linux-arm/grandi.node +0 -0
- package/prebuilds/linux-arm/libndi.so.6 +0 -0
- package/prebuilds/linux-arm64/grandi.node +0 -0
- package/prebuilds/linux-arm64/libndi.so.6 +0 -0
- package/prebuilds/linux-ia32/grandi.node +0 -0
- package/prebuilds/linux-ia32/libndi.so.6 +0 -0
- package/prebuilds/linux-x64/grandi.node +0 -0
- package/prebuilds/linux-x64/libndi.so.6 +0 -0
- package/prebuilds/win32-ia32/Processing.NDI.Lib.x86.dll +0 -0
- package/prebuilds/win32-ia32/grandi.node +0 -0
- package/prebuilds/win32-x64/Processing.NDI.Lib.x64.dll +0 -0
- package/prebuilds/win32-x64/grandi.node +0 -0
- package/scripts/preinstall.mjs +429 -0
- package/src/index.ts +141 -0
- package/src/node-gyp-build.d.ts +5 -0
- package/src/types.ts +228 -0
package/binding.gyp
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
{
|
|
2
|
+
"variables": {
|
|
3
|
+
"ndi_dir": "<(module_root_dir)/ndi",
|
|
4
|
+
"ndi_include_dir": "<(ndi_dir)/include",
|
|
5
|
+
"product_dir": "<(PRODUCT_DIR)"
|
|
6
|
+
},
|
|
7
|
+
"targets": [
|
|
8
|
+
{
|
|
9
|
+
"target_name": "grandi",
|
|
10
|
+
"sources": [
|
|
11
|
+
"lib/grandi_util.cc",
|
|
12
|
+
"lib/grandi_find.cc",
|
|
13
|
+
"lib/grandi_send.cc",
|
|
14
|
+
"lib/grandi_receive.cc",
|
|
15
|
+
"lib/grandi_routing.cc",
|
|
16
|
+
"lib/grandi.cc"
|
|
17
|
+
],
|
|
18
|
+
"include_dirs": [
|
|
19
|
+
"<(ndi_include_dir)"
|
|
20
|
+
],
|
|
21
|
+
"copies": [
|
|
22
|
+
{
|
|
23
|
+
"destination": "<(product_dir)",
|
|
24
|
+
"files": [
|
|
25
|
+
"<(ndi_dir)/lib/libndi_licenses.txt"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"conditions": [
|
|
30
|
+
[
|
|
31
|
+
"OS == 'win' and target_arch == 'ia32'",
|
|
32
|
+
{
|
|
33
|
+
"copies": [
|
|
34
|
+
{
|
|
35
|
+
"destination": "<(product_dir)",
|
|
36
|
+
"files": [
|
|
37
|
+
"<(ndi_dir)/lib/win-x86/Processing.NDI.Lib.x86.dll",
|
|
38
|
+
"<(ndi_dir)/lib/LICENSE.pdf"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"link_settings": {
|
|
43
|
+
"libraries": [
|
|
44
|
+
"Processing.NDI.Lib.x86.lib"
|
|
45
|
+
],
|
|
46
|
+
"library_dirs": [
|
|
47
|
+
"<(ndi_dir)/lib/win-x86"
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
"OS == 'win' and target_arch == 'x64'",
|
|
54
|
+
{
|
|
55
|
+
"copies": [
|
|
56
|
+
{
|
|
57
|
+
"destination": "<(product_dir)",
|
|
58
|
+
"files": [
|
|
59
|
+
"<(ndi_dir)/lib/win-x64/Processing.NDI.Lib.x64.dll",
|
|
60
|
+
"<(ndi_dir)/lib/LICENSE.pdf"
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"link_settings": {
|
|
65
|
+
"libraries": [
|
|
66
|
+
"Processing.NDI.Lib.x64.lib"
|
|
67
|
+
],
|
|
68
|
+
"library_dirs": [
|
|
69
|
+
"<(ndi_dir)/lib/win-x64"
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
[
|
|
75
|
+
"OS == 'linux' and target_arch == 'ia32'",
|
|
76
|
+
{
|
|
77
|
+
"copies": [
|
|
78
|
+
{
|
|
79
|
+
"destination": "<(product_dir)",
|
|
80
|
+
"files": [
|
|
81
|
+
"<(ndi_dir)/lib/lnx-x86/libndi.so.6",
|
|
82
|
+
"<(ndi_dir)/lib/LICENSE",
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
"link_settings": {
|
|
87
|
+
"ldflags": [
|
|
88
|
+
"-Wl,-rpath,'$$ORIGIN'"
|
|
89
|
+
],
|
|
90
|
+
"libraries": [
|
|
91
|
+
"-lndi"
|
|
92
|
+
],
|
|
93
|
+
"library_dirs": [
|
|
94
|
+
"<(ndi_dir)/lib/lnx-x86"
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
[
|
|
100
|
+
"OS == 'linux' and target_arch == 'x64'",
|
|
101
|
+
{
|
|
102
|
+
"copies": [
|
|
103
|
+
{
|
|
104
|
+
"destination": "<(product_dir)",
|
|
105
|
+
"files": [
|
|
106
|
+
"<(ndi_dir)/lib/lnx-x64/libndi.so.6",
|
|
107
|
+
"<(ndi_dir)/lib/LICENSE"
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
"link_settings": {
|
|
112
|
+
"ldflags": [
|
|
113
|
+
"-Wl,-rpath,'$$ORIGIN'"
|
|
114
|
+
],
|
|
115
|
+
"libraries": [
|
|
116
|
+
"-lndi"
|
|
117
|
+
],
|
|
118
|
+
"library_dirs": [
|
|
119
|
+
"<(ndi_dir)/lib/lnx-x64"
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
[
|
|
125
|
+
"OS == 'linux' and target_arch == 'arm'",
|
|
126
|
+
{
|
|
127
|
+
"copies": [
|
|
128
|
+
{
|
|
129
|
+
"destination": "<(product_dir)",
|
|
130
|
+
"files": [
|
|
131
|
+
"<(ndi_dir)/lib/lnx-armv7l/libndi.so.6",
|
|
132
|
+
"<(ndi_dir)/lib/LICENSE"
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
"link_settings": {
|
|
137
|
+
"ldflags": [
|
|
138
|
+
"-Wl,-rpath,'$$ORIGIN'"
|
|
139
|
+
],
|
|
140
|
+
"libraries": [
|
|
141
|
+
"-lndi"
|
|
142
|
+
],
|
|
143
|
+
"library_dirs": [
|
|
144
|
+
"<(ndi_dir)/lib/lnx-armv7l"
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
[
|
|
150
|
+
"OS == 'linux' and target_arch == 'arm64'",
|
|
151
|
+
{
|
|
152
|
+
"copies": [
|
|
153
|
+
{
|
|
154
|
+
"destination": "<(product_dir)",
|
|
155
|
+
"files": [
|
|
156
|
+
"<(ndi_dir)/lib/lnx-arm64/libndi.so.6",
|
|
157
|
+
"<(ndi_dir)/lib/LICENSE"
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
"link_settings": {
|
|
162
|
+
"ldflags": [
|
|
163
|
+
"-Wl,-rpath,'$$ORIGIN'"
|
|
164
|
+
],
|
|
165
|
+
"libraries": [
|
|
166
|
+
"-lndi"
|
|
167
|
+
],
|
|
168
|
+
"library_dirs": [
|
|
169
|
+
"<(ndi_dir)/lib/lnx-arm64"
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
],
|
|
174
|
+
[
|
|
175
|
+
"OS == 'mac'",
|
|
176
|
+
{
|
|
177
|
+
"copies": [
|
|
178
|
+
{
|
|
179
|
+
"destination": "<(product_dir)",
|
|
180
|
+
"files": [
|
|
181
|
+
"<(ndi_dir)/lib/macOS/libndi.dylib",
|
|
182
|
+
"<(ndi_dir)/lib/LICENSE.pdf"
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
],
|
|
186
|
+
"link_settings": {
|
|
187
|
+
"libraries": [
|
|
188
|
+
"-Wl,-rpath,@loader_path",
|
|
189
|
+
"-lndi"
|
|
190
|
+
],
|
|
191
|
+
"library_dirs": [
|
|
192
|
+
"<(ndi_dir)/lib/macOS"
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
]
|
|
197
|
+
]
|
|
198
|
+
}
|
|
199
|
+
]
|
|
200
|
+
}
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
---
|
|
2
|
+
Language: Cpp
|
|
3
|
+
AccessModifierOffset: -2
|
|
4
|
+
AlignAfterOpenBracket: Align
|
|
5
|
+
AlignArrayOfStructures: None
|
|
6
|
+
AlignConsecutiveAssignments:
|
|
7
|
+
Enabled: false
|
|
8
|
+
AcrossEmptyLines: false
|
|
9
|
+
AcrossComments: false
|
|
10
|
+
AlignCompound: false
|
|
11
|
+
AlignFunctionDeclarations: false
|
|
12
|
+
AlignFunctionPointers: false
|
|
13
|
+
PadOperators: true
|
|
14
|
+
AlignConsecutiveBitFields:
|
|
15
|
+
Enabled: false
|
|
16
|
+
AcrossEmptyLines: false
|
|
17
|
+
AcrossComments: false
|
|
18
|
+
AlignCompound: false
|
|
19
|
+
AlignFunctionDeclarations: false
|
|
20
|
+
AlignFunctionPointers: false
|
|
21
|
+
PadOperators: false
|
|
22
|
+
AlignConsecutiveDeclarations:
|
|
23
|
+
Enabled: false
|
|
24
|
+
AcrossEmptyLines: false
|
|
25
|
+
AcrossComments: false
|
|
26
|
+
AlignCompound: false
|
|
27
|
+
AlignFunctionDeclarations: true
|
|
28
|
+
AlignFunctionPointers: false
|
|
29
|
+
PadOperators: false
|
|
30
|
+
AlignConsecutiveMacros:
|
|
31
|
+
Enabled: false
|
|
32
|
+
AcrossEmptyLines: false
|
|
33
|
+
AcrossComments: false
|
|
34
|
+
AlignCompound: false
|
|
35
|
+
AlignFunctionDeclarations: false
|
|
36
|
+
AlignFunctionPointers: false
|
|
37
|
+
PadOperators: false
|
|
38
|
+
AlignConsecutiveShortCaseStatements:
|
|
39
|
+
Enabled: false
|
|
40
|
+
AcrossEmptyLines: false
|
|
41
|
+
AcrossComments: false
|
|
42
|
+
AlignCaseArrows: false
|
|
43
|
+
AlignCaseColons: false
|
|
44
|
+
AlignConsecutiveTableGenBreakingDAGArgColons:
|
|
45
|
+
Enabled: false
|
|
46
|
+
AcrossEmptyLines: false
|
|
47
|
+
AcrossComments: false
|
|
48
|
+
AlignCompound: false
|
|
49
|
+
AlignFunctionDeclarations: false
|
|
50
|
+
AlignFunctionPointers: false
|
|
51
|
+
PadOperators: false
|
|
52
|
+
AlignConsecutiveTableGenCondOperatorColons:
|
|
53
|
+
Enabled: false
|
|
54
|
+
AcrossEmptyLines: false
|
|
55
|
+
AcrossComments: false
|
|
56
|
+
AlignCompound: false
|
|
57
|
+
AlignFunctionDeclarations: false
|
|
58
|
+
AlignFunctionPointers: false
|
|
59
|
+
PadOperators: false
|
|
60
|
+
AlignConsecutiveTableGenDefinitionColons:
|
|
61
|
+
Enabled: false
|
|
62
|
+
AcrossEmptyLines: false
|
|
63
|
+
AcrossComments: false
|
|
64
|
+
AlignCompound: false
|
|
65
|
+
AlignFunctionDeclarations: false
|
|
66
|
+
AlignFunctionPointers: false
|
|
67
|
+
PadOperators: false
|
|
68
|
+
AlignEscapedNewlines: Right
|
|
69
|
+
AlignOperands: Align
|
|
70
|
+
AlignTrailingComments:
|
|
71
|
+
Kind: Always
|
|
72
|
+
OverEmptyLines: 0
|
|
73
|
+
AllowAllArgumentsOnNextLine: true
|
|
74
|
+
AllowAllParametersOfDeclarationOnNextLine: true
|
|
75
|
+
AllowBreakBeforeNoexceptSpecifier: Never
|
|
76
|
+
AllowShortBlocksOnASingleLine: Never
|
|
77
|
+
AllowShortCaseExpressionOnASingleLine: true
|
|
78
|
+
AllowShortCaseLabelsOnASingleLine: false
|
|
79
|
+
AllowShortCompoundRequirementOnASingleLine: true
|
|
80
|
+
AllowShortEnumsOnASingleLine: true
|
|
81
|
+
AllowShortFunctionsOnASingleLine: All
|
|
82
|
+
AllowShortIfStatementsOnASingleLine: Never
|
|
83
|
+
AllowShortLambdasOnASingleLine: All
|
|
84
|
+
AllowShortLoopsOnASingleLine: false
|
|
85
|
+
AllowShortNamespacesOnASingleLine: false
|
|
86
|
+
AlwaysBreakAfterDefinitionReturnType: None
|
|
87
|
+
AlwaysBreakBeforeMultilineStrings: false
|
|
88
|
+
AttributeMacros:
|
|
89
|
+
- __capability
|
|
90
|
+
BinPackArguments: true
|
|
91
|
+
BinPackLongBracedList: true
|
|
92
|
+
BinPackParameters: BinPack
|
|
93
|
+
BitFieldColonSpacing: Both
|
|
94
|
+
BracedInitializerIndentWidth: -1
|
|
95
|
+
BraceWrapping:
|
|
96
|
+
AfterCaseLabel: false
|
|
97
|
+
AfterClass: false
|
|
98
|
+
AfterControlStatement: Never
|
|
99
|
+
AfterEnum: false
|
|
100
|
+
AfterExternBlock: false
|
|
101
|
+
AfterFunction: false
|
|
102
|
+
AfterNamespace: false
|
|
103
|
+
AfterObjCDeclaration: false
|
|
104
|
+
AfterStruct: false
|
|
105
|
+
AfterUnion: false
|
|
106
|
+
BeforeCatch: false
|
|
107
|
+
BeforeElse: false
|
|
108
|
+
BeforeLambdaBody: false
|
|
109
|
+
BeforeWhile: false
|
|
110
|
+
IndentBraces: false
|
|
111
|
+
SplitEmptyFunction: true
|
|
112
|
+
SplitEmptyRecord: true
|
|
113
|
+
SplitEmptyNamespace: true
|
|
114
|
+
BreakAdjacentStringLiterals: true
|
|
115
|
+
BreakAfterAttributes: Leave
|
|
116
|
+
BreakAfterJavaFieldAnnotations: false
|
|
117
|
+
BreakAfterReturnType: None
|
|
118
|
+
BreakArrays: true
|
|
119
|
+
BreakBeforeBinaryOperators: None
|
|
120
|
+
BreakBeforeConceptDeclarations: Always
|
|
121
|
+
BreakBeforeBraces: Attach
|
|
122
|
+
BreakBeforeInlineASMColon: OnlyMultiline
|
|
123
|
+
BreakBeforeTemplateCloser: false
|
|
124
|
+
BreakBeforeTernaryOperators: true
|
|
125
|
+
BreakBinaryOperations: Never
|
|
126
|
+
BreakConstructorInitializers: BeforeColon
|
|
127
|
+
BreakFunctionDefinitionParameters: false
|
|
128
|
+
BreakInheritanceList: BeforeColon
|
|
129
|
+
BreakStringLiterals: true
|
|
130
|
+
BreakTemplateDeclarations: MultiLine
|
|
131
|
+
ColumnLimit: 80
|
|
132
|
+
CommentPragmas: '^ IWYU pragma:'
|
|
133
|
+
CompactNamespaces: false
|
|
134
|
+
ConstructorInitializerIndentWidth: 4
|
|
135
|
+
ContinuationIndentWidth: 4
|
|
136
|
+
Cpp11BracedListStyle: true
|
|
137
|
+
DerivePointerAlignment: false
|
|
138
|
+
DisableFormat: false
|
|
139
|
+
EmptyLineAfterAccessModifier: Never
|
|
140
|
+
EmptyLineBeforeAccessModifier: LogicalBlock
|
|
141
|
+
EnumTrailingComma: Leave
|
|
142
|
+
ExperimentalAutoDetectBinPacking: false
|
|
143
|
+
FixNamespaceComments: true
|
|
144
|
+
ForEachMacros:
|
|
145
|
+
- foreach
|
|
146
|
+
- Q_FOREACH
|
|
147
|
+
- BOOST_FOREACH
|
|
148
|
+
IfMacros:
|
|
149
|
+
- KJ_IF_MAYBE
|
|
150
|
+
IncludeBlocks: Preserve
|
|
151
|
+
IncludeCategories:
|
|
152
|
+
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
|
|
153
|
+
Priority: 2
|
|
154
|
+
SortPriority: 0
|
|
155
|
+
CaseSensitive: false
|
|
156
|
+
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
|
|
157
|
+
Priority: 3
|
|
158
|
+
SortPriority: 0
|
|
159
|
+
CaseSensitive: false
|
|
160
|
+
- Regex: '.*'
|
|
161
|
+
Priority: 1
|
|
162
|
+
SortPriority: 0
|
|
163
|
+
CaseSensitive: false
|
|
164
|
+
IncludeIsMainRegex: '(Test)?$'
|
|
165
|
+
IncludeIsMainSourceRegex: ''
|
|
166
|
+
IndentAccessModifiers: false
|
|
167
|
+
IndentCaseBlocks: false
|
|
168
|
+
IndentCaseLabels: false
|
|
169
|
+
IndentExportBlock: true
|
|
170
|
+
IndentExternBlock: AfterExternBlock
|
|
171
|
+
IndentGotoLabels: true
|
|
172
|
+
IndentPPDirectives: None
|
|
173
|
+
IndentRequiresClause: true
|
|
174
|
+
IndentWidth: 2
|
|
175
|
+
IndentWrappedFunctionNames: false
|
|
176
|
+
InsertBraces: false
|
|
177
|
+
InsertNewlineAtEOF: false
|
|
178
|
+
InsertTrailingCommas: None
|
|
179
|
+
IntegerLiteralSeparator:
|
|
180
|
+
Binary: 0
|
|
181
|
+
BinaryMinDigits: 0
|
|
182
|
+
Decimal: 0
|
|
183
|
+
DecimalMinDigits: 0
|
|
184
|
+
Hex: 0
|
|
185
|
+
HexMinDigits: 0
|
|
186
|
+
JavaScriptQuotes: Leave
|
|
187
|
+
JavaScriptWrapImports: true
|
|
188
|
+
KeepEmptyLines:
|
|
189
|
+
AtEndOfFile: false
|
|
190
|
+
AtStartOfBlock: true
|
|
191
|
+
AtStartOfFile: true
|
|
192
|
+
KeepFormFeed: false
|
|
193
|
+
LambdaBodyIndentation: Signature
|
|
194
|
+
LineEnding: DeriveLF
|
|
195
|
+
MacroBlockBegin: ''
|
|
196
|
+
MacroBlockEnd: ''
|
|
197
|
+
MainIncludeChar: Quote
|
|
198
|
+
MaxEmptyLinesToKeep: 1
|
|
199
|
+
NamespaceIndentation: None
|
|
200
|
+
ObjCBinPackProtocolList: Auto
|
|
201
|
+
ObjCBlockIndentWidth: 2
|
|
202
|
+
ObjCBreakBeforeNestedBlockParam: true
|
|
203
|
+
ObjCSpaceAfterProperty: false
|
|
204
|
+
ObjCSpaceBeforeProtocolList: true
|
|
205
|
+
OneLineFormatOffRegex: ''
|
|
206
|
+
PackConstructorInitializers: BinPack
|
|
207
|
+
PenaltyBreakAssignment: 2
|
|
208
|
+
PenaltyBreakBeforeFirstCallParameter: 19
|
|
209
|
+
PenaltyBreakBeforeMemberAccess: 150
|
|
210
|
+
PenaltyBreakComment: 300
|
|
211
|
+
PenaltyBreakFirstLessLess: 120
|
|
212
|
+
PenaltyBreakOpenParenthesis: 0
|
|
213
|
+
PenaltyBreakScopeResolution: 500
|
|
214
|
+
PenaltyBreakString: 1000
|
|
215
|
+
PenaltyBreakTemplateDeclaration: 10
|
|
216
|
+
PenaltyExcessCharacter: 1000000
|
|
217
|
+
PenaltyIndentedWhitespace: 0
|
|
218
|
+
PenaltyReturnTypeOnItsOwnLine: 60
|
|
219
|
+
PointerAlignment: Right
|
|
220
|
+
PPIndentWidth: -1
|
|
221
|
+
QualifierAlignment: Leave
|
|
222
|
+
ReferenceAlignment: Pointer
|
|
223
|
+
ReflowComments: Always
|
|
224
|
+
RemoveBracesLLVM: false
|
|
225
|
+
RemoveEmptyLinesInUnwrappedLines: false
|
|
226
|
+
RemoveParentheses: Leave
|
|
227
|
+
RemoveSemicolon: false
|
|
228
|
+
RequiresClausePosition: OwnLine
|
|
229
|
+
RequiresExpressionIndentation: OuterScope
|
|
230
|
+
SeparateDefinitionBlocks: Leave
|
|
231
|
+
ShortNamespaceLines: 1
|
|
232
|
+
SkipMacroDefinitionBody: false
|
|
233
|
+
SortIncludes:
|
|
234
|
+
Enabled: false
|
|
235
|
+
IgnoreCase: false
|
|
236
|
+
SortJavaStaticImport: Before
|
|
237
|
+
SortUsingDeclarations: LexicographicNumeric
|
|
238
|
+
SpaceAfterCStyleCast: false
|
|
239
|
+
SpaceAfterLogicalNot: false
|
|
240
|
+
SpaceAfterOperatorKeyword: false
|
|
241
|
+
SpaceAfterTemplateKeyword: true
|
|
242
|
+
SpaceAroundPointerQualifiers: Default
|
|
243
|
+
SpaceBeforeAssignmentOperators: true
|
|
244
|
+
SpaceBeforeCaseColon: false
|
|
245
|
+
SpaceBeforeCpp11BracedList: false
|
|
246
|
+
SpaceBeforeCtorInitializerColon: true
|
|
247
|
+
SpaceBeforeInheritanceColon: true
|
|
248
|
+
SpaceBeforeJsonColon: false
|
|
249
|
+
SpaceBeforeParens: ControlStatements
|
|
250
|
+
SpaceBeforeParensOptions:
|
|
251
|
+
AfterControlStatements: true
|
|
252
|
+
AfterForeachMacros: true
|
|
253
|
+
AfterFunctionDefinitionName: false
|
|
254
|
+
AfterFunctionDeclarationName: false
|
|
255
|
+
AfterIfMacros: true
|
|
256
|
+
AfterNot: false
|
|
257
|
+
AfterOverloadedOperator: false
|
|
258
|
+
AfterPlacementOperator: true
|
|
259
|
+
AfterRequiresInClause: false
|
|
260
|
+
AfterRequiresInExpression: false
|
|
261
|
+
BeforeNonEmptyParentheses: false
|
|
262
|
+
SpaceBeforeRangeBasedForLoopColon: true
|
|
263
|
+
SpaceBeforeSquareBrackets: false
|
|
264
|
+
SpaceInEmptyBlock: false
|
|
265
|
+
SpacesBeforeTrailingComments: 1
|
|
266
|
+
SpacesInAngles: Never
|
|
267
|
+
SpacesInContainerLiterals: true
|
|
268
|
+
SpacesInLineCommentPrefix:
|
|
269
|
+
Minimum: 1
|
|
270
|
+
Maximum: -1
|
|
271
|
+
SpacesInParens: Never
|
|
272
|
+
SpacesInParensOptions:
|
|
273
|
+
ExceptDoubleParentheses: false
|
|
274
|
+
InCStyleCasts: false
|
|
275
|
+
InConditionalStatements: false
|
|
276
|
+
InEmptyParentheses: false
|
|
277
|
+
Other: false
|
|
278
|
+
SpacesInSquareBrackets: false
|
|
279
|
+
Standard: Latest
|
|
280
|
+
StatementAttributeLikeMacros:
|
|
281
|
+
- Q_EMIT
|
|
282
|
+
StatementMacros:
|
|
283
|
+
- Q_UNUSED
|
|
284
|
+
- QT_REQUIRE_VERSION
|
|
285
|
+
TableGenBreakInsideDAGArg: DontBreak
|
|
286
|
+
TabWidth: 8
|
|
287
|
+
UseTab: Never
|
|
288
|
+
VerilogBreakBetweenInstancePorts: true
|
|
289
|
+
WhitespaceSensitiveMacros:
|
|
290
|
+
- BOOST_PP_STRINGIZE
|
|
291
|
+
- CF_SWIFT_NAME
|
|
292
|
+
- NS_SWIFT_NAME
|
|
293
|
+
- PP_STRINGIZE
|
|
294
|
+
- STRINGIZE
|
|
295
|
+
WrapNamespaceBodyWithEmptyLines: Leave
|
|
296
|
+
...
|
|
297
|
+
|
package/lib/grandi.cc
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/* Copyright 2018 Streampunk Media Ltd.
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
|
+
limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
#include <cstdio>
|
|
17
|
+
#include <chrono>
|
|
18
|
+
#include <Processing.NDI.Lib.h>
|
|
19
|
+
|
|
20
|
+
#ifdef _WIN32
|
|
21
|
+
#ifdef _WIN64
|
|
22
|
+
#pragma comment(lib, "Processing.NDI.Lib.x64.lib")
|
|
23
|
+
#else // _WIN64
|
|
24
|
+
#pragma comment(lib, "Processing.NDI.Lib.x86.lib")
|
|
25
|
+
#endif // _WIN64
|
|
26
|
+
#endif // _WIN32
|
|
27
|
+
|
|
28
|
+
#include "grandi_util.h"
|
|
29
|
+
#include "grandi_find.h"
|
|
30
|
+
#include "grandi_send.h"
|
|
31
|
+
#include "grandi_receive.h"
|
|
32
|
+
#include "grandi_routing.h"
|
|
33
|
+
#include "node_api.h"
|
|
34
|
+
|
|
35
|
+
napi_value version(napi_env env, napi_callback_info info) {
|
|
36
|
+
napi_status status;
|
|
37
|
+
|
|
38
|
+
const char *ndiVersion = NDIlib_version();
|
|
39
|
+
napi_value result;
|
|
40
|
+
status = napi_create_string_utf8(env, ndiVersion, NAPI_AUTO_LENGTH, &result);
|
|
41
|
+
CHECK_STATUS;
|
|
42
|
+
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
napi_value isSupportedCPU(napi_env env, napi_callback_info info) {
|
|
47
|
+
napi_status status;
|
|
48
|
+
|
|
49
|
+
napi_value result;
|
|
50
|
+
status = napi_get_boolean(env, NDIlib_is_supported_CPU(), &result);
|
|
51
|
+
CHECK_STATUS;
|
|
52
|
+
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
napi_value initialize(napi_env env, napi_callback_info info) {
|
|
57
|
+
napi_status status;
|
|
58
|
+
|
|
59
|
+
bool ok = NDIlib_initialize();
|
|
60
|
+
napi_value result;
|
|
61
|
+
status = napi_get_boolean(env, ok, &result);
|
|
62
|
+
CHECK_STATUS;
|
|
63
|
+
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
napi_value destroy(napi_env env, napi_callback_info info) {
|
|
68
|
+
napi_status status;
|
|
69
|
+
|
|
70
|
+
NDIlib_destroy();
|
|
71
|
+
napi_value result;
|
|
72
|
+
status = napi_get_boolean(env, true, &result);
|
|
73
|
+
CHECK_STATUS;
|
|
74
|
+
|
|
75
|
+
return result;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
napi_value Init(napi_env env, napi_value exports) {
|
|
79
|
+
napi_status status;
|
|
80
|
+
napi_property_descriptor desc[] = {
|
|
81
|
+
DECLARE_NAPI_METHOD("version", version),
|
|
82
|
+
DECLARE_NAPI_METHOD("isSupportedCPU", isSupportedCPU),
|
|
83
|
+
DECLARE_NAPI_METHOD("initialize", initialize),
|
|
84
|
+
DECLARE_NAPI_METHOD("destroy", destroy),
|
|
85
|
+
DECLARE_NAPI_METHOD("find", find),
|
|
86
|
+
DECLARE_NAPI_METHOD("send", send),
|
|
87
|
+
DECLARE_NAPI_METHOD("receive", receive),
|
|
88
|
+
DECLARE_NAPI_METHOD("routing", routing)};
|
|
89
|
+
status = napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]),
|
|
90
|
+
desc);
|
|
91
|
+
CHECK_STATUS;
|
|
92
|
+
|
|
93
|
+
return exports;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
NAPI_MODULE(nodencl, Init)
|