node-av 1.0.3 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/README.md +56 -41
  2. package/dist/api/bitstream-filter.d.ts +180 -123
  3. package/dist/api/bitstream-filter.js +182 -126
  4. package/dist/api/bitstream-filter.js.map +1 -1
  5. package/dist/api/decoder.d.ts +286 -130
  6. package/dist/api/decoder.js +321 -159
  7. package/dist/api/decoder.js.map +1 -1
  8. package/dist/api/encoder.d.ts +254 -158
  9. package/dist/api/encoder.js +326 -298
  10. package/dist/api/encoder.js.map +1 -1
  11. package/dist/api/filter-presets.d.ts +912 -0
  12. package/dist/api/filter-presets.js +1407 -0
  13. package/dist/api/filter-presets.js.map +1 -0
  14. package/dist/api/filter.d.ts +280 -284
  15. package/dist/api/filter.js +435 -509
  16. package/dist/api/filter.js.map +1 -1
  17. package/dist/api/hardware.d.ts +226 -159
  18. package/dist/api/hardware.js +405 -287
  19. package/dist/api/hardware.js.map +1 -1
  20. package/dist/api/index.d.ts +3 -2
  21. package/dist/api/index.js +1 -0
  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 +45 -47
  25. package/dist/api/io-stream.js.map +1 -1
  26. package/dist/api/media-input.d.ts +244 -141
  27. package/dist/api/media-input.js +207 -104
  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 +212 -129
  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 +22 -182
  36. package/dist/api/utilities/audio-sample.d.ts +1 -1
  37. package/dist/api/utilities/image.d.ts +1 -1
  38. package/dist/api/utilities/media-type.d.ts +1 -1
  39. package/dist/api/utilities/pixel-format.d.ts +1 -1
  40. package/dist/api/utilities/sample-format.d.ts +1 -1
  41. package/dist/api/utilities/timestamp.d.ts +1 -1
  42. package/dist/api/utils.d.ts +1 -2
  43. package/dist/api/utils.js +9 -0
  44. package/dist/api/utils.js.map +1 -1
  45. package/dist/{lib → constants}/channel-layouts.d.ts +1 -1
  46. package/dist/constants/channel-layouts.js.map +1 -0
  47. package/dist/{lib → constants}/constants.d.ts +19 -4
  48. package/dist/{lib → constants}/constants.js +15 -1
  49. package/dist/constants/constants.js.map +1 -0
  50. package/dist/constants/decoders.d.ts +609 -0
  51. package/dist/constants/decoders.js +617 -0
  52. package/dist/constants/decoders.js.map +1 -0
  53. package/dist/constants/encoders.d.ts +285 -0
  54. package/dist/constants/encoders.js +298 -0
  55. package/dist/constants/encoders.js.map +1 -0
  56. package/dist/constants/index.d.ts +4 -0
  57. package/dist/constants/index.js +5 -0
  58. package/dist/constants/index.js.map +1 -0
  59. package/dist/index.d.ts +1 -0
  60. package/dist/index.js +2 -0
  61. package/dist/index.js.map +1 -1
  62. package/dist/lib/audio-fifo.d.ts +128 -171
  63. package/dist/lib/audio-fifo.js +130 -173
  64. package/dist/lib/audio-fifo.js.map +1 -1
  65. package/dist/lib/binding.d.ts +7 -5
  66. package/dist/lib/binding.js +5 -0
  67. package/dist/lib/binding.js.map +1 -1
  68. package/dist/lib/bitstream-filter-context.d.ts +139 -184
  69. package/dist/lib/bitstream-filter-context.js +139 -188
  70. package/dist/lib/bitstream-filter-context.js.map +1 -1
  71. package/dist/lib/bitstream-filter.d.ts +69 -55
  72. package/dist/lib/bitstream-filter.js +68 -54
  73. package/dist/lib/bitstream-filter.js.map +1 -1
  74. package/dist/lib/codec-context.d.ts +317 -381
  75. package/dist/lib/codec-context.js +316 -381
  76. package/dist/lib/codec-context.js.map +1 -1
  77. package/dist/lib/codec-parameters.d.ts +161 -171
  78. package/dist/lib/codec-parameters.js +162 -172
  79. package/dist/lib/codec-parameters.js.map +1 -1
  80. package/dist/lib/codec-parser.d.ts +92 -105
  81. package/dist/lib/codec-parser.js +92 -103
  82. package/dist/lib/codec-parser.js.map +1 -1
  83. package/dist/lib/codec.d.ts +328 -217
  84. package/dist/lib/codec.js +392 -218
  85. package/dist/lib/codec.js.map +1 -1
  86. package/dist/lib/dictionary.d.ts +150 -204
  87. package/dist/lib/dictionary.js +159 -213
  88. package/dist/lib/dictionary.js.map +1 -1
  89. package/dist/lib/error.d.ts +97 -131
  90. package/dist/lib/error.js +98 -128
  91. package/dist/lib/error.js.map +1 -1
  92. package/dist/lib/filter-context.d.ts +317 -194
  93. package/dist/lib/filter-context.js +335 -200
  94. package/dist/lib/filter-context.js.map +1 -1
  95. package/dist/lib/filter-graph.d.ts +252 -293
  96. package/dist/lib/filter-graph.js +253 -294
  97. package/dist/lib/filter-graph.js.map +1 -1
  98. package/dist/lib/filter-inout.d.ts +87 -95
  99. package/dist/lib/filter-inout.js +87 -95
  100. package/dist/lib/filter-inout.js.map +1 -1
  101. package/dist/lib/filter.d.ts +93 -111
  102. package/dist/lib/filter.js +94 -112
  103. package/dist/lib/filter.js.map +1 -1
  104. package/dist/lib/format-context.d.ts +321 -429
  105. package/dist/lib/format-context.js +314 -386
  106. package/dist/lib/format-context.js.map +1 -1
  107. package/dist/lib/frame.d.ts +263 -406
  108. package/dist/lib/frame.js +263 -408
  109. package/dist/lib/frame.js.map +1 -1
  110. package/dist/lib/hardware-device-context.d.ts +150 -204
  111. package/dist/lib/hardware-device-context.js +149 -203
  112. package/dist/lib/hardware-device-context.js.map +1 -1
  113. package/dist/lib/hardware-frames-context.d.ts +171 -181
  114. package/dist/lib/hardware-frames-context.js +171 -181
  115. package/dist/lib/hardware-frames-context.js.map +1 -1
  116. package/dist/lib/index.d.ts +2 -3
  117. package/dist/lib/index.js +2 -5
  118. package/dist/lib/index.js.map +1 -1
  119. package/dist/lib/input-format.d.ts +90 -118
  120. package/dist/lib/input-format.js +89 -117
  121. package/dist/lib/input-format.js.map +1 -1
  122. package/dist/lib/io-context.d.ts +210 -242
  123. package/dist/lib/io-context.js +221 -253
  124. package/dist/lib/io-context.js.map +1 -1
  125. package/dist/lib/log.d.ts +86 -120
  126. package/dist/lib/log.js +85 -122
  127. package/dist/lib/log.js.map +1 -1
  128. package/dist/lib/native-types.d.ts +127 -112
  129. package/dist/lib/native-types.js +9 -0
  130. package/dist/lib/native-types.js.map +1 -1
  131. package/dist/lib/option.d.ts +285 -242
  132. package/dist/lib/option.js +310 -250
  133. package/dist/lib/option.js.map +1 -1
  134. package/dist/lib/output-format.d.ts +78 -102
  135. package/dist/lib/output-format.js +77 -101
  136. package/dist/lib/output-format.js.map +1 -1
  137. package/dist/lib/packet.d.ts +173 -241
  138. package/dist/lib/packet.js +172 -241
  139. package/dist/lib/packet.js.map +1 -1
  140. package/dist/lib/rational.d.ts +0 -2
  141. package/dist/lib/rational.js +0 -2
  142. package/dist/lib/rational.js.map +1 -1
  143. package/dist/lib/software-resample-context.d.ts +242 -326
  144. package/dist/lib/software-resample-context.js +242 -326
  145. package/dist/lib/software-resample-context.js.map +1 -1
  146. package/dist/lib/software-scale-context.d.ts +130 -174
  147. package/dist/lib/software-scale-context.js +132 -176
  148. package/dist/lib/software-scale-context.js.map +1 -1
  149. package/dist/lib/stream.d.ts +88 -198
  150. package/dist/lib/stream.js +87 -197
  151. package/dist/lib/stream.js.map +1 -1
  152. package/dist/lib/types.d.ts +1 -1
  153. package/dist/lib/utilities.d.ts +372 -181
  154. package/dist/lib/utilities.js +373 -182
  155. package/dist/lib/utilities.js.map +1 -1
  156. package/install/check.js +0 -1
  157. package/package.json +32 -24
  158. package/release_notes.md +43 -13
  159. package/CHANGELOG.md +0 -8
  160. package/dist/lib/channel-layouts.js.map +0 -1
  161. package/dist/lib/constants.js.map +0 -1
  162. /package/dist/{lib → constants}/channel-layouts.js +0 -0
@@ -3,75 +3,51 @@ import { Rational } from './rational.js';
3
3
  /**
4
4
  * Codec parameters for stream configuration.
5
5
  *
6
- * Describes the properties of an encoded media stream.
7
- * Used to transfer codec parameters between contexts and streams.
8
- * Contains essential information like codec type, dimensions, and format.
6
+ * Stores essential codec parameters without requiring a full codec context.
7
+ * Used to describe stream properties in containers, transfer codec configuration
8
+ * between contexts, and initialize decoders/encoders. Contains format, dimensions,
9
+ * sample rates, and other codec-specific parameters.
9
10
  *
10
11
  * Direct mapping to FFmpeg's AVCodecParameters.
11
12
  *
12
13
  * @example
13
14
  * ```typescript
14
- * import { CodecParameters, FFmpegError } from 'node-av';
15
- * import { AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_H264, AV_PIX_FMT_YUV420P } from 'node-av/constants';
15
+ * import { CodecParameters, CodecContext, FFmpegError } from 'node-av';
16
16
  *
17
- * // Create and allocate codec parameters
17
+ * // Create and allocate parameters
18
18
  * const params = new CodecParameters();
19
19
  * params.alloc();
20
20
  *
21
- * // Copy parameters from a codec context
22
- * const ret = params.fromContext(codecContext);
23
- * FFmpegError.throwIfError(ret, 'fromContext');
21
+ * // Copy from stream
22
+ * const stream = formatContext.streams[0];
23
+ * const ret = stream.codecpar.copy(params);
24
+ * FFmpegError.throwIfError(ret, 'copy');
24
25
  *
25
- * // Set video parameters manually
26
- * params.codecType = AVMEDIA_TYPE_VIDEO;
27
- * params.codecId = AV_CODEC_ID_H264;
28
- * params.width = 1920;
29
- * params.height = 1080;
30
- * params.format = AV_PIX_FMT_YUV420P;
31
- *
32
- * // Apply parameters to another codec context
33
- * const ret2 = params.toContext(otherCodecContext);
26
+ * // Transfer to codec context
27
+ * const ret2 = params.toContext(codecContext);
34
28
  * FFmpegError.throwIfError(ret2, 'toContext');
35
29
  *
36
- * // Copy to another parameters struct
37
- * const params2 = new CodecParameters();
38
- * params2.alloc();
39
- * const copyRet = params.copy(params2);
40
- * FFmpegError.throwIfError(copyRet, 'copy');
41
- *
42
- * // Clean up
43
- * params.free();
44
- * params2.free();
30
+ * // Get parameters info
31
+ * console.log(`Codec: ${params.codecId}`);
32
+ * console.log(`Dimensions: ${params.width}x${params.height}`);
33
+ * console.log(`Bitrate: ${params.bitRate}`);
45
34
  * ```
35
+ *
36
+ * @see [AVCodecParameters](https://ffmpeg.org/doxygen/trunk/structAVCodecParameters.html) - FFmpeg Doxygen
37
+ * @see {@link CodecContext} For full codec operations
38
+ * @see {@link Stream} For stream parameters
46
39
  */
47
40
  export class CodecParameters {
48
41
  native;
49
- /**
50
- * Create new codec parameters.
51
- *
52
- * The parameters are uninitialized - you must call alloc() before use.
53
- * No FFmpeg resources are allocated until alloc() is called.
54
- *
55
- * Direct wrapper around AVCodecParameters.
56
- *
57
- * @example
58
- * ```typescript
59
- * import { CodecParameters } from 'node-av';
60
- *
61
- * const params = new CodecParameters();
62
- * params.alloc();
63
- * // Parameters are now ready for use
64
- * ```
65
- */
66
42
  constructor() {
67
43
  this.native = new bindings.CodecParameters();
68
44
  }
69
45
  /**
70
- * General type of the encoded data.
46
+ * Codec type.
71
47
  *
72
- * Identifies the media type (video, audio, subtitle, etc.).
48
+ * Media type (video, audio, subtitle, etc.).
73
49
  *
74
- * Direct mapping to AVCodecParameters->codec_type
50
+ * Direct mapping to AVCodecParameters->codec_type.
75
51
  */
76
52
  get codecType() {
77
53
  return this.native.codecType;
@@ -80,11 +56,11 @@ export class CodecParameters {
80
56
  this.native.codecType = value;
81
57
  }
82
58
  /**
83
- * Specific type of the encoded data.
59
+ * Codec ID.
84
60
  *
85
- * Identifies the exact codec (H.264, AAC, etc.).
61
+ * Specific codec identifier (e.g., AV_CODEC_ID_H264).
86
62
  *
87
- * Direct mapping to AVCodecParameters->codec_id
63
+ * Direct mapping to AVCodecParameters->codec_id.
88
64
  */
89
65
  get codecId() {
90
66
  return this.native.codecId;
@@ -95,8 +71,9 @@ export class CodecParameters {
95
71
  /**
96
72
  * Codec tag.
97
73
  *
98
- * Direct mapping to AVCodecParameters->codec_tag
99
- * Additional information about the codec (corresponds to the AVI FOURCC).
74
+ * Additional codec tag used by some formats.
75
+ *
76
+ * Direct mapping to AVCodecParameters->codec_tag.
100
77
  */
101
78
  get codecTag() {
102
79
  return this.native.codecTag;
@@ -105,13 +82,11 @@ export class CodecParameters {
105
82
  this.native.codecTag = value;
106
83
  }
107
84
  /**
108
- * Extra binary data needed for initializing the decoder.
85
+ * Extra codec data.
109
86
  *
110
- * Direct mapping to AVCodecParameters->extradata
111
- * The allocated memory should be AV_INPUT_BUFFER_PADDING_SIZE bytes larger
112
- * than extradata_size to avoid problems if it is read with the bitstream reader.
113
- * The bytewise contents of extradata must not depend on the architecture or CPU endianness.
114
- * Must be allocated with the av_malloc() family of functions.
87
+ * Codec-specific initialization data (e.g., H.264 SPS/PPS).
88
+ *
89
+ * Direct mapping to AVCodecParameters->extradata.
115
90
  */
116
91
  get extradata() {
117
92
  return this.native.extradata;
@@ -120,17 +95,21 @@ export class CodecParameters {
120
95
  this.native.extradata = value;
121
96
  }
122
97
  /**
123
- * Size of the extradata content in bytes.
98
+ * Extra data size.
99
+ *
100
+ * Size of extradata buffer in bytes.
124
101
  *
125
- * Direct mapping to AVCodecParameters->extradata_size
102
+ * Direct mapping to AVCodecParameters->extradata_size.
126
103
  */
127
104
  get extradataSize() {
128
105
  return this.native.extradataSize;
129
106
  }
130
107
  /**
131
- * Format of the encoded data.
132
- * - video: the pixel format (AVPixelFormat)
133
- * - audio: the sample format (AVSampleFormat)
108
+ * Pixel or sample format.
109
+ *
110
+ * Format of video pixels or audio samples.
111
+ *
112
+ * Direct mapping to AVCodecParameters->format.
134
113
  */
135
114
  get format() {
136
115
  return this.native.format;
@@ -139,7 +118,11 @@ export class CodecParameters {
139
118
  this.native.format = value;
140
119
  }
141
120
  /**
142
- * The average bitrate of the encoded data (in bits per second).
121
+ * Bit rate.
122
+ *
123
+ * Average bitrate in bits per second.
124
+ *
125
+ * Direct mapping to AVCodecParameters->bit_rate.
143
126
  */
144
127
  get bitRate() {
145
128
  return this.native.bitRate;
@@ -148,8 +131,11 @@ export class CodecParameters {
148
131
  this.native.bitRate = value;
149
132
  }
150
133
  /**
151
- * Codec-specific bitstream restrictions that the stream conforms to.
152
- * FF_PROFILE_H264_BASELINE, FF_PROFILE_H264_MAIN, etc.
134
+ * Codec profile.
135
+ *
136
+ * Profile level (e.g., baseline, main, high for H.264).
137
+ *
138
+ * Direct mapping to AVCodecParameters->profile.
153
139
  */
154
140
  get profile() {
155
141
  return this.native.profile;
@@ -158,8 +144,11 @@ export class CodecParameters {
158
144
  this.native.profile = value;
159
145
  }
160
146
  /**
161
- * Level of the bitstream.
162
- * FF_LEVEL_UNKNOWN or codec-specific values.
147
+ * Codec level.
148
+ *
149
+ * Level within the profile.
150
+ *
151
+ * Direct mapping to AVCodecParameters->level.
163
152
  */
164
153
  get level() {
165
154
  return this.native.level;
@@ -168,9 +157,11 @@ export class CodecParameters {
168
157
  this.native.level = value;
169
158
  }
170
159
  /**
171
- * Video frame width in pixels.
160
+ * Video width.
161
+ *
162
+ * Width of video frames in pixels.
172
163
  *
173
- * Direct mapping to AVCodecParameters->width
164
+ * Direct mapping to AVCodecParameters->width.
174
165
  */
175
166
  get width() {
176
167
  return this.native.width;
@@ -179,9 +170,11 @@ export class CodecParameters {
179
170
  this.native.width = value;
180
171
  }
181
172
  /**
182
- * Video frame height in pixels.
173
+ * Video height.
183
174
  *
184
- * Direct mapping to AVCodecParameters->height
175
+ * Height of video frames in pixels.
176
+ *
177
+ * Direct mapping to AVCodecParameters->height.
185
178
  */
186
179
  get height() {
187
180
  return this.native.height;
@@ -190,10 +183,11 @@ export class CodecParameters {
190
183
  this.native.height = value;
191
184
  }
192
185
  /**
193
- * The pixel aspect ratio (width / height) which a single pixel should have when displayed.
186
+ * Sample aspect ratio.
187
+ *
188
+ * Pixel aspect ratio for video.
194
189
  *
195
- * When the aspect ratio is unknown / undefined, the numerator should be set to 0
196
- * (the denominator may have any value).
190
+ * Direct mapping to AVCodecParameters->sample_aspect_ratio.
197
191
  */
198
192
  get sampleAspectRatio() {
199
193
  const sar = this.native.sampleAspectRatio;
@@ -203,9 +197,11 @@ export class CodecParameters {
203
197
  this.native.sampleAspectRatio = { num: value.num, den: value.den };
204
198
  }
205
199
  /**
206
- * Video only. The framerate of the video.
207
- * This is the fundamental unit of time (in seconds) in terms
208
- * of which frame timestamps are represented.
200
+ * Frame rate.
201
+ *
202
+ * Video frame rate in frames per second.
203
+ *
204
+ * Direct mapping to AVCodecParameters->framerate.
209
205
  */
210
206
  get frameRate() {
211
207
  const fr = this.native.frameRate;
@@ -215,8 +211,11 @@ export class CodecParameters {
215
211
  this.native.frameRate = { num: value.num, den: value.den };
216
212
  }
217
213
  /**
218
- * Video only. Additional colorspace characteristics.
219
- * AVCOL_RANGE_MPEG, AVCOL_RANGE_JPEG, etc.
214
+ * Color range.
215
+ *
216
+ * MPEG (limited) or JPEG (full) range.
217
+ *
218
+ * Direct mapping to AVCodecParameters->color_range.
220
219
  */
221
220
  get colorRange() {
222
221
  return this.native.colorRange;
@@ -225,8 +224,11 @@ export class CodecParameters {
225
224
  this.native.colorRange = value;
226
225
  }
227
226
  /**
228
- * Chromaticity coordinates of the source primaries.
229
- * AVCOL_PRI_BT709, AVCOL_PRI_BT2020, etc.
227
+ * Color primaries.
228
+ *
229
+ * Chromaticity coordinates of source primaries.
230
+ *
231
+ * Direct mapping to AVCodecParameters->color_primaries.
230
232
  */
231
233
  get colorPrimaries() {
232
234
  return this.native.colorPrimaries;
@@ -235,8 +237,11 @@ export class CodecParameters {
235
237
  this.native.colorPrimaries = value;
236
238
  }
237
239
  /**
238
- * Color Transfer Characteristic.
239
- * AVCOL_TRC_BT709, AVCOL_TRC_SMPTE2084, etc.
240
+ * Color transfer characteristic.
241
+ *
242
+ * Color transfer function (gamma).
243
+ *
244
+ * Direct mapping to AVCodecParameters->color_trc.
240
245
  */
241
246
  get colorTrc() {
242
247
  return this.native.colorTrc;
@@ -245,8 +250,11 @@ export class CodecParameters {
245
250
  this.native.colorTrc = value;
246
251
  }
247
252
  /**
253
+ * Color space.
254
+ *
248
255
  * YUV colorspace type.
249
- * AVCOL_SPC_BT709, AVCOL_SPC_BT2020_NCL, etc.
256
+ *
257
+ * Direct mapping to AVCodecParameters->color_space.
250
258
  */
251
259
  get colorSpace() {
252
260
  return this.native.colorSpace;
@@ -255,8 +263,11 @@ export class CodecParameters {
255
263
  this.native.colorSpace = value;
256
264
  }
257
265
  /**
266
+ * Chroma sample location.
267
+ *
258
268
  * Location of chroma samples.
259
- * AVCHROMA_LOC_LEFT, AVCHROMA_LOC_CENTER, etc.
269
+ *
270
+ * Direct mapping to AVCodecParameters->chroma_location.
260
271
  */
261
272
  get chromaLocation() {
262
273
  return this.native.chromaLocation;
@@ -266,7 +277,10 @@ export class CodecParameters {
266
277
  }
267
278
  /**
268
279
  * Audio channel layout.
269
- * @deprecated use ch_layout
280
+ *
281
+ * Configuration of audio channels.
282
+ *
283
+ * Direct mapping to AVCodecParameters->ch_layout.
270
284
  */
271
285
  get channelLayout() {
272
286
  return this.native.channelLayout;
@@ -275,8 +289,11 @@ export class CodecParameters {
275
289
  this.native.channelLayout = value;
276
290
  }
277
291
  /**
278
- * Audio only. The number of audio channels.
279
- * @deprecated use ch_layout.nb_channels
292
+ * Number of audio channels.
293
+ *
294
+ * @deprecated Use channelLayout.nbChannels instead
295
+ *
296
+ * Direct mapping to AVCodecParameters->channels.
280
297
  */
281
298
  get channels() {
282
299
  return this.native.channels;
@@ -287,8 +304,9 @@ export class CodecParameters {
287
304
  /**
288
305
  * Audio sample rate.
289
306
  *
290
- * Direct mapping to AVCodecParameters->sample_rate
291
- * The number of audio samples per second.
307
+ * Sample rate in Hz.
308
+ *
309
+ * Direct mapping to AVCodecParameters->sample_rate.
292
310
  */
293
311
  get sampleRate() {
294
312
  return this.native.sampleRate;
@@ -297,188 +315,160 @@ export class CodecParameters {
297
315
  this.native.sampleRate = value;
298
316
  }
299
317
  /**
300
- * Allocate a new AVCodecParameters and set its fields to default values.
318
+ * Allocate codec parameters.
301
319
  *
302
- * Allocates the parameters structure and initializes with defaults.
303
- * Must be called before using the parameters.
320
+ * Allocates memory for the parameters structure.
304
321
  *
305
- * Direct mapping to avcodec_parameters_alloc()
322
+ * Direct mapping to avcodec_parameters_alloc().
306
323
  *
307
- * @throws {Error} Memory allocation failure (ENOMEM)
324
+ * @throws {Error} If allocation fails (ENOMEM)
308
325
  *
309
326
  * @example
310
327
  * ```typescript
311
- * import { CodecParameters } from 'node-av';
312
- *
313
328
  * const params = new CodecParameters();
314
329
  * params.alloc();
315
- * // Parameters are now allocated with default values
330
+ * // Parameters ready for use
316
331
  * ```
317
332
  *
318
- * @see {@link free} To free the parameters
333
+ * @see {@link free} To deallocate
319
334
  */
320
335
  alloc() {
321
336
  this.native.alloc();
322
337
  }
323
338
  /**
324
- * Free the codec parameters and everything associated with it.
339
+ * Free codec parameters.
325
340
  *
326
- * Releases all resources associated with the parameters.
327
- * The parameters become invalid after this call.
341
+ * Releases all memory associated with the parameters.
328
342
  *
329
- * Direct mapping to avcodec_parameters_free()
343
+ * Direct mapping to avcodec_parameters_free().
330
344
  *
331
345
  * @example
332
346
  * ```typescript
333
347
  * params.free();
334
- * // params is now invalid and should not be used
348
+ * // Parameters now invalid
335
349
  * ```
350
+ *
351
+ * @see {@link alloc} To allocate
352
+ * @see {@link Symbol.dispose} For automatic cleanup
336
353
  */
337
354
  free() {
338
355
  this.native.free();
339
356
  }
340
357
  /**
341
- * Copy the contents of this CodecParameters to dst.
358
+ * Copy parameters to destination.
342
359
  *
343
- * Copies all parameter values to the destination.
344
- * Any allocated fields in dst are freed and replaced with newly allocated duplicates.
360
+ * Copies all codec parameters to another instance.
345
361
  *
346
- * Direct mapping to avcodec_parameters_copy()
347
- *
348
- * @param dst - Destination CodecParameters. Must be allocated.
362
+ * Direct mapping to avcodec_parameters_copy().
349
363
  *
364
+ * @param dst - Destination parameters
350
365
  * @returns 0 on success, negative AVERROR on error:
351
- * - 0: Success
352
- * - AVERROR(ENOMEM): Memory allocation failure
366
+ * - AVERROR_ENOMEM: Memory allocation failure
353
367
  *
354
368
  * @example
355
369
  * ```typescript
356
- * import { CodecParameters, FFmpegError } from 'node-av';
357
- *
358
- * const src = new CodecParameters();
359
- * src.alloc();
360
- * // ... set up src parameters ...
370
+ * import { FFmpegError } from 'node-av';
361
371
  *
362
372
  * const dst = new CodecParameters();
363
373
  * dst.alloc();
364
374
  * const ret = src.copy(dst);
365
375
  * FFmpegError.throwIfError(ret, 'copy');
366
376
  * ```
367
- *
368
- * @see {@link fromContext} To copy from codec context
369
- * @see {@link toContext} To copy to codec context
370
377
  */
371
378
  copy(dst) {
372
379
  return this.native.copy(dst.getNative());
373
380
  }
374
381
  /**
375
- * Fill this parameters struct based on the values from the supplied codec context.
382
+ * Fill parameters from codec context.
376
383
  *
377
- * Copies codec parameters from a codec context to this parameters struct.
378
- * Any allocated fields are freed and replaced with duplicates.
384
+ * Extracts codec parameters from a configured codec context.
379
385
  *
380
- * Direct mapping to avcodec_parameters_from_context()
381
- *
382
- * @param codecContext - Source CodecContext to copy from
386
+ * Direct mapping to avcodec_parameters_from_context().
383
387
  *
388
+ * @param codecContext - Source codec context
384
389
  * @returns 0 on success, negative AVERROR on error:
385
- * - 0: Success
386
- * - AVERROR(EINVAL): Invalid codec context
387
- * - AVERROR(ENOMEM): Memory allocation failure
390
+ * - AVERROR_ENOMEM: Memory allocation failure
388
391
  *
389
392
  * @example
390
393
  * ```typescript
391
394
  * import { FFmpegError } from 'node-av';
392
395
  *
393
- * // Copy encoder parameters to stream
394
- * const ret = outputStream.codecpar.fromContext(encoderContext);
396
+ * // Extract parameters from encoder
397
+ * const ret = params.fromContext(encoderContext);
395
398
  * FFmpegError.throwIfError(ret, 'fromContext');
396
399
  * ```
397
400
  *
398
- * @see {@link toContext} To copy in the opposite direction
401
+ * @see {@link toContext} To apply to context
399
402
  */
400
403
  fromContext(codecContext) {
401
404
  return this.native.fromContext(codecContext.getNative());
402
405
  }
403
406
  /**
404
- * Fill the codec context based on the values from this codec parameters.
405
- *
406
- * Copies parameters from this struct to a codec context.
407
- * Any allocated fields in the codec context are freed and replaced with duplicates.
407
+ * Apply parameters to codec context.
408
408
  *
409
- * Direct mapping to avcodec_parameters_to_context()
409
+ * Configures a codec context with these parameters.
410
+ * Essential for initializing decoders with stream parameters.
410
411
  *
411
- * @param codecContext - Destination CodecContext to copy to
412
+ * Direct mapping to avcodec_parameters_to_context().
412
413
  *
414
+ * @param codecContext - Destination codec context
413
415
  * @returns 0 on success, negative AVERROR on error:
414
- * - 0: Success
415
- * - AVERROR(EINVAL): Invalid codec context
416
- * - AVERROR(ENOMEM): Memory allocation failure
416
+ * - AVERROR_ENOMEM: Memory allocation failure
417
417
  *
418
418
  * @example
419
419
  * ```typescript
420
420
  * import { FFmpegError } from 'node-av';
421
421
  *
422
- * // Copy stream parameters to decoder
423
- * const ret = inputStream.codecpar.toContext(decoderContext);
422
+ * // Configure decoder with stream parameters
423
+ * const stream = formatContext.streams[0];
424
+ * const ret = stream.codecpar.toContext(decoderContext);
424
425
  * FFmpegError.throwIfError(ret, 'toContext');
425
426
  * ```
426
427
  *
427
- * @see {@link fromContext} To copy in the opposite direction
428
+ * @see {@link fromContext} To extract from context
428
429
  */
429
430
  toContext(codecContext) {
430
431
  return this.native.toContext(codecContext.getNative());
431
432
  }
432
433
  /**
433
- * Get the native FFmpeg AVCodecParameters pointer.
434
- *
435
- * @internal For use by other wrapper classes
436
- * @returns The underlying native codec parameters object
437
- */
438
- getNative() {
439
- return this.native;
440
- }
441
- /**
442
- * Convert all codec parameters to a JSON object.
434
+ * Convert to JSON representation.
443
435
  *
444
- * Returns all codec parameters as a plain JavaScript object.
445
- * Useful for debugging, logging, or serialization.
436
+ * Returns all codec parameters as a plain object.
437
+ * Useful for debugging and serialization.
446
438
  *
447
- * Uses native implementation to access all AVCodecParameters fields directly.
448
- *
449
- * @returns Object with all codec parameters
439
+ * @returns Object with all parameter values
450
440
  *
451
441
  * @example
452
442
  * ```typescript
453
- * const params = stream.codecpar;
454
443
  * const json = params.toJSON();
455
444
  * console.log(JSON.stringify(json, null, 2));
456
- * // {
457
- * // "codecType": 0,
458
- * // "codecId": 27,
459
- * // "width": 1920,
460
- * // "height": 1080,
461
- * // "format": 0,
462
- * // ...
463
- * // }
464
445
  * ```
465
446
  */
466
447
  toJSON() {
467
448
  return this.native.toJSON();
468
449
  }
450
+ /**
451
+ * Get the underlying native CodecParameters object.
452
+ *
453
+ * @returns The native CodecParameters binding object
454
+ *
455
+ * @internal
456
+ */
457
+ getNative() {
458
+ return this.native;
459
+ }
469
460
  /**
470
461
  * Dispose of the codec parameters.
471
462
  *
472
463
  * Implements the Disposable interface for automatic cleanup.
473
- * Equivalent to calling free().
474
464
  *
475
465
  * @example
476
466
  * ```typescript
477
467
  * {
478
468
  * using params = new CodecParameters();
479
469
  * params.alloc();
480
- * // ... use parameters
481
- * } // Automatically freed when leaving scope
470
+ * // Use params...
471
+ * } // Automatically disposed when leaving scope
482
472
  * ```
483
473
  */
484
474
  [Symbol.dispose]() {
@@ -1 +1 @@
1
- {"version":3,"file":"codec-parameters.js","sourceRoot":"","sources":["../../src/lib/codec-parameters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAkBzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,OAAO,eAAe;IAClB,MAAM,CAAwB;IAEtC;;;;;;;;;;;;;;;;OAgBG;IACH;QACE,IAAI,CAAC,MAAM,GAAG,IAAI,QAAQ,CAAC,eAAe,EAAE,CAAC;IAC/C,CAAC;IAED;;;;;;OAMG;IACH,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;IAC/B,CAAC;IAED,IAAI,SAAS,CAAC,KAAkB;QAC9B,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,KAAK,CAAC;IAChC,CAAC;IAED;;;;;;OAMG;IACH,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;IAC7B,CAAC;IAED,IAAI,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