node-av 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/LICENSE.md +22 -0
- package/README.md +377 -0
- package/binding.gyp +78 -0
- package/dist/api/bitstream-filter.d.ts +246 -0
- package/dist/api/bitstream-filter.js +369 -0
- package/dist/api/bitstream-filter.js.map +1 -0
- package/dist/api/decoder.d.ts +257 -0
- package/dist/api/decoder.js +424 -0
- package/dist/api/decoder.js.map +1 -0
- package/dist/api/encoder.d.ts +298 -0
- package/dist/api/encoder.js +574 -0
- package/dist/api/encoder.js.map +1 -0
- package/dist/api/filter.d.ts +457 -0
- package/dist/api/filter.js +876 -0
- package/dist/api/filter.js.map +1 -0
- package/dist/api/hardware.d.ts +318 -0
- package/dist/api/hardware.js +558 -0
- package/dist/api/hardware.js.map +1 -0
- package/dist/api/index.d.ts +12 -0
- package/dist/api/index.js +20 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/io-stream.d.ts +109 -0
- package/dist/api/io-stream.js +124 -0
- package/dist/api/io-stream.js.map +1 -0
- package/dist/api/media-input.d.ts +295 -0
- package/dist/api/media-input.js +456 -0
- package/dist/api/media-input.js.map +1 -0
- package/dist/api/media-output.d.ts +274 -0
- package/dist/api/media-output.js +486 -0
- package/dist/api/media-output.js.map +1 -0
- package/dist/api/pipeline.d.ts +117 -0
- package/dist/api/pipeline.js +836 -0
- package/dist/api/pipeline.js.map +1 -0
- package/dist/api/types.d.ts +440 -0
- package/dist/api/types.js +2 -0
- package/dist/api/types.js.map +1 -0
- package/dist/api/utilities/audio-sample.d.ts +115 -0
- package/dist/api/utilities/audio-sample.js +110 -0
- package/dist/api/utilities/audio-sample.js.map +1 -0
- package/dist/api/utilities/channel-layout.d.ts +83 -0
- package/dist/api/utilities/channel-layout.js +87 -0
- package/dist/api/utilities/channel-layout.js.map +1 -0
- package/dist/api/utilities/image.d.ts +177 -0
- package/dist/api/utilities/image.js +183 -0
- package/dist/api/utilities/image.js.map +1 -0
- package/dist/api/utilities/index.d.ts +8 -0
- package/dist/api/utilities/index.js +17 -0
- package/dist/api/utilities/index.js.map +1 -0
- package/dist/api/utilities/media-type.d.ts +56 -0
- package/dist/api/utilities/media-type.js +60 -0
- package/dist/api/utilities/media-type.js.map +1 -0
- package/dist/api/utilities/pixel-format.d.ts +94 -0
- package/dist/api/utilities/pixel-format.js +102 -0
- package/dist/api/utilities/pixel-format.js.map +1 -0
- package/dist/api/utilities/sample-format.d.ts +132 -0
- package/dist/api/utilities/sample-format.js +144 -0
- package/dist/api/utilities/sample-format.js.map +1 -0
- package/dist/api/utilities/streaming.d.ts +104 -0
- package/dist/api/utilities/streaming.js +137 -0
- package/dist/api/utilities/streaming.js.map +1 -0
- package/dist/api/utilities/timestamp.d.ts +187 -0
- package/dist/api/utilities/timestamp.js +200 -0
- package/dist/api/utilities/timestamp.js.map +1 -0
- package/dist/api/utils.d.ts +61 -0
- package/dist/api/utils.js +330 -0
- package/dist/api/utils.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/audio-fifo.d.ts +339 -0
- package/dist/lib/audio-fifo.js +365 -0
- package/dist/lib/audio-fifo.js.map +1 -0
- package/dist/lib/binding.d.ts +192 -0
- package/dist/lib/binding.js +70 -0
- package/dist/lib/binding.js.map +1 -0
- package/dist/lib/bitstream-filter-context.d.ts +345 -0
- package/dist/lib/bitstream-filter-context.js +407 -0
- package/dist/lib/bitstream-filter-context.js.map +1 -0
- package/dist/lib/bitstream-filter.d.ts +124 -0
- package/dist/lib/bitstream-filter.js +138 -0
- package/dist/lib/bitstream-filter.js.map +1 -0
- package/dist/lib/channel-layouts.d.ts +51 -0
- package/dist/lib/channel-layouts.js +55 -0
- package/dist/lib/channel-layouts.js.map +1 -0
- package/dist/lib/codec-context.d.ts +763 -0
- package/dist/lib/codec-context.js +974 -0
- package/dist/lib/codec-context.js.map +1 -0
- package/dist/lib/codec-parameters.d.ts +362 -0
- package/dist/lib/codec-parameters.js +460 -0
- package/dist/lib/codec-parameters.js.map +1 -0
- package/dist/lib/codec-parser.d.ts +185 -0
- package/dist/lib/codec-parser.js +193 -0
- package/dist/lib/codec-parser.js.map +1 -0
- package/dist/lib/codec.d.ts +432 -0
- package/dist/lib/codec.js +492 -0
- package/dist/lib/codec.js.map +1 -0
- package/dist/lib/constants.d.ts +2037 -0
- package/dist/lib/constants.js +1659 -0
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/dictionary.d.ts +371 -0
- package/dist/lib/dictionary.js +406 -0
- package/dist/lib/dictionary.js.map +1 -0
- package/dist/lib/error.d.ts +216 -0
- package/dist/lib/error.js +254 -0
- package/dist/lib/error.js.map +1 -0
- package/dist/lib/filter-context.d.ts +445 -0
- package/dist/lib/filter-context.js +505 -0
- package/dist/lib/filter-context.js.map +1 -0
- package/dist/lib/filter-graph.d.ts +556 -0
- package/dist/lib/filter-graph.js +608 -0
- package/dist/lib/filter-graph.js.map +1 -0
- package/dist/lib/filter-inout.d.ts +205 -0
- package/dist/lib/filter-inout.js +264 -0
- package/dist/lib/filter-inout.js.map +1 -0
- package/dist/lib/filter.d.ts +231 -0
- package/dist/lib/filter.js +260 -0
- package/dist/lib/filter.js.map +1 -0
- package/dist/lib/format-context.d.ts +798 -0
- package/dist/lib/format-context.js +845 -0
- package/dist/lib/format-context.js.map +1 -0
- package/dist/lib/frame.d.ts +784 -0
- package/dist/lib/frame.js +933 -0
- package/dist/lib/frame.js.map +1 -0
- package/dist/lib/hardware-device-context.d.ts +407 -0
- package/dist/lib/hardware-device-context.js +429 -0
- package/dist/lib/hardware-device-context.js.map +1 -0
- package/dist/lib/hardware-frames-context.d.ts +374 -0
- package/dist/lib/hardware-frames-context.js +430 -0
- package/dist/lib/hardware-frames-context.js.map +1 -0
- package/dist/lib/index.d.ts +31 -0
- package/dist/lib/index.js +54 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/input-format.d.ts +216 -0
- package/dist/lib/input-format.js +246 -0
- package/dist/lib/input-format.js.map +1 -0
- package/dist/lib/io-context.d.ts +495 -0
- package/dist/lib/io-context.js +550 -0
- package/dist/lib/io-context.js.map +1 -0
- package/dist/lib/log.d.ts +201 -0
- package/dist/lib/log.js +219 -0
- package/dist/lib/log.js.map +1 -0
- package/dist/lib/native-types.d.ts +719 -0
- package/dist/lib/native-types.js +2 -0
- package/dist/lib/native-types.js.map +1 -0
- package/dist/lib/option.d.ts +589 -0
- package/dist/lib/option.js +853 -0
- package/dist/lib/option.js.map +1 -0
- package/dist/lib/output-format.d.ts +179 -0
- package/dist/lib/output-format.js +205 -0
- package/dist/lib/output-format.js.map +1 -0
- package/dist/lib/packet.d.ts +487 -0
- package/dist/lib/packet.js +558 -0
- package/dist/lib/packet.js.map +1 -0
- package/dist/lib/rational.d.ts +210 -0
- package/dist/lib/rational.js +233 -0
- package/dist/lib/rational.js.map +1 -0
- package/dist/lib/software-resample-context.d.ts +572 -0
- package/dist/lib/software-resample-context.js +610 -0
- package/dist/lib/software-resample-context.js.map +1 -0
- package/dist/lib/software-scale-context.d.ts +290 -0
- package/dist/lib/software-scale-context.js +308 -0
- package/dist/lib/software-scale-context.js.map +1 -0
- package/dist/lib/stream.d.ts +322 -0
- package/dist/lib/stream.js +408 -0
- package/dist/lib/stream.js.map +1 -0
- package/dist/lib/types.d.ts +59 -0
- package/dist/lib/types.js +8 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/utilities.d.ts +346 -0
- package/dist/lib/utilities.js +424 -0
- package/dist/lib/utilities.js.map +1 -0
- package/install/check.js +113 -0
- package/install/ffmpeg.js +163 -0
- package/package.json +107 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame.js","sourceRoot":"","sources":["../../src/lib/frame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAA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O,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;IACjC,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,WAAW,CAAC,IAAyB;QACnC,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,WAAW,CAAC,IAAyB,EAAE,IAAY;QACjD,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,cAAc,CAAC,IAAyB;QACtC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED;;;;;OAKG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,CAAC,MAAM,CAAC,OAAO,CAAC;QACd,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;IAChC,CAAC;CACF"}
|
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
import type { AVHWDeviceType } from './constants.js';
|
|
2
|
+
import type { Dictionary } from './dictionary.js';
|
|
3
|
+
import type { NativeHardwareDeviceContext, NativeWrapper } from './native-types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Hardware device context for hardware acceleration.
|
|
6
|
+
*
|
|
7
|
+
* Manages hardware acceleration devices like CUDA, VAAPI, DXVA2, etc.
|
|
8
|
+
* Provides device creation, configuration, and constraint querying.
|
|
9
|
+
* Required for hardware-accelerated encoding, decoding, and filtering.
|
|
10
|
+
*
|
|
11
|
+
* Direct mapping to FFmpeg's AVHWDeviceContext.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* import { HardwareDeviceContext, HardwareFramesContext, FFmpegError } from 'node-av';
|
|
16
|
+
* import { AV_HWDEVICE_TYPE_CUDA, AV_PIX_FMT_CUDA, AV_PIX_FMT_NV12 } from 'node-av/constants';
|
|
17
|
+
*
|
|
18
|
+
* // Create CUDA device context
|
|
19
|
+
* const device = new HardwareDeviceContext();
|
|
20
|
+
* const ret = device.create(AV_HWDEVICE_TYPE_CUDA, null, null);
|
|
21
|
+
* FFmpegError.throwIfError(ret, 'create device');
|
|
22
|
+
*
|
|
23
|
+
* // Get device constraints
|
|
24
|
+
* const constraints = device.getHwframeConstraints();
|
|
25
|
+
* console.log(`Max size: ${constraints.maxWidth}x${constraints.maxHeight}`);
|
|
26
|
+
*
|
|
27
|
+
* // Create frames context for this device
|
|
28
|
+
* const frames = new HardwareFramesContext();
|
|
29
|
+
* frames.alloc(device);
|
|
30
|
+
* frames.format = AV_PIX_FMT_CUDA;
|
|
31
|
+
* frames.swFormat = AV_PIX_FMT_NV12;
|
|
32
|
+
* frames.width = 1920;
|
|
33
|
+
* frames.height = 1080;
|
|
34
|
+
* const initRet = frames.init();
|
|
35
|
+
* FFmpegError.throwIfError(initRet, 'init frames');
|
|
36
|
+
*
|
|
37
|
+
* // Cleanup
|
|
38
|
+
* frames.free();
|
|
39
|
+
* device.free();
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```typescript
|
|
44
|
+
* import { HardwareDeviceContext } from 'node-av';
|
|
45
|
+
* import { AV_HWDEVICE_TYPE_NONE } from 'node-av/constants';
|
|
46
|
+
*
|
|
47
|
+
* // List available hardware device types
|
|
48
|
+
* const types = HardwareDeviceContext.iterateTypes();
|
|
49
|
+
* for (const type of types) {
|
|
50
|
+
* const name = HardwareDeviceContext.getTypeName(type);
|
|
51
|
+
* console.log(`Available: ${name}`);
|
|
52
|
+
* }
|
|
53
|
+
*
|
|
54
|
+
* // Find specific device type
|
|
55
|
+
* const vaapi = HardwareDeviceContext.findTypeByName('vaapi');
|
|
56
|
+
* if (vaapi !== AV_HWDEVICE_TYPE_NONE) {
|
|
57
|
+
* const device = new HardwareDeviceContext();
|
|
58
|
+
* const ret = device.create(vaapi, '/dev/dri/renderD128', null);
|
|
59
|
+
* FFmpegError.throwIfError(ret, 'create VAAPI device');
|
|
60
|
+
* }
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @see {@link HardwareFramesContext} For managing hardware frame pools
|
|
64
|
+
* @see {@link CodecContext} For hardware-accelerated encoding/decoding
|
|
65
|
+
*/
|
|
66
|
+
export declare class HardwareDeviceContext implements Disposable, NativeWrapper<NativeHardwareDeviceContext> {
|
|
67
|
+
private native;
|
|
68
|
+
/**
|
|
69
|
+
* Create a new hardware device context.
|
|
70
|
+
*
|
|
71
|
+
* The context is uninitialized - you must call alloc() or create() before use.
|
|
72
|
+
* No FFmpeg resources are allocated until initialization.
|
|
73
|
+
*
|
|
74
|
+
* Direct wrapper around AVHWDeviceContext.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* import { HardwareDeviceContext, FFmpegError } from 'node-av';
|
|
79
|
+
* import { AV_HWDEVICE_TYPE_CUDA } from 'node-av/constants';
|
|
80
|
+
*
|
|
81
|
+
* const device = new HardwareDeviceContext();
|
|
82
|
+
* const ret = device.create(AV_HWDEVICE_TYPE_CUDA, null, null);
|
|
83
|
+
* FFmpegError.throwIfError(ret, 'create device');
|
|
84
|
+
* // Device is now ready for use
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
constructor();
|
|
88
|
+
/**
|
|
89
|
+
* Get the string name of an AVHWDeviceType.
|
|
90
|
+
*
|
|
91
|
+
* Returns the human-readable name for a hardware device type.
|
|
92
|
+
*
|
|
93
|
+
* Direct mapping to av_hwdevice_get_type_name()
|
|
94
|
+
*
|
|
95
|
+
* @param type - Hardware device type (AVHWDeviceType)
|
|
96
|
+
*
|
|
97
|
+
* @returns Device type name or null if unknown
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```typescript
|
|
101
|
+
* import { HardwareDeviceContext } from 'node-av';
|
|
102
|
+
* import { AV_HWDEVICE_TYPE_CUDA } from 'node-av/constants';
|
|
103
|
+
*
|
|
104
|
+
* const name = HardwareDeviceContext.getTypeName(AV_HWDEVICE_TYPE_CUDA);
|
|
105
|
+
* console.log(name); // "cuda"
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
static getTypeName(type: AVHWDeviceType): string | null;
|
|
109
|
+
/**
|
|
110
|
+
* Iterate over supported device types.
|
|
111
|
+
*
|
|
112
|
+
* Returns all hardware device types supported by this FFmpeg build.
|
|
113
|
+
*
|
|
114
|
+
* Direct mapping to av_hwdevice_iterate_types()
|
|
115
|
+
*
|
|
116
|
+
* @returns Array of supported AVHWDeviceType values
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```typescript
|
|
120
|
+
* import { HardwareDeviceContext } from 'node-av';
|
|
121
|
+
*
|
|
122
|
+
* const types = HardwareDeviceContext.iterateTypes();
|
|
123
|
+
* for (const type of types) {
|
|
124
|
+
* const name = HardwareDeviceContext.getTypeName(type);
|
|
125
|
+
* console.log(`Supported: ${name}`);
|
|
126
|
+
* }
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
static iterateTypes(): AVHWDeviceType[];
|
|
130
|
+
/**
|
|
131
|
+
* Get the AVHWDeviceType corresponding to the name.
|
|
132
|
+
*
|
|
133
|
+
* Looks up a hardware device type by its string name.
|
|
134
|
+
*
|
|
135
|
+
* Direct mapping to av_hwdevice_find_type_by_name()
|
|
136
|
+
*
|
|
137
|
+
* @param name - Device type name (e.g., "cuda", "vaapi", "dxva2")
|
|
138
|
+
*
|
|
139
|
+
* @returns AVHWDeviceType or AV_HWDEVICE_TYPE_NONE if not found
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```typescript
|
|
143
|
+
* import { HardwareDeviceContext } from 'node-av';
|
|
144
|
+
* import { AV_HWDEVICE_TYPE_NONE } from 'node-av/constants';
|
|
145
|
+
*
|
|
146
|
+
* const type = HardwareDeviceContext.findTypeByName('cuda');
|
|
147
|
+
* if (type !== AV_HWDEVICE_TYPE_NONE) {
|
|
148
|
+
* // CUDA is available
|
|
149
|
+
* }
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
152
|
+
static findTypeByName(name: string): AVHWDeviceType;
|
|
153
|
+
/**
|
|
154
|
+
* Hardware device type.
|
|
155
|
+
*
|
|
156
|
+
* Direct mapping to AVHWDeviceContext->type
|
|
157
|
+
*
|
|
158
|
+
* @readonly
|
|
159
|
+
*/
|
|
160
|
+
get type(): AVHWDeviceType;
|
|
161
|
+
/**
|
|
162
|
+
* Hardware-specific data.
|
|
163
|
+
*
|
|
164
|
+
* Direct mapping to AVHWDeviceContext->hwctx
|
|
165
|
+
*
|
|
166
|
+
* Returns opaque pointer as BigInt for advanced users.
|
|
167
|
+
* @readonly
|
|
168
|
+
*/
|
|
169
|
+
get hwctx(): bigint | null;
|
|
170
|
+
/**
|
|
171
|
+
* Allocate an AVHWDeviceContext for a given hardware type.
|
|
172
|
+
*
|
|
173
|
+
* Allocates the device context structure but doesn't open the device.
|
|
174
|
+
* Must call init() after configuration to finalize.
|
|
175
|
+
*
|
|
176
|
+
* Direct mapping to av_hwdevice_ctx_alloc()
|
|
177
|
+
*
|
|
178
|
+
* @param type - Hardware device type
|
|
179
|
+
*
|
|
180
|
+
* @throws {Error} Memory allocation failure (ENOMEM)
|
|
181
|
+
*
|
|
182
|
+
* @example
|
|
183
|
+
* ```typescript
|
|
184
|
+
* import { HardwareDeviceContext, FFmpegError } from 'node-av';
|
|
185
|
+
* import { AV_HWDEVICE_TYPE_CUDA } from 'node-av/constants';
|
|
186
|
+
*
|
|
187
|
+
* const device = new HardwareDeviceContext();
|
|
188
|
+
* device.alloc(AV_HWDEVICE_TYPE_CUDA);
|
|
189
|
+
* // Configure device properties if needed
|
|
190
|
+
* const ret = device.init();
|
|
191
|
+
* FFmpegError.throwIfError(ret, 'init device');
|
|
192
|
+
* ```
|
|
193
|
+
*
|
|
194
|
+
* @see {@link init} To finalize the device
|
|
195
|
+
* @see {@link create} For one-step device creation
|
|
196
|
+
*/
|
|
197
|
+
alloc(type: AVHWDeviceType): void;
|
|
198
|
+
/**
|
|
199
|
+
* Finalize the device context before use.
|
|
200
|
+
*
|
|
201
|
+
* Completes device initialization after alloc() and configuration.
|
|
202
|
+
* Must be called before using the device context.
|
|
203
|
+
*
|
|
204
|
+
* Direct mapping to av_hwdevice_ctx_init()
|
|
205
|
+
*
|
|
206
|
+
* @returns 0 on success, negative AVERROR on error:
|
|
207
|
+
* - 0: Success (device ready)
|
|
208
|
+
* - AVERROR(EINVAL): Invalid parameters
|
|
209
|
+
* - AVERROR(ENOMEM): Memory allocation failure
|
|
210
|
+
* - <0: Device-specific errors
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* ```typescript
|
|
214
|
+
* import { HardwareDeviceContext, FFmpegError } from 'node-av';
|
|
215
|
+
*
|
|
216
|
+
* const ret = device.init();
|
|
217
|
+
* FFmpegError.throwIfError(ret, 'init device');
|
|
218
|
+
* // Device is now ready for use
|
|
219
|
+
* ```
|
|
220
|
+
*
|
|
221
|
+
* @see {@link alloc} Must be called first
|
|
222
|
+
*/
|
|
223
|
+
init(): number;
|
|
224
|
+
/**
|
|
225
|
+
* Open a device of the specified type and create an AVHWDeviceContext.
|
|
226
|
+
*
|
|
227
|
+
* One-step device creation that allocates, opens, and initializes the device.
|
|
228
|
+
* This is the preferred method for creating hardware devices.
|
|
229
|
+
*
|
|
230
|
+
* Direct mapping to av_hwdevice_ctx_create()
|
|
231
|
+
*
|
|
232
|
+
* @param type - Hardware device type
|
|
233
|
+
* @param device - Device to open (e.g., "/dev/dri/renderD128" for VAAPI), or null for default
|
|
234
|
+
* @param options - Device creation options, or null
|
|
235
|
+
*
|
|
236
|
+
* @returns 0 on success, negative AVERROR on error:
|
|
237
|
+
* - 0: Success (device created and ready)
|
|
238
|
+
* - AVERROR(EINVAL): Invalid parameters
|
|
239
|
+
* - AVERROR(ENOMEM): Memory allocation failure
|
|
240
|
+
* - AVERROR(ENOSYS): Device type not supported
|
|
241
|
+
* - <0: Device-specific errors
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* ```typescript
|
|
245
|
+
* import { HardwareDeviceContext, FFmpegError } from 'node-av';
|
|
246
|
+
* import { AV_HWDEVICE_TYPE_CUDA, AV_HWDEVICE_TYPE_VAAPI } from 'node-av/constants';
|
|
247
|
+
*
|
|
248
|
+
* // Create CUDA device
|
|
249
|
+
* const ret = device.create(AV_HWDEVICE_TYPE_CUDA, null, null);
|
|
250
|
+
* FFmpegError.throwIfError(ret, 'create CUDA device');
|
|
251
|
+
*
|
|
252
|
+
* // Create VAAPI device with specific device
|
|
253
|
+
* const ret2 = device.create(
|
|
254
|
+
* AV_HWDEVICE_TYPE_VAAPI,
|
|
255
|
+
* '/dev/dri/renderD128',
|
|
256
|
+
* null
|
|
257
|
+
* );
|
|
258
|
+
* FFmpegError.throwIfError(ret2, 'create VAAPI device');
|
|
259
|
+
* ```
|
|
260
|
+
*
|
|
261
|
+
* @see {@link alloc} For manual device allocation
|
|
262
|
+
* @see {@link createDerived} To derive from another device
|
|
263
|
+
*/
|
|
264
|
+
create(type: AVHWDeviceType, device?: string | null, options?: Dictionary | null): number;
|
|
265
|
+
/**
|
|
266
|
+
* Create a new device of the specified type from an existing device.
|
|
267
|
+
*
|
|
268
|
+
* Creates a device that shares resources with the source device.
|
|
269
|
+
* Useful for interop between different hardware APIs.
|
|
270
|
+
*
|
|
271
|
+
* Direct mapping to av_hwdevice_ctx_create_derived()
|
|
272
|
+
*
|
|
273
|
+
* @param source - Source device context to derive from
|
|
274
|
+
* @param type - Target hardware device type
|
|
275
|
+
*
|
|
276
|
+
* @returns 0 on success, negative AVERROR on error:
|
|
277
|
+
* - 0: Success (derived device created)
|
|
278
|
+
* - AVERROR(ENOSYS): Derivation not supported
|
|
279
|
+
* - AVERROR(EINVAL): Invalid parameters
|
|
280
|
+
* - <0: Other errors
|
|
281
|
+
*
|
|
282
|
+
* @example
|
|
283
|
+
* ```typescript
|
|
284
|
+
* import { HardwareDeviceContext, FFmpegError } from 'node-av';
|
|
285
|
+
* import { AV_HWDEVICE_TYPE_VAAPI, AV_HWDEVICE_TYPE_CUDA } from 'node-av/constants';
|
|
286
|
+
*
|
|
287
|
+
* // Create CUDA device from VAAPI device
|
|
288
|
+
* const vaapi = new HardwareDeviceContext();
|
|
289
|
+
* const vaapiRet = vaapi.create(AV_HWDEVICE_TYPE_VAAPI, null, null);
|
|
290
|
+
* FFmpegError.throwIfError(vaapiRet, 'create VAAPI');
|
|
291
|
+
*
|
|
292
|
+
* const cuda = new HardwareDeviceContext();
|
|
293
|
+
* const ret = cuda.createDerived(vaapi, AV_HWDEVICE_TYPE_CUDA);
|
|
294
|
+
* FFmpegError.throwIfError(ret, 'derive CUDA from VAAPI');
|
|
295
|
+
* ```
|
|
296
|
+
*
|
|
297
|
+
* @see {@link create} For standalone device creation
|
|
298
|
+
*/
|
|
299
|
+
createDerived(source: HardwareDeviceContext, type: AVHWDeviceType): number;
|
|
300
|
+
/**
|
|
301
|
+
* Free the device context.
|
|
302
|
+
*
|
|
303
|
+
* Unreferences the AVBufferRef and releases all device resources.
|
|
304
|
+
*
|
|
305
|
+
* Direct mapping to av_buffer_unref()
|
|
306
|
+
*
|
|
307
|
+
* @example
|
|
308
|
+
* ```typescript
|
|
309
|
+
* import { HardwareDeviceContext } from 'node-av';
|
|
310
|
+
*
|
|
311
|
+
* device.free();
|
|
312
|
+
* // device is now invalid and should not be used
|
|
313
|
+
* ```
|
|
314
|
+
*/
|
|
315
|
+
free(): void;
|
|
316
|
+
/**
|
|
317
|
+
* Allocate a HW-specific configuration structure.
|
|
318
|
+
*
|
|
319
|
+
* Allocates a configuration structure for querying device constraints.
|
|
320
|
+
*
|
|
321
|
+
* Direct mapping to av_hwdevice_hwconfig_alloc()
|
|
322
|
+
*
|
|
323
|
+
* @returns Opaque pointer as BigInt or null
|
|
324
|
+
*
|
|
325
|
+
* @example
|
|
326
|
+
* ```typescript
|
|
327
|
+
* import { HardwareDeviceContext } from 'node-av';
|
|
328
|
+
*
|
|
329
|
+
* const hwconfig = device.hwconfigAlloc();
|
|
330
|
+
* if (hwconfig) {
|
|
331
|
+
* // Use with getHwframeConstraints
|
|
332
|
+
* const constraints = device.getHwframeConstraints(hwconfig);
|
|
333
|
+
* }
|
|
334
|
+
* ```
|
|
335
|
+
*
|
|
336
|
+
* @see {@link getHwframeConstraints} To use the configuration
|
|
337
|
+
*/
|
|
338
|
+
hwconfigAlloc(): bigint | null;
|
|
339
|
+
/**
|
|
340
|
+
* Get the constraints on HW frames given a device and parameters.
|
|
341
|
+
*
|
|
342
|
+
* Queries the device for supported formats, sizes, and other constraints.
|
|
343
|
+
* Essential for configuring hardware frames contexts.
|
|
344
|
+
*
|
|
345
|
+
* Direct mapping to av_hwdevice_get_hwframe_constraints()
|
|
346
|
+
*
|
|
347
|
+
* @param hwconfig - Hardware configuration from hwconfigAlloc(), or undefined
|
|
348
|
+
*
|
|
349
|
+
* @returns Constraints object or null:
|
|
350
|
+
* - Object: Device constraints
|
|
351
|
+
* - null: No constraints available
|
|
352
|
+
*
|
|
353
|
+
* @example
|
|
354
|
+
* ```typescript
|
|
355
|
+
* import { HardwareDeviceContext } from 'node-av';
|
|
356
|
+
*
|
|
357
|
+
* const constraints = device.getHwframeConstraints();
|
|
358
|
+
* if (constraints) {
|
|
359
|
+
* console.log(`Size range: ${constraints.minWidth}x${constraints.minHeight} to ${constraints.maxWidth}x${constraints.maxHeight}`);
|
|
360
|
+
*
|
|
361
|
+
* if (constraints.validSwFormats) {
|
|
362
|
+
* console.log('Valid software formats:', constraints.validSwFormats);
|
|
363
|
+
* }
|
|
364
|
+
* }
|
|
365
|
+
* ```
|
|
366
|
+
*
|
|
367
|
+
* @see {@link hwconfigAlloc} To create configuration
|
|
368
|
+
* @see {@link HardwareFramesContext} To use with frame pools
|
|
369
|
+
*/
|
|
370
|
+
getHwframeConstraints(hwconfig?: bigint): {
|
|
371
|
+
validHwFormats?: number[];
|
|
372
|
+
validSwFormats?: number[];
|
|
373
|
+
minWidth: number;
|
|
374
|
+
minHeight: number;
|
|
375
|
+
maxWidth: number;
|
|
376
|
+
maxHeight: number;
|
|
377
|
+
} | null;
|
|
378
|
+
/**
|
|
379
|
+
* Get the native FFmpeg AVHWDeviceContext pointer.
|
|
380
|
+
*
|
|
381
|
+
* @internal For use by other wrapper classes
|
|
382
|
+
* @returns The underlying native hardware device context object
|
|
383
|
+
*/
|
|
384
|
+
getNative(): NativeHardwareDeviceContext;
|
|
385
|
+
/**
|
|
386
|
+
* Dispose of the hardware device context.
|
|
387
|
+
*
|
|
388
|
+
* Implements the Disposable interface for automatic cleanup.
|
|
389
|
+
* Equivalent to calling free().
|
|
390
|
+
*
|
|
391
|
+
* @example
|
|
392
|
+
* ```typescript
|
|
393
|
+
* import { HardwareDeviceContext, FFmpegError } from 'node-av';
|
|
394
|
+
* import { AV_HWDEVICE_TYPE_CUDA } from 'node-av/constants';
|
|
395
|
+
*
|
|
396
|
+
* {
|
|
397
|
+
* using device = new HardwareDeviceContext();
|
|
398
|
+
* const ret = device.create(AV_HWDEVICE_TYPE_CUDA, null, null);
|
|
399
|
+
* FFmpegError.throwIfError(ret, 'create device');
|
|
400
|
+
* // ... use device
|
|
401
|
+
* } // Automatically freed when leaving scope
|
|
402
|
+
* ```
|
|
403
|
+
*
|
|
404
|
+
* @see {@link free} For manual cleanup
|
|
405
|
+
*/
|
|
406
|
+
[Symbol.dispose](): void;
|
|
407
|
+
}
|