node-av-light 0.0.0 → 7.1.0-beta.1

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.
Files changed (311) hide show
  1. package/LICENSE.md +22 -0
  2. package/README.md +711 -0
  3. package/dist/api/audio-frame-buffer.d.ts +636 -0
  4. package/dist/api/audio-frame-buffer.js +1027 -0
  5. package/dist/api/audio-frame-buffer.js.map +1 -0
  6. package/dist/api/bitstream-filter.d.ts +938 -0
  7. package/dist/api/bitstream-filter.js +1427 -0
  8. package/dist/api/bitstream-filter.js.map +1 -0
  9. package/dist/api/constants.d.ts +44 -0
  10. package/dist/api/constants.js +45 -0
  11. package/dist/api/constants.js.map +1 -0
  12. package/dist/api/data/test_av1.ivf +0 -0
  13. package/dist/api/data/test_h264.h264 +0 -0
  14. package/dist/api/data/test_hevc.h265 +0 -0
  15. package/dist/api/data/test_mjpeg.mjpeg +0 -0
  16. package/dist/api/data/test_vp8.ivf +0 -0
  17. package/dist/api/data/test_vp9.ivf +0 -0
  18. package/dist/api/decoder.d.ts +1413 -0
  19. package/dist/api/decoder.js +2367 -0
  20. package/dist/api/decoder.js.map +1 -0
  21. package/dist/api/demuxer.d.ts +1295 -0
  22. package/dist/api/demuxer.js +2344 -0
  23. package/dist/api/demuxer.js.map +1 -0
  24. package/dist/api/device.d.ts +589 -0
  25. package/dist/api/device.js +964 -0
  26. package/dist/api/device.js.map +1 -0
  27. package/dist/api/encoder-pool.d.ts +262 -0
  28. package/dist/api/encoder-pool.js +397 -0
  29. package/dist/api/encoder-pool.js.map +1 -0
  30. package/dist/api/encoder.d.ts +1509 -0
  31. package/dist/api/encoder.js +2619 -0
  32. package/dist/api/encoder.js.map +1 -0
  33. package/dist/api/filter-complex.d.ts +828 -0
  34. package/dist/api/filter-complex.js +1661 -0
  35. package/dist/api/filter-complex.js.map +1 -0
  36. package/dist/api/filter-presets.d.ts +800 -0
  37. package/dist/api/filter-presets.js +1554 -0
  38. package/dist/api/filter-presets.js.map +1 -0
  39. package/dist/api/filter.d.ts +1339 -0
  40. package/dist/api/filter.js +2075 -0
  41. package/dist/api/filter.js.map +1 -0
  42. package/dist/api/fmp4-stream.d.ts +797 -0
  43. package/dist/api/fmp4-stream.js +1428 -0
  44. package/dist/api/fmp4-stream.js.map +1 -0
  45. package/dist/api/hardware.d.ts +677 -0
  46. package/dist/api/hardware.js +1300 -0
  47. package/dist/api/hardware.js.map +1 -0
  48. package/dist/api/index.d.ts +21 -0
  49. package/dist/api/index.js +38 -0
  50. package/dist/api/index.js.map +1 -0
  51. package/dist/api/io-stream.d.ts +308 -0
  52. package/dist/api/io-stream.js +358 -0
  53. package/dist/api/io-stream.js.map +1 -0
  54. package/dist/api/muxer.d.ts +1311 -0
  55. package/dist/api/muxer.js +2672 -0
  56. package/dist/api/muxer.js.map +1 -0
  57. package/dist/api/pipeline.d.ts +801 -0
  58. package/dist/api/pipeline.js +1344 -0
  59. package/dist/api/pipeline.js.map +1 -0
  60. package/dist/api/probe.d.ts +128 -0
  61. package/dist/api/probe.js +227 -0
  62. package/dist/api/probe.js.map +1 -0
  63. package/dist/api/rtp-stream.d.ts +497 -0
  64. package/dist/api/rtp-stream.js +1131 -0
  65. package/dist/api/rtp-stream.js.map +1 -0
  66. package/dist/api/scaler.d.ts +561 -0
  67. package/dist/api/scaler.js +918 -0
  68. package/dist/api/scaler.js.map +1 -0
  69. package/dist/api/types.d.ts +17 -0
  70. package/dist/api/types.js +2 -0
  71. package/dist/api/types.js.map +1 -0
  72. package/dist/api/utilities/async-queue.d.ts +149 -0
  73. package/dist/api/utilities/async-queue.js +254 -0
  74. package/dist/api/utilities/async-queue.js.map +1 -0
  75. package/dist/api/utilities/audio-sample.d.ts +117 -0
  76. package/dist/api/utilities/audio-sample.js +112 -0
  77. package/dist/api/utilities/audio-sample.js.map +1 -0
  78. package/dist/api/utilities/audio-transcode.d.ts +20 -0
  79. package/dist/api/utilities/audio-transcode.js +27 -0
  80. package/dist/api/utilities/audio-transcode.js.map +1 -0
  81. package/dist/api/utilities/channel-layout.d.ts +76 -0
  82. package/dist/api/utilities/channel-layout.js +80 -0
  83. package/dist/api/utilities/channel-layout.js.map +1 -0
  84. package/dist/api/utilities/codec-format.d.ts +87 -0
  85. package/dist/api/utilities/codec-format.js +117 -0
  86. package/dist/api/utilities/codec-format.js.map +1 -0
  87. package/dist/api/utilities/context-options.d.ts +25 -0
  88. package/dist/api/utilities/context-options.js +23 -0
  89. package/dist/api/utilities/context-options.js.map +1 -0
  90. package/dist/api/utilities/electron-shared-texture.d.ts +368 -0
  91. package/dist/api/utilities/electron-shared-texture.js +540 -0
  92. package/dist/api/utilities/electron-shared-texture.js.map +1 -0
  93. package/dist/api/utilities/image.d.ts +207 -0
  94. package/dist/api/utilities/image.js +213 -0
  95. package/dist/api/utilities/image.js.map +1 -0
  96. package/dist/api/utilities/index.d.ts +14 -0
  97. package/dist/api/utilities/index.js +27 -0
  98. package/dist/api/utilities/index.js.map +1 -0
  99. package/dist/api/utilities/live-decoding.d.ts +15 -0
  100. package/dist/api/utilities/live-decoding.js +32 -0
  101. package/dist/api/utilities/live-decoding.js.map +1 -0
  102. package/dist/api/utilities/media-type.d.ts +49 -0
  103. package/dist/api/utilities/media-type.js +53 -0
  104. package/dist/api/utilities/media-type.js.map +1 -0
  105. package/dist/api/utilities/packet-age-watchdog.d.ts +198 -0
  106. package/dist/api/utilities/packet-age-watchdog.js +594 -0
  107. package/dist/api/utilities/packet-age-watchdog.js.map +1 -0
  108. package/dist/api/utilities/pixel-format.d.ts +89 -0
  109. package/dist/api/utilities/pixel-format.js +97 -0
  110. package/dist/api/utilities/pixel-format.js.map +1 -0
  111. package/dist/api/utilities/sample-format.d.ts +129 -0
  112. package/dist/api/utilities/sample-format.js +141 -0
  113. package/dist/api/utilities/sample-format.js.map +1 -0
  114. package/dist/api/utilities/scale-size.d.ts +51 -0
  115. package/dist/api/utilities/scale-size.js +55 -0
  116. package/dist/api/utilities/scale-size.js.map +1 -0
  117. package/dist/api/utilities/scheduler.d.ts +138 -0
  118. package/dist/api/utilities/scheduler.js +98 -0
  119. package/dist/api/utilities/scheduler.js.map +1 -0
  120. package/dist/api/utilities/streaming.d.ts +186 -0
  121. package/dist/api/utilities/streaming.js +309 -0
  122. package/dist/api/utilities/streaming.js.map +1 -0
  123. package/dist/api/utilities/timestamp.d.ts +193 -0
  124. package/dist/api/utilities/timestamp.js +206 -0
  125. package/dist/api/utilities/timestamp.js.map +1 -0
  126. package/dist/api/utilities/video-transcode.d.ts +218 -0
  127. package/dist/api/utilities/video-transcode.js +624 -0
  128. package/dist/api/utilities/video-transcode.js.map +1 -0
  129. package/dist/api/utilities/whisper-model.d.ts +330 -0
  130. package/dist/api/utilities/whisper-model.js +587 -0
  131. package/dist/api/utilities/whisper-model.js.map +1 -0
  132. package/dist/api/utils.d.ts +19 -0
  133. package/dist/api/utils.js +39 -0
  134. package/dist/api/utils.js.map +1 -0
  135. package/dist/api/webrtc-stream.d.ts +294 -0
  136. package/dist/api/webrtc-stream.js +546 -0
  137. package/dist/api/webrtc-stream.js.map +1 -0
  138. package/dist/api/whisper.d.ts +326 -0
  139. package/dist/api/whisper.js +402 -0
  140. package/dist/api/whisper.js.map +1 -0
  141. package/dist/constants/bsf-options.d.ts +364 -0
  142. package/dist/constants/bsf-options.js +7 -0
  143. package/dist/constants/bsf-options.js.map +1 -0
  144. package/dist/constants/channel-layouts.d.ts +53 -0
  145. package/dist/constants/channel-layouts.js +57 -0
  146. package/dist/constants/channel-layouts.js.map +1 -0
  147. package/dist/constants/constants.d.ts +2435 -0
  148. package/dist/constants/constants.js +1989 -0
  149. package/dist/constants/constants.js.map +1 -0
  150. package/dist/constants/decoders.d.ts +651 -0
  151. package/dist/constants/decoders.js +641 -0
  152. package/dist/constants/decoders.js.map +1 -0
  153. package/dist/constants/encoders.d.ts +314 -0
  154. package/dist/constants/encoders.js +309 -0
  155. package/dist/constants/encoders.js.map +1 -0
  156. package/dist/constants/filter-options.d.ts +12099 -0
  157. package/dist/constants/filter-options.js +7 -0
  158. package/dist/constants/filter-options.js.map +1 -0
  159. package/dist/constants/format-options.d.ts +4319 -0
  160. package/dist/constants/format-options.js +7 -0
  161. package/dist/constants/format-options.js.map +1 -0
  162. package/dist/constants/formats.d.ts +18 -0
  163. package/dist/constants/formats.js +7 -0
  164. package/dist/constants/formats.js.map +1 -0
  165. package/dist/constants/hardware.d.ts +26 -0
  166. package/dist/constants/hardware.js +27 -0
  167. package/dist/constants/hardware.js.map +1 -0
  168. package/dist/constants/index.d.ts +10 -0
  169. package/dist/constants/index.js +6 -0
  170. package/dist/constants/index.js.map +1 -0
  171. package/dist/constants/options.d.ts +6217 -0
  172. package/dist/constants/options.js +7 -0
  173. package/dist/constants/options.js.map +1 -0
  174. package/dist/ffmpeg/index.d.ts +101 -0
  175. package/dist/ffmpeg/index.js +161 -0
  176. package/dist/ffmpeg/index.js.map +1 -0
  177. package/dist/ffmpeg/version.d.ts +6 -0
  178. package/dist/ffmpeg/version.js +7 -0
  179. package/dist/ffmpeg/version.js.map +1 -0
  180. package/dist/index.d.ts +4 -0
  181. package/dist/index.js +9 -0
  182. package/dist/index.js.map +1 -0
  183. package/dist/lib/audio-fifo.d.ts +399 -0
  184. package/dist/lib/audio-fifo.js +431 -0
  185. package/dist/lib/audio-fifo.js.map +1 -0
  186. package/dist/lib/binding.d.ts +242 -0
  187. package/dist/lib/binding.js +102 -0
  188. package/dist/lib/binding.js.map +1 -0
  189. package/dist/lib/bitstream-filter-context.d.ts +381 -0
  190. package/dist/lib/bitstream-filter-context.js +443 -0
  191. package/dist/lib/bitstream-filter-context.js.map +1 -0
  192. package/dist/lib/bitstream-filter.d.ts +140 -0
  193. package/dist/lib/bitstream-filter.js +154 -0
  194. package/dist/lib/bitstream-filter.js.map +1 -0
  195. package/dist/lib/codec-context.d.ts +1069 -0
  196. package/dist/lib/codec-context.js +1336 -0
  197. package/dist/lib/codec-context.js.map +1 -0
  198. package/dist/lib/codec-parameters.d.ts +664 -0
  199. package/dist/lib/codec-parameters.js +813 -0
  200. package/dist/lib/codec-parameters.js.map +1 -0
  201. package/dist/lib/codec-parser.d.ts +201 -0
  202. package/dist/lib/codec-parser.js +213 -0
  203. package/dist/lib/codec-parser.js.map +1 -0
  204. package/dist/lib/codec.d.ts +617 -0
  205. package/dist/lib/codec.js +746 -0
  206. package/dist/lib/codec.js.map +1 -0
  207. package/dist/lib/device.d.ts +294 -0
  208. package/dist/lib/device.js +326 -0
  209. package/dist/lib/device.js.map +1 -0
  210. package/dist/lib/dictionary.d.ts +333 -0
  211. package/dist/lib/dictionary.js +372 -0
  212. package/dist/lib/dictionary.js.map +1 -0
  213. package/dist/lib/error.d.ts +311 -0
  214. package/dist/lib/error.js +395 -0
  215. package/dist/lib/error.js.map +1 -0
  216. package/dist/lib/fifo.d.ts +416 -0
  217. package/dist/lib/fifo.js +453 -0
  218. package/dist/lib/fifo.js.map +1 -0
  219. package/dist/lib/filter-context.d.ts +714 -0
  220. package/dist/lib/filter-context.js +783 -0
  221. package/dist/lib/filter-context.js.map +1 -0
  222. package/dist/lib/filter-graph-segment.d.ts +161 -0
  223. package/dist/lib/filter-graph-segment.js +172 -0
  224. package/dist/lib/filter-graph-segment.js.map +1 -0
  225. package/dist/lib/filter-graph.d.ts +641 -0
  226. package/dist/lib/filter-graph.js +704 -0
  227. package/dist/lib/filter-graph.js.map +1 -0
  228. package/dist/lib/filter-inout.d.ts +202 -0
  229. package/dist/lib/filter-inout.js +261 -0
  230. package/dist/lib/filter-inout.js.map +1 -0
  231. package/dist/lib/filter.d.ts +243 -0
  232. package/dist/lib/filter.js +272 -0
  233. package/dist/lib/filter.js.map +1 -0
  234. package/dist/lib/format-context.d.ts +1335 -0
  235. package/dist/lib/format-context.js +1455 -0
  236. package/dist/lib/format-context.js.map +1 -0
  237. package/dist/lib/frame-utils.d.ts +116 -0
  238. package/dist/lib/frame-utils.js +98 -0
  239. package/dist/lib/frame-utils.js.map +1 -0
  240. package/dist/lib/frame.d.ts +1315 -0
  241. package/dist/lib/frame.js +1535 -0
  242. package/dist/lib/frame.js.map +1 -0
  243. package/dist/lib/hardware-device-context.d.ts +362 -0
  244. package/dist/lib/hardware-device-context.js +383 -0
  245. package/dist/lib/hardware-device-context.js.map +1 -0
  246. package/dist/lib/hardware-frames-context.d.ts +418 -0
  247. package/dist/lib/hardware-frames-context.js +471 -0
  248. package/dist/lib/hardware-frames-context.js.map +1 -0
  249. package/dist/lib/index.d.ts +35 -0
  250. package/dist/lib/index.js +60 -0
  251. package/dist/lib/index.js.map +1 -0
  252. package/dist/lib/input-format.d.ts +249 -0
  253. package/dist/lib/input-format.js +306 -0
  254. package/dist/lib/input-format.js.map +1 -0
  255. package/dist/lib/io-context.d.ts +698 -0
  256. package/dist/lib/io-context.js +771 -0
  257. package/dist/lib/io-context.js.map +1 -0
  258. package/dist/lib/log.d.ts +174 -0
  259. package/dist/lib/log.js +184 -0
  260. package/dist/lib/log.js.map +1 -0
  261. package/dist/lib/native-types.d.ts +1024 -0
  262. package/dist/lib/native-types.js +2 -0
  263. package/dist/lib/native-types.js.map +1 -0
  264. package/dist/lib/option.d.ts +953 -0
  265. package/dist/lib/option.js +1607 -0
  266. package/dist/lib/option.js.map +1 -0
  267. package/dist/lib/output-format.d.ts +222 -0
  268. package/dist/lib/output-format.js +259 -0
  269. package/dist/lib/output-format.js.map +1 -0
  270. package/dist/lib/packet.d.ts +521 -0
  271. package/dist/lib/packet.js +613 -0
  272. package/dist/lib/packet.js.map +1 -0
  273. package/dist/lib/rational.d.ts +251 -0
  274. package/dist/lib/rational.js +278 -0
  275. package/dist/lib/rational.js.map +1 -0
  276. package/dist/lib/software-resample-context.d.ts +552 -0
  277. package/dist/lib/software-resample-context.js +592 -0
  278. package/dist/lib/software-resample-context.js.map +1 -0
  279. package/dist/lib/software-scale-context.d.ts +344 -0
  280. package/dist/lib/software-scale-context.js +366 -0
  281. package/dist/lib/software-scale-context.js.map +1 -0
  282. package/dist/lib/stream.d.ts +383 -0
  283. package/dist/lib/stream.js +524 -0
  284. package/dist/lib/stream.js.map +1 -0
  285. package/dist/lib/sync-queue.d.ts +179 -0
  286. package/dist/lib/sync-queue.js +197 -0
  287. package/dist/lib/sync-queue.js.map +1 -0
  288. package/dist/lib/types.d.ts +34 -0
  289. package/dist/lib/types.js +2 -0
  290. package/dist/lib/types.js.map +1 -0
  291. package/dist/lib/utilities.d.ts +1198 -0
  292. package/dist/lib/utilities.js +1302 -0
  293. package/dist/lib/utilities.js.map +1 -0
  294. package/dist/utils/electron.d.ts +49 -0
  295. package/dist/utils/electron.js +63 -0
  296. package/dist/utils/electron.js.map +1 -0
  297. package/dist/utils/index.d.ts +6 -0
  298. package/dist/utils/index.js +7 -0
  299. package/dist/utils/index.js.map +1 -0
  300. package/dist/utils/libc.d.ts +11 -0
  301. package/dist/utils/libc.js +35 -0
  302. package/dist/utils/libc.js.map +1 -0
  303. package/dist/utils/variant.d.ts +26 -0
  304. package/dist/utils/variant.js +31 -0
  305. package/dist/utils/variant.js.map +1 -0
  306. package/dist/webrtc/index.d.ts +4 -0
  307. package/dist/webrtc/index.js +7 -0
  308. package/dist/webrtc/index.js.map +1 -0
  309. package/install/check.js +124 -0
  310. package/install/ffmpeg.js +66 -0
  311. package/package.json +165 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter-context.js","sourceRoot":"","sources":["../../src/lib/filter-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAQzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,OAAO,aAAc,SAAQ,YAAiC;IAClE;;;;OAIG;IACH,YAAY,MAA2B;QACrC,KAAK,CAAC,MAAM,CAAC,CAAC;I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;;;;OAeG;IACH,MAAM;QACJ,OAAO,IAAI,CAAC,SAAS,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED;;;;;;OAMG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,CAAC,MAAM,CAAC,OAAO,CAAC;QACd,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;IAChC,CAAC;CACF"}
@@ -0,0 +1,161 @@
1
+ import type { FilterInOut } from './filter-inout.js';
2
+ import type { NativeFilterGraphSegment } from './native-types.js';
3
+ /**
4
+ * Parsed filter graph segment.
5
+ *
6
+ * Represents a parsed filtergraph segment that separates parsing from initialization.
7
+ * This allows filter contexts to be configured after creation but before initialization.
8
+ * The workflow involves parsing the filter description, creating filter instances,
9
+ * applying options, and finally initializing and linking the filters.
10
+ * Freeing the graph it was parsed into also frees the segment.
11
+ *
12
+ * Direct mapping to FFmpeg's AVFilterGraphSegment.
13
+ *
14
+ * @see [AVFilterGraphSegment](https://ffmpeg.org/doxygen/trunk/structAVFilterGraphSegment.html) - FFmpeg Doxygen
15
+ */
16
+ export declare class FilterGraphSegment implements Disposable {
17
+ private native;
18
+ /**
19
+ * @param native - The native filter graph segment instance
20
+ *
21
+ * @internal
22
+ */
23
+ constructor(native: NativeFilterGraphSegment);
24
+ /**
25
+ * Create filter instances in the segment.
26
+ *
27
+ * Allocates all filter contexts defined in the segment but does not initialize them.
28
+ * This separation allows configuration of filter properties before the filters are initialized.
29
+ *
30
+ * Direct mapping to avfilter_graph_segment_create_filters().
31
+ *
32
+ * @param flags - Creation flags (default: 0)
33
+ *
34
+ * @returns 0 on success, negative AVERROR on failure:
35
+ * - AVERROR_EINVAL: Invalid segment
36
+ * - AVERROR_ENOMEM: Memory allocation failure
37
+ *
38
+ * @example
39
+ * ```typescript
40
+ * import { FFmpegError } from 'node-av';
41
+ *
42
+ * const segment = graph.segmentParse('scale=640:480');
43
+ * if (segment) {
44
+ * const ret = segment.createFilters();
45
+ * FFmpegError.throwIfError(ret, 'createFilters');
46
+ * }
47
+ * ```
48
+ *
49
+ * @see {@link applyOpts} To apply options after creation
50
+ * @see {@link apply} To initialize and link filters
51
+ */
52
+ createFilters(flags?: number): number;
53
+ /**
54
+ * Apply options to filter instances.
55
+ *
56
+ * Applies the parsed filter options to their respective filter contexts.
57
+ * This method should be called after creating filters and before initializing them.
58
+ *
59
+ * Direct mapping to avfilter_graph_segment_apply_opts().
60
+ *
61
+ * @param flags - Option flags (default: 0)
62
+ *
63
+ * @returns 0 on success, negative AVERROR on failure:
64
+ * - AVERROR_EINVAL: Invalid options
65
+ * - AVERROR_OPTION_NOT_FOUND: Unknown option
66
+ *
67
+ * @example
68
+ * ```typescript
69
+ * import { FFmpegError } from 'node-av';
70
+ *
71
+ * const segment = graph.segmentParse('scale=640:480');
72
+ * if (segment) {
73
+ * FFmpegError.throwIfError(segment.createFilters(), 'createFilters');
74
+ * FFmpegError.throwIfError(segment.applyOpts(), 'applyOpts');
75
+ * }
76
+ * ```
77
+ *
78
+ * @see {@link createFilters} To create filter instances first
79
+ * @see {@link apply} To initialize and link after applying options
80
+ */
81
+ applyOpts(flags?: number): number;
82
+ /**
83
+ * Initialize and link all filters in the segment.
84
+ *
85
+ * Initializes all filter contexts in the segment and creates links between them
86
+ * according to the parsed filter graph description. This is the final step that
87
+ * completes the filter setup. All necessary filter configuration should be done
88
+ * before calling this method.
89
+ *
90
+ * Direct mapping to avfilter_graph_segment_apply().
91
+ *
92
+ * @param inputs - Receives the unlinked input pads; free it when done
93
+ *
94
+ * @param outputs - Receives the unlinked output pads; free it when done
95
+ *
96
+ * @param flags - Apply flags (default: 0)
97
+ *
98
+ * @returns 0 on success, negative AVERROR on failure:
99
+ * - AVERROR_EINVAL: Invalid segment or pads
100
+ * - AVERROR_ENOMEM: Memory allocation failure
101
+ *
102
+ * @example
103
+ * ```typescript
104
+ * import { FFmpegError, FilterInOut } from 'node-av';
105
+ *
106
+ * const segment = graph.segmentParse('scale=640:480');
107
+ * if (segment) {
108
+ * FFmpegError.throwIfError(segment.createFilters(), 'createFilters');
109
+ * FFmpegError.throwIfError(segment.applyOpts(), 'applyOpts');
110
+ *
111
+ * const inputs = new FilterInOut();
112
+ * const outputs = new FilterInOut();
113
+ * FFmpegError.throwIfError(segment.apply(inputs, outputs), 'apply');
114
+ *
115
+ * inputs.free();
116
+ * outputs.free();
117
+ * segment.free();
118
+ * }
119
+ * ```
120
+ *
121
+ * @see {@link createFilters} To create filter instances
122
+ * @see {@link applyOpts} To apply options before initialization
123
+ */
124
+ apply(inputs: FilterInOut, outputs: FilterInOut, flags?: number): number;
125
+ /**
126
+ * Free the segment and all associated resources.
127
+ *
128
+ * Releases all memory and resources allocated for this filter graph segment.
129
+ * After calling this method, the segment cannot be used anymore.
130
+ *
131
+ * Direct mapping to avfilter_graph_segment_free().
132
+ *
133
+ * @example
134
+ * ```typescript
135
+ * const segment = graph.segmentParse('scale=640:480');
136
+ * if (segment) {
137
+ * // Use segment...
138
+ * segment.free();
139
+ * }
140
+ * ```
141
+ *
142
+ * @see {@link Symbol.dispose} For automatic cleanup with using statement
143
+ */
144
+ free(): void;
145
+ /**
146
+ * Dispose of the segment.
147
+ *
148
+ * Automatically frees the segment when using the `using` statement.
149
+ * This implements the Disposable interface for automatic resource cleanup.
150
+ * Equivalent to calling free().
151
+ *
152
+ * @example
153
+ * ```typescript
154
+ * {
155
+ * using segment = graph.segmentParse('scale=640:480');
156
+ * // Use segment...
157
+ * } // Automatically freed
158
+ * ```
159
+ */
160
+ [Symbol.dispose](): void;
161
+ }
@@ -0,0 +1,172 @@
1
+ /**
2
+ * Parsed filter graph segment.
3
+ *
4
+ * Represents a parsed filtergraph segment that separates parsing from initialization.
5
+ * This allows filter contexts to be configured after creation but before initialization.
6
+ * The workflow involves parsing the filter description, creating filter instances,
7
+ * applying options, and finally initializing and linking the filters.
8
+ * Freeing the graph it was parsed into also frees the segment.
9
+ *
10
+ * Direct mapping to FFmpeg's AVFilterGraphSegment.
11
+ *
12
+ * @see [AVFilterGraphSegment](https://ffmpeg.org/doxygen/trunk/structAVFilterGraphSegment.html) - FFmpeg Doxygen
13
+ */
14
+ export class FilterGraphSegment {
15
+ native;
16
+ /**
17
+ * @param native - The native filter graph segment instance
18
+ *
19
+ * @internal
20
+ */
21
+ constructor(native) {
22
+ this.native = native;
23
+ }
24
+ /**
25
+ * Create filter instances in the segment.
26
+ *
27
+ * Allocates all filter contexts defined in the segment but does not initialize them.
28
+ * This separation allows configuration of filter properties before the filters are initialized.
29
+ *
30
+ * Direct mapping to avfilter_graph_segment_create_filters().
31
+ *
32
+ * @param flags - Creation flags (default: 0)
33
+ *
34
+ * @returns 0 on success, negative AVERROR on failure:
35
+ * - AVERROR_EINVAL: Invalid segment
36
+ * - AVERROR_ENOMEM: Memory allocation failure
37
+ *
38
+ * @example
39
+ * ```typescript
40
+ * import { FFmpegError } from 'node-av';
41
+ *
42
+ * const segment = graph.segmentParse('scale=640:480');
43
+ * if (segment) {
44
+ * const ret = segment.createFilters();
45
+ * FFmpegError.throwIfError(ret, 'createFilters');
46
+ * }
47
+ * ```
48
+ *
49
+ * @see {@link applyOpts} To apply options after creation
50
+ * @see {@link apply} To initialize and link filters
51
+ */
52
+ createFilters(flags = 0) {
53
+ return this.native.createFilters(flags);
54
+ }
55
+ /**
56
+ * Apply options to filter instances.
57
+ *
58
+ * Applies the parsed filter options to their respective filter contexts.
59
+ * This method should be called after creating filters and before initializing them.
60
+ *
61
+ * Direct mapping to avfilter_graph_segment_apply_opts().
62
+ *
63
+ * @param flags - Option flags (default: 0)
64
+ *
65
+ * @returns 0 on success, negative AVERROR on failure:
66
+ * - AVERROR_EINVAL: Invalid options
67
+ * - AVERROR_OPTION_NOT_FOUND: Unknown option
68
+ *
69
+ * @example
70
+ * ```typescript
71
+ * import { FFmpegError } from 'node-av';
72
+ *
73
+ * const segment = graph.segmentParse('scale=640:480');
74
+ * if (segment) {
75
+ * FFmpegError.throwIfError(segment.createFilters(), 'createFilters');
76
+ * FFmpegError.throwIfError(segment.applyOpts(), 'applyOpts');
77
+ * }
78
+ * ```
79
+ *
80
+ * @see {@link createFilters} To create filter instances first
81
+ * @see {@link apply} To initialize and link after applying options
82
+ */
83
+ applyOpts(flags = 0) {
84
+ return this.native.applyOpts(flags);
85
+ }
86
+ /**
87
+ * Initialize and link all filters in the segment.
88
+ *
89
+ * Initializes all filter contexts in the segment and creates links between them
90
+ * according to the parsed filter graph description. This is the final step that
91
+ * completes the filter setup. All necessary filter configuration should be done
92
+ * before calling this method.
93
+ *
94
+ * Direct mapping to avfilter_graph_segment_apply().
95
+ *
96
+ * @param inputs - Receives the unlinked input pads; free it when done
97
+ *
98
+ * @param outputs - Receives the unlinked output pads; free it when done
99
+ *
100
+ * @param flags - Apply flags (default: 0)
101
+ *
102
+ * @returns 0 on success, negative AVERROR on failure:
103
+ * - AVERROR_EINVAL: Invalid segment or pads
104
+ * - AVERROR_ENOMEM: Memory allocation failure
105
+ *
106
+ * @example
107
+ * ```typescript
108
+ * import { FFmpegError, FilterInOut } from 'node-av';
109
+ *
110
+ * const segment = graph.segmentParse('scale=640:480');
111
+ * if (segment) {
112
+ * FFmpegError.throwIfError(segment.createFilters(), 'createFilters');
113
+ * FFmpegError.throwIfError(segment.applyOpts(), 'applyOpts');
114
+ *
115
+ * const inputs = new FilterInOut();
116
+ * const outputs = new FilterInOut();
117
+ * FFmpegError.throwIfError(segment.apply(inputs, outputs), 'apply');
118
+ *
119
+ * inputs.free();
120
+ * outputs.free();
121
+ * segment.free();
122
+ * }
123
+ * ```
124
+ *
125
+ * @see {@link createFilters} To create filter instances
126
+ * @see {@link applyOpts} To apply options before initialization
127
+ */
128
+ apply(inputs, outputs, flags = 0) {
129
+ return this.native.apply(inputs.getNative(), outputs.getNative(), flags);
130
+ }
131
+ /**
132
+ * Free the segment and all associated resources.
133
+ *
134
+ * Releases all memory and resources allocated for this filter graph segment.
135
+ * After calling this method, the segment cannot be used anymore.
136
+ *
137
+ * Direct mapping to avfilter_graph_segment_free().
138
+ *
139
+ * @example
140
+ * ```typescript
141
+ * const segment = graph.segmentParse('scale=640:480');
142
+ * if (segment) {
143
+ * // Use segment...
144
+ * segment.free();
145
+ * }
146
+ * ```
147
+ *
148
+ * @see {@link Symbol.dispose} For automatic cleanup with using statement
149
+ */
150
+ free() {
151
+ this.native.free();
152
+ }
153
+ /**
154
+ * Dispose of the segment.
155
+ *
156
+ * Automatically frees the segment when using the `using` statement.
157
+ * This implements the Disposable interface for automatic resource cleanup.
158
+ * Equivalent to calling free().
159
+ *
160
+ * @example
161
+ * ```typescript
162
+ * {
163
+ * using segment = graph.segmentParse('scale=640:480');
164
+ * // Use segment...
165
+ * } // Automatically freed
166
+ * ```
167
+ */
168
+ [Symbol.dispose]() {
169
+ this.native[Symbol.dispose]();
170
+ }
171
+ }
172
+ //# sourceMappingURL=filter-graph-segment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter-graph-segment.js","sourceRoot":"","sources":["../../src/lib/filter-graph-segment.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,kBAAkB;IACrB,MAAM,CAA2B;IAEzC;;;;OAIG;IACH,YAAY,MAAgC;QAC1C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,aAAa,CAAC,KAAK,GAAG,CAAC;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,SAAS,CAAC,KAAK,GAAG,CAAC;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IACH,KAAK,CAAC,MAAmB,EAAE,OAAoB,EAAE,KAAK,GAAG,CAAC;QACxD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,OAAO,CAAC,SAAS,EAAE,EAAE,KAAK,CAAC,CAAC;IAC3E,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,IAAI;QACF,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,CAAC,MAAM,CAAC,OAAO,CAAC;QACd,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;IAChC,CAAC;CACF"}