@revizly/node-av 5.2.2-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BUILD_LINUX.md +61 -0
- package/LICENSE.md +22 -0
- package/README.md +662 -0
- package/build_mac_local.sh +69 -0
- package/dist/api/audio-frame-buffer.d.ts +205 -0
- package/dist/api/audio-frame-buffer.js +287 -0
- package/dist/api/audio-frame-buffer.js.map +1 -0
- package/dist/api/bitstream-filter.d.ts +820 -0
- package/dist/api/bitstream-filter.js +1242 -0
- package/dist/api/bitstream-filter.js.map +1 -0
- package/dist/api/constants.d.ts +44 -0
- package/dist/api/constants.js +45 -0
- package/dist/api/constants.js.map +1 -0
- package/dist/api/data/test_av1.ivf +0 -0
- package/dist/api/data/test_h264.h264 +0 -0
- package/dist/api/data/test_hevc.h265 +0 -0
- package/dist/api/data/test_mjpeg.mjpeg +0 -0
- package/dist/api/data/test_vp8.ivf +0 -0
- package/dist/api/data/test_vp9.ivf +0 -0
- package/dist/api/decoder.d.ts +1088 -0
- package/dist/api/decoder.js +1775 -0
- package/dist/api/decoder.js.map +1 -0
- package/dist/api/demuxer.d.ts +1219 -0
- package/dist/api/demuxer.js +2081 -0
- package/dist/api/demuxer.js.map +1 -0
- package/dist/api/device.d.ts +586 -0
- package/dist/api/device.js +961 -0
- package/dist/api/device.js.map +1 -0
- package/dist/api/encoder.d.ts +1132 -0
- package/dist/api/encoder.js +1988 -0
- package/dist/api/encoder.js.map +1 -0
- package/dist/api/filter-complex.d.ts +821 -0
- package/dist/api/filter-complex.js +1604 -0
- package/dist/api/filter-complex.js.map +1 -0
- package/dist/api/filter-presets.d.ts +1286 -0
- package/dist/api/filter-presets.js +2152 -0
- package/dist/api/filter-presets.js.map +1 -0
- package/dist/api/filter.d.ts +1234 -0
- package/dist/api/filter.js +1976 -0
- package/dist/api/filter.js.map +1 -0
- package/dist/api/fmp4-stream.d.ts +426 -0
- package/dist/api/fmp4-stream.js +739 -0
- package/dist/api/fmp4-stream.js.map +1 -0
- package/dist/api/hardware.d.ts +651 -0
- package/dist/api/hardware.js +1260 -0
- package/dist/api/hardware.js.map +1 -0
- package/dist/api/index.d.ts +17 -0
- package/dist/api/index.js +32 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/io-stream.d.ts +307 -0
- package/dist/api/io-stream.js +282 -0
- package/dist/api/io-stream.js.map +1 -0
- package/dist/api/muxer.d.ts +957 -0
- package/dist/api/muxer.js +2002 -0
- package/dist/api/muxer.js.map +1 -0
- package/dist/api/pipeline.d.ts +607 -0
- package/dist/api/pipeline.js +1145 -0
- package/dist/api/pipeline.js.map +1 -0
- package/dist/api/utilities/async-queue.d.ts +120 -0
- package/dist/api/utilities/async-queue.js +211 -0
- package/dist/api/utilities/async-queue.js.map +1 -0
- package/dist/api/utilities/audio-sample.d.ts +117 -0
- package/dist/api/utilities/audio-sample.js +112 -0
- package/dist/api/utilities/audio-sample.js.map +1 -0
- package/dist/api/utilities/channel-layout.d.ts +76 -0
- package/dist/api/utilities/channel-layout.js +80 -0
- package/dist/api/utilities/channel-layout.js.map +1 -0
- package/dist/api/utilities/electron-shared-texture.d.ts +328 -0
- package/dist/api/utilities/electron-shared-texture.js +503 -0
- package/dist/api/utilities/electron-shared-texture.js.map +1 -0
- package/dist/api/utilities/image.d.ts +207 -0
- package/dist/api/utilities/image.js +213 -0
- package/dist/api/utilities/image.js.map +1 -0
- package/dist/api/utilities/index.d.ts +12 -0
- package/dist/api/utilities/index.js +25 -0
- package/dist/api/utilities/index.js.map +1 -0
- package/dist/api/utilities/media-type.d.ts +49 -0
- package/dist/api/utilities/media-type.js +53 -0
- package/dist/api/utilities/media-type.js.map +1 -0
- package/dist/api/utilities/pixel-format.d.ts +89 -0
- package/dist/api/utilities/pixel-format.js +97 -0
- package/dist/api/utilities/pixel-format.js.map +1 -0
- package/dist/api/utilities/sample-format.d.ts +129 -0
- package/dist/api/utilities/sample-format.js +141 -0
- package/dist/api/utilities/sample-format.js.map +1 -0
- package/dist/api/utilities/scheduler.d.ts +138 -0
- package/dist/api/utilities/scheduler.js +98 -0
- package/dist/api/utilities/scheduler.js.map +1 -0
- package/dist/api/utilities/streaming.d.ts +186 -0
- package/dist/api/utilities/streaming.js +309 -0
- package/dist/api/utilities/streaming.js.map +1 -0
- package/dist/api/utilities/timestamp.d.ts +193 -0
- package/dist/api/utilities/timestamp.js +206 -0
- package/dist/api/utilities/timestamp.js.map +1 -0
- package/dist/api/utilities/whisper-model.d.ts +310 -0
- package/dist/api/utilities/whisper-model.js +528 -0
- package/dist/api/utilities/whisper-model.js.map +1 -0
- package/dist/api/utils.d.ts +19 -0
- package/dist/api/utils.js +39 -0
- package/dist/api/utils.js.map +1 -0
- package/dist/api/whisper.d.ts +324 -0
- package/dist/api/whisper.js +362 -0
- package/dist/api/whisper.js.map +1 -0
- package/dist/constants/channel-layouts.d.ts +53 -0
- package/dist/constants/channel-layouts.js +57 -0
- package/dist/constants/channel-layouts.js.map +1 -0
- package/dist/constants/constants.d.ts +2325 -0
- package/dist/constants/constants.js +1887 -0
- package/dist/constants/constants.js.map +1 -0
- package/dist/constants/decoders.d.ts +633 -0
- package/dist/constants/decoders.js +641 -0
- package/dist/constants/decoders.js.map +1 -0
- package/dist/constants/encoders.d.ts +295 -0
- package/dist/constants/encoders.js +308 -0
- package/dist/constants/encoders.js.map +1 -0
- package/dist/constants/hardware.d.ts +26 -0
- package/dist/constants/hardware.js +27 -0
- package/dist/constants/hardware.js.map +1 -0
- package/dist/constants/index.d.ts +5 -0
- package/dist/constants/index.js +6 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/ffmpeg/index.d.ts +99 -0
- package/dist/ffmpeg/index.js +115 -0
- package/dist/ffmpeg/index.js.map +1 -0
- package/dist/ffmpeg/utils.d.ts +31 -0
- package/dist/ffmpeg/utils.js +68 -0
- package/dist/ffmpeg/utils.js.map +1 -0
- package/dist/ffmpeg/version.d.ts +6 -0
- package/dist/ffmpeg/version.js +7 -0
- package/dist/ffmpeg/version.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/audio-fifo.d.ts +399 -0
- package/dist/lib/audio-fifo.js +431 -0
- package/dist/lib/audio-fifo.js.map +1 -0
- package/dist/lib/binding.d.ts +228 -0
- package/dist/lib/binding.js +60 -0
- package/dist/lib/binding.js.map +1 -0
- package/dist/lib/bitstream-filter-context.d.ts +379 -0
- package/dist/lib/bitstream-filter-context.js +441 -0
- package/dist/lib/bitstream-filter-context.js.map +1 -0
- package/dist/lib/bitstream-filter.d.ts +140 -0
- package/dist/lib/bitstream-filter.js +154 -0
- package/dist/lib/bitstream-filter.js.map +1 -0
- package/dist/lib/codec-context.d.ts +1071 -0
- package/dist/lib/codec-context.js +1354 -0
- package/dist/lib/codec-context.js.map +1 -0
- package/dist/lib/codec-parameters.d.ts +616 -0
- package/dist/lib/codec-parameters.js +761 -0
- package/dist/lib/codec-parameters.js.map +1 -0
- package/dist/lib/codec-parser.d.ts +201 -0
- package/dist/lib/codec-parser.js +213 -0
- package/dist/lib/codec-parser.js.map +1 -0
- package/dist/lib/codec.d.ts +586 -0
- package/dist/lib/codec.js +713 -0
- package/dist/lib/codec.js.map +1 -0
- package/dist/lib/device.d.ts +291 -0
- package/dist/lib/device.js +324 -0
- package/dist/lib/device.js.map +1 -0
- package/dist/lib/dictionary.d.ts +333 -0
- package/dist/lib/dictionary.js +372 -0
- package/dist/lib/dictionary.js.map +1 -0
- package/dist/lib/error.d.ts +242 -0
- package/dist/lib/error.js +303 -0
- package/dist/lib/error.js.map +1 -0
- package/dist/lib/fifo.d.ts +416 -0
- package/dist/lib/fifo.js +453 -0
- package/dist/lib/fifo.js.map +1 -0
- package/dist/lib/filter-context.d.ts +712 -0
- package/dist/lib/filter-context.js +789 -0
- package/dist/lib/filter-context.js.map +1 -0
- package/dist/lib/filter-graph-segment.d.ts +160 -0
- package/dist/lib/filter-graph-segment.js +171 -0
- package/dist/lib/filter-graph-segment.js.map +1 -0
- package/dist/lib/filter-graph.d.ts +641 -0
- package/dist/lib/filter-graph.js +704 -0
- package/dist/lib/filter-graph.js.map +1 -0
- package/dist/lib/filter-inout.d.ts +198 -0
- package/dist/lib/filter-inout.js +257 -0
- package/dist/lib/filter-inout.js.map +1 -0
- package/dist/lib/filter.d.ts +243 -0
- package/dist/lib/filter.js +272 -0
- package/dist/lib/filter.js.map +1 -0
- package/dist/lib/format-context.d.ts +1254 -0
- package/dist/lib/format-context.js +1379 -0
- package/dist/lib/format-context.js.map +1 -0
- package/dist/lib/frame-utils.d.ts +116 -0
- package/dist/lib/frame-utils.js +98 -0
- package/dist/lib/frame-utils.js.map +1 -0
- package/dist/lib/frame.d.ts +1222 -0
- package/dist/lib/frame.js +1435 -0
- package/dist/lib/frame.js.map +1 -0
- package/dist/lib/hardware-device-context.d.ts +362 -0
- package/dist/lib/hardware-device-context.js +383 -0
- package/dist/lib/hardware-device-context.js.map +1 -0
- package/dist/lib/hardware-frames-context.d.ts +419 -0
- package/dist/lib/hardware-frames-context.js +477 -0
- package/dist/lib/hardware-frames-context.js.map +1 -0
- package/dist/lib/index.d.ts +35 -0
- package/dist/lib/index.js +60 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/input-format.d.ts +249 -0
- package/dist/lib/input-format.js +306 -0
- package/dist/lib/input-format.js.map +1 -0
- package/dist/lib/io-context.d.ts +696 -0
- package/dist/lib/io-context.js +769 -0
- package/dist/lib/io-context.js.map +1 -0
- package/dist/lib/log.d.ts +174 -0
- package/dist/lib/log.js +184 -0
- package/dist/lib/log.js.map +1 -0
- package/dist/lib/native-types.d.ts +946 -0
- package/dist/lib/native-types.js +2 -0
- package/dist/lib/native-types.js.map +1 -0
- package/dist/lib/option.d.ts +927 -0
- package/dist/lib/option.js +1583 -0
- package/dist/lib/option.js.map +1 -0
- package/dist/lib/output-format.d.ts +180 -0
- package/dist/lib/output-format.js +213 -0
- package/dist/lib/output-format.js.map +1 -0
- package/dist/lib/packet.d.ts +501 -0
- package/dist/lib/packet.js +590 -0
- package/dist/lib/packet.js.map +1 -0
- package/dist/lib/rational.d.ts +251 -0
- package/dist/lib/rational.js +278 -0
- package/dist/lib/rational.js.map +1 -0
- package/dist/lib/software-resample-context.d.ts +552 -0
- package/dist/lib/software-resample-context.js +592 -0
- package/dist/lib/software-resample-context.js.map +1 -0
- package/dist/lib/software-scale-context.d.ts +344 -0
- package/dist/lib/software-scale-context.js +366 -0
- package/dist/lib/software-scale-context.js.map +1 -0
- package/dist/lib/stream.d.ts +379 -0
- package/dist/lib/stream.js +526 -0
- package/dist/lib/stream.js.map +1 -0
- package/dist/lib/sync-queue.d.ts +179 -0
- package/dist/lib/sync-queue.js +197 -0
- package/dist/lib/sync-queue.js.map +1 -0
- package/dist/lib/types.d.ts +34 -0
- package/dist/lib/types.js +2 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/utilities.d.ts +1127 -0
- package/dist/lib/utilities.js +1225 -0
- package/dist/lib/utilities.js.map +1 -0
- package/dist/utils/electron.d.ts +49 -0
- package/dist/utils/electron.js +63 -0
- package/dist/utils/electron.js.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +5 -0
- package/dist/utils/index.js.map +1 -0
- package/install/check.js +121 -0
- package/install/ffmpeg.js +66 -0
- package/jellyfin-ffmpeg.patch +181 -0
- package/package.json +129 -0
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
import { bindings } from './binding.js';
|
|
2
|
+
import { HardwareDeviceContext } from './hardware-device-context.js';
|
|
3
|
+
/**
|
|
4
|
+
* Hardware frames context for GPU memory management.
|
|
5
|
+
*
|
|
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.
|
|
10
|
+
*
|
|
11
|
+
* Direct mapping to FFmpeg's AVHWFramesContext.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
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';
|
|
17
|
+
*
|
|
18
|
+
* // Create hardware frames context
|
|
19
|
+
* const device = new HardwareDeviceContext();
|
|
20
|
+
* device.create(AV_HWDEVICE_TYPE_CUDA);
|
|
21
|
+
*
|
|
22
|
+
* const frames = new HardwareFramesContext();
|
|
23
|
+
* frames.format = AV_PIX_FMT_CUDA; // Hardware format
|
|
24
|
+
* frames.swFormat = AV_PIX_FMT_NV12; // Software format
|
|
25
|
+
* frames.width = 1920;
|
|
26
|
+
* frames.height = 1080;
|
|
27
|
+
* frames.initialPoolSize = 20; // Pre-allocate 20 frames
|
|
28
|
+
*
|
|
29
|
+
* frames.alloc(device);
|
|
30
|
+
* const ret = frames.init();
|
|
31
|
+
* FFmpegError.throwIfError(ret, 'init');
|
|
32
|
+
*
|
|
33
|
+
* // Allocate hardware frame
|
|
34
|
+
* const hwFrame = new Frame();
|
|
35
|
+
* const ret2 = frames.getBuffer(hwFrame, 0);
|
|
36
|
+
* FFmpegError.throwIfError(ret2, 'getBuffer');
|
|
37
|
+
*
|
|
38
|
+
* // Transfer from CPU to GPU
|
|
39
|
+
* const cpuFrame = new Frame();
|
|
40
|
+
* // ... fill cpuFrame with data ...
|
|
41
|
+
* await frames.transferData(hwFrame, cpuFrame);
|
|
42
|
+
*
|
|
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');
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @see [AVHWFramesContext](https://ffmpeg.org/doxygen/trunk/structAVHWFramesContext.html) - FFmpeg Doxygen
|
|
50
|
+
* @see {@link HardwareDeviceContext} For device management
|
|
51
|
+
* @see {@link Frame} For frame operations
|
|
52
|
+
*/
|
|
53
|
+
export class HardwareFramesContext {
|
|
54
|
+
native;
|
|
55
|
+
_deviceRef; // Cache for device context wrapper
|
|
56
|
+
constructor() {
|
|
57
|
+
this.native = new bindings.HardwareFramesContext();
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Hardware pixel format.
|
|
61
|
+
*
|
|
62
|
+
* The pixel format used for frames in GPU memory.
|
|
63
|
+
* Hardware-specific format like AV_PIX_FMT_CUDA or AV_PIX_FMT_VAAPI.
|
|
64
|
+
*
|
|
65
|
+
* Direct mapping to AVHWFramesContext->format.
|
|
66
|
+
*/
|
|
67
|
+
get format() {
|
|
68
|
+
return this.native.format;
|
|
69
|
+
}
|
|
70
|
+
set format(value) {
|
|
71
|
+
this.native.format = value;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Software pixel format.
|
|
75
|
+
*
|
|
76
|
+
* The pixel format frames are converted to when transferred
|
|
77
|
+
* to system memory. Standard format like AV_PIX_FMT_YUV420P.
|
|
78
|
+
*
|
|
79
|
+
* Direct mapping to AVHWFramesContext->sw_format.
|
|
80
|
+
*/
|
|
81
|
+
get swFormat() {
|
|
82
|
+
return this.native.swFormat;
|
|
83
|
+
}
|
|
84
|
+
set swFormat(value) {
|
|
85
|
+
this.native.swFormat = value;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Frame width.
|
|
89
|
+
*
|
|
90
|
+
* Width of frames in pixels.
|
|
91
|
+
*
|
|
92
|
+
* Direct mapping to AVHWFramesContext->width.
|
|
93
|
+
*/
|
|
94
|
+
get width() {
|
|
95
|
+
return this.native.width;
|
|
96
|
+
}
|
|
97
|
+
set width(value) {
|
|
98
|
+
this.native.width = value;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Frame height.
|
|
102
|
+
*
|
|
103
|
+
* Height of frames in pixels.
|
|
104
|
+
*
|
|
105
|
+
* Direct mapping to AVHWFramesContext->height.
|
|
106
|
+
*/
|
|
107
|
+
get height() {
|
|
108
|
+
return this.native.height;
|
|
109
|
+
}
|
|
110
|
+
set height(value) {
|
|
111
|
+
this.native.height = value;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Initial pool size.
|
|
115
|
+
*
|
|
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.
|
|
120
|
+
*/
|
|
121
|
+
get initialPoolSize() {
|
|
122
|
+
return this.native.initialPoolSize;
|
|
123
|
+
}
|
|
124
|
+
set initialPoolSize(value) {
|
|
125
|
+
this.native.initialPoolSize = value;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Associated hardware device.
|
|
129
|
+
*
|
|
130
|
+
* Reference to the device context this frames context belongs to.
|
|
131
|
+
* Automatically set when calling alloc().
|
|
132
|
+
*
|
|
133
|
+
* Direct mapping to AVHWFramesContext->device_ref.
|
|
134
|
+
*/
|
|
135
|
+
get deviceRef() {
|
|
136
|
+
// Return cached wrapper if we already have one
|
|
137
|
+
if (this._deviceRef !== undefined) {
|
|
138
|
+
return this._deviceRef;
|
|
139
|
+
}
|
|
140
|
+
const native = this.native.deviceRef;
|
|
141
|
+
if (!native) {
|
|
142
|
+
this._deviceRef = null;
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
// Create and cache the wrapper
|
|
146
|
+
const device = Object.create(HardwareDeviceContext.prototype);
|
|
147
|
+
device.native = native;
|
|
148
|
+
this._deviceRef = device;
|
|
149
|
+
return device;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
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().
|
|
158
|
+
*
|
|
159
|
+
* @param device - Hardware device context to use
|
|
160
|
+
*
|
|
161
|
+
* @throws {Error} If allocation fails (ENOMEM)
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```typescript
|
|
165
|
+
* import { AV_PIX_FMT_CUDA, AV_PIX_FMT_NV12 } from 'node-av/constants';
|
|
166
|
+
*
|
|
167
|
+
* const frames = new HardwareFramesContext();
|
|
168
|
+
* frames.format = AV_PIX_FMT_CUDA;
|
|
169
|
+
* frames.swFormat = AV_PIX_FMT_NV12;
|
|
170
|
+
* frames.width = 1920;
|
|
171
|
+
* frames.height = 1080;
|
|
172
|
+
* frames.alloc(device);
|
|
173
|
+
* ```
|
|
174
|
+
*
|
|
175
|
+
* @see {@link init} To initialize after allocation
|
|
176
|
+
*/
|
|
177
|
+
alloc(device) {
|
|
178
|
+
this.native.alloc(device.getNative());
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Initialize hardware frames context.
|
|
182
|
+
*
|
|
183
|
+
* Initializes the frame pool after configuration.
|
|
184
|
+
* Must be called after alloc() and property setup.
|
|
185
|
+
*
|
|
186
|
+
* Direct mapping to av_hwframe_ctx_init().
|
|
187
|
+
*
|
|
188
|
+
* @returns 0 on success, negative AVERROR on error:
|
|
189
|
+
* - AVERROR_EINVAL: Invalid parameters
|
|
190
|
+
* - AVERROR_ENOMEM: Memory allocation failure
|
|
191
|
+
* - AVERROR_ENOSYS: Operation not supported
|
|
192
|
+
* - Hardware-specific errors
|
|
193
|
+
*
|
|
194
|
+
* @example
|
|
195
|
+
* ```typescript
|
|
196
|
+
* import { FFmpegError } from 'node-av';
|
|
197
|
+
*
|
|
198
|
+
* frames.alloc(device);
|
|
199
|
+
* const ret = frames.init();
|
|
200
|
+
* FFmpegError.throwIfError(ret, 'init');
|
|
201
|
+
* ```
|
|
202
|
+
*
|
|
203
|
+
* @see {@link alloc} Must be called first
|
|
204
|
+
*/
|
|
205
|
+
init() {
|
|
206
|
+
return this.native.init();
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Free hardware frames context.
|
|
210
|
+
*
|
|
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.
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* ```typescript
|
|
218
|
+
* frames.free();
|
|
219
|
+
* // Frames context is now invalid
|
|
220
|
+
* ```
|
|
221
|
+
*
|
|
222
|
+
* @see {@link Symbol.dispose} For automatic cleanup
|
|
223
|
+
*/
|
|
224
|
+
free() {
|
|
225
|
+
this.native.free();
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Allocate hardware frame from pool.
|
|
229
|
+
*
|
|
230
|
+
* Gets a frame from the hardware frame pool.
|
|
231
|
+
* The frame will have hardware-backed storage.
|
|
232
|
+
*
|
|
233
|
+
* Direct mapping to av_hwframe_get_buffer().
|
|
234
|
+
*
|
|
235
|
+
* @param frame - Frame to allocate buffer for
|
|
236
|
+
*
|
|
237
|
+
* @param flags - Allocation flags (usually 0)
|
|
238
|
+
*
|
|
239
|
+
* @returns 0 on success, negative AVERROR on error:
|
|
240
|
+
* - AVERROR_ENOMEM: No frames available in pool
|
|
241
|
+
* - AVERROR_EINVAL: Invalid parameters
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* ```typescript
|
|
245
|
+
* import { Frame, FFmpegError } from 'node-av';
|
|
246
|
+
*
|
|
247
|
+
* const hwFrame = new Frame();
|
|
248
|
+
* const ret = frames.getBuffer(hwFrame, 0);
|
|
249
|
+
* FFmpegError.throwIfError(ret, 'getBuffer');
|
|
250
|
+
* // hwFrame now has GPU memory allocated
|
|
251
|
+
* ```
|
|
252
|
+
*
|
|
253
|
+
* @see {@link transferData} To upload data to hardware frame
|
|
254
|
+
*/
|
|
255
|
+
getBuffer(frame, flags) {
|
|
256
|
+
return this.native.getBuffer(frame.getNative(), flags ?? 0);
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Transfer data between hardware and system memory.
|
|
260
|
+
*
|
|
261
|
+
* Copies frame data between GPU and CPU memory.
|
|
262
|
+
* Direction is determined by frame types.
|
|
263
|
+
*
|
|
264
|
+
* Direct mapping to av_hwframe_transfer_data().
|
|
265
|
+
*
|
|
266
|
+
* @param dst - Destination frame
|
|
267
|
+
*
|
|
268
|
+
* @param src - Source frame
|
|
269
|
+
*
|
|
270
|
+
* @param flags - Transfer flags (usually 0)
|
|
271
|
+
*
|
|
272
|
+
* @returns 0 on success, negative AVERROR on error:
|
|
273
|
+
* - AVERROR_EINVAL: Invalid parameters
|
|
274
|
+
* - AVERROR_ENOSYS: Transfer not supported
|
|
275
|
+
* - AVERROR_ENOMEM: Memory allocation failure
|
|
276
|
+
*
|
|
277
|
+
* @example
|
|
278
|
+
* ```typescript
|
|
279
|
+
* import { FFmpegError } from 'node-av';
|
|
280
|
+
*
|
|
281
|
+
* // Upload: CPU -> GPU
|
|
282
|
+
* const cpuFrame = new Frame();
|
|
283
|
+
* // ... fill cpuFrame with data ...
|
|
284
|
+
* const hwFrame = new Frame();
|
|
285
|
+
* frames.getBuffer(hwFrame, 0);
|
|
286
|
+
* const ret = await frames.transferData(hwFrame, cpuFrame);
|
|
287
|
+
* FFmpegError.throwIfError(ret, 'transferData');
|
|
288
|
+
*
|
|
289
|
+
* // Download: GPU -> CPU
|
|
290
|
+
* const downloadFrame = new Frame();
|
|
291
|
+
* const ret2 = await frames.transferData(downloadFrame, hwFrame);
|
|
292
|
+
* FFmpegError.throwIfError(ret2, 'transferData');
|
|
293
|
+
* ```
|
|
294
|
+
*
|
|
295
|
+
* @see {@link getBuffer} To allocate hardware frame
|
|
296
|
+
* @see {@link map} For zero-copy access
|
|
297
|
+
*/
|
|
298
|
+
async transferData(dst, src, flags) {
|
|
299
|
+
return await this.native.transferData(dst.getNative(), src.getNative(), flags ?? 0);
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Transfer frame between hardware and system memory synchronously.
|
|
303
|
+
* Synchronous version of transferData.
|
|
304
|
+
*
|
|
305
|
+
* Copies frame data between GPU and CPU memory.
|
|
306
|
+
* Direction depends on frame types (hardware vs software).
|
|
307
|
+
*
|
|
308
|
+
* Direct mapping to av_hwframe_transfer_data().
|
|
309
|
+
*
|
|
310
|
+
* @param dst - Destination frame
|
|
311
|
+
*
|
|
312
|
+
* @param src - Source frame
|
|
313
|
+
*
|
|
314
|
+
* @param flags - Transfer flags (currently unused, pass 0)
|
|
315
|
+
*
|
|
316
|
+
* @returns 0 on success, negative AVERROR on error:
|
|
317
|
+
* - AVERROR_EINVAL: Invalid frames
|
|
318
|
+
* - AVERROR_ENOSYS: Operation not supported
|
|
319
|
+
* - AVERROR_ENOMEM: Memory allocation failure
|
|
320
|
+
*
|
|
321
|
+
* @example
|
|
322
|
+
* ```typescript
|
|
323
|
+
* import { Frame, FFmpegError } from 'node-av';
|
|
324
|
+
*
|
|
325
|
+
* // Download from GPU to CPU
|
|
326
|
+
* const cpuFrame = new Frame();
|
|
327
|
+
* cpuFrame.format = frames.swFormat;
|
|
328
|
+
* cpuFrame.width = frames.width;
|
|
329
|
+
* cpuFrame.height = frames.height;
|
|
330
|
+
* cpuFrame.allocBuffer();
|
|
331
|
+
*
|
|
332
|
+
* const ret = frames.transferDataSync(cpuFrame, hwFrame);
|
|
333
|
+
* FFmpegError.throwIfError(ret, 'transferDataSync');
|
|
334
|
+
*
|
|
335
|
+
* // Upload from CPU to GPU
|
|
336
|
+
* const ret2 = frames.transferDataSync(hwFrame, cpuFrame);
|
|
337
|
+
* FFmpegError.throwIfError(ret2, 'transferDataSync');
|
|
338
|
+
* ```
|
|
339
|
+
*
|
|
340
|
+
* @see {@link transferData} For async version
|
|
341
|
+
*/
|
|
342
|
+
transferDataSync(dst, src, flags) {
|
|
343
|
+
return this.native.transferDataSync(dst.getNative(), src.getNative(), flags ?? 0);
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Get supported transfer formats.
|
|
347
|
+
*
|
|
348
|
+
* Returns pixel formats supported for frame transfer
|
|
349
|
+
* in the specified direction.
|
|
350
|
+
*
|
|
351
|
+
* Direct mapping to av_hwframe_transfer_get_formats().
|
|
352
|
+
*
|
|
353
|
+
* @param direction - Transfer direction (FROM/TO hardware)
|
|
354
|
+
*
|
|
355
|
+
* @returns Array of supported formats, or error code:
|
|
356
|
+
* - AVERROR_ENOSYS: Query not supported
|
|
357
|
+
* - AVERROR_ENOMEM: Memory allocation failure
|
|
358
|
+
*
|
|
359
|
+
* @example
|
|
360
|
+
* ```typescript
|
|
361
|
+
* import { AV_HWFRAME_TRANSFER_DIRECTION_FROM } from 'node-av/constants';
|
|
362
|
+
*
|
|
363
|
+
* const formats = frames.transferGetFormats(AV_HWFRAME_TRANSFER_DIRECTION_FROM);
|
|
364
|
+
* if (Array.isArray(formats)) {
|
|
365
|
+
* console.log('Supported download formats:', formats);
|
|
366
|
+
* } else {
|
|
367
|
+
* console.error('Error querying formats:', formats);
|
|
368
|
+
* }
|
|
369
|
+
* ```
|
|
370
|
+
*/
|
|
371
|
+
transferGetFormats(direction) {
|
|
372
|
+
return this.native.transferGetFormats(direction);
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Map hardware frame to system memory.
|
|
376
|
+
*
|
|
377
|
+
* Creates a mapping of hardware frame data accessible from CPU.
|
|
378
|
+
* More efficient than transferData() for read-only access.
|
|
379
|
+
*
|
|
380
|
+
* Direct mapping to av_hwframe_map().
|
|
381
|
+
*
|
|
382
|
+
* @param dst - Destination frame for mapped data
|
|
383
|
+
*
|
|
384
|
+
* @param src - Hardware frame to map
|
|
385
|
+
*
|
|
386
|
+
* @param flags - Mapping flags (AV_HWFRAME_MAP_*)
|
|
387
|
+
*
|
|
388
|
+
* @returns 0 on success, negative AVERROR on error:
|
|
389
|
+
* - AVERROR_EINVAL: Invalid parameters
|
|
390
|
+
* - AVERROR_ENOSYS: Mapping not supported
|
|
391
|
+
*
|
|
392
|
+
* @example
|
|
393
|
+
* ```typescript
|
|
394
|
+
* import { FFmpegError } from 'node-av';
|
|
395
|
+
* import { AV_HWFRAME_MAP_READ } from 'node-av/constants';
|
|
396
|
+
*
|
|
397
|
+
* const mappedFrame = new Frame();
|
|
398
|
+
* const ret = frames.map(mappedFrame, hwFrame, AV_HWFRAME_MAP_READ);
|
|
399
|
+
* FFmpegError.throwIfError(ret, 'map');
|
|
400
|
+
* // Can now read hwFrame data through mappedFrame
|
|
401
|
+
* ```
|
|
402
|
+
*
|
|
403
|
+
* @see {@link transferData} For full data copy
|
|
404
|
+
*/
|
|
405
|
+
map(dst, src, flags) {
|
|
406
|
+
return this.native.map(dst.getNative(), src.getNative(), flags ?? 0);
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Create derived frames context.
|
|
410
|
+
*
|
|
411
|
+
* Creates a new frames context derived from another,
|
|
412
|
+
* potentially on a different device.
|
|
413
|
+
*
|
|
414
|
+
* Direct mapping to av_hwframe_ctx_create_derived().
|
|
415
|
+
*
|
|
416
|
+
* @param format - Pixel format for derived frames
|
|
417
|
+
*
|
|
418
|
+
* @param derivedDevice - Target device context
|
|
419
|
+
*
|
|
420
|
+
* @param source - Source frames context
|
|
421
|
+
*
|
|
422
|
+
* @param flags - Creation flags
|
|
423
|
+
*
|
|
424
|
+
* @returns 0 on success, negative AVERROR on error:
|
|
425
|
+
* - AVERROR_EINVAL: Invalid parameters
|
|
426
|
+
* - AVERROR_ENOSYS: Derivation not supported
|
|
427
|
+
* - AVERROR_ENOMEM: Memory allocation failure
|
|
428
|
+
*
|
|
429
|
+
* @example
|
|
430
|
+
* ```typescript
|
|
431
|
+
* import { FFmpegError } from 'node-av';
|
|
432
|
+
* import { AV_PIX_FMT_VULKAN } from 'node-av/constants';
|
|
433
|
+
*
|
|
434
|
+
* const derivedFrames = new HardwareFramesContext();
|
|
435
|
+
* const ret = derivedFrames.createDerived(
|
|
436
|
+
* AV_PIX_FMT_VULKAN,
|
|
437
|
+
* vulkanDevice,
|
|
438
|
+
* cudaFrames,
|
|
439
|
+
* 0
|
|
440
|
+
* );
|
|
441
|
+
* FFmpegError.throwIfError(ret, 'createDerived');
|
|
442
|
+
* ```
|
|
443
|
+
*/
|
|
444
|
+
createDerived(format, derivedDevice, source, flags) {
|
|
445
|
+
return this.native.createDerived(format, derivedDevice.getNative(), source.native, flags ?? 0);
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Get the underlying native HardwareFramesContext object.
|
|
449
|
+
*
|
|
450
|
+
* @returns The native HardwareFramesContext binding object
|
|
451
|
+
*
|
|
452
|
+
* @internal
|
|
453
|
+
*/
|
|
454
|
+
getNative() {
|
|
455
|
+
return this.native;
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Dispose of the hardware frames context.
|
|
459
|
+
*
|
|
460
|
+
* Implements the Disposable interface for automatic cleanup.
|
|
461
|
+
* Equivalent to calling free().
|
|
462
|
+
*
|
|
463
|
+
* @example
|
|
464
|
+
* ```typescript
|
|
465
|
+
* {
|
|
466
|
+
* using frames = new HardwareFramesContext();
|
|
467
|
+
* frames.alloc(device);
|
|
468
|
+
* frames.init();
|
|
469
|
+
* // Use frames...
|
|
470
|
+
* } // Automatically freed when leaving scope
|
|
471
|
+
* ```
|
|
472
|
+
*/
|
|
473
|
+
[Symbol.dispose]() {
|
|
474
|
+
this.native[Symbol.dispose]();
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
//# sourceMappingURL=hardware-frames-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hardware-frames-context.js","sourceRoot":"","sources":["../../src/lib/hardware-frames-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,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CAAC,OAAO,CAAC,EAAE,CAAC;IAChC,CAAC;CACF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type * from './types.js';
|
|
2
|
+
export { FormatContext } from './format-context.js';
|
|
3
|
+
export { CodecContext } from './codec-context.js';
|
|
4
|
+
export { CodecParameters } from './codec-parameters.js';
|
|
5
|
+
export { Codec, type CodecProfile } from './codec.js';
|
|
6
|
+
export { CodecParser } from './codec-parser.js';
|
|
7
|
+
export { Packet } from './packet.js';
|
|
8
|
+
export { Frame, type AudioFrame, type D3D11TextureFrame, type DmaBufFrame, type DmaBufPlanes, type IOSurfaceFrame, type VideoFrame } from './frame.js';
|
|
9
|
+
export { Stream } from './stream.js';
|
|
10
|
+
export { InputFormat } from './input-format.js';
|
|
11
|
+
export { OutputFormat } from './output-format.js';
|
|
12
|
+
export { HardwareDeviceContext } from './hardware-device-context.js';
|
|
13
|
+
export { HardwareFramesContext } from './hardware-frames-context.js';
|
|
14
|
+
export { SoftwareScaleContext } from './software-scale-context.js';
|
|
15
|
+
export { SoftwareResampleContext } from './software-resample-context.js';
|
|
16
|
+
export { AudioFifo } from './audio-fifo.js';
|
|
17
|
+
export { Fifo } from './fifo.js';
|
|
18
|
+
export { FrameUtils, type ImageCrop, type ImageFormat, type ImageOptions, type ImageOutputFormat, type ImageResize } from './frame-utils.js';
|
|
19
|
+
export { IOContext } from './io-context.js';
|
|
20
|
+
export { Dictionary } from './dictionary.js';
|
|
21
|
+
export { Option, OptionInfo, type OptionMember } from './option.js';
|
|
22
|
+
export { SyncQueue, SyncQueueType } from './sync-queue.js';
|
|
23
|
+
export { FilterContext } from './filter-context.js';
|
|
24
|
+
export { FilterGraphSegment } from './filter-graph-segment.js';
|
|
25
|
+
export { FilterGraph } from './filter-graph.js';
|
|
26
|
+
export { FilterInOut } from './filter-inout.js';
|
|
27
|
+
export { Filter, type FilterPad } from './filter.js';
|
|
28
|
+
export { BitStreamFilterContext } from './bitstream-filter-context.js';
|
|
29
|
+
export { BitStreamFilter } from './bitstream-filter.js';
|
|
30
|
+
export { Rational } from './rational.js';
|
|
31
|
+
export { Log, type LogOptions } from './log.js';
|
|
32
|
+
export { Device, type AudioDeviceInfo, type AudioDeviceMode, type BaseDeviceInfo, type DeviceInfo, type DeviceMode, type ScreenBounds, type ScreenDeviceInfo, type VideoDeviceInfo, } from './device.js';
|
|
33
|
+
export { FFmpegError, PosixError } from './error.js';
|
|
34
|
+
export * from './utilities.js';
|
|
35
|
+
export type { OptionCapableObject } from './binding.js';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// Format Context
|
|
2
|
+
export { FormatContext } from './format-context.js';
|
|
3
|
+
// Codec Context
|
|
4
|
+
export { CodecContext } from './codec-context.js';
|
|
5
|
+
// Codec Parameters
|
|
6
|
+
export { CodecParameters } from './codec-parameters.js';
|
|
7
|
+
// Codec
|
|
8
|
+
export { Codec } from './codec.js';
|
|
9
|
+
// Codec Parser
|
|
10
|
+
export { CodecParser } from './codec-parser.js';
|
|
11
|
+
// Packet
|
|
12
|
+
export { Packet } from './packet.js';
|
|
13
|
+
// Frame
|
|
14
|
+
export { Frame } from './frame.js';
|
|
15
|
+
// Stream
|
|
16
|
+
export { Stream } from './stream.js';
|
|
17
|
+
// Input/Output Format
|
|
18
|
+
export { InputFormat } from './input-format.js';
|
|
19
|
+
export { OutputFormat } from './output-format.js';
|
|
20
|
+
// Hardware related classes
|
|
21
|
+
export { HardwareDeviceContext } from './hardware-device-context.js';
|
|
22
|
+
export { HardwareFramesContext } from './hardware-frames-context.js';
|
|
23
|
+
// Software Scale
|
|
24
|
+
export { SoftwareScaleContext } from './software-scale-context.js';
|
|
25
|
+
// Software Resample
|
|
26
|
+
export { SoftwareResampleContext } from './software-resample-context.js';
|
|
27
|
+
// Audio FIFO
|
|
28
|
+
export { AudioFifo } from './audio-fifo.js';
|
|
29
|
+
// Generic FIFO
|
|
30
|
+
export { Fifo } from './fifo.js';
|
|
31
|
+
// Frame Utils
|
|
32
|
+
export { FrameUtils } from './frame-utils.js';
|
|
33
|
+
// I/O Context
|
|
34
|
+
export { IOContext } from './io-context.js';
|
|
35
|
+
// Dictionary
|
|
36
|
+
export { Dictionary } from './dictionary.js';
|
|
37
|
+
// Option
|
|
38
|
+
export { Option, OptionInfo } from './option.js';
|
|
39
|
+
// Sync Queue
|
|
40
|
+
export { SyncQueue, SyncQueueType } from './sync-queue.js';
|
|
41
|
+
// Filter related classes
|
|
42
|
+
export { FilterContext } from './filter-context.js';
|
|
43
|
+
export { FilterGraphSegment } from './filter-graph-segment.js';
|
|
44
|
+
export { FilterGraph } from './filter-graph.js';
|
|
45
|
+
export { FilterInOut } from './filter-inout.js';
|
|
46
|
+
export { Filter } from './filter.js';
|
|
47
|
+
// Bitstream Filter related classes
|
|
48
|
+
export { BitStreamFilterContext } from './bitstream-filter-context.js';
|
|
49
|
+
export { BitStreamFilter } from './bitstream-filter.js';
|
|
50
|
+
// Utils
|
|
51
|
+
export { Rational } from './rational.js';
|
|
52
|
+
// Logging
|
|
53
|
+
export { Log } from './log.js';
|
|
54
|
+
// Device
|
|
55
|
+
export { Device, } from './device.js';
|
|
56
|
+
// Error handling
|
|
57
|
+
export { FFmpegError, PosixError } from './error.js';
|
|
58
|
+
// Utilities
|
|
59
|
+
export * from './utilities.js';
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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,EAAqB,MAAM,YAAY,CAAC;AAEtD,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,mB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