node-av 1.0.3 → 1.2.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/README.md +56 -41
- package/dist/api/bitstream-filter.d.ts +180 -123
- package/dist/api/bitstream-filter.js +182 -126
- package/dist/api/bitstream-filter.js.map +1 -1
- package/dist/api/decoder.d.ts +286 -130
- package/dist/api/decoder.js +321 -159
- package/dist/api/decoder.js.map +1 -1
- package/dist/api/encoder.d.ts +254 -158
- package/dist/api/encoder.js +326 -298
- package/dist/api/encoder.js.map +1 -1
- package/dist/api/filter-presets.d.ts +912 -0
- package/dist/api/filter-presets.js +1407 -0
- package/dist/api/filter-presets.js.map +1 -0
- package/dist/api/filter.d.ts +280 -284
- package/dist/api/filter.js +435 -509
- package/dist/api/filter.js.map +1 -1
- package/dist/api/hardware.d.ts +226 -159
- package/dist/api/hardware.js +405 -287
- package/dist/api/hardware.js.map +1 -1
- package/dist/api/index.d.ts +3 -2
- package/dist/api/index.js +1 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/io-stream.d.ts +65 -61
- package/dist/api/io-stream.js +45 -47
- package/dist/api/io-stream.js.map +1 -1
- package/dist/api/media-input.d.ts +244 -141
- package/dist/api/media-input.js +207 -104
- package/dist/api/media-input.js.map +1 -1
- package/dist/api/media-output.d.ts +206 -128
- package/dist/api/media-output.js +212 -129
- package/dist/api/media-output.js.map +1 -1
- package/dist/api/pipeline.d.ts +168 -38
- package/dist/api/pipeline.js +238 -14
- package/dist/api/pipeline.js.map +1 -1
- package/dist/api/types.d.ts +22 -182
- package/dist/api/utilities/audio-sample.d.ts +1 -1
- package/dist/api/utilities/image.d.ts +1 -1
- package/dist/api/utilities/media-type.d.ts +1 -1
- package/dist/api/utilities/pixel-format.d.ts +1 -1
- package/dist/api/utilities/sample-format.d.ts +1 -1
- package/dist/api/utilities/timestamp.d.ts +1 -1
- package/dist/api/utils.d.ts +1 -2
- package/dist/api/utils.js +9 -0
- package/dist/api/utils.js.map +1 -1
- package/dist/{lib → constants}/channel-layouts.d.ts +1 -1
- package/dist/constants/channel-layouts.js.map +1 -0
- package/dist/{lib → constants}/constants.d.ts +19 -4
- package/dist/{lib → constants}/constants.js +15 -1
- package/dist/constants/constants.js.map +1 -0
- package/dist/constants/decoders.d.ts +609 -0
- package/dist/constants/decoders.js +617 -0
- package/dist/constants/decoders.js.map +1 -0
- package/dist/constants/encoders.d.ts +285 -0
- package/dist/constants/encoders.js +298 -0
- package/dist/constants/encoders.js.map +1 -0
- package/dist/constants/index.d.ts +4 -0
- package/dist/constants/index.js +5 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/audio-fifo.d.ts +128 -171
- package/dist/lib/audio-fifo.js +130 -173
- package/dist/lib/audio-fifo.js.map +1 -1
- package/dist/lib/binding.d.ts +7 -5
- package/dist/lib/binding.js +5 -0
- package/dist/lib/binding.js.map +1 -1
- package/dist/lib/bitstream-filter-context.d.ts +139 -184
- package/dist/lib/bitstream-filter-context.js +139 -188
- package/dist/lib/bitstream-filter-context.js.map +1 -1
- package/dist/lib/bitstream-filter.d.ts +69 -55
- package/dist/lib/bitstream-filter.js +68 -54
- package/dist/lib/bitstream-filter.js.map +1 -1
- package/dist/lib/codec-context.d.ts +317 -381
- package/dist/lib/codec-context.js +316 -381
- package/dist/lib/codec-context.js.map +1 -1
- package/dist/lib/codec-parameters.d.ts +161 -171
- package/dist/lib/codec-parameters.js +162 -172
- package/dist/lib/codec-parameters.js.map +1 -1
- package/dist/lib/codec-parser.d.ts +92 -105
- package/dist/lib/codec-parser.js +92 -103
- package/dist/lib/codec-parser.js.map +1 -1
- package/dist/lib/codec.d.ts +328 -217
- package/dist/lib/codec.js +392 -218
- package/dist/lib/codec.js.map +1 -1
- package/dist/lib/dictionary.d.ts +150 -204
- package/dist/lib/dictionary.js +159 -213
- package/dist/lib/dictionary.js.map +1 -1
- package/dist/lib/error.d.ts +97 -131
- package/dist/lib/error.js +98 -128
- package/dist/lib/error.js.map +1 -1
- package/dist/lib/filter-context.d.ts +317 -194
- package/dist/lib/filter-context.js +335 -200
- package/dist/lib/filter-context.js.map +1 -1
- package/dist/lib/filter-graph.d.ts +252 -293
- package/dist/lib/filter-graph.js +253 -294
- package/dist/lib/filter-graph.js.map +1 -1
- package/dist/lib/filter-inout.d.ts +87 -95
- package/dist/lib/filter-inout.js +87 -95
- package/dist/lib/filter-inout.js.map +1 -1
- package/dist/lib/filter.d.ts +93 -111
- package/dist/lib/filter.js +94 -112
- package/dist/lib/filter.js.map +1 -1
- package/dist/lib/format-context.d.ts +321 -429
- package/dist/lib/format-context.js +314 -386
- package/dist/lib/format-context.js.map +1 -1
- package/dist/lib/frame.d.ts +263 -406
- package/dist/lib/frame.js +263 -408
- package/dist/lib/frame.js.map +1 -1
- package/dist/lib/hardware-device-context.d.ts +150 -204
- package/dist/lib/hardware-device-context.js +149 -203
- package/dist/lib/hardware-device-context.js.map +1 -1
- package/dist/lib/hardware-frames-context.d.ts +171 -181
- package/dist/lib/hardware-frames-context.js +171 -181
- package/dist/lib/hardware-frames-context.js.map +1 -1
- package/dist/lib/index.d.ts +2 -3
- package/dist/lib/index.js +2 -5
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/input-format.d.ts +90 -118
- package/dist/lib/input-format.js +89 -117
- package/dist/lib/input-format.js.map +1 -1
- package/dist/lib/io-context.d.ts +210 -242
- package/dist/lib/io-context.js +221 -253
- package/dist/lib/io-context.js.map +1 -1
- package/dist/lib/log.d.ts +86 -120
- package/dist/lib/log.js +85 -122
- package/dist/lib/log.js.map +1 -1
- package/dist/lib/native-types.d.ts +127 -112
- package/dist/lib/native-types.js +9 -0
- package/dist/lib/native-types.js.map +1 -1
- package/dist/lib/option.d.ts +285 -242
- package/dist/lib/option.js +310 -250
- package/dist/lib/option.js.map +1 -1
- package/dist/lib/output-format.d.ts +78 -102
- package/dist/lib/output-format.js +77 -101
- package/dist/lib/output-format.js.map +1 -1
- package/dist/lib/packet.d.ts +173 -241
- package/dist/lib/packet.js +172 -241
- package/dist/lib/packet.js.map +1 -1
- package/dist/lib/rational.d.ts +0 -2
- package/dist/lib/rational.js +0 -2
- package/dist/lib/rational.js.map +1 -1
- package/dist/lib/software-resample-context.d.ts +242 -326
- package/dist/lib/software-resample-context.js +242 -326
- package/dist/lib/software-resample-context.js.map +1 -1
- package/dist/lib/software-scale-context.d.ts +130 -174
- package/dist/lib/software-scale-context.js +132 -176
- package/dist/lib/software-scale-context.js.map +1 -1
- package/dist/lib/stream.d.ts +88 -198
- package/dist/lib/stream.js +87 -197
- package/dist/lib/stream.js.map +1 -1
- package/dist/lib/types.d.ts +1 -1
- package/dist/lib/utilities.d.ts +372 -181
- package/dist/lib/utilities.js +373 -182
- package/dist/lib/utilities.js.map +1 -1
- package/install/check.js +0 -1
- package/package.json +32 -24
- package/release_notes.md +43 -13
- package/CHANGELOG.md +0 -8
- package/dist/lib/channel-layouts.js.map +0 -1
- package/dist/lib/constants.js.map +0 -1
- /package/dist/{lib → constants}/channel-layouts.js +0 -0
package/dist/lib/filter-graph.js
CHANGED
|
@@ -2,103 +2,79 @@ import { bindings } from './binding.js';
|
|
|
2
2
|
import { FilterContext } from './filter-context.js';
|
|
3
3
|
import { OptionMember } from './option.js';
|
|
4
4
|
/**
|
|
5
|
-
* Filter graph for
|
|
5
|
+
* Filter graph for audio/video processing pipelines.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Manages a collection of interconnected filters forming a processing pipeline.
|
|
8
|
+
* Filters are connected through their input/output pads to create complex
|
|
9
|
+
* audio/video transformations. Supports both simple linear chains and complex
|
|
10
|
+
* graphs with multiple inputs/outputs. Essential for effects, format conversions,
|
|
11
|
+
* scaling, and other media processing operations.
|
|
10
12
|
*
|
|
11
13
|
* Direct mapping to FFmpeg's AVFilterGraph.
|
|
12
14
|
*
|
|
13
15
|
* @example
|
|
14
16
|
* ```typescript
|
|
15
|
-
* import { FilterGraph, Filter,
|
|
17
|
+
* import { FilterGraph, Filter, FilterInOut, FFmpegError } from 'node-av';
|
|
16
18
|
*
|
|
17
|
-
* // Create and configure
|
|
19
|
+
* // Create and configure filter graph
|
|
18
20
|
* const graph = new FilterGraph();
|
|
19
21
|
* graph.alloc();
|
|
20
22
|
*
|
|
21
|
-
* // Create
|
|
22
|
-
* const bufferFilter = Filter.getByName('buffer');
|
|
23
|
-
* if (!bufferFilter) throw new Error('Buffer filter not found');
|
|
23
|
+
* // Create filters
|
|
24
24
|
* const bufferSrc = graph.createFilter(
|
|
25
|
-
*
|
|
26
|
-
* '
|
|
27
|
-
* 'video_size=1920x1080:pix_fmt=yuv420p
|
|
25
|
+
* Filter.getByName('buffer')!,
|
|
26
|
+
* 'src',
|
|
27
|
+
* 'video_size=1920x1080:pix_fmt=yuv420p'
|
|
28
28
|
* );
|
|
29
|
-
* if (!bufferSrc) throw new Error('Failed to create buffer source');
|
|
30
29
|
*
|
|
31
|
-
* // Create scale filter
|
|
32
|
-
* const scaleFilter = Filter.getByName('scale');
|
|
33
|
-
* if (!scaleFilter) throw new Error('Scale filter not found');
|
|
34
30
|
* const scale = graph.createFilter(
|
|
35
|
-
*
|
|
31
|
+
* Filter.getByName('scale')!,
|
|
36
32
|
* 'scale',
|
|
37
|
-
* '
|
|
33
|
+
* '640:480'
|
|
38
34
|
* );
|
|
39
|
-
* if (!scale) throw new Error('Failed to create scale filter');
|
|
40
35
|
*
|
|
41
|
-
* // Create buffer sink
|
|
42
|
-
* const sinkFilter = Filter.getByName('buffersink');
|
|
43
|
-
* if (!sinkFilter) throw new Error('Buffersink filter not found');
|
|
44
36
|
* const bufferSink = graph.createFilter(
|
|
45
|
-
*
|
|
46
|
-
* '
|
|
37
|
+
* Filter.getByName('buffersink')!,
|
|
38
|
+
* 'sink'
|
|
47
39
|
* );
|
|
48
|
-
* if (!bufferSink) throw new Error('Failed to create buffer sink');
|
|
49
40
|
*
|
|
50
41
|
* // Link filters
|
|
51
|
-
*
|
|
52
|
-
*
|
|
42
|
+
* bufferSrc.link(0, scale, 0);
|
|
43
|
+
* scale.link(0, bufferSink, 0);
|
|
53
44
|
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
45
|
+
* // Configure graph
|
|
46
|
+
* const ret = await graph.config();
|
|
47
|
+
* FFmpegError.throwIfError(ret, 'config');
|
|
56
48
|
*
|
|
57
|
-
* //
|
|
58
|
-
* const
|
|
59
|
-
* FFmpegError.throwIfError(
|
|
60
|
-
*
|
|
61
|
-
* // Clean up
|
|
62
|
-
* graph.free();
|
|
49
|
+
* // Parse filter string
|
|
50
|
+
* const ret2 = graph.parse2('[in]scale=640:480[out]');
|
|
51
|
+
* FFmpegError.throwIfError(ret2, 'parse2');
|
|
63
52
|
* ```
|
|
53
|
+
*
|
|
54
|
+
* @see [AVFilterGraph](https://ffmpeg.org/doxygen/trunk/structAVFilterGraph.html) - FFmpeg Doxygen
|
|
55
|
+
* @see {@link FilterContext} For filter instances
|
|
56
|
+
* @see {@link Filter} For filter descriptors
|
|
64
57
|
*/
|
|
65
58
|
export class FilterGraph extends OptionMember {
|
|
66
|
-
/**
|
|
67
|
-
* Create a new FilterGraph instance.
|
|
68
|
-
*
|
|
69
|
-
* The graph is uninitialized - you must call alloc() before use.
|
|
70
|
-
* No FFmpeg resources are allocated until alloc() is called.
|
|
71
|
-
*
|
|
72
|
-
* Direct wrapper around AVFilterGraph.
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* ```typescript
|
|
76
|
-
* import { FilterGraph } from 'node-av';
|
|
77
|
-
*
|
|
78
|
-
* const graph = new FilterGraph();
|
|
79
|
-
* graph.alloc();
|
|
80
|
-
* // Graph is now ready for use
|
|
81
|
-
* ```
|
|
82
|
-
*/
|
|
83
59
|
constructor() {
|
|
84
60
|
super(new bindings.FilterGraph());
|
|
85
61
|
}
|
|
86
62
|
/**
|
|
87
63
|
* Number of filters in the graph.
|
|
88
64
|
*
|
|
89
|
-
*
|
|
65
|
+
* Total count of filter contexts in this graph.
|
|
90
66
|
*
|
|
91
|
-
*
|
|
67
|
+
* Direct mapping to AVFilterGraph->nb_filters.
|
|
92
68
|
*/
|
|
93
69
|
get nbFilters() {
|
|
94
70
|
return this.native.nbFilters;
|
|
95
71
|
}
|
|
96
72
|
/**
|
|
97
|
-
* Array of
|
|
98
|
-
*
|
|
99
|
-
* Direct mapping to AVFilterGraph->filters
|
|
73
|
+
* Array of filters in the graph.
|
|
100
74
|
*
|
|
101
75
|
* All filter contexts currently in the graph.
|
|
76
|
+
*
|
|
77
|
+
* Direct mapping to AVFilterGraph->filters.
|
|
102
78
|
*/
|
|
103
79
|
get filters() {
|
|
104
80
|
const natives = this.native.filters;
|
|
@@ -107,11 +83,12 @@ export class FilterGraph extends OptionMember {
|
|
|
107
83
|
return natives.map((native) => new FilterContext(native));
|
|
108
84
|
}
|
|
109
85
|
/**
|
|
110
|
-
*
|
|
86
|
+
* Threading type for graph execution.
|
|
111
87
|
*
|
|
112
|
-
*
|
|
88
|
+
* Controls how filters are executed in parallel.
|
|
89
|
+
* Use AVFILTER_THREAD_SLICE for slice-based threading.
|
|
113
90
|
*
|
|
114
|
-
*
|
|
91
|
+
* Direct mapping to AVFilterGraph->thread_type.
|
|
115
92
|
*/
|
|
116
93
|
get threadType() {
|
|
117
94
|
return this.native.threadType;
|
|
@@ -120,11 +97,12 @@ export class FilterGraph extends OptionMember {
|
|
|
120
97
|
this.native.threadType = value;
|
|
121
98
|
}
|
|
122
99
|
/**
|
|
123
|
-
* Number of threads for
|
|
100
|
+
* Number of threads for parallel processing.
|
|
124
101
|
*
|
|
125
|
-
*
|
|
102
|
+
* Number of threads used for filter execution.
|
|
103
|
+
* 0 means automatic detection.
|
|
126
104
|
*
|
|
127
|
-
*
|
|
105
|
+
* Direct mapping to AVFilterGraph->nb_threads.
|
|
128
106
|
*/
|
|
129
107
|
get nbThreads() {
|
|
130
108
|
return this.native.nbThreads;
|
|
@@ -133,11 +111,11 @@ export class FilterGraph extends OptionMember {
|
|
|
133
111
|
this.native.nbThreads = value;
|
|
134
112
|
}
|
|
135
113
|
/**
|
|
136
|
-
*
|
|
114
|
+
* Swscale options for scale filter.
|
|
137
115
|
*
|
|
138
|
-
*
|
|
116
|
+
* Options string passed to swscale for scaling operations.
|
|
139
117
|
*
|
|
140
|
-
*
|
|
118
|
+
* Direct mapping to AVFilterGraph->scale_sws_opts.
|
|
141
119
|
*/
|
|
142
120
|
get scaleSwsOpts() {
|
|
143
121
|
return this.native.scaleSwsOpts;
|
|
@@ -146,25 +124,24 @@ export class FilterGraph extends OptionMember {
|
|
|
146
124
|
this.native.scaleSwsOpts = value;
|
|
147
125
|
}
|
|
148
126
|
/**
|
|
149
|
-
* Allocate
|
|
127
|
+
* Allocate a filter graph.
|
|
150
128
|
*
|
|
151
|
-
* Allocates the graph structure
|
|
152
|
-
* Must be called before
|
|
129
|
+
* Allocates memory for the filter graph structure.
|
|
130
|
+
* Must be called before using the graph.
|
|
153
131
|
*
|
|
154
|
-
* Direct mapping to avfilter_graph_alloc()
|
|
132
|
+
* Direct mapping to avfilter_graph_alloc().
|
|
155
133
|
*
|
|
156
|
-
* @throws {Error}
|
|
134
|
+
* @throws {Error} If allocation fails (ENOMEM)
|
|
157
135
|
*
|
|
158
136
|
* @example
|
|
159
137
|
* ```typescript
|
|
160
|
-
* import { FilterGraph } from 'node-av';
|
|
161
|
-
*
|
|
162
138
|
* const graph = new FilterGraph();
|
|
163
139
|
* graph.alloc();
|
|
164
|
-
* // Graph is now
|
|
140
|
+
* // Graph is now ready for filter creation
|
|
165
141
|
* ```
|
|
166
142
|
*
|
|
167
|
-
* @see {@link free} To
|
|
143
|
+
* @see {@link free} To deallocate
|
|
144
|
+
* @see {@link config} To configure after building
|
|
168
145
|
*/
|
|
169
146
|
alloc() {
|
|
170
147
|
this.native.alloc();
|
|
@@ -172,90 +149,88 @@ export class FilterGraph extends OptionMember {
|
|
|
172
149
|
/**
|
|
173
150
|
* Free the filter graph.
|
|
174
151
|
*
|
|
175
|
-
* Releases all resources associated with the graph
|
|
176
|
-
*
|
|
152
|
+
* Releases all resources associated with the graph,
|
|
153
|
+
* including all contained filters.
|
|
177
154
|
*
|
|
178
|
-
* Direct mapping to avfilter_graph_free()
|
|
155
|
+
* Direct mapping to avfilter_graph_free().
|
|
179
156
|
*
|
|
180
157
|
* @example
|
|
181
158
|
* ```typescript
|
|
182
159
|
* graph.free();
|
|
183
|
-
* //
|
|
160
|
+
* // Graph is now invalid
|
|
184
161
|
* ```
|
|
162
|
+
*
|
|
163
|
+
* @see {@link alloc} To allocate
|
|
164
|
+
* @see {@link Symbol.dispose} For automatic cleanup
|
|
185
165
|
*/
|
|
186
166
|
free() {
|
|
187
167
|
this.native.free();
|
|
188
168
|
}
|
|
189
169
|
/**
|
|
190
|
-
* Create a filter
|
|
170
|
+
* Create and initialize a filter in the graph.
|
|
191
171
|
*
|
|
192
|
-
*
|
|
172
|
+
* Creates a new filter context, adds it to the graph,
|
|
173
|
+
* and initializes it with the provided arguments.
|
|
193
174
|
*
|
|
194
|
-
*
|
|
195
|
-
* @param name - Name for this filter instance (must be unique in the graph)
|
|
196
|
-
* @param args - Optional initialization arguments (filter-specific format)
|
|
175
|
+
* Direct mapping to avfilter_graph_create_filter().
|
|
197
176
|
*
|
|
198
|
-
* @
|
|
177
|
+
* @param filter - Filter descriptor to instantiate
|
|
178
|
+
* @param name - Name for this filter instance
|
|
179
|
+
* @param args - Initialization arguments (filter-specific)
|
|
180
|
+
* @returns Created filter context, or null on failure
|
|
199
181
|
*
|
|
200
182
|
* @example
|
|
201
183
|
* ```typescript
|
|
202
184
|
* // Create a scale filter
|
|
203
|
-
* const
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
* '
|
|
207
|
-
* '1280:720' // width:height
|
|
185
|
+
* const scale = graph.createFilter(
|
|
186
|
+
* Filter.getByName('scale')!,
|
|
187
|
+
* 'scaler',
|
|
188
|
+
* '640:480' // width:height
|
|
208
189
|
* );
|
|
209
190
|
*
|
|
210
|
-
* // Create a buffer source
|
|
211
|
-
* const
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
* '
|
|
215
|
-
* 'video_size=1920x1080:pix_fmt=yuv420p:time_base=1/25:pixel_aspect=1/1'
|
|
191
|
+
* // Create a buffer source
|
|
192
|
+
* const src = graph.createFilter(
|
|
193
|
+
* Filter.getByName('buffer')!,
|
|
194
|
+
* 'source',
|
|
195
|
+
* 'video_size=1920x1080:pix_fmt=yuv420p:time_base=1/25'
|
|
216
196
|
* );
|
|
217
197
|
* ```
|
|
198
|
+
*
|
|
199
|
+
* @see {@link allocFilter} To allocate without initializing
|
|
200
|
+
* @see {@link getFilter} To retrieve by name
|
|
218
201
|
*/
|
|
219
202
|
createFilter(filter, name, args = null) {
|
|
220
203
|
const native = this.native.createFilter(filter.getNative(), name, args ?? null);
|
|
221
204
|
return native ? new FilterContext(native) : null;
|
|
222
205
|
}
|
|
223
206
|
/**
|
|
224
|
-
* Allocate a filter
|
|
207
|
+
* Allocate a filter in the graph.
|
|
225
208
|
*
|
|
226
|
-
*
|
|
209
|
+
* Creates a new filter context and adds it to the graph,
|
|
210
|
+
* but does not initialize it. Call init() on the context afterwards.
|
|
227
211
|
*
|
|
228
|
-
*
|
|
229
|
-
* You must call filter.init() or filter.initStr() afterwards.
|
|
212
|
+
* Direct mapping to avfilter_graph_alloc_filter().
|
|
230
213
|
*
|
|
231
|
-
* @param filter -
|
|
232
|
-
* @param name - Name for this filter instance
|
|
233
|
-
*
|
|
234
|
-
* @returns The allocated filter context or null on failure
|
|
214
|
+
* @param filter - Filter descriptor to instantiate
|
|
215
|
+
* @param name - Name for this filter instance
|
|
216
|
+
* @returns Allocated filter context, or null on failure
|
|
235
217
|
*
|
|
236
218
|
* @example
|
|
237
219
|
* ```typescript
|
|
238
|
-
* import {
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
* if (
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
* const ret2 = scaleCtx.setOpt('height', '720');
|
|
250
|
-
* FFmpegError.throwIfError(ret2, 'setOpt height');
|
|
251
|
-
*
|
|
252
|
-
* // Initialize the filter
|
|
253
|
-
* const initRet = scaleCtx.init();
|
|
254
|
-
* FFmpegError.throwIfError(initRet, 'init');
|
|
220
|
+
* import { FFmpegError } from 'node-av';
|
|
221
|
+
*
|
|
222
|
+
* const filter = graph.allocFilter(
|
|
223
|
+
* Filter.getByName('scale')!,
|
|
224
|
+
* 'scaler'
|
|
225
|
+
* );
|
|
226
|
+
* if (filter) {
|
|
227
|
+
* // Initialize separately
|
|
228
|
+
* const ret = filter.initStr('640:480');
|
|
229
|
+
* FFmpegError.throwIfError(ret, 'initStr');
|
|
230
|
+
* }
|
|
255
231
|
* ```
|
|
256
232
|
*
|
|
257
|
-
* @
|
|
258
|
-
* allowing options to be set before initialization.
|
|
233
|
+
* @see {@link createFilter} To allocate and initialize
|
|
259
234
|
*/
|
|
260
235
|
allocFilter(filter, name) {
|
|
261
236
|
const native = this.native.allocFilter(filter.getNative(), name);
|
|
@@ -264,19 +239,23 @@ export class FilterGraph extends OptionMember {
|
|
|
264
239
|
/**
|
|
265
240
|
* Get a filter by name from the graph.
|
|
266
241
|
*
|
|
267
|
-
*
|
|
242
|
+
* Retrieves an existing filter context by its instance name.
|
|
268
243
|
*
|
|
269
|
-
*
|
|
244
|
+
* Direct mapping to avfilter_graph_get_filter().
|
|
270
245
|
*
|
|
271
|
-
* @
|
|
246
|
+
* @param name - Name of the filter instance
|
|
247
|
+
* @returns Filter context if found, null otherwise
|
|
272
248
|
*
|
|
273
249
|
* @example
|
|
274
250
|
* ```typescript
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
*
|
|
251
|
+
* // Find a previously created filter
|
|
252
|
+
* const scaler = graph.getFilter('scaler');
|
|
253
|
+
* if (scaler) {
|
|
254
|
+
* console.log('Found scaler filter');
|
|
278
255
|
* }
|
|
279
256
|
* ```
|
|
257
|
+
*
|
|
258
|
+
* @see {@link createFilter} To create new filters
|
|
280
259
|
*/
|
|
281
260
|
getFilter(name) {
|
|
282
261
|
const native = this.native.getFilter(name);
|
|
@@ -285,164 +264,150 @@ export class FilterGraph extends OptionMember {
|
|
|
285
264
|
/**
|
|
286
265
|
* Configure the filter graph.
|
|
287
266
|
*
|
|
288
|
-
*
|
|
267
|
+
* Validates and finalizes the graph configuration.
|
|
268
|
+
* Must be called after all filters are created and linked.
|
|
269
|
+
*
|
|
270
|
+
* Direct mapping to avfilter_graph_config().
|
|
289
271
|
*
|
|
290
272
|
* @returns 0 on success, negative AVERROR on error:
|
|
291
|
-
* -
|
|
292
|
-
* -
|
|
293
|
-
* - AVERROR(ENOMEM): Memory allocation failure
|
|
294
|
-
* - <0: Other configuration errors
|
|
273
|
+
* - AVERROR_EINVAL: Invalid graph configuration
|
|
274
|
+
* - AVERROR_ENOMEM: Memory allocation failure
|
|
295
275
|
*
|
|
296
276
|
* @example
|
|
297
277
|
* ```typescript
|
|
298
|
-
* import {
|
|
278
|
+
* import { FFmpegError } from 'node-av';
|
|
299
279
|
*
|
|
300
|
-
* //
|
|
301
|
-
*
|
|
280
|
+
* // Build graph...
|
|
281
|
+
* // Link filters...
|
|
282
|
+
*
|
|
283
|
+
* // Configure the complete graph
|
|
284
|
+
* const ret = await graph.config();
|
|
302
285
|
* FFmpegError.throwIfError(ret, 'config');
|
|
303
286
|
* // Graph is now ready for processing
|
|
304
287
|
* ```
|
|
305
288
|
*
|
|
306
|
-
* @
|
|
289
|
+
* @see {@link validate} To check configuration
|
|
307
290
|
*/
|
|
308
291
|
async config() {
|
|
309
|
-
return this.native.config();
|
|
292
|
+
return await this.native.config();
|
|
310
293
|
}
|
|
311
294
|
/**
|
|
312
|
-
* Parse a
|
|
295
|
+
* Parse a filter graph description.
|
|
313
296
|
*
|
|
314
|
-
*
|
|
297
|
+
* Parses a textual representation of a filter graph and adds
|
|
298
|
+
* filters to this graph. Handles labeled inputs and outputs.
|
|
315
299
|
*
|
|
316
|
-
*
|
|
317
|
-
* @param inputs - Input pad list
|
|
318
|
-
* @param outputs - Output pad list
|
|
300
|
+
* Direct mapping to avfilter_graph_parse().
|
|
319
301
|
*
|
|
302
|
+
* @param filters - Filter graph description string
|
|
303
|
+
* @param inputs - Linked list of graph inputs
|
|
304
|
+
* @param outputs - Linked list of graph outputs
|
|
320
305
|
* @returns 0 on success, negative AVERROR on error:
|
|
321
|
-
* -
|
|
322
|
-
* -
|
|
323
|
-
* - AVERROR(ENOMEM): Memory allocation failure
|
|
324
|
-
* - <0: Other parsing errors
|
|
306
|
+
* - AVERROR_EINVAL: Parse error
|
|
307
|
+
* - AVERROR_ENOMEM: Memory allocation failure
|
|
325
308
|
*
|
|
326
309
|
* @example
|
|
327
310
|
* ```typescript
|
|
328
|
-
* import {
|
|
329
|
-
*
|
|
330
|
-
* const inputs =
|
|
331
|
-
*
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
*
|
|
340
|
-
*
|
|
341
|
-
*
|
|
342
|
-
* const ret = graph.parse('[in] scale=1280:720 [out]', inputs, outputs);
|
|
311
|
+
* import { FFmpegError, FilterInOut } from 'node-av';
|
|
312
|
+
*
|
|
313
|
+
* const inputs = FilterInOut.createList([
|
|
314
|
+
* { name: 'in', filterCtx: bufferSrc, padIdx: 0 }
|
|
315
|
+
* ]);
|
|
316
|
+
* const outputs = FilterInOut.createList([
|
|
317
|
+
* { name: 'out', filterCtx: bufferSink, padIdx: 0 }
|
|
318
|
+
* ]);
|
|
319
|
+
*
|
|
320
|
+
* const ret = graph.parse(
|
|
321
|
+
* '[in]scale=640:480,format=yuv420p[out]',
|
|
322
|
+
* inputs,
|
|
323
|
+
* outputs
|
|
324
|
+
* );
|
|
343
325
|
* FFmpegError.throwIfError(ret, 'parse');
|
|
344
326
|
* ```
|
|
327
|
+
*
|
|
328
|
+
* @see {@link parse2} For simpler syntax
|
|
329
|
+
* @see {@link parsePtr} For alternative parsing
|
|
345
330
|
*/
|
|
346
331
|
parse(filters, inputs, outputs) {
|
|
347
332
|
return this.native.parse(filters, inputs ? inputs.getNative() : null, outputs ? outputs.getNative() : null);
|
|
348
333
|
}
|
|
349
334
|
/**
|
|
350
|
-
* Parse a
|
|
335
|
+
* Parse a filter graph description (simplified).
|
|
351
336
|
*
|
|
352
|
-
*
|
|
337
|
+
* Parses a textual filter description with automatic input/output handling.
|
|
338
|
+
* Simpler than parse() but less flexible.
|
|
353
339
|
*
|
|
354
|
-
*
|
|
340
|
+
* Direct mapping to avfilter_graph_parse2().
|
|
355
341
|
*
|
|
342
|
+
* @param filters - Filter graph description string
|
|
356
343
|
* @returns 0 on success, negative AVERROR on error:
|
|
357
|
-
* -
|
|
358
|
-
* -
|
|
359
|
-
* - AVERROR(ENOMEM): Memory allocation failure
|
|
360
|
-
* - <0: Other parsing errors
|
|
344
|
+
* - AVERROR_EINVAL: Parse error
|
|
345
|
+
* - AVERROR_ENOMEM: Memory allocation failure
|
|
361
346
|
*
|
|
362
347
|
* @example
|
|
363
348
|
* ```typescript
|
|
364
|
-
* import {
|
|
349
|
+
* import { FFmpegError } from 'node-av';
|
|
365
350
|
*
|
|
366
351
|
* // Parse a simple filter chain
|
|
367
|
-
* const ret = graph.parse2(
|
|
352
|
+
* const ret = graph.parse2(
|
|
353
|
+
* 'scale=640:480,format=yuv420p'
|
|
354
|
+
* );
|
|
368
355
|
* FFmpegError.throwIfError(ret, 'parse2');
|
|
369
356
|
* ```
|
|
370
357
|
*
|
|
371
|
-
* @
|
|
358
|
+
* @see {@link parse} For labeled inputs/outputs
|
|
372
359
|
*/
|
|
373
360
|
parse2(filters) {
|
|
374
361
|
return this.native.parse2(filters);
|
|
375
362
|
}
|
|
376
363
|
/**
|
|
377
|
-
* Parse a
|
|
364
|
+
* Parse a filter graph description with pointer.
|
|
378
365
|
*
|
|
379
|
-
*
|
|
366
|
+
* Alternative parsing method with different parameter handling.
|
|
380
367
|
*
|
|
381
|
-
*
|
|
382
|
-
* @param inputs - Optional input pad list (FilterInOut)
|
|
383
|
-
* @param outputs - Optional output pad list (FilterInOut)
|
|
368
|
+
* Direct mapping to avfilter_graph_parse_ptr().
|
|
384
369
|
*
|
|
370
|
+
* @param filters - Filter graph description string
|
|
371
|
+
* @param inputs - Optional linked list of inputs
|
|
372
|
+
* @param outputs - Optional linked list of outputs
|
|
385
373
|
* @returns 0 on success, negative AVERROR on error:
|
|
386
|
-
* -
|
|
387
|
-
* -
|
|
388
|
-
* - AVERROR(ENOMEM): Memory allocation failure
|
|
389
|
-
* - <0: Other parsing errors
|
|
374
|
+
* - AVERROR_EINVAL: Parse error
|
|
375
|
+
* - AVERROR_ENOMEM: Memory allocation failure
|
|
390
376
|
*
|
|
391
377
|
* @example
|
|
392
378
|
* ```typescript
|
|
393
|
-
* import {
|
|
379
|
+
* import { FFmpegError } from 'node-av';
|
|
394
380
|
*
|
|
395
|
-
* // Parse a complex filter graph
|
|
396
381
|
* const ret = graph.parsePtr(
|
|
397
|
-
* '[
|
|
382
|
+
* '[in]scale=w=640:h=480[out]'
|
|
398
383
|
* );
|
|
399
384
|
* FFmpegError.throwIfError(ret, 'parsePtr');
|
|
400
385
|
* ```
|
|
401
386
|
*
|
|
402
|
-
* @
|
|
403
|
-
*
|
|
404
|
-
* import { FilterGraph, FilterInOut, FFmpegError } from 'node-av';
|
|
405
|
-
*
|
|
406
|
-
* // Parse with explicit inputs/outputs
|
|
407
|
-
* const inputs = new FilterInOut();
|
|
408
|
-
* inputs.name = 'in';
|
|
409
|
-
* inputs.filterCtx = buffersrcCtx;
|
|
410
|
-
* inputs.padIdx = 0;
|
|
411
|
-
*
|
|
412
|
-
* const outputs = new FilterInOut();
|
|
413
|
-
* outputs.name = 'out';
|
|
414
|
-
* outputs.filterCtx = buffersinkCtx;
|
|
415
|
-
* outputs.padIdx = 0;
|
|
416
|
-
*
|
|
417
|
-
* const ret = graph.parsePtr(filtersDescr, inputs, outputs);
|
|
418
|
-
* FFmpegError.throwIfError(ret, 'parsePtr');
|
|
419
|
-
* ```
|
|
420
|
-
*
|
|
421
|
-
* @note Similar to parse2 but with different internal handling.
|
|
387
|
+
* @see {@link parse} For standard parsing
|
|
388
|
+
* @see {@link parse2} For simplified parsing
|
|
422
389
|
*/
|
|
423
390
|
parsePtr(filters, inputs, outputs) {
|
|
424
391
|
return this.native.parsePtr(filters, inputs ? inputs.getNative() : null, outputs ? outputs.getNative() : null);
|
|
425
392
|
}
|
|
426
393
|
/**
|
|
427
|
-
* Validate the filter graph.
|
|
394
|
+
* Validate the filter graph configuration.
|
|
428
395
|
*
|
|
429
|
-
*
|
|
396
|
+
* Checks if the graph is valid and properly configured.
|
|
397
|
+
* Does not finalize the graph like config() does.
|
|
430
398
|
*
|
|
431
399
|
* @returns 0 on success, negative AVERROR on error:
|
|
432
|
-
* -
|
|
433
|
-
* - AVERROR(EINVAL): Invalid graph structure
|
|
434
|
-
* - <0: Other validation errors
|
|
400
|
+
* - AVERROR_EINVAL: Invalid configuration
|
|
435
401
|
*
|
|
436
402
|
* @example
|
|
437
403
|
* ```typescript
|
|
438
|
-
*
|
|
404
|
+
* import { FFmpegError } from 'node-av';
|
|
405
|
+
*
|
|
439
406
|
* const ret = graph.validate();
|
|
440
|
-
*
|
|
441
|
-
* console.error('Graph validation failed');
|
|
442
|
-
* }
|
|
407
|
+
* FFmpegError.throwIfError(ret, 'validate');
|
|
443
408
|
* ```
|
|
444
409
|
*
|
|
445
|
-
* @
|
|
410
|
+
* @see {@link config} To configure and finalize
|
|
446
411
|
*/
|
|
447
412
|
validate() {
|
|
448
413
|
return this.native.validate();
|
|
@@ -450,138 +415,132 @@ export class FilterGraph extends OptionMember {
|
|
|
450
415
|
/**
|
|
451
416
|
* Request a frame from the oldest sink.
|
|
452
417
|
*
|
|
453
|
-
*
|
|
418
|
+
* Requests that a frame be output from the oldest sink in the graph.
|
|
419
|
+
* Used to drive the filter graph processing.
|
|
420
|
+
*
|
|
421
|
+
* Direct mapping to avfilter_graph_request_oldest().
|
|
454
422
|
*
|
|
455
423
|
* @returns 0 on success, negative AVERROR on error:
|
|
456
|
-
* -
|
|
457
|
-
* -
|
|
458
|
-
* - AVERROR(EAGAIN): Need more input data
|
|
459
|
-
* - <0: Other processing errors
|
|
424
|
+
* - AVERROR_EOF: End of stream reached
|
|
425
|
+
* - AVERROR_EAGAIN: Need more input
|
|
460
426
|
*
|
|
461
427
|
* @example
|
|
462
428
|
* ```typescript
|
|
463
|
-
* import {
|
|
429
|
+
* import { FFmpegError } from 'node-av';
|
|
464
430
|
* import { AVERROR_EOF, AVERROR_EAGAIN } from 'node-av/constants';
|
|
465
431
|
*
|
|
466
|
-
*
|
|
467
|
-
*
|
|
468
|
-
*
|
|
469
|
-
*
|
|
470
|
-
*
|
|
471
|
-
*
|
|
472
|
-
*
|
|
473
|
-
* FFmpegError.throwIfError(ret, 'requestOldest');
|
|
474
|
-
* }
|
|
475
|
-
* // Process output from sinks
|
|
432
|
+
* const ret = await graph.requestOldest();
|
|
433
|
+
* if (ret === AVERROR_EOF) {
|
|
434
|
+
* // No more frames
|
|
435
|
+
* } else if (ret === AVERROR_EAGAIN) {
|
|
436
|
+
* // Need to provide more input
|
|
437
|
+
* } else {
|
|
438
|
+
* FFmpegError.throwIfError(ret, 'requestOldest');
|
|
476
439
|
* }
|
|
477
440
|
* ```
|
|
478
|
-
*
|
|
479
|
-
* @note Triggers processing in the graph to produce output.
|
|
480
441
|
*/
|
|
481
442
|
async requestOldest() {
|
|
482
|
-
return this.native.requestOldest();
|
|
443
|
+
return await this.native.requestOldest();
|
|
483
444
|
}
|
|
484
445
|
/**
|
|
485
|
-
*
|
|
446
|
+
* Dump the filter graph to a string.
|
|
486
447
|
*
|
|
487
|
-
* Returns a
|
|
488
|
-
*
|
|
448
|
+
* Returns a textual representation of the graph structure.
|
|
449
|
+
* Useful for debugging and visualization.
|
|
489
450
|
*
|
|
490
|
-
*
|
|
451
|
+
* Direct mapping to avfilter_graph_dump().
|
|
452
|
+
*
|
|
453
|
+
* @returns Graph description string, or null on failure
|
|
491
454
|
*
|
|
492
455
|
* @example
|
|
493
456
|
* ```typescript
|
|
494
|
-
* const
|
|
495
|
-
*
|
|
457
|
+
* const graphStr = graph.dump();
|
|
458
|
+
* if (graphStr) {
|
|
459
|
+
* console.log('Graph structure:');
|
|
460
|
+
* console.log(graphStr);
|
|
461
|
+
* }
|
|
496
462
|
* ```
|
|
497
463
|
*/
|
|
498
464
|
dump() {
|
|
499
465
|
return this.native.dump();
|
|
500
466
|
}
|
|
501
467
|
/**
|
|
502
|
-
* Send a command to
|
|
503
|
-
*
|
|
504
|
-
* Direct mapping to avfilter_graph_send_command()
|
|
505
|
-
*
|
|
506
|
-
* @param target - Filter name or "all" to send to all filters
|
|
507
|
-
* @param cmd - Command name (e.g., "volume", "hue", "rate")
|
|
508
|
-
* @param arg - Command argument (e.g., "0.5", "2.0")
|
|
509
|
-
* @param flags - Command flags (AVFilterCmdFlag, default: 0)
|
|
510
|
-
* - AVFILTER_CMD_FLAG_ONE: Stop once a filter understood the command
|
|
511
|
-
* - AVFILTER_CMD_FLAG_FAST: Only execute if fast (hardware acceleration)
|
|
468
|
+
* Send a command to filters in the graph.
|
|
512
469
|
*
|
|
513
|
-
*
|
|
470
|
+
* Sends a command to one or more filters for immediate execution.
|
|
471
|
+
* Target can be a specific filter name or "all" for all filters.
|
|
514
472
|
*
|
|
515
|
-
*
|
|
516
|
-
* ```typescript
|
|
517
|
-
* import { FilterGraph, FFmpegError, AVFILTER_CMD_FLAG_ONE } from 'node-av';
|
|
473
|
+
* Direct mapping to avfilter_graph_send_command().
|
|
518
474
|
*
|
|
519
|
-
*
|
|
520
|
-
*
|
|
521
|
-
*
|
|
522
|
-
*
|
|
523
|
-
*
|
|
524
|
-
* console.log('Response:', result.response);
|
|
525
|
-
* }
|
|
526
|
-
* ```
|
|
475
|
+
* @param target - Filter name or "all"
|
|
476
|
+
* @param cmd - Command to send
|
|
477
|
+
* @param arg - Command argument
|
|
478
|
+
* @param flags - Command flags
|
|
479
|
+
* @returns Error code or response object
|
|
527
480
|
*
|
|
528
481
|
* @example
|
|
529
482
|
* ```typescript
|
|
530
|
-
* // Send command to all filters, stop at first one that handles it
|
|
531
|
-
* const result = graph.sendCommand('all', 'enable', 'expr=gte(t,10)', AVFILTER_CMD_FLAG_ONE);
|
|
532
|
-
*
|
|
533
483
|
* // Send command to specific filter
|
|
534
|
-
* const result = graph.sendCommand(
|
|
484
|
+
* const result = graph.sendCommand(
|
|
485
|
+
* 'volume',
|
|
486
|
+
* 'volume',
|
|
487
|
+
* '0.5'
|
|
488
|
+
* );
|
|
489
|
+
*
|
|
490
|
+
* // Send to all filters
|
|
491
|
+
* const result2 = graph.sendCommand(
|
|
492
|
+
* 'all',
|
|
493
|
+
* 'enable',
|
|
494
|
+
* 'timeline'
|
|
495
|
+
* );
|
|
535
496
|
* ```
|
|
536
497
|
*
|
|
537
|
-
* @
|
|
498
|
+
* @see {@link queueCommand} For delayed execution
|
|
538
499
|
*/
|
|
539
500
|
sendCommand(target, cmd, arg, flags) {
|
|
540
501
|
return this.native.sendCommand(target, cmd, arg, flags);
|
|
541
502
|
}
|
|
542
503
|
/**
|
|
543
|
-
* Queue a command
|
|
504
|
+
* Queue a command for delayed execution.
|
|
544
505
|
*
|
|
545
|
-
*
|
|
506
|
+
* Schedules a command to be executed at a specific timestamp.
|
|
507
|
+
* The command is executed when the filter processes a frame with that timestamp.
|
|
546
508
|
*
|
|
547
|
-
*
|
|
548
|
-
* @param cmd - Command name (e.g., "volume", "hue", "rate")
|
|
549
|
-
* @param arg - Command argument (e.g., "0.5", "2.0")
|
|
550
|
-
* @param ts - Timestamp when the command should be executed
|
|
551
|
-
* @param flags - Command flags (AVFilterCmdFlag, default: 0)
|
|
552
|
-
* - AVFILTER_CMD_FLAG_ONE: Stop once a filter understood the command
|
|
553
|
-
* - AVFILTER_CMD_FLAG_FAST: Only execute if fast (hardware acceleration)
|
|
509
|
+
* Direct mapping to avfilter_graph_queue_command().
|
|
554
510
|
*
|
|
511
|
+
* @param target - Filter name or "all"
|
|
512
|
+
* @param cmd - Command to queue
|
|
513
|
+
* @param arg - Command argument
|
|
514
|
+
* @param ts - Timestamp for execution
|
|
515
|
+
* @param flags - Command flags
|
|
555
516
|
* @returns 0 on success, negative AVERROR on error
|
|
556
517
|
*
|
|
557
518
|
* @example
|
|
558
519
|
* ```typescript
|
|
559
|
-
* import {
|
|
560
|
-
*
|
|
561
|
-
* // Queue volume change at
|
|
562
|
-
* const ret = graph.queueCommand(
|
|
520
|
+
* import { FFmpegError } from 'node-av';
|
|
521
|
+
*
|
|
522
|
+
* // Queue volume change at 5 seconds
|
|
523
|
+
* const ret = graph.queueCommand(
|
|
524
|
+
* 'volume',
|
|
525
|
+
* 'volume',
|
|
526
|
+
* '0.2',
|
|
527
|
+
* 5000000, // microseconds
|
|
528
|
+
* 0
|
|
529
|
+
* );
|
|
563
530
|
* FFmpegError.throwIfError(ret, 'queueCommand');
|
|
564
531
|
* ```
|
|
565
532
|
*
|
|
566
|
-
* @
|
|
567
|
-
* ```typescript
|
|
568
|
-
* // Queue multiple commands at different times
|
|
569
|
-
* graph.queueCommand('volume', 'volume', '0.5', 5.0);
|
|
570
|
-
* graph.queueCommand('volume', 'volume', '1.0', 10.0);
|
|
571
|
-
* graph.queueCommand('volume', 'volume', '0.2', 15.0);
|
|
572
|
-
* ```
|
|
573
|
-
*
|
|
574
|
-
* @note Commands are executed when processing frames with matching timestamps.
|
|
575
|
-
* @note Not all filters support queued commands.
|
|
533
|
+
* @see {@link sendCommand} For immediate execution
|
|
576
534
|
*/
|
|
577
535
|
queueCommand(target, cmd, arg, ts, flags) {
|
|
578
536
|
return this.native.queueCommand(target, cmd, arg, ts, flags);
|
|
579
537
|
}
|
|
580
538
|
/**
|
|
581
|
-
* Get the native
|
|
539
|
+
* Get the underlying native FilterGraph object.
|
|
540
|
+
*
|
|
541
|
+
* @returns The native FilterGraph binding object
|
|
582
542
|
*
|
|
583
|
-
* @internal
|
|
584
|
-
* @returns The underlying native filter graph object
|
|
543
|
+
* @internal
|
|
585
544
|
*/
|
|
586
545
|
getNative() {
|
|
587
546
|
return this.native;
|
|
@@ -597,7 +556,7 @@ export class FilterGraph extends OptionMember {
|
|
|
597
556
|
* {
|
|
598
557
|
* using graph = new FilterGraph();
|
|
599
558
|
* graph.alloc();
|
|
600
|
-
* //
|
|
559
|
+
* // Build and use graph...
|
|
601
560
|
* } // Automatically freed when leaving scope
|
|
602
561
|
* ```
|
|
603
562
|
*/
|