node-av 1.1.0 → 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.
Files changed (134) hide show
  1. package/README.md +51 -38
  2. package/dist/api/bitstream-filter.d.ts +180 -123
  3. package/dist/api/bitstream-filter.js +180 -125
  4. package/dist/api/bitstream-filter.js.map +1 -1
  5. package/dist/api/decoder.d.ts +279 -132
  6. package/dist/api/decoder.js +285 -142
  7. package/dist/api/decoder.js.map +1 -1
  8. package/dist/api/encoder.d.ts +246 -162
  9. package/dist/api/encoder.js +272 -208
  10. package/dist/api/encoder.js.map +1 -1
  11. package/dist/api/filter-presets.d.ts +690 -94
  12. package/dist/api/filter-presets.js +686 -102
  13. package/dist/api/filter-presets.js.map +1 -1
  14. package/dist/api/filter.d.ts +249 -213
  15. package/dist/api/filter.js +252 -242
  16. package/dist/api/filter.js.map +1 -1
  17. package/dist/api/hardware.d.ts +224 -117
  18. package/dist/api/hardware.js +380 -214
  19. package/dist/api/hardware.js.map +1 -1
  20. package/dist/api/index.d.ts +3 -3
  21. package/dist/api/index.js +1 -1
  22. package/dist/api/index.js.map +1 -1
  23. package/dist/api/io-stream.d.ts +65 -61
  24. package/dist/api/io-stream.js +43 -46
  25. package/dist/api/io-stream.js.map +1 -1
  26. package/dist/api/media-input.d.ts +242 -140
  27. package/dist/api/media-input.js +205 -103
  28. package/dist/api/media-input.js.map +1 -1
  29. package/dist/api/media-output.d.ts +206 -128
  30. package/dist/api/media-output.js +210 -128
  31. package/dist/api/media-output.js.map +1 -1
  32. package/dist/api/pipeline.d.ts +168 -38
  33. package/dist/api/pipeline.js +238 -14
  34. package/dist/api/pipeline.js.map +1 -1
  35. package/dist/api/types.d.ts +21 -187
  36. package/dist/api/utils.d.ts +1 -2
  37. package/dist/api/utils.js +9 -0
  38. package/dist/api/utils.js.map +1 -1
  39. package/dist/lib/audio-fifo.d.ts +127 -170
  40. package/dist/lib/audio-fifo.js +130 -173
  41. package/dist/lib/audio-fifo.js.map +1 -1
  42. package/dist/lib/binding.js +5 -0
  43. package/dist/lib/binding.js.map +1 -1
  44. package/dist/lib/bitstream-filter-context.d.ts +139 -184
  45. package/dist/lib/bitstream-filter-context.js +139 -188
  46. package/dist/lib/bitstream-filter-context.js.map +1 -1
  47. package/dist/lib/bitstream-filter.d.ts +68 -54
  48. package/dist/lib/bitstream-filter.js +68 -54
  49. package/dist/lib/bitstream-filter.js.map +1 -1
  50. package/dist/lib/codec-context.d.ts +316 -380
  51. package/dist/lib/codec-context.js +316 -381
  52. package/dist/lib/codec-context.js.map +1 -1
  53. package/dist/lib/codec-parameters.d.ts +160 -170
  54. package/dist/lib/codec-parameters.js +162 -172
  55. package/dist/lib/codec-parameters.js.map +1 -1
  56. package/dist/lib/codec-parser.d.ts +91 -104
  57. package/dist/lib/codec-parser.js +92 -103
  58. package/dist/lib/codec-parser.js.map +1 -1
  59. package/dist/lib/codec.d.ts +264 -281
  60. package/dist/lib/codec.js +268 -285
  61. package/dist/lib/codec.js.map +1 -1
  62. package/dist/lib/dictionary.d.ts +149 -203
  63. package/dist/lib/dictionary.js +158 -212
  64. package/dist/lib/dictionary.js.map +1 -1
  65. package/dist/lib/error.d.ts +96 -130
  66. package/dist/lib/error.js +98 -128
  67. package/dist/lib/error.js.map +1 -1
  68. package/dist/lib/filter-context.d.ts +284 -218
  69. package/dist/lib/filter-context.js +290 -227
  70. package/dist/lib/filter-context.js.map +1 -1
  71. package/dist/lib/filter-graph.d.ts +251 -292
  72. package/dist/lib/filter-graph.js +253 -294
  73. package/dist/lib/filter-graph.js.map +1 -1
  74. package/dist/lib/filter-inout.d.ts +87 -95
  75. package/dist/lib/filter-inout.js +87 -95
  76. package/dist/lib/filter-inout.js.map +1 -1
  77. package/dist/lib/filter.d.ts +93 -111
  78. package/dist/lib/filter.js +93 -111
  79. package/dist/lib/filter.js.map +1 -1
  80. package/dist/lib/format-context.d.ts +320 -428
  81. package/dist/lib/format-context.js +313 -385
  82. package/dist/lib/format-context.js.map +1 -1
  83. package/dist/lib/frame.d.ts +262 -405
  84. package/dist/lib/frame.js +263 -408
  85. package/dist/lib/frame.js.map +1 -1
  86. package/dist/lib/hardware-device-context.d.ts +149 -203
  87. package/dist/lib/hardware-device-context.js +149 -203
  88. package/dist/lib/hardware-device-context.js.map +1 -1
  89. package/dist/lib/hardware-frames-context.d.ts +170 -180
  90. package/dist/lib/hardware-frames-context.js +171 -181
  91. package/dist/lib/hardware-frames-context.js.map +1 -1
  92. package/dist/lib/index.d.ts +2 -1
  93. package/dist/lib/index.js +2 -2
  94. package/dist/lib/index.js.map +1 -1
  95. package/dist/lib/input-format.d.ts +89 -117
  96. package/dist/lib/input-format.js +89 -117
  97. package/dist/lib/input-format.js.map +1 -1
  98. package/dist/lib/io-context.d.ts +209 -241
  99. package/dist/lib/io-context.js +220 -252
  100. package/dist/lib/io-context.js.map +1 -1
  101. package/dist/lib/log.d.ts +85 -119
  102. package/dist/lib/log.js +85 -122
  103. package/dist/lib/log.js.map +1 -1
  104. package/dist/lib/native-types.d.ts +117 -106
  105. package/dist/lib/native-types.js +0 -7
  106. package/dist/lib/native-types.js.map +1 -1
  107. package/dist/lib/option.d.ts +284 -241
  108. package/dist/lib/option.js +309 -249
  109. package/dist/lib/option.js.map +1 -1
  110. package/dist/lib/output-format.d.ts +77 -101
  111. package/dist/lib/output-format.js +77 -101
  112. package/dist/lib/output-format.js.map +1 -1
  113. package/dist/lib/packet.d.ts +172 -240
  114. package/dist/lib/packet.js +172 -241
  115. package/dist/lib/packet.js.map +1 -1
  116. package/dist/lib/rational.d.ts +0 -2
  117. package/dist/lib/rational.js +0 -2
  118. package/dist/lib/rational.js.map +1 -1
  119. package/dist/lib/software-resample-context.d.ts +241 -325
  120. package/dist/lib/software-resample-context.js +242 -326
  121. package/dist/lib/software-resample-context.js.map +1 -1
  122. package/dist/lib/software-scale-context.d.ts +129 -173
  123. package/dist/lib/software-scale-context.js +131 -175
  124. package/dist/lib/software-scale-context.js.map +1 -1
  125. package/dist/lib/stream.d.ts +87 -197
  126. package/dist/lib/stream.js +87 -197
  127. package/dist/lib/stream.js.map +1 -1
  128. package/dist/lib/utilities.d.ts +372 -181
  129. package/dist/lib/utilities.js +373 -182
  130. package/dist/lib/utilities.js.map +1 -1
  131. package/install/check.js +0 -1
  132. package/package.json +21 -12
  133. package/release_notes.md +43 -59
  134. package/CHANGELOG.md +0 -8
@@ -3,100 +3,66 @@ import { HardwareDeviceContext } from './hardware-device-context.js';
3
3
  /**
4
4
  * Hardware frames context for GPU memory management.
5
5
  *
6
- * Manages pools of hardware frames for efficient GPU memory allocation.
7
- * Handles format conversions and data transfers between CPU and GPU memory.
8
- * Required for hardware-accelerated video processing pipelines.
6
+ * Manages pools of hardware frames (textures/surfaces) on the GPU.
7
+ * Essential for zero-copy hardware acceleration, allowing frames to stay
8
+ * in GPU memory throughout the processing pipeline. Provides frame allocation,
9
+ * format conversion, and data transfer between hardware and system memory.
9
10
  *
10
11
  * Direct mapping to FFmpeg's AVHWFramesContext.
11
12
  *
12
13
  * @example
13
14
  * ```typescript
14
- * import { HardwareDeviceContext, HardwareFramesContext, Frame, FFmpegError } from 'node-av';
15
- * import { AV_HWDEVICE_TYPE_CUDA, AV_PIX_FMT_CUDA, AV_PIX_FMT_NV12 } from 'node-av/constants';
15
+ * import { HardwareFramesContext, HardwareDeviceContext, Frame, FFmpegError } from 'node-av';
16
+ * import { AV_PIX_FMT_NV12, AV_PIX_FMT_CUDA, AV_HWDEVICE_TYPE_CUDA } from 'node-av/constants';
16
17
  *
17
18
  * // Create hardware frames context
18
19
  * const device = new HardwareDeviceContext();
19
- * const deviceRet = device.create(AV_HWDEVICE_TYPE_CUDA, null, null);
20
- * FFmpegError.throwIfError(deviceRet, 'create device');
20
+ * device.create(AV_HWDEVICE_TYPE_CUDA);
21
21
  *
22
22
  * const frames = new HardwareFramesContext();
23
- * frames.alloc(device);
24
- *
25
- * // Configure frame parameters
26
23
  * frames.format = AV_PIX_FMT_CUDA; // Hardware format
27
24
  * frames.swFormat = AV_PIX_FMT_NV12; // Software format
28
25
  * frames.width = 1920;
29
26
  * frames.height = 1080;
30
- * frames.initialPoolSize = 10;
27
+ * frames.initialPoolSize = 20; // Pre-allocate 20 frames
31
28
  *
32
- * // Initialize the context
29
+ * frames.alloc(device);
33
30
  * const ret = frames.init();
34
- * FFmpegError.throwIfError(ret, 'init frames');
31
+ * FFmpegError.throwIfError(ret, 'init');
35
32
  *
36
33
  * // Allocate hardware frame
37
34
  * const hwFrame = new Frame();
38
- * hwFrame.alloc();
39
35
  * const ret2 = frames.getBuffer(hwFrame, 0);
40
36
  * FFmpegError.throwIfError(ret2, 'getBuffer');
41
37
  *
42
- * // Transfer between hardware and software
43
- * const swFrame = new Frame();
44
- * swFrame.alloc();
45
- * swFrame.width = 1920;
46
- * swFrame.height = 1080;
47
- * swFrame.format = AV_PIX_FMT_NV12;
48
- * const swRet = swFrame.getBuffer();
49
- * FFmpegError.throwIfError(swRet, 'getBuffer sw');
50
- *
51
- * // Download from hardware
52
- * const dlRet = await frames.transferData(swFrame, hwFrame, 0);
53
- * FFmpegError.throwIfError(dlRet, 'download');
38
+ * // Transfer from CPU to GPU
39
+ * const cpuFrame = new Frame();
40
+ * // ... fill cpuFrame with data ...
41
+ * await frames.transferData(hwFrame, cpuFrame);
54
42
  *
55
- * // Upload to hardware
56
- * const ulRet = await frames.transferData(hwFrame, swFrame, 0);
57
- * FFmpegError.throwIfError(ulRet, 'upload');
58
- *
59
- * // Cleanup
60
- * hwFrame.free();
61
- * swFrame.free();
62
- * frames.free();
63
- * device.free();
43
+ * // Map hardware frame to CPU for access
44
+ * const mappedFrame = new Frame();
45
+ * const ret3 = frames.map(mappedFrame, hwFrame, AV_HWFRAME_MAP_READ);
46
+ * FFmpegError.throwIfError(ret3, 'map');
64
47
  * ```
65
48
  *
49
+ * @see [AVHWFramesContext](https://ffmpeg.org/doxygen/trunk/structAVHWFramesContext.html) - FFmpeg Doxygen
66
50
  * @see {@link HardwareDeviceContext} For device management
67
- * @see {@link Frame} For frame allocation
51
+ * @see {@link Frame} For frame operations
68
52
  */
69
53
  export class HardwareFramesContext {
70
54
  native;
71
55
  _deviceRef; // Cache for device context wrapper
72
- /**
73
- * Create a new hardware frames context.
74
- *
75
- * The context is uninitialized - you must call alloc() before use.
76
- * No FFmpeg resources are allocated until initialization.
77
- *
78
- * Direct wrapper around AVHWFramesContext.
79
- *
80
- * @example
81
- * ```typescript
82
- * import { HardwareFramesContext, FFmpegError } from 'node-av';
83
- *
84
- * const frames = new HardwareFramesContext();
85
- * frames.alloc(device);
86
- * // Configure parameters
87
- * const ret = frames.init();
88
- * FFmpegError.throwIfError(ret, 'init');
89
- * ```
90
- */
91
56
  constructor() {
92
57
  this.native = new bindings.HardwareFramesContext();
93
58
  }
94
59
  /**
95
60
  * Hardware pixel format.
96
61
  *
97
- * The pixel format identifying the underlying HW surface type.
62
+ * The pixel format used for frames in GPU memory.
63
+ * Hardware-specific format like AV_PIX_FMT_CUDA or AV_PIX_FMT_VAAPI.
98
64
  *
99
- * Direct mapping to AVHWFramesContext->format
65
+ * Direct mapping to AVHWFramesContext->format.
100
66
  */
101
67
  get format() {
102
68
  return this.native.format;
@@ -107,9 +73,10 @@ export class HardwareFramesContext {
107
73
  /**
108
74
  * Software pixel format.
109
75
  *
110
- * The pixel format identifying the actual data layout of the hardware frames.
76
+ * The pixel format frames are converted to when transferred
77
+ * to system memory. Standard format like AV_PIX_FMT_YUV420P.
111
78
  *
112
- * Direct mapping to AVHWFramesContext->sw_format
79
+ * Direct mapping to AVHWFramesContext->sw_format.
113
80
  */
114
81
  get swFormat() {
115
82
  return this.native.swFormat;
@@ -120,9 +87,9 @@ export class HardwareFramesContext {
120
87
  /**
121
88
  * Frame width.
122
89
  *
123
- * The allocated dimensions of the frames in this pool.
90
+ * Width of frames in pixels.
124
91
  *
125
- * Direct mapping to AVHWFramesContext->width
92
+ * Direct mapping to AVHWFramesContext->width.
126
93
  */
127
94
  get width() {
128
95
  return this.native.width;
@@ -133,9 +100,9 @@ export class HardwareFramesContext {
133
100
  /**
134
101
  * Frame height.
135
102
  *
136
- * The allocated dimensions of the frames in this pool.
103
+ * Height of frames in pixels.
137
104
  *
138
- * Direct mapping to AVHWFramesContext->height
105
+ * Direct mapping to AVHWFramesContext->height.
139
106
  */
140
107
  get height() {
141
108
  return this.native.height;
@@ -146,8 +113,10 @@ export class HardwareFramesContext {
146
113
  /**
147
114
  * Initial pool size.
148
115
  *
149
- * Initial size of the frame pool. If a device type does not support
150
- * dynamically resizing the pool, then this is also the maximum pool size.
116
+ * Number of frames to pre-allocate in the pool.
117
+ * Set before calling init() for optimal performance.
118
+ *
119
+ * Direct mapping to AVHWFramesContext->initial_pool_size.
151
120
  */
152
121
  get initialPoolSize() {
153
122
  return this.native.initialPoolSize;
@@ -156,11 +125,12 @@ export class HardwareFramesContext {
156
125
  this.native.initialPoolSize = value;
157
126
  }
158
127
  /**
159
- * Associated device context.
128
+ * Associated hardware device.
160
129
  *
161
- * Direct mapping to AVHWFramesContext->device_ref
130
+ * Reference to the device context this frames context belongs to.
131
+ * Automatically set when calling alloc().
162
132
  *
163
- * @readonly
133
+ * Direct mapping to AVHWFramesContext->device_ref.
164
134
  */
165
135
  get deviceRef() {
166
136
  // Return cached wrapper if we already have one
@@ -179,148 +149,172 @@ export class HardwareFramesContext {
179
149
  return device;
180
150
  }
181
151
  /**
182
- * Allocate an AVHWFramesContext tied to a given device context.
152
+ * Allocate hardware frames context.
153
+ *
154
+ * Allocates the frames context and associates it with a device.
155
+ * Must be called before init().
156
+ *
157
+ * Direct mapping to av_hwframe_ctx_alloc().
183
158
  *
184
- * Direct mapping to av_hwframe_ctx_alloc()
159
+ * @param device - Hardware device context to use
185
160
  *
186
- * @param device - Hardware device context
161
+ * @throws {Error} If allocation fails (ENOMEM)
187
162
  *
188
163
  * @example
189
164
  * ```typescript
165
+ * import { AV_PIX_FMT_CUDA, AV_PIX_FMT_NV12 } from 'node-av/constants';
166
+ *
190
167
  * const frames = new HardwareFramesContext();
191
- * frames.alloc(device);
192
- * // Set parameters before init()
193
168
  * frames.format = AV_PIX_FMT_CUDA;
194
169
  * frames.swFormat = AV_PIX_FMT_NV12;
195
170
  * frames.width = 1920;
196
171
  * frames.height = 1080;
172
+ * frames.alloc(device);
197
173
  * ```
198
174
  *
199
- * @throws {Error} If allocation fails
175
+ * @see {@link init} To initialize after allocation
200
176
  */
201
177
  alloc(device) {
202
178
  this.native.alloc(device.getNative());
203
179
  }
204
180
  /**
205
- * Finalize the context before use.
181
+ * Initialize hardware frames context.
182
+ *
183
+ * Initializes the frame pool after configuration.
184
+ * Must be called after alloc() and property setup.
206
185
  *
207
- * Direct mapping to av_hwframe_ctx_init()
186
+ * Direct mapping to av_hwframe_ctx_init().
208
187
  *
209
188
  * @returns 0 on success, negative AVERROR on error:
210
- * - 0: Success
211
- * - AVERROR(EINVAL): Invalid parameters
212
- * - AVERROR(ENOMEM): Memory allocation failure
213
- * - <0: Device-specific errors
189
+ * - AVERROR_EINVAL: Invalid parameters
190
+ * - AVERROR_ENOMEM: Memory allocation failure
191
+ * - AVERROR_ENOSYS: Operation not supported
192
+ * - Hardware-specific errors
214
193
  *
215
194
  * @example
216
195
  * ```typescript
196
+ * import { FFmpegError } from 'node-av';
197
+ *
198
+ * frames.alloc(device);
217
199
  * const ret = frames.init();
218
- * if (ret < 0) {
219
- * throw new FFmpegError(ret);
220
- * }
200
+ * FFmpegError.throwIfError(ret, 'init');
221
201
  * ```
202
+ *
203
+ * @see {@link alloc} Must be called first
222
204
  */
223
205
  init() {
224
206
  return this.native.init();
225
207
  }
226
208
  /**
227
- * Free the frames context.
209
+ * Free hardware frames context.
228
210
  *
229
- * Unreferences the AVBufferRef.
211
+ * Releases all frames and resources associated with the context.
212
+ * The context becomes invalid after calling this.
213
+ *
214
+ * Direct mapping to av_buffer_unref() on frames context.
230
215
  *
231
216
  * @example
232
217
  * ```typescript
233
218
  * frames.free();
234
- * // frames is now invalid and should not be used
219
+ * // Frames context is now invalid
235
220
  * ```
221
+ *
222
+ * @see {@link Symbol.dispose} For automatic cleanup
236
223
  */
237
224
  free() {
238
225
  this.native.free();
239
226
  }
240
227
  /**
241
- * Allocate a new frame attached to the given AVHWFramesContext.
228
+ * Allocate hardware frame from pool.
242
229
  *
243
- * Direct mapping to av_hwframe_get_buffer()
230
+ * Gets a frame from the hardware frame pool.
231
+ * The frame will have hardware-backed storage.
244
232
  *
245
- * @param frame - Frame to allocate (must be allocated but empty)
246
- * @param flags - Currently unused, should be set to 0
233
+ * Direct mapping to av_hwframe_get_buffer().
247
234
  *
235
+ * @param frame - Frame to allocate buffer for
236
+ * @param flags - Allocation flags (usually 0)
248
237
  * @returns 0 on success, negative AVERROR on error:
249
- * - 0: Success
250
- * - AVERROR(EINVAL): Invalid parameters
251
- * - AVERROR(ENOMEM): Memory allocation failure
252
- * - <0: Device-specific errors
238
+ * - AVERROR_ENOMEM: No frames available in pool
239
+ * - AVERROR_EINVAL: Invalid parameters
253
240
  *
254
241
  * @example
255
242
  * ```typescript
256
- * const frame = new Frame();
257
- * frame.alloc();
258
- * const ret = frames.getBuffer(frame, 0);
259
- * if (ret < 0) {
260
- * throw new FFmpegError(ret);
261
- * }
262
- * // frame now contains a hardware frame
243
+ * import { Frame, FFmpegError } from 'node-av';
244
+ *
245
+ * const hwFrame = new Frame();
246
+ * const ret = frames.getBuffer(hwFrame, 0);
247
+ * FFmpegError.throwIfError(ret, 'getBuffer');
248
+ * // hwFrame now has GPU memory allocated
263
249
  * ```
250
+ *
251
+ * @see {@link transferData} To upload data to hardware frame
264
252
  */
265
253
  getBuffer(frame, flags) {
266
254
  return this.native.getBuffer(frame.getNative(), flags ?? 0);
267
255
  }
268
256
  /**
269
- * Copy data to or from a hardware surface.
257
+ * Transfer data between hardware and system memory.
270
258
  *
271
- * Direct mapping to av_hwframe_transfer_data()
259
+ * Copies frame data between GPU and CPU memory.
260
+ * Direction is determined by frame types.
261
+ *
262
+ * Direct mapping to av_hwframe_transfer_data().
272
263
  *
273
264
  * @param dst - Destination frame
274
265
  * @param src - Source frame
275
- * @param flags - Currently unused, should be set to 0
276
- *
277
- * @returns Promise resolving to 0 on success, negative AVERROR on error:
278
- * - 0: Success
279
- * - AVERROR(ENOSYS): Transfer not supported
280
- * - AVERROR(EINVAL): Invalid parameters
281
- * - <0: Other errors
266
+ * @param flags - Transfer flags (usually 0)
267
+ * @returns 0 on success, negative AVERROR on error:
268
+ * - AVERROR_EINVAL: Invalid parameters
269
+ * - AVERROR_ENOSYS: Transfer not supported
270
+ * - AVERROR_ENOMEM: Memory allocation failure
282
271
  *
283
272
  * @example
284
273
  * ```typescript
285
- * // Download from hardware to software
286
- * const ret = await frames.transferData(swFrame, hwFrame, 0);
287
- * if (ret < 0) {
288
- * throw new FFmpegError(ret);
289
- * }
290
- *
291
- * // Upload from software to hardware
292
- * const ret2 = await frames.transferData(hwFrame, swFrame, 0);
293
- * if (ret2 < 0) {
294
- * throw new FFmpegError(ret2);
295
- * }
274
+ * import { FFmpegError } from 'node-av';
275
+ *
276
+ * // Upload: CPU -> GPU
277
+ * const cpuFrame = new Frame();
278
+ * // ... fill cpuFrame with data ...
279
+ * const hwFrame = new Frame();
280
+ * frames.getBuffer(hwFrame, 0);
281
+ * const ret = await frames.transferData(hwFrame, cpuFrame);
282
+ * FFmpegError.throwIfError(ret, 'transferData');
283
+ *
284
+ * // Download: GPU -> CPU
285
+ * const downloadFrame = new Frame();
286
+ * const ret2 = await frames.transferData(downloadFrame, hwFrame);
287
+ * FFmpegError.throwIfError(ret2, 'transferData');
296
288
  * ```
289
+ *
290
+ * @see {@link getBuffer} To allocate hardware frame
291
+ * @see {@link map} For zero-copy access
297
292
  */
298
293
  async transferData(dst, src, flags) {
299
- return this.native.transferData(dst.getNative(), src.getNative(), flags ?? 0);
294
+ return await this.native.transferData(dst.getNative(), src.getNative(), flags ?? 0);
300
295
  }
301
296
  /**
302
- * Get a list of possible source/target formats.
297
+ * Get supported transfer formats.
303
298
  *
304
- * Direct mapping to av_hwframe_transfer_get_formats()
299
+ * Returns pixel formats supported for frame transfer
300
+ * in the specified direction.
305
301
  *
306
- * @param direction - Transfer direction (AV_HWFRAME_TRANSFER_DIRECTION_*)
302
+ * Direct mapping to av_hwframe_transfer_get_formats().
307
303
  *
308
- * @returns Array of pixel formats or error code:
309
- * - Array: List of supported formats
310
- * - <0: AVERROR on failure
304
+ * @param direction - Transfer direction (FROM/TO hardware)
305
+ * @returns Array of supported formats, or error code:
306
+ * - AVERROR_ENOSYS: Query not supported
307
+ * - AVERROR_ENOMEM: Memory allocation failure
311
308
  *
312
309
  * @example
313
310
  * ```typescript
314
- * // Get formats for downloading from hardware
311
+ * import { AV_HWFRAME_TRANSFER_DIRECTION_FROM } from 'node-av/constants';
312
+ *
315
313
  * const formats = frames.transferGetFormats(AV_HWFRAME_TRANSFER_DIRECTION_FROM);
316
314
  * if (Array.isArray(formats)) {
317
315
  * console.log('Supported download formats:', formats);
318
- * }
319
- *
320
- * // Get formats for uploading to hardware
321
- * const formats2 = frames.transferGetFormats(AV_HWFRAME_TRANSFER_DIRECTION_TO);
322
- * if (Array.isArray(formats2)) {
323
- * console.log('Supported upload formats:', formats2);
316
+ * } else {
317
+ * console.error('Error querying formats:', formats);
324
318
  * }
325
319
  * ```
326
320
  */
@@ -328,76 +322,77 @@ export class HardwareFramesContext {
328
322
  return this.native.transferGetFormats(direction);
329
323
  }
330
324
  /**
331
- * Map a hardware frame.
325
+ * Map hardware frame to system memory.
332
326
  *
333
- * Direct mapping to av_hwframe_map()
327
+ * Creates a mapping of hardware frame data accessible from CPU.
328
+ * More efficient than transferData() for read-only access.
334
329
  *
335
- * This has a number of different possible effects, depending on the format
336
- * and origin of the src and dst frames. On input, src should be a usable
337
- * frame with valid hardware/software format and allocated data.
338
- *
339
- * @param dst - Destination frame
340
- * @param src - Source frame to map
341
- * @param flags - Combination of AV_HWFRAME_MAP_* flags
330
+ * Direct mapping to av_hwframe_map().
342
331
  *
332
+ * @param dst - Destination frame for mapped data
333
+ * @param src - Hardware frame to map
334
+ * @param flags - Mapping flags (AV_HWFRAME_MAP_*)
343
335
  * @returns 0 on success, negative AVERROR on error:
344
- * - 0: Success
345
- * - AVERROR(ENOSYS): Mapping not supported
346
- * - AVERROR(EINVAL): Invalid parameters
347
- * - <0: Other errors
336
+ * - AVERROR_EINVAL: Invalid parameters
337
+ * - AVERROR_ENOSYS: Mapping not supported
348
338
  *
349
339
  * @example
350
340
  * ```typescript
341
+ * import { FFmpegError } from 'node-av';
342
+ * import { AV_HWFRAME_MAP_READ } from 'node-av/constants';
343
+ *
351
344
  * const mappedFrame = new Frame();
352
- * mappedFrame.alloc();
353
345
  * const ret = frames.map(mappedFrame, hwFrame, AV_HWFRAME_MAP_READ);
354
- * if (ret < 0) {
355
- * throw new FFmpegError(ret);
356
- * }
357
- * // mappedFrame now provides CPU access to hwFrame
346
+ * FFmpegError.throwIfError(ret, 'map');
347
+ * // Can now read hwFrame data through mappedFrame
358
348
  * ```
349
+ *
350
+ * @see {@link transferData} For full data copy
359
351
  */
360
352
  map(dst, src, flags) {
361
353
  return this.native.map(dst.getNative(), src.getNative(), flags ?? 0);
362
354
  }
363
355
  /**
364
- * Create a new frame context derived from an existing one.
356
+ * Create derived frames context.
365
357
  *
366
- * Direct mapping to av_hwframe_ctx_create_derived()
358
+ * Creates a new frames context derived from another,
359
+ * potentially on a different device.
367
360
  *
368
- * @param format - Pixel format for the derived context
369
- * @param derivedDevice - Device context for the derived frames
370
- * @param source - Source frames context
371
- * @param flags - Currently unused, should be 0
361
+ * Direct mapping to av_hwframe_ctx_create_derived().
372
362
  *
363
+ * @param format - Pixel format for derived frames
364
+ * @param derivedDevice - Target device context
365
+ * @param source - Source frames context
366
+ * @param flags - Creation flags
373
367
  * @returns 0 on success, negative AVERROR on error:
374
- * - 0: Success
375
- * - AVERROR(ENOSYS): Derivation not supported
376
- * - AVERROR(EINVAL): Invalid parameters
377
- * - <0: Other errors
368
+ * - AVERROR_EINVAL: Invalid parameters
369
+ * - AVERROR_ENOSYS: Derivation not supported
370
+ * - AVERROR_ENOMEM: Memory allocation failure
378
371
  *
379
372
  * @example
380
373
  * ```typescript
381
- * const derived = new HardwareFramesContext();
382
- * const ret = derived.createDerived(
383
- * AV_PIX_FMT_NV12,
384
- * derivedDevice,
385
- * sourceFrames,
374
+ * import { FFmpegError } from 'node-av';
375
+ * import { AV_PIX_FMT_VULKAN } from 'node-av/constants';
376
+ *
377
+ * const derivedFrames = new HardwareFramesContext();
378
+ * const ret = derivedFrames.createDerived(
379
+ * AV_PIX_FMT_VULKAN,
380
+ * vulkanDevice,
381
+ * cudaFrames,
386
382
  * 0
387
383
  * );
388
- * if (ret < 0) {
389
- * throw new FFmpegError(ret);
390
- * }
384
+ * FFmpegError.throwIfError(ret, 'createDerived');
391
385
  * ```
392
386
  */
393
387
  createDerived(format, derivedDevice, source, flags) {
394
388
  return this.native.createDerived(format, derivedDevice.getNative(), source.native, flags ?? 0);
395
389
  }
396
390
  /**
397
- * Get the native FFmpeg AVHWFramesContext pointer.
391
+ * Get the underlying native HardwareFramesContext object.
398
392
  *
399
- * @internal For use by other wrapper classes
400
- * @returns The underlying native hardware frames context object
393
+ * @returns The native HardwareFramesContext binding object
394
+ *
395
+ * @internal
401
396
  */
402
397
  getNative() {
403
398
  return this.native;
@@ -410,18 +405,13 @@ export class HardwareFramesContext {
410
405
  *
411
406
  * @example
412
407
  * ```typescript
413
- * import { HardwareFramesContext, FFmpegError } from 'node-av';
414
- *
415
408
  * {
416
409
  * using frames = new HardwareFramesContext();
417
410
  * frames.alloc(device);
418
- * const ret = frames.init();
419
- * FFmpegError.throwIfError(ret, 'init');
420
- * // ... use frames
411
+ * frames.init();
412
+ * // Use frames...
421
413
  * } // Automatically freed when leaving scope
422
414
  * ```
423
- *
424
- * @see {@link free} For manual cleanup
425
415
  */
426
416
  [Symbol.dispose]() {
427
417
  this.native[Symbol.dispose]();
@@ -1 +1 @@
1
- {"version":3,"file":"hardware-frames-context.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;;;;;;;;OAoCG;IACH,KAAK,CAAC,YAAY,CAAC,GAAU,EAAE,GAAU,EAAE,KAAc;QACvD,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,GAAG,CAAC,SAAS,EAAE,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;IACtF,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,kBAAkB,CAAC,SAAqC;QACtD,OAAO,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;IACnD,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,GAAG,CAAC,GAAU,EAAE,GAAU,EAAE,KAAc;QACxC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,GAAG,CAAC,SAAS,EAAE,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;IACvE,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,aAAa,CAAC,MAAqB,EAAE,aAAoC,EAAE,MAA6B,EAAE,KAAc;QACtH,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,aAAa,CAAC,SAAS,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;IACjG,CAAC;IAED;;;;;;OAMG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,CAAC,MAAM,CAAC,OAAO,CAAC;QACd,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;IAChC,CAAC;CACF"}
@@ -16,6 +16,7 @@ export { SoftwareResampleContext } from './software-resample-context.js';
16
16
  export { AudioFifo } from './audio-fifo.js';
17
17
  export { IOContext } from './io-context.js';
18
18
  export { Dictionary } from './dictionary.js';
19
+ export { Option, OptionInfo, type OptionMember } from './option.js';
19
20
  export { FilterContext } from './filter-context.js';
20
21
  export { FilterGraph } from './filter-graph.js';
21
22
  export { FilterInOut } from './filter-inout.js';
@@ -26,4 +27,4 @@ export { Rational } from './rational.js';
26
27
  export { Log } from './log.js';
27
28
  export * from './error.js';
28
29
  export * from './utilities.js';
29
- export { Option, OptionInfo } from './option.js';
30
+ export type { OptionCapableObject } from './binding.js';
package/dist/lib/index.js CHANGED
@@ -30,6 +30,8 @@ export { AudioFifo } from './audio-fifo.js';
30
30
  export { IOContext } from './io-context.js';
31
31
  // Dictionary
32
32
  export { Dictionary } from './dictionary.js';
33
+ // Option
34
+ export { Option, OptionInfo } from './option.js';
33
35
  // Filter related classes
34
36
  export { FilterContext } from './filter-context.js';
35
37
  export { FilterGraph } from './filter-graph.js';
@@ -46,6 +48,4 @@ export { Log } from './log.js';
46
48
  export * from './error.js';
47
49
  // Utilities
48
50
  export * from './utilities.js';
49
- // Option
50
- export { Option, OptionInfo } from './option.js';
51
51
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAEA,iBAAiB;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,gBAAgB;AAChB,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,mBAAmB;AACnB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,QAAQ;AACR,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,SAAS;AACT,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,QAAQ;AACR,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,SAAS;AACT,OAAO,EAAE,MAAM,EAAE,MA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