node-av-lgpl 0.0.0 → 7.1.0-beta.2

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 +384 -0
  283. package/dist/lib/stream.js +525 -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,613 @@
1
+ import { bindings } from './binding.js';
2
+ import { Rational } from './rational.js';
3
+ /**
4
+ * Container for compressed audio/video data.
5
+ *
6
+ * Stores encoded data from demuxers or to be sent to muxers. Each packet contains
7
+ * a portion of compressed stream data, typically one video frame or several audio frames.
8
+ * Includes timing information (PTS/DTS), stream index, and flags. Essential for
9
+ * demuxing, muxing, and codec operations.
10
+ *
11
+ * Direct mapping to FFmpeg's AVPacket.
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * import { Packet, FFmpegError } from 'node-av';
16
+ * import { AV_PKT_FLAG_KEY } from 'node-av/constants';
17
+ *
18
+ * // Create and allocate packet
19
+ * const packet = new Packet();
20
+ * packet.alloc();
21
+ *
22
+ * // Read packet from format context
23
+ * const ret = await formatContext.readFrame(packet);
24
+ * FFmpegError.throwIfError(ret, 'readFrame');
25
+ *
26
+ * // Check packet properties
27
+ * console.log(`Stream: ${packet.streamIndex}`);
28
+ * console.log(`PTS: ${packet.pts}`);
29
+ * console.log(`Size: ${packet.size} bytes`);
30
+ * console.log(`Keyframe: ${packet.isKeyframe}`);
31
+ *
32
+ * // Send to decoder
33
+ * const ret2 = await codecContext.sendPacket(packet);
34
+ * FFmpegError.throwIfError(ret2, 'sendPacket');
35
+ *
36
+ * // Cleanup
37
+ * packet.unref();
38
+ * ```
39
+ *
40
+ * @see [AVPacket](https://ffmpeg.org/doxygen/trunk/structAVPacket.html) - FFmpeg Doxygen
41
+ * @see {@link FormatContext} For reading/writing packets
42
+ * @see {@link CodecContext} For encoding/decoding packets
43
+ */
44
+ export class Packet {
45
+ native;
46
+ constructor() {
47
+ this.native = new bindings.Packet();
48
+ }
49
+ /**
50
+ * Stream index this packet belongs to.
51
+ *
52
+ * Identifies which stream in a format context this packet is from/for.
53
+ * Set automatically when reading, must be set manually when writing.
54
+ *
55
+ * Direct mapping to AVPacket->stream_index.
56
+ */
57
+ get streamIndex() {
58
+ return this.native.streamIndex;
59
+ }
60
+ set streamIndex(value) {
61
+ this.native.streamIndex = value;
62
+ }
63
+ /**
64
+ * Presentation timestamp.
65
+ *
66
+ * Time when the decompressed packet should be presented to the user.
67
+ * In stream time base units. AV_NOPTS_VALUE if unknown.
68
+ *
69
+ * Direct mapping to AVPacket->pts.
70
+ */
71
+ get pts() {
72
+ return this.native.pts;
73
+ }
74
+ set pts(value) {
75
+ this.native.pts = value;
76
+ }
77
+ /**
78
+ * Decompression timestamp.
79
+ *
80
+ * Time when the packet should be decompressed.
81
+ * In stream time base units. AV_NOPTS_VALUE if unknown.
82
+ *
83
+ * Direct mapping to AVPacket->dts.
84
+ */
85
+ get dts() {
86
+ return this.native.dts;
87
+ }
88
+ set dts(value) {
89
+ this.native.dts = value;
90
+ }
91
+ /**
92
+ * Duration of this packet.
93
+ *
94
+ * Duration in stream time base units, 0 if unknown.
95
+ * Typically equal to next_pts - this_pts.
96
+ *
97
+ * Direct mapping to AVPacket->duration.
98
+ */
99
+ get duration() {
100
+ return this.native.duration;
101
+ }
102
+ set duration(value) {
103
+ this.native.duration = value;
104
+ }
105
+ /**
106
+ * Timebase for timestamps in this packet.
107
+ *
108
+ * Used by av_interleaved_write_frame() to correctly sort packets from different streams.
109
+ * Must be set to the output stream's timebase before calling av_interleaved_write_frame().
110
+ *
111
+ * Direct mapping to AVPacket->time_base.
112
+ */
113
+ get timeBase() {
114
+ const tb = this.native.timeBase;
115
+ return new Rational(tb.num, tb.den);
116
+ }
117
+ set timeBase(value) {
118
+ this.native.timeBase = { num: value.num, den: value.den };
119
+ }
120
+ /**
121
+ * Byte position in stream.
122
+ *
123
+ * Byte position of packet data in the input file.
124
+ * -1 if unknown.
125
+ *
126
+ * Direct mapping to AVPacket->pos.
127
+ */
128
+ get pos() {
129
+ return this.native.pos;
130
+ }
131
+ set pos(value) {
132
+ this.native.pos = value;
133
+ }
134
+ /**
135
+ * Size of packet data in bytes.
136
+ *
137
+ * Direct mapping to AVPacket->size.
138
+ */
139
+ get size() {
140
+ return this.native.size;
141
+ }
142
+ /**
143
+ * Bytes of native payload this packet currently reports to V8's GC via
144
+ * `napi_adjust_external_memory`. Exposed only so the accounting can be
145
+ * asserted in tests; the value is not observable through V8 heap statistics.
146
+ *
147
+ * @internal
148
+ */
149
+ get reportedExternalMemory() {
150
+ return this.native.reportedExternalMemory;
151
+ }
152
+ /**
153
+ * Packet flags.
154
+ *
155
+ * Combination of AV_PKT_FLAG values indicating packet properties
156
+ * (e.g., AV_PKT_FLAG_KEY for keyframes).
157
+ *
158
+ * Direct mapping to AVPacket->flags.
159
+ */
160
+ get flags() {
161
+ return this.native.flags;
162
+ }
163
+ set flags(value) {
164
+ this.native.flags = value;
165
+ }
166
+ /**
167
+ * Packet data buffer.
168
+ *
169
+ * Contains the compressed audio/video data.
170
+ * May be null for packets signaling special conditions.
171
+ *
172
+ * Assigning a Buffer replaces the payload with a copy of it; assigning null
173
+ * clears the payload. Either assignment drops any attached side data but
174
+ * preserves the packet's metadata (pts, dts, duration, pos, streamIndex,
175
+ * flags, timeBase), so assignment order does not matter.
176
+ *
177
+ * Direct mapping to AVPacket->data.
178
+ */
179
+ get data() {
180
+ return this.native.data;
181
+ }
182
+ set data(value) {
183
+ this.native.data = value;
184
+ }
185
+ /**
186
+ * Check if packet contains a keyframe.
187
+ *
188
+ * Convenience property that checks AV_PKT_FLAG_KEY flag.
189
+ * Keyframes can be decoded independently without reference frames.
190
+ */
191
+ get isKeyframe() {
192
+ return this.native.isKeyframe;
193
+ }
194
+ set isKeyframe(value) {
195
+ this.native.isKeyframe = value;
196
+ }
197
+ /**
198
+ * Allocate a new packet.
199
+ *
200
+ * Allocates the packet structure. Must be called before using the packet
201
+ * unless it was created by another function (e.g., clone()).
202
+ *
203
+ * Direct mapping to av_packet_alloc().
204
+ *
205
+ * @throws {Error} If allocation fails (ENOMEM)
206
+ *
207
+ * @example
208
+ * ```typescript
209
+ * const packet = new Packet();
210
+ * packet.alloc();
211
+ * // Packet is now ready for use
212
+ * ```
213
+ *
214
+ * @see {@link free} To deallocate the packet
215
+ */
216
+ alloc() {
217
+ this.native.alloc();
218
+ }
219
+ /**
220
+ * Free the packet.
221
+ *
222
+ * Deallocates the packet and its data. The packet becomes invalid after this.
223
+ *
224
+ * Direct mapping to av_packet_free().
225
+ *
226
+ * @example
227
+ * ```typescript
228
+ * packet.free();
229
+ * // Packet is now invalid
230
+ * ```
231
+ *
232
+ * @see {@link unref} To only free data, keeping structure
233
+ */
234
+ free() {
235
+ this.native.free();
236
+ }
237
+ /**
238
+ * Create a reference to another packet.
239
+ *
240
+ * Sets up this packet as a reference to the source packet's data.
241
+ * Both packets will share the same data buffer.
242
+ *
243
+ * Direct mapping to av_packet_ref().
244
+ *
245
+ * IMPORTANT: per FFmpeg's contract, this packet (the destination) is completely
246
+ * overwritten - it MUST be unreferenced or freshly allocated before calling.
247
+ * Re-using a packet as the destination without {@link unref} first leaks its
248
+ * previous buffer and side data. When reusing one packet across a loop, call
249
+ * `packet.unref()` before each `packet.ref(src)`.
250
+ *
251
+ * @param src - Source packet to reference
252
+ *
253
+ * @returns 0 on success, negative AVERROR on error:
254
+ * - AVERROR_ENOMEM: Memory allocation failure
255
+ * - AVERROR_EINVAL: Invalid parameters
256
+ *
257
+ * @example
258
+ * ```typescript
259
+ * import { FFmpegError } from 'node-av';
260
+ *
261
+ * // Reusing one packet across a loop: unref before re-referencing.
262
+ * packet2.unref();
263
+ * const ret = packet2.ref(packet1);
264
+ * FFmpegError.throwIfError(ret, 'ref');
265
+ * // packet2 now references packet1's data
266
+ * ```
267
+ *
268
+ * @see {@link unref} To remove reference (call before re-referencing a reused packet)
269
+ * @see {@link clone} To create independent copy
270
+ */
271
+ ref(src) {
272
+ return this.native.ref(src.getNative());
273
+ }
274
+ /**
275
+ * Unreference the packet.
276
+ *
277
+ * Frees the packet data if this was the last reference.
278
+ * The packet structure remains allocated and can be reused.
279
+ *
280
+ * Direct mapping to av_packet_unref().
281
+ *
282
+ * @example
283
+ * ```typescript
284
+ * packet.unref();
285
+ * // Packet data is freed, structure can be reused
286
+ * ```
287
+ *
288
+ * @see {@link ref} To create reference
289
+ * @see {@link free} To free everything
290
+ */
291
+ unref() {
292
+ this.native.unref();
293
+ }
294
+ /**
295
+ * Clone the packet.
296
+ *
297
+ * Creates an independent copy of the packet with its own data buffer.
298
+ * The new packet has the same content but can be modified independently.
299
+ *
300
+ * Direct mapping to av_packet_clone().
301
+ *
302
+ * @returns New packet instance, or null on allocation failure
303
+ *
304
+ * @example
305
+ * ```typescript
306
+ * const copy = packet.clone();
307
+ * if (copy) {
308
+ * // Modify copy without affecting original
309
+ * copy.pts = packet.pts + 1000n;
310
+ * }
311
+ * ```
312
+ *
313
+ * @see {@link ref} To create reference instead of copy
314
+ */
315
+ clone() {
316
+ const cloned = this.native.clone();
317
+ if (!cloned) {
318
+ return null;
319
+ }
320
+ // Wrap the native cloned packet
321
+ const packet = Object.create(Packet.prototype);
322
+ packet.native = cloned;
323
+ return packet;
324
+ }
325
+ /**
326
+ * Rescale packet timestamps.
327
+ *
328
+ * Converts PTS, DTS, and duration from one time base to another.
329
+ * Essential when moving packets between streams with different time bases.
330
+ *
331
+ * Direct mapping to av_packet_rescale_ts().
332
+ *
333
+ * @param srcTimebase - Source time base
334
+ *
335
+ * @param dstTimebase - Destination time base
336
+ *
337
+ * @example
338
+ * ```typescript
339
+ * import { Rational } from 'node-av';
340
+ *
341
+ * // Convert from 1/25 fps to 1/1000 (milliseconds)
342
+ * const src = new Rational(1, 25);
343
+ * const dst = new Rational(1, 1000);
344
+ * packet.rescaleTs(src, dst);
345
+ * ```
346
+ */
347
+ rescaleTs(srcTimebase, dstTimebase) {
348
+ this.native.rescaleTs({ num: srcTimebase.num, den: srcTimebase.den }, { num: dstTimebase.num, den: dstTimebase.den });
349
+ }
350
+ /**
351
+ * Ensure packet data is reference counted.
352
+ *
353
+ * Makes sure the packet data is stored in a reference-counted buffer.
354
+ * If not already reference-counted, allocates a new buffer and copies data.
355
+ *
356
+ * Direct mapping to av_packet_make_refcounted().
357
+ *
358
+ * @returns 0 on success, negative AVERROR on error:
359
+ * - AVERROR_ENOMEM: Memory allocation failure
360
+ * - AVERROR_EINVAL: Invalid packet
361
+ *
362
+ * @example
363
+ * ```typescript
364
+ * import { FFmpegError } from 'node-av';
365
+ *
366
+ * const ret = packet.makeRefcounted();
367
+ * FFmpegError.throwIfError(ret, 'makeRefcounted');
368
+ * ```
369
+ */
370
+ makeRefcounted() {
371
+ return this.native.makeRefcounted();
372
+ }
373
+ /**
374
+ * Ensure packet data is writable.
375
+ *
376
+ * Creates a private copy of the data if it's shared with other packets.
377
+ * Call before modifying packet data to avoid affecting other references.
378
+ *
379
+ * Direct mapping to av_packet_make_writable().
380
+ *
381
+ * @returns 0 on success, negative AVERROR on error:
382
+ * - AVERROR_ENOMEM: Memory allocation failure
383
+ * - AVERROR_EINVAL: Invalid packet
384
+ *
385
+ * @example
386
+ * ```typescript
387
+ * import { FFmpegError } from 'node-av';
388
+ *
389
+ * // Ensure we can safely modify data
390
+ * const ret = packet.makeWritable();
391
+ * FFmpegError.throwIfError(ret, 'makeWritable');
392
+ * // Now safe to modify packet.data
393
+ * ```
394
+ */
395
+ makeWritable() {
396
+ return this.native.makeWritable();
397
+ }
398
+ /**
399
+ * Get packet side data.
400
+ *
401
+ * Retrieves additional data associated with the packet
402
+ * (e.g., palette data, quality stats, encryption info).
403
+ *
404
+ * Direct mapping to av_packet_get_side_data().
405
+ *
406
+ * @param type - Type of side data to retrieve
407
+ *
408
+ * @returns Side data buffer, or null if not present
409
+ *
410
+ * @example
411
+ * ```typescript
412
+ * import { AV_PKT_DATA_PALETTE } from 'node-av/constants';
413
+ *
414
+ * const palette = packet.getSideData(AV_PKT_DATA_PALETTE);
415
+ * if (palette) {
416
+ * console.log(`Palette size: ${palette.length} bytes`);
417
+ * }
418
+ * ```
419
+ *
420
+ * @see {@link addSideData} To add side data
421
+ * @see {@link newSideData} To allocate new side data
422
+ */
423
+ getSideData(type) {
424
+ return this.native.getSideData(type);
425
+ }
426
+ /**
427
+ * Add side data to packet.
428
+ *
429
+ * Attaches additional data to the packet. The data is copied.
430
+ *
431
+ * Direct mapping to av_packet_add_side_data().
432
+ *
433
+ * @param type - Type of side data
434
+ *
435
+ * @param data - Side data buffer
436
+ *
437
+ * @returns 0 on success, negative AVERROR on error:
438
+ * - AVERROR_ENOMEM: Memory allocation failure
439
+ * - AVERROR_EINVAL: Invalid parameters
440
+ *
441
+ * @example
442
+ * ```typescript
443
+ * import { FFmpegError } from 'node-av';
444
+ * import { AV_PKT_DATA_NEW_EXTRADATA } from 'node-av/constants';
445
+ *
446
+ * const extradata = Buffer.from([...]);
447
+ * const ret = packet.addSideData(AV_PKT_DATA_NEW_EXTRADATA, extradata);
448
+ * FFmpegError.throwIfError(ret, 'addSideData');
449
+ * ```
450
+ *
451
+ * @see {@link getSideData} To retrieve side data
452
+ * @see {@link newSideData} To allocate in-place
453
+ */
454
+ addSideData(type, data) {
455
+ return this.native.addSideData(type, data);
456
+ }
457
+ /**
458
+ * Allocate new side data.
459
+ *
460
+ * Allocates side data buffer attached to the packet.
461
+ * Returns buffer that can be written to directly.
462
+ *
463
+ * Direct mapping to av_packet_new_side_data().
464
+ *
465
+ * @param type - Type of side data
466
+ *
467
+ * @param size - Size in bytes to allocate
468
+ *
469
+ * @returns Allocated buffer for writing
470
+ *
471
+ * @throws {Error} If allocation fails
472
+ *
473
+ * @example
474
+ * ```typescript
475
+ * import { AV_PKT_DATA_NEW_EXTRADATA } from 'node-av/constants';
476
+ *
477
+ * // Allocate and write side data directly
478
+ * const sideData = packet.newSideData(AV_PKT_DATA_NEW_EXTRADATA, 16);
479
+ * sideData.writeUInt32LE(0x12345678, 0);
480
+ * ```
481
+ *
482
+ * @see {@link getSideData} To retrieve side data
483
+ * @see {@link addSideData} To add existing buffer
484
+ */
485
+ newSideData(type, size) {
486
+ return this.native.newSideData(type, size);
487
+ }
488
+ /**
489
+ * Free all side data.
490
+ *
491
+ * Removes all side data attached to the packet.
492
+ *
493
+ * Direct mapping to av_packet_free_side_data().
494
+ *
495
+ * @example
496
+ * ```typescript
497
+ * packet.freeSideData();
498
+ * // All side data removed
499
+ * ```
500
+ */
501
+ freeSideData() {
502
+ this.native.freeSideData();
503
+ }
504
+ /**
505
+ * Set packet flags.
506
+ *
507
+ * Sets one or more flags using bitwise OR. Allows setting multiple flags
508
+ * without manually performing bitwise operations.
509
+ *
510
+ * @param flags - One or more flag values to set
511
+ *
512
+ * @example
513
+ * ```typescript
514
+ * import { AV_PKT_FLAG_KEY, AV_PKT_FLAG_DISCARD } from 'node-av/constants';
515
+ *
516
+ * // Set multiple flags at once
517
+ * packet.setFlags(AV_PKT_FLAG_KEY, AV_PKT_FLAG_DISCARD);
518
+ * ```
519
+ *
520
+ * @see {@link clearFlags} To unset flags
521
+ * @see {@link hasFlags} To check flags
522
+ * @see {@link flags} For direct flag access
523
+ */
524
+ setFlags(...flags) {
525
+ for (const flag of flags) {
526
+ this.native.flags = (this.native.flags | flag);
527
+ }
528
+ }
529
+ /**
530
+ * Clear packet flags.
531
+ *
532
+ * Clears one or more flags using bitwise AND NOT. Allows clearing multiple
533
+ * flags without manually performing bitwise operations.
534
+ *
535
+ * @param flags - One or more flag values to clear
536
+ *
537
+ * @example
538
+ * ```typescript
539
+ * import { AV_PKT_FLAG_DISCARD } from 'node-av/constants';
540
+ *
541
+ * // Clear specific flag
542
+ * packet.clearFlags(AV_PKT_FLAG_DISCARD);
543
+ * ```
544
+ *
545
+ * @see {@link setFlags} To set flags
546
+ * @see {@link hasFlags} To check flags
547
+ * @see {@link flags} For direct flag access
548
+ */
549
+ clearFlags(...flags) {
550
+ for (const flag of flags) {
551
+ this.native.flags = (this.native.flags & ~flag);
552
+ }
553
+ }
554
+ /**
555
+ * Check if packet has specific flags.
556
+ *
557
+ * Tests whether all specified flags are set using bitwise AND.
558
+ *
559
+ * @param flags - One or more flag values to check
560
+ *
561
+ * @returns true if all specified flags are set, false otherwise
562
+ *
563
+ * @example
564
+ * ```typescript
565
+ * import { AV_PKT_FLAG_KEY } from 'node-av/constants';
566
+ *
567
+ * if (packet.hasFlags(AV_PKT_FLAG_KEY)) {
568
+ * console.log('This is a keyframe packet');
569
+ * }
570
+ * ```
571
+ *
572
+ * @see {@link setFlags} To set flags
573
+ * @see {@link clearFlags} To unset flags
574
+ * @see {@link flags} For direct flag access
575
+ */
576
+ hasFlags(...flags) {
577
+ for (const flag of flags) {
578
+ if ((this.native.flags & flag) !== flag) {
579
+ return false;
580
+ }
581
+ }
582
+ return true;
583
+ }
584
+ /**
585
+ * Get the underlying native Packet object.
586
+ *
587
+ * @returns The native Packet binding object
588
+ *
589
+ * @internal
590
+ */
591
+ getNative() {
592
+ return this.native;
593
+ }
594
+ /**
595
+ * Dispose of the packet.
596
+ *
597
+ * Implements the Disposable interface for automatic cleanup.
598
+ * Equivalent to calling free().
599
+ *
600
+ * @example
601
+ * ```typescript
602
+ * {
603
+ * using packet = new Packet();
604
+ * packet.alloc();
605
+ * // Use packet...
606
+ * } // Automatically freed when leaving scope
607
+ * ```
608
+ */
609
+ [Symbol.dispose]() {
610
+ this.native[Symbol.dispose]();
611
+ }
612
+ }
613
+ //# sourceMappingURL=packet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packet.js","sourceRoot":"","sources":["../../src/lib/packet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAMzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,OAAO,MAAM;IACT,MAAM,CAAe;IAE7B;QACE,IAAI,CAAC,MAAM,GAAG,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;IACtC,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;IACjC,CAAC;IAED,IAAI,WAAW,CAAC,KAAa;QAC3B,IAAI,CAAC,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;IAClC,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;IACzB,CAAC;IAED,IAAI,GAAG,CAAC,KAAa;QACnB,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,KAAK,CAAC;IAC1B,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;IACzB,CAAC;IAED,IAAI,GAAG,CAAC,KAAa;QACnB,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,KAAK,CAAC;IAC1B,CAAC;IAED;;;;;;;OAOG;IACH,IA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