@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 @@
|
|
|
1
|
+
{"version":3,"file":"hardware.js","sourceRoot":"","sources":["../../src/api/hardware.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EACL,uCAAuC,EACvC,uCAAuC,EACvC,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,E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Callbacks } from './io-stream.js';
|
|
2
|
+
export { Demuxer, type AudioRawData, type DemuxerOptions, type RTPDemuxer, type VideoRawData } from './demuxer.js';
|
|
3
|
+
export { Muxer, type MuxerOptions } from './muxer.js';
|
|
4
|
+
export { Decoder, type DecoderOptions } from './decoder.js';
|
|
5
|
+
export { Encoder, type EncoderOptions } from './encoder.js';
|
|
6
|
+
export { AudioFrameBuffer } from './audio-frame-buffer.js';
|
|
7
|
+
export { HardwareContext, type BaseCodecName, type HardwareOptions } from './hardware.js';
|
|
8
|
+
export { DeviceAPI, type CameraOptions, type DeviceOptions, type MicrophoneOptions, type ScreenCaptureOptions } from './device.js';
|
|
9
|
+
export { FilterComplexAPI, type FilterComplexInput, type FilterComplexOutput } from './filter-complex.js';
|
|
10
|
+
export { FilterPreset, type FilterSupport } from './filter-presets.js';
|
|
11
|
+
export { FilterAPI, type FilterOptions } from './filter.js';
|
|
12
|
+
export { BitStreamFilterAPI, type BitstreamFilterOptions } from './bitstream-filter.js';
|
|
13
|
+
export { pipeline, type NamedInputs, type NamedOutputs, type NamedStages, type PipelineControl, type PipelineOptions, type StreamName } from './pipeline.js';
|
|
14
|
+
export { FMP4_CODECS, FMP4Stream, type FMP4Data, type FMP4Fragment, type FMP4StreamOptions, type MP4Box, type MP4BoxType } from './fmp4-stream.js';
|
|
15
|
+
export { WhisperTranscriber, type WhisperSegment, type WhisperTranscriberOptions } from './whisper.js';
|
|
16
|
+
export * from './utilities/index.js';
|
|
17
|
+
export * from './utils.js';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// IOStream
|
|
2
|
+
export { IOStream } from './io-stream.js';
|
|
3
|
+
// Demuxer
|
|
4
|
+
export { Demuxer } from './demuxer.js';
|
|
5
|
+
// Muxer
|
|
6
|
+
export { Muxer } from './muxer.js';
|
|
7
|
+
// Decoder
|
|
8
|
+
export { Decoder } from './decoder.js';
|
|
9
|
+
// Encoder
|
|
10
|
+
export { Encoder } from './encoder.js';
|
|
11
|
+
// AudioFrameBuffer
|
|
12
|
+
export { AudioFrameBuffer } from './audio-frame-buffer.js';
|
|
13
|
+
// Hardware
|
|
14
|
+
export { HardwareContext } from './hardware.js';
|
|
15
|
+
// Device
|
|
16
|
+
export { DeviceAPI } from './device.js';
|
|
17
|
+
// Filter
|
|
18
|
+
export { FilterComplexAPI } from './filter-complex.js';
|
|
19
|
+
export { FilterPreset } from './filter-presets.js';
|
|
20
|
+
export { FilterAPI } from './filter.js';
|
|
21
|
+
// BitStreamFilter
|
|
22
|
+
export { BitStreamFilterAPI } from './bitstream-filter.js';
|
|
23
|
+
// Pipeline
|
|
24
|
+
export { pipeline } from './pipeline.js';
|
|
25
|
+
// fMP4 Stream
|
|
26
|
+
export { FMP4_CODECS, FMP4Stream } from './fmp4-stream.js';
|
|
27
|
+
// Whisper Transcriber
|
|
28
|
+
export { WhisperTranscriber } from './whisper.js';
|
|
29
|
+
// Utilities
|
|
30
|
+
export * from './utilities/index.js';
|
|
31
|
+
export * from './utils.js';
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,WAAW;AACX,OAAO,EAAE,QAAQ,EAAiD,MAAM,gBAAgB,CAAC;AAEzF,UAAU;AACV,OAAO,EAAE,OAAO,EAA8E,MAAM,cAAc,CAAC;AAEnH,QAAQ;AACR,OAAO,EAAE,KAAK,EAAqB,MAAM,YAAY,CAAC;AAEtD,UAAU;AACV,OAAO,EAAE,OAAO,EAAuB,MAAM,cAAc,CAAC;AAE5D,UAAU;AACV,OAAO,EAAE,OAAO,EAAuB,MAAM,cAAc,CAAC;AAE5D,mBAAmB;AACnB,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,WAAW;AACX,OAAO,EAAE,eAAe,EAA4C,MAAM,eAAe,CAAC;AAE1F,SAAS;AACT,OAAO,EAAE,SAAS,EAA6F,MAAM,aAAa,CAAC;AAEnI,SAAS;AACT,OAAO,EAAE,gBAAgB,EAAqD,MAAM,qBAAqB,CAAC;AAC1G,OAAO,EAAE,YAAY,EAAsB,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,SAAS,EAAsB,MAAM,aAAa,CAAC;AAE5D,kBAAkB;AAClB,OAAO,EAAE,kBAAkB,EAA+B,MAAM,uBAAuB,CAAC;AAExF,WAAW;AACX,OAAO,EAAE,QAAQ,EAAsH,MAAM,eAAe,CAAC;AAE7J,cAAc;AACd,OAAO,EAAE,WAAW,EAAE,UAAU,EAA0F,MAAM,kBAAkB,CAAC;AAEnJ,sBAAsB;AACtB,OAAO,EAAE,kBAAkB,EAAuD,MAAM,cAAc,CAAC;AAEvG,YAAY;AACZ,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import { Readable } from 'node:stream';
|
|
2
|
+
import { IOContext } from '../lib/index.js';
|
|
3
|
+
import type { Writable } from 'node:stream';
|
|
4
|
+
import type { AVSeekWhence } from '../constants/index.js';
|
|
5
|
+
import type { DemuxerOptions } from './demuxer.js';
|
|
6
|
+
import type { MuxerOptions } from './muxer.js';
|
|
7
|
+
/**
|
|
8
|
+
* Custom I/O callbacks for implementing custom input sources.
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
export interface IOInputCallbacks {
|
|
12
|
+
/**
|
|
13
|
+
* Read callback - called when FFmpeg needs to read data.
|
|
14
|
+
*
|
|
15
|
+
* Can be synchronous or async (return a Promise).
|
|
16
|
+
*
|
|
17
|
+
* @param size - Number of bytes to read
|
|
18
|
+
*
|
|
19
|
+
* @returns Buffer with data, null for EOF, negative error code, or Promise resolving to same
|
|
20
|
+
*/
|
|
21
|
+
read: (size: number) => Buffer | null | number | Promise<Buffer | null | number>;
|
|
22
|
+
/**
|
|
23
|
+
* Seek callback - called when FFmpeg needs to seek in the stream.
|
|
24
|
+
*
|
|
25
|
+
* Can be synchronous or async (return a Promise).
|
|
26
|
+
*
|
|
27
|
+
* @param offset - Offset to seek to
|
|
28
|
+
*
|
|
29
|
+
* @param whence - Seek origin (AVSEEK_SET, AVSEEK_CUR, AVSEEK_END, or AVSEEK_SIZE)
|
|
30
|
+
*
|
|
31
|
+
* @returns New position, negative error code, or Promise resolving to same
|
|
32
|
+
*/
|
|
33
|
+
seek?: (offset: bigint, whence: AVSeekWhence) => bigint | number | Promise<bigint | number>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Custom I/O callbacks for implementing custom output targets.
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
export interface IOOutputCallbacks {
|
|
40
|
+
/**
|
|
41
|
+
* Write callback - called when FFmpeg needs to write data.
|
|
42
|
+
*
|
|
43
|
+
* Can be synchronous or async (return a Promise).
|
|
44
|
+
* The buffer may be reused by FFmpeg after the callback completes,
|
|
45
|
+
* so copy it if you need to keep the data.
|
|
46
|
+
*
|
|
47
|
+
* @param buffer - Buffer containing data to write
|
|
48
|
+
*
|
|
49
|
+
* @returns Number of bytes written, void (assumes all bytes written), or Promise resolving to same
|
|
50
|
+
*/
|
|
51
|
+
write: (buffer: Buffer) => number | void | Promise<number | void>;
|
|
52
|
+
/**
|
|
53
|
+
* Seek callback - called when FFmpeg needs to seek in the output.
|
|
54
|
+
*
|
|
55
|
+
* Can be synchronous or async (return a Promise).
|
|
56
|
+
*
|
|
57
|
+
* @param offset - Offset to seek to
|
|
58
|
+
*
|
|
59
|
+
* @param whence - Seek origin (AVSEEK_SET, AVSEEK_CUR, AVSEEK_END)
|
|
60
|
+
*
|
|
61
|
+
* @returns New position, negative error code, or Promise resolving to same
|
|
62
|
+
*/
|
|
63
|
+
seek?: (offset: bigint, whence: AVSeekWhence) => bigint | number | Promise<bigint | number>;
|
|
64
|
+
/**
|
|
65
|
+
* Read callback - some formats may need to read back data.
|
|
66
|
+
*
|
|
67
|
+
* Can be synchronous or async (return a Promise).
|
|
68
|
+
*
|
|
69
|
+
* @param size - Number of bytes to read
|
|
70
|
+
*
|
|
71
|
+
* @returns Buffer with data, null for EOF, negative error code, or Promise resolving to same
|
|
72
|
+
*/
|
|
73
|
+
read?: (size: number) => Buffer | null | number | Promise<Buffer | null | number>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Factory for creating custom I/O contexts.
|
|
77
|
+
*
|
|
78
|
+
* Provides simplified creation of I/O contexts from buffers or custom callbacks.
|
|
79
|
+
* Handles buffer management and seek operations for in-memory media.
|
|
80
|
+
* Bridges the gap between high-level media operations and custom I/O sources.
|
|
81
|
+
* Essential for processing media from non-file sources like network streams or memory.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```typescript
|
|
85
|
+
* import { IOStream, Demuxer } from 'node-av/api';
|
|
86
|
+
*
|
|
87
|
+
* // From buffer
|
|
88
|
+
* const buffer = await fs.readFile('video.mp4');
|
|
89
|
+
* const ioContext = IOStream.create(buffer);
|
|
90
|
+
* const input = await Demuxer.open(buffer);
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```typescript
|
|
95
|
+
* // Custom I/O callbacks
|
|
96
|
+
* const callbacks = {
|
|
97
|
+
* read: async (size: number) => {
|
|
98
|
+
* // Read from custom source
|
|
99
|
+
* return Buffer.alloc(size);
|
|
100
|
+
* },
|
|
101
|
+
* seek: async (offset: bigint, whence: AVSeekWhence) => {
|
|
102
|
+
* // Seek in custom source
|
|
103
|
+
* return offset;
|
|
104
|
+
* }
|
|
105
|
+
* };
|
|
106
|
+
*
|
|
107
|
+
* const ioContext = IOStream.create(callbacks, {
|
|
108
|
+
* bufferSize: 4096
|
|
109
|
+
* });
|
|
110
|
+
* ```
|
|
111
|
+
*
|
|
112
|
+
* @see {@link IOContext} For low-level I/O operations
|
|
113
|
+
* @see {@link Demuxer} For using I/O contexts
|
|
114
|
+
* @see {@link IOInputCallbacks} For callback interface
|
|
115
|
+
*/
|
|
116
|
+
export declare class IOStream {
|
|
117
|
+
/**
|
|
118
|
+
* Create I/O context from buffer.
|
|
119
|
+
*
|
|
120
|
+
* Creates an I/O context from an in-memory buffer for reading media data.
|
|
121
|
+
* Automatically handles seek operations and position tracking.
|
|
122
|
+
*
|
|
123
|
+
* @param buffer - Buffer containing media data
|
|
124
|
+
*
|
|
125
|
+
* @param options - I/O configuration options
|
|
126
|
+
*
|
|
127
|
+
* @returns Configured I/O context
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```typescript
|
|
131
|
+
* const buffer = await fs.readFile('video.mp4');
|
|
132
|
+
* const ioContext = IOStream.create(buffer, {
|
|
133
|
+
* bufferSize: 8192
|
|
134
|
+
* });
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
static create(buffer: Buffer, options?: DemuxerOptions): IOContext;
|
|
138
|
+
/**
|
|
139
|
+
* Create I/O context from callbacks.
|
|
140
|
+
*
|
|
141
|
+
* Creates an I/O context using custom read and seek callbacks.
|
|
142
|
+
* Useful for streaming from non-file sources like network or custom storage.
|
|
143
|
+
*
|
|
144
|
+
* @param callbacks - I/O callbacks for read and seek operations
|
|
145
|
+
*
|
|
146
|
+
* @param options - I/O configuration options
|
|
147
|
+
*
|
|
148
|
+
* @returns Configured I/O context
|
|
149
|
+
*
|
|
150
|
+
* @throws {Error} If callbacks missing required read function
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* ```typescript
|
|
154
|
+
* const ioContext = IOStream.create({
|
|
155
|
+
* read: async (size) => {
|
|
156
|
+
* return await customSource.read(size);
|
|
157
|
+
* },
|
|
158
|
+
* seek: async (offset, whence) => {
|
|
159
|
+
* return await customSource.seek(offset, whence);
|
|
160
|
+
* }
|
|
161
|
+
* });
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
static create(callbacks: IOInputCallbacks, options?: DemuxerOptions): IOContext;
|
|
165
|
+
/**
|
|
166
|
+
* Create I/O context from a Node.js Readable stream.
|
|
167
|
+
*
|
|
168
|
+
* Creates an I/O context that reads from a Readable stream.
|
|
169
|
+
* Seeking is not supported for streams.
|
|
170
|
+
*
|
|
171
|
+
* @param stream - Node.js Readable stream
|
|
172
|
+
*
|
|
173
|
+
* @param options - I/O configuration options
|
|
174
|
+
*
|
|
175
|
+
* @returns Configured I/O context
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* ```typescript
|
|
179
|
+
* const readable = fs.createReadStream('video.mkv');
|
|
180
|
+
* const ioContext = IOStream.create(readable, { format: 'matroska' });
|
|
181
|
+
* ```
|
|
182
|
+
*/
|
|
183
|
+
static create(stream: Readable, options?: DemuxerOptions): IOContext;
|
|
184
|
+
/**
|
|
185
|
+
* Create I/O context for writing to a Node.js Writable stream.
|
|
186
|
+
*
|
|
187
|
+
* Creates a write-mode I/O context from a Writable stream with
|
|
188
|
+
* backpressure support and automatic buffer copying.
|
|
189
|
+
* Seeking is not supported for streams.
|
|
190
|
+
*
|
|
191
|
+
* @param stream - Node.js Writable stream
|
|
192
|
+
*
|
|
193
|
+
* @param options - Output configuration options
|
|
194
|
+
*
|
|
195
|
+
* @returns Configured I/O context
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* ```typescript
|
|
199
|
+
* const writable = fs.createWriteStream('output.mkv');
|
|
200
|
+
* const ioContext = IOStream.createOutput(writable, { format: 'matroska' });
|
|
201
|
+
* ```
|
|
202
|
+
*/
|
|
203
|
+
static createOutput(stream: Writable, options?: MuxerOptions): IOContext;
|
|
204
|
+
/**
|
|
205
|
+
* Create I/O context from custom output callbacks.
|
|
206
|
+
*
|
|
207
|
+
* Creates a write-mode I/O context using custom write, optional seek,
|
|
208
|
+
* and optional read callbacks.
|
|
209
|
+
*
|
|
210
|
+
* @param callbacks - I/O callbacks for write, seek, and read operations
|
|
211
|
+
*
|
|
212
|
+
* @param options - Output configuration options
|
|
213
|
+
*
|
|
214
|
+
* @returns Configured I/O context
|
|
215
|
+
*
|
|
216
|
+
* @throws {Error} If callbacks missing required write function
|
|
217
|
+
*
|
|
218
|
+
* @example
|
|
219
|
+
* ```typescript
|
|
220
|
+
* const chunks: Buffer[] = [];
|
|
221
|
+
* const ioContext = IOStream.createOutput({
|
|
222
|
+
* write: (buffer) => {
|
|
223
|
+
* chunks.push(Buffer.from(buffer));
|
|
224
|
+
* return buffer.length;
|
|
225
|
+
* }
|
|
226
|
+
* }, { format: 'matroska' });
|
|
227
|
+
* ```
|
|
228
|
+
*/
|
|
229
|
+
static createOutput(callbacks: IOOutputCallbacks, options?: MuxerOptions): IOContext;
|
|
230
|
+
/**
|
|
231
|
+
* Create I/O context from buffer.
|
|
232
|
+
*
|
|
233
|
+
* Sets up read and seek callbacks for in-memory buffer.
|
|
234
|
+
* Manages position tracking and EOF handling.
|
|
235
|
+
*
|
|
236
|
+
* @param buffer - Source buffer
|
|
237
|
+
*
|
|
238
|
+
* @param bufferSize - Internal buffer size
|
|
239
|
+
*
|
|
240
|
+
* @returns Configured I/O context
|
|
241
|
+
*
|
|
242
|
+
* @internal
|
|
243
|
+
*/
|
|
244
|
+
private static createFromBuffer;
|
|
245
|
+
/**
|
|
246
|
+
* Create I/O context from a Node.js Readable stream.
|
|
247
|
+
*
|
|
248
|
+
* Sets up async read callbacks that buffer data from the stream.
|
|
249
|
+
* Seeking is not supported for streams.
|
|
250
|
+
*
|
|
251
|
+
* @param stream - Node.js Readable stream
|
|
252
|
+
*
|
|
253
|
+
* @param bufferSize - Internal buffer size
|
|
254
|
+
*
|
|
255
|
+
* @returns Configured I/O context
|
|
256
|
+
*
|
|
257
|
+
* @internal
|
|
258
|
+
*/
|
|
259
|
+
private static createFromReadable;
|
|
260
|
+
/**
|
|
261
|
+
* Create I/O context for writing to a Node.js Writable stream.
|
|
262
|
+
*
|
|
263
|
+
* Sets up async write callbacks with backpressure support.
|
|
264
|
+
* The buffer is copied before writing since FFmpeg reuses its internal buffer.
|
|
265
|
+
*
|
|
266
|
+
* @param stream - Node.js Writable stream
|
|
267
|
+
*
|
|
268
|
+
* @param bufferSize - Internal buffer size
|
|
269
|
+
*
|
|
270
|
+
* @param maxPacketSize - Maximum packet size
|
|
271
|
+
*
|
|
272
|
+
* @returns Configured I/O context
|
|
273
|
+
*
|
|
274
|
+
* @internal
|
|
275
|
+
*/
|
|
276
|
+
private static createForWritable;
|
|
277
|
+
/**
|
|
278
|
+
* Create I/O context from custom input callbacks.
|
|
279
|
+
*
|
|
280
|
+
* Sets up custom I/O with user-provided read and optional seek callbacks.
|
|
281
|
+
*
|
|
282
|
+
* @param callbacks - User I/O callbacks
|
|
283
|
+
*
|
|
284
|
+
* @param bufferSize - Internal buffer size
|
|
285
|
+
*
|
|
286
|
+
* @returns Configured I/O context
|
|
287
|
+
*
|
|
288
|
+
* @internal
|
|
289
|
+
*/
|
|
290
|
+
private static createFromInputCallbacks;
|
|
291
|
+
/**
|
|
292
|
+
* Create I/O context from custom output callbacks.
|
|
293
|
+
*
|
|
294
|
+
* Sets up custom I/O with user-provided write, optional seek, and optional read callbacks.
|
|
295
|
+
*
|
|
296
|
+
* @param callbacks - User I/O callbacks
|
|
297
|
+
*
|
|
298
|
+
* @param bufferSize - Internal buffer size
|
|
299
|
+
*
|
|
300
|
+
* @param maxPacketSize - Maximum packet size
|
|
301
|
+
*
|
|
302
|
+
* @returns Configured I/O context
|
|
303
|
+
*
|
|
304
|
+
* @internal
|
|
305
|
+
*/
|
|
306
|
+
private static createFromOutputCallbacks;
|
|
307
|
+
}
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { once } from 'node:events';
|
|
2
|
+
import { Readable } from 'node:stream';
|
|
3
|
+
import { AVSEEK_CUR, AVSEEK_END, AVSEEK_SET, AVSEEK_SIZE } from '../constants/constants.js';
|
|
4
|
+
import { IOContext } from '../lib/index.js';
|
|
5
|
+
import { IO_BUFFER_SIZE, MAX_PACKET_SIZE } from './constants.js';
|
|
6
|
+
/**
|
|
7
|
+
* Factory for creating custom I/O contexts.
|
|
8
|
+
*
|
|
9
|
+
* Provides simplified creation of I/O contexts from buffers or custom callbacks.
|
|
10
|
+
* Handles buffer management and seek operations for in-memory media.
|
|
11
|
+
* Bridges the gap between high-level media operations and custom I/O sources.
|
|
12
|
+
* Essential for processing media from non-file sources like network streams or memory.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* import { IOStream, Demuxer } from 'node-av/api';
|
|
17
|
+
*
|
|
18
|
+
* // From buffer
|
|
19
|
+
* const buffer = await fs.readFile('video.mp4');
|
|
20
|
+
* const ioContext = IOStream.create(buffer);
|
|
21
|
+
* const input = await Demuxer.open(buffer);
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* // Custom I/O callbacks
|
|
27
|
+
* const callbacks = {
|
|
28
|
+
* read: async (size: number) => {
|
|
29
|
+
* // Read from custom source
|
|
30
|
+
* return Buffer.alloc(size);
|
|
31
|
+
* },
|
|
32
|
+
* seek: async (offset: bigint, whence: AVSeekWhence) => {
|
|
33
|
+
* // Seek in custom source
|
|
34
|
+
* return offset;
|
|
35
|
+
* }
|
|
36
|
+
* };
|
|
37
|
+
*
|
|
38
|
+
* const ioContext = IOStream.create(callbacks, {
|
|
39
|
+
* bufferSize: 4096
|
|
40
|
+
* });
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @see {@link IOContext} For low-level I/O operations
|
|
44
|
+
* @see {@link Demuxer} For using I/O contexts
|
|
45
|
+
* @see {@link IOInputCallbacks} For callback interface
|
|
46
|
+
*/
|
|
47
|
+
export class IOStream {
|
|
48
|
+
static create(input, options = {}) {
|
|
49
|
+
const { bufferSize = IO_BUFFER_SIZE } = options;
|
|
50
|
+
// Handle Buffer
|
|
51
|
+
if (Buffer.isBuffer(input)) {
|
|
52
|
+
return this.createFromBuffer(input, bufferSize);
|
|
53
|
+
}
|
|
54
|
+
// Handle Readable stream (must be before callbacks check since Readable has 'read')
|
|
55
|
+
if (input instanceof Readable) {
|
|
56
|
+
return this.createFromReadable(input, bufferSize);
|
|
57
|
+
}
|
|
58
|
+
// Handle custom callbacks
|
|
59
|
+
if (typeof input === 'object' && 'read' in input) {
|
|
60
|
+
return this.createFromInputCallbacks(input, bufferSize);
|
|
61
|
+
}
|
|
62
|
+
throw new TypeError('Invalid input type. Expected Buffer, Readable, or IOInputCallbacks');
|
|
63
|
+
}
|
|
64
|
+
static createOutput(output, options) {
|
|
65
|
+
const { bufferSize = IO_BUFFER_SIZE, maxPacketSize = MAX_PACKET_SIZE } = options ?? {};
|
|
66
|
+
// Handle Writable stream (must be before callbacks check since Writable has 'write')
|
|
67
|
+
if (typeof output === 'object' && 'writable' in output) {
|
|
68
|
+
return this.createForWritable(output, bufferSize, maxPacketSize);
|
|
69
|
+
}
|
|
70
|
+
// Handle custom callbacks
|
|
71
|
+
if (typeof output === 'object' && 'write' in output) {
|
|
72
|
+
return this.createFromOutputCallbacks(output, bufferSize, maxPacketSize);
|
|
73
|
+
}
|
|
74
|
+
throw new TypeError('Invalid output type. Expected Writable or IOOutputCallbacks');
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Create I/O context from buffer.
|
|
78
|
+
*
|
|
79
|
+
* Sets up read and seek callbacks for in-memory buffer.
|
|
80
|
+
* Manages position tracking and EOF handling.
|
|
81
|
+
*
|
|
82
|
+
* @param buffer - Source buffer
|
|
83
|
+
*
|
|
84
|
+
* @param bufferSize - Internal buffer size
|
|
85
|
+
*
|
|
86
|
+
* @returns Configured I/O context
|
|
87
|
+
*
|
|
88
|
+
* @internal
|
|
89
|
+
*/
|
|
90
|
+
static createFromBuffer(buffer, bufferSize) {
|
|
91
|
+
let position = 0;
|
|
92
|
+
const ioContext = new IOContext();
|
|
93
|
+
ioContext.allocContextWithCallbacks(bufferSize, 0, (size) => {
|
|
94
|
+
if (position >= buffer.length) {
|
|
95
|
+
return null; // EOF
|
|
96
|
+
}
|
|
97
|
+
const chunk = buffer.subarray(position, Math.min(position + size, buffer.length));
|
|
98
|
+
position += chunk.length;
|
|
99
|
+
return chunk;
|
|
100
|
+
}, undefined, (offset, whence) => {
|
|
101
|
+
switch (whence) {
|
|
102
|
+
case AVSEEK_SIZE:
|
|
103
|
+
return BigInt(buffer.length);
|
|
104
|
+
case AVSEEK_SET:
|
|
105
|
+
position = Number(offset);
|
|
106
|
+
break;
|
|
107
|
+
case AVSEEK_CUR:
|
|
108
|
+
position += Number(offset);
|
|
109
|
+
break;
|
|
110
|
+
case AVSEEK_END:
|
|
111
|
+
position = buffer.length + Number(offset);
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
// Clamp position
|
|
115
|
+
position = Math.max(0, Math.min(position, buffer.length));
|
|
116
|
+
return BigInt(position);
|
|
117
|
+
});
|
|
118
|
+
return ioContext;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Create I/O context from a Node.js Readable stream.
|
|
122
|
+
*
|
|
123
|
+
* Sets up async read callbacks that buffer data from the stream.
|
|
124
|
+
* Seeking is not supported for streams.
|
|
125
|
+
*
|
|
126
|
+
* @param stream - Node.js Readable stream
|
|
127
|
+
*
|
|
128
|
+
* @param bufferSize - Internal buffer size
|
|
129
|
+
*
|
|
130
|
+
* @returns Configured I/O context
|
|
131
|
+
*
|
|
132
|
+
* @internal
|
|
133
|
+
*/
|
|
134
|
+
static createFromReadable(stream, bufferSize) {
|
|
135
|
+
let chunks = [];
|
|
136
|
+
let totalBuffered = 0;
|
|
137
|
+
let streamEnded = false;
|
|
138
|
+
let streamError = null;
|
|
139
|
+
let pendingResolve = null;
|
|
140
|
+
const wakeUp = () => {
|
|
141
|
+
if (pendingResolve) {
|
|
142
|
+
const resolve = pendingResolve;
|
|
143
|
+
pendingResolve = null;
|
|
144
|
+
resolve();
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
const removeListeners = () => {
|
|
148
|
+
stream.off('readable', onReadable);
|
|
149
|
+
stream.off('end', onEnd);
|
|
150
|
+
stream.off('error', onError);
|
|
151
|
+
stream.off('close', wakeUp);
|
|
152
|
+
};
|
|
153
|
+
const onReadable = () => wakeUp();
|
|
154
|
+
const onEnd = () => {
|
|
155
|
+
streamEnded = true;
|
|
156
|
+
wakeUp();
|
|
157
|
+
};
|
|
158
|
+
const onError = (err) => {
|
|
159
|
+
streamError = err;
|
|
160
|
+
wakeUp();
|
|
161
|
+
};
|
|
162
|
+
// Track state changes and wake up pending reads
|
|
163
|
+
stream.on('readable', onReadable);
|
|
164
|
+
stream.on('end', onEnd);
|
|
165
|
+
stream.on('error', onError);
|
|
166
|
+
stream.on('close', wakeUp);
|
|
167
|
+
const ioContext = new IOContext();
|
|
168
|
+
ioContext.allocContextWithCallbacks(bufferSize, 0, // read mode
|
|
169
|
+
async (size) => {
|
|
170
|
+
// Pull-based: read from stream on demand
|
|
171
|
+
while (totalBuffered < size && !streamEnded && !streamError && !stream.destroyed) {
|
|
172
|
+
// Try to read available data first
|
|
173
|
+
let chunk;
|
|
174
|
+
while ((chunk = stream.read()) !== null) {
|
|
175
|
+
chunks.push(chunk);
|
|
176
|
+
totalBuffered += chunk.length;
|
|
177
|
+
}
|
|
178
|
+
// If we have enough data, stop waiting
|
|
179
|
+
if (totalBuffered >= size)
|
|
180
|
+
break;
|
|
181
|
+
// If stream is done, stop waiting
|
|
182
|
+
if (streamEnded || streamError || stream.destroyed)
|
|
183
|
+
break;
|
|
184
|
+
// Wait for more data
|
|
185
|
+
await new Promise((resolve) => {
|
|
186
|
+
pendingResolve = resolve;
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
// No data available — EOF, remove listeners
|
|
190
|
+
if (totalBuffered === 0) {
|
|
191
|
+
removeListeners();
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
const concat = Buffer.concat(chunks);
|
|
195
|
+
const result = concat.subarray(0, Math.min(size, concat.length));
|
|
196
|
+
const remainder = concat.subarray(result.length);
|
|
197
|
+
chunks = remainder.length > 0 ? [remainder] : [];
|
|
198
|
+
totalBuffered = remainder.length;
|
|
199
|
+
// If stream is done and all data consumed, remove listeners
|
|
200
|
+
if (totalBuffered === 0 && (streamEnded || streamError || stream.destroyed)) {
|
|
201
|
+
removeListeners();
|
|
202
|
+
}
|
|
203
|
+
return result;
|
|
204
|
+
}, undefined, // no write
|
|
205
|
+
undefined);
|
|
206
|
+
return ioContext;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Create I/O context for writing to a Node.js Writable stream.
|
|
210
|
+
*
|
|
211
|
+
* Sets up async write callbacks with backpressure support.
|
|
212
|
+
* The buffer is copied before writing since FFmpeg reuses its internal buffer.
|
|
213
|
+
*
|
|
214
|
+
* @param stream - Node.js Writable stream
|
|
215
|
+
*
|
|
216
|
+
* @param bufferSize - Internal buffer size
|
|
217
|
+
*
|
|
218
|
+
* @param maxPacketSize - Maximum packet size
|
|
219
|
+
*
|
|
220
|
+
* @returns Configured I/O context
|
|
221
|
+
*
|
|
222
|
+
* @internal
|
|
223
|
+
*/
|
|
224
|
+
static createForWritable(stream, bufferSize, maxPacketSize) {
|
|
225
|
+
const ioContext = new IOContext();
|
|
226
|
+
ioContext.allocContextWithCallbacks(bufferSize, 1, // write mode
|
|
227
|
+
undefined, // no read
|
|
228
|
+
async (buffer) => {
|
|
229
|
+
// Copy buffer — FFmpeg reuses the internal buffer after callback returns
|
|
230
|
+
const copy = Buffer.from(buffer);
|
|
231
|
+
if (!stream.write(copy)) {
|
|
232
|
+
// Backpressure: wait for drain
|
|
233
|
+
await once(stream, 'drain');
|
|
234
|
+
}
|
|
235
|
+
return copy.length;
|
|
236
|
+
}, undefined);
|
|
237
|
+
ioContext.maxPacketSize = maxPacketSize;
|
|
238
|
+
return ioContext;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Create I/O context from custom input callbacks.
|
|
242
|
+
*
|
|
243
|
+
* Sets up custom I/O with user-provided read and optional seek callbacks.
|
|
244
|
+
*
|
|
245
|
+
* @param callbacks - User I/O callbacks
|
|
246
|
+
*
|
|
247
|
+
* @param bufferSize - Internal buffer size
|
|
248
|
+
*
|
|
249
|
+
* @returns Configured I/O context
|
|
250
|
+
*
|
|
251
|
+
* @internal
|
|
252
|
+
*/
|
|
253
|
+
static createFromInputCallbacks(callbacks, bufferSize) {
|
|
254
|
+
const ioContext = new IOContext();
|
|
255
|
+
ioContext.allocContextWithCallbacks(bufferSize, 0, // read mode
|
|
256
|
+
callbacks.read, undefined, callbacks.seek);
|
|
257
|
+
return ioContext;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Create I/O context from custom output callbacks.
|
|
261
|
+
*
|
|
262
|
+
* Sets up custom I/O with user-provided write, optional seek, and optional read callbacks.
|
|
263
|
+
*
|
|
264
|
+
* @param callbacks - User I/O callbacks
|
|
265
|
+
*
|
|
266
|
+
* @param bufferSize - Internal buffer size
|
|
267
|
+
*
|
|
268
|
+
* @param maxPacketSize - Maximum packet size
|
|
269
|
+
*
|
|
270
|
+
* @returns Configured I/O context
|
|
271
|
+
*
|
|
272
|
+
* @internal
|
|
273
|
+
*/
|
|
274
|
+
static createFromOutputCallbacks(callbacks, bufferSize, maxPacketSize) {
|
|
275
|
+
const ioContext = new IOContext();
|
|
276
|
+
ioContext.allocContextWithCallbacks(bufferSize, 1, // write mode
|
|
277
|
+
callbacks.read, callbacks.write, callbacks.seek);
|
|
278
|
+
ioContext.maxPacketSize = maxPacketSize;
|
|
279
|
+
return ioContext;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
//# sourceMappingURL=io-stream.js.map
|