@meframe/core 0.0.15 → 0.0.17
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/dist/cache/CacheManager.d.ts +2 -1
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.js +5 -2
- package/dist/cache/CacheManager.js.map +1 -1
- package/dist/cache/l1/AudioL1Cache.d.ts +1 -1
- package/dist/cache/l1/AudioL1Cache.d.ts.map +1 -1
- package/dist/cache/l1/AudioL1Cache.js +3 -2
- package/dist/cache/l1/AudioL1Cache.js.map +1 -1
- package/dist/controllers/PlaybackController.d.ts.map +1 -1
- package/dist/controllers/PlaybackController.js +1 -3
- package/dist/controllers/PlaybackController.js.map +1 -1
- package/dist/model/CompositionModel.d.ts +2 -2
- package/dist/model/CompositionModel.d.ts.map +1 -1
- package/dist/model/CompositionModel.js +23 -10
- package/dist/model/CompositionModel.js.map +1 -1
- package/dist/model/patch.js +3 -1
- package/dist/model/patch.js.map +1 -1
- package/dist/model/types.d.ts +9 -0
- package/dist/model/types.d.ts.map +1 -1
- package/dist/model/types.js +4 -0
- package/dist/model/types.js.map +1 -1
- package/dist/orchestrator/ClipSessionManager.d.ts +1 -1
- package/dist/orchestrator/ClipSessionManager.d.ts.map +1 -1
- package/dist/orchestrator/ClipSessionManager.js +7 -4
- package/dist/orchestrator/ClipSessionManager.js.map +1 -1
- package/dist/orchestrator/CompositionPlanner.d.ts.map +1 -1
- package/dist/orchestrator/CompositionPlanner.js +4 -0
- package/dist/orchestrator/CompositionPlanner.js.map +1 -1
- package/dist/orchestrator/Orchestrator.d.ts.map +1 -1
- package/dist/orchestrator/Orchestrator.js +29 -1
- package/dist/orchestrator/Orchestrator.js.map +1 -1
- package/dist/orchestrator/VideoClipSession.d.ts +7 -0
- package/dist/orchestrator/VideoClipSession.d.ts.map +1 -1
- package/dist/orchestrator/VideoClipSession.js +55 -5
- package/dist/orchestrator/VideoClipSession.js.map +1 -1
- package/dist/stages/compose/GlobalAudioSession.d.ts +4 -0
- package/dist/stages/compose/GlobalAudioSession.d.ts.map +1 -1
- package/dist/stages/compose/GlobalAudioSession.js +122 -21
- package/dist/stages/compose/GlobalAudioSession.js.map +1 -1
- package/dist/stages/compose/OfflineAudioMixer.d.ts.map +1 -1
- package/dist/stages/compose/OfflineAudioMixer.js +21 -6
- package/dist/stages/compose/OfflineAudioMixer.js.map +1 -1
- package/dist/stages/decode/AudioChunkDecoder.d.ts +8 -1
- package/dist/stages/decode/AudioChunkDecoder.d.ts.map +1 -1
- package/dist/stages/demux/MP4Demuxer.d.ts +10 -4
- package/dist/stages/demux/MP4Demuxer.d.ts.map +1 -1
- package/dist/workers/MP4Demuxer.js +65 -29
- package/dist/workers/MP4Demuxer.js.map +1 -1
- package/dist/workers/stages/decode/audio-decode.worker.js +101 -7
- package/dist/workers/stages/decode/audio-decode.worker.js.map +1 -1
- package/dist/workers/stages/demux/video-demux.worker.js +48 -15
- package/dist/workers/stages/demux/video-demux.worker.js.map +1 -1
- package/package.json +1 -1
|
@@ -7054,9 +7054,11 @@ class MP4Demuxer {
|
|
|
7054
7054
|
fileOffset = 0;
|
|
7055
7055
|
videoTimestampOffset = null;
|
|
7056
7056
|
audioTimestampOffset = null;
|
|
7057
|
+
skipAudio = false;
|
|
7057
7058
|
constructor(config = {}) {
|
|
7058
7059
|
this.mp4boxFile = mp4box_all.createFile();
|
|
7059
7060
|
this.onReadyCallback = config.onReady;
|
|
7061
|
+
this.skipAudio = config.skipAudio ?? false;
|
|
7060
7062
|
const DEFAULT_HIGH_WATER_MARK = 10;
|
|
7061
7063
|
this.demuxHighWaterMark = config.highWaterMark ?? DEFAULT_HIGH_WATER_MARK;
|
|
7062
7064
|
this.setupHandlers();
|
|
@@ -7129,7 +7131,12 @@ class MP4Demuxer {
|
|
|
7129
7131
|
data: sample.data
|
|
7130
7132
|
});
|
|
7131
7133
|
this.videoController.enqueue(chunk);
|
|
7132
|
-
} else if (track.type === "audio"
|
|
7134
|
+
} else if (track.type === "audio") {
|
|
7135
|
+
if (!this.audioController) {
|
|
7136
|
+
const last2 = samples[samples.length - 1].number;
|
|
7137
|
+
this.mp4boxFile.releaseUsedSamples(trackId, last2 + 1);
|
|
7138
|
+
return;
|
|
7139
|
+
}
|
|
7133
7140
|
if (this.audioTimestampOffset === null) {
|
|
7134
7141
|
this.audioTimestampOffset = rawTimestamp;
|
|
7135
7142
|
}
|
|
@@ -7175,9 +7182,27 @@ class MP4Demuxer {
|
|
|
7175
7182
|
try {
|
|
7176
7183
|
const fullTrack = this.mp4boxFile.getTrackById(track.id);
|
|
7177
7184
|
for (const entry of fullTrack.mdia.minf.stbl.stsd.entries) {
|
|
7178
|
-
if (entry.esds
|
|
7179
|
-
const
|
|
7180
|
-
|
|
7185
|
+
if (entry.esds) {
|
|
7186
|
+
const decConfigDesc = entry.esds.esd?.descs?.[0];
|
|
7187
|
+
const decSpecInfo = decConfigDesc?.descs?.[0];
|
|
7188
|
+
if (decSpecInfo?.data) {
|
|
7189
|
+
const data = decSpecInfo.data;
|
|
7190
|
+
if (data instanceof Uint8Array) {
|
|
7191
|
+
const buffer = data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
|
|
7192
|
+
return buffer instanceof ArrayBuffer ? buffer : void 0;
|
|
7193
|
+
} else if (Array.isArray(data)) {
|
|
7194
|
+
return new Uint8Array(data).buffer;
|
|
7195
|
+
}
|
|
7196
|
+
}
|
|
7197
|
+
console.warn("[MP4Demuxer] Could not extract AudioSpecificConfig from esds structure");
|
|
7198
|
+
return void 0;
|
|
7199
|
+
} else if (entry.dOps) {
|
|
7200
|
+
const stream = new mp4box_all.DataStream(
|
|
7201
|
+
void 0,
|
|
7202
|
+
0,
|
|
7203
|
+
mp4box_all.DataStream.BIG_ENDIAN
|
|
7204
|
+
);
|
|
7205
|
+
entry.dOps.write(stream);
|
|
7181
7206
|
return new Uint8Array(stream.buffer.slice(8)).buffer;
|
|
7182
7207
|
}
|
|
7183
7208
|
}
|
|
@@ -7187,56 +7212,67 @@ class MP4Demuxer {
|
|
|
7187
7212
|
return void 0;
|
|
7188
7213
|
}
|
|
7189
7214
|
/**
|
|
7190
|
-
* Create
|
|
7215
|
+
* Create readable stream for video chunks (output only)
|
|
7191
7216
|
*/
|
|
7192
7217
|
createVideoStream() {
|
|
7193
|
-
return new
|
|
7218
|
+
return new ReadableStream(
|
|
7194
7219
|
{
|
|
7195
|
-
start: (
|
|
7196
|
-
this.videoController =
|
|
7197
|
-
},
|
|
7198
|
-
transform: (chunk, _controller) => {
|
|
7199
|
-
const chunkData = new Uint8Array(chunk);
|
|
7200
|
-
this.appendBuffer(chunkData);
|
|
7201
|
-
this.mp4boxFile.flush();
|
|
7220
|
+
start: (ctrl) => {
|
|
7221
|
+
this.videoController = ctrl;
|
|
7202
7222
|
},
|
|
7203
|
-
|
|
7204
|
-
this.
|
|
7205
|
-
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
7223
|
+
cancel: () => {
|
|
7224
|
+
this.videoController = void 0;
|
|
7206
7225
|
}
|
|
7207
7226
|
},
|
|
7208
|
-
// Queuing strategy: use configuration
|
|
7209
7227
|
{
|
|
7210
7228
|
highWaterMark: this.demuxHighWaterMark,
|
|
7211
7229
|
size: () => 1
|
|
7212
|
-
// Count-based
|
|
7213
7230
|
}
|
|
7214
7231
|
);
|
|
7215
7232
|
}
|
|
7216
7233
|
/**
|
|
7217
|
-
* Create
|
|
7234
|
+
* Create readable stream for audio chunks (output only)
|
|
7218
7235
|
*/
|
|
7219
7236
|
createAudioStream() {
|
|
7220
|
-
|
|
7221
|
-
|
|
7222
|
-
|
|
7237
|
+
if (this.skipAudio) {
|
|
7238
|
+
return null;
|
|
7239
|
+
}
|
|
7240
|
+
return new ReadableStream(
|
|
7223
7241
|
{
|
|
7224
|
-
start: (
|
|
7225
|
-
this.audioController =
|
|
7242
|
+
start: (ctrl) => {
|
|
7243
|
+
this.audioController = ctrl;
|
|
7226
7244
|
},
|
|
7227
|
-
|
|
7245
|
+
cancel: () => {
|
|
7246
|
+
this.audioController = void 0;
|
|
7247
|
+
}
|
|
7248
|
+
},
|
|
7249
|
+
{
|
|
7250
|
+
highWaterMark: this.demuxHighWaterMark,
|
|
7251
|
+
size: () => 1
|
|
7252
|
+
}
|
|
7253
|
+
);
|
|
7254
|
+
}
|
|
7255
|
+
/**
|
|
7256
|
+
* Create writable stream for input data (single source)
|
|
7257
|
+
* This is the only stream that should receive the input data
|
|
7258
|
+
*/
|
|
7259
|
+
createInputStream() {
|
|
7260
|
+
return new WritableStream(
|
|
7261
|
+
{
|
|
7262
|
+
write: (chunk) => {
|
|
7228
7263
|
const chunkData = new Uint8Array(chunk);
|
|
7229
7264
|
this.appendBuffer(chunkData);
|
|
7230
7265
|
this.mp4boxFile.flush();
|
|
7231
7266
|
},
|
|
7232
|
-
|
|
7267
|
+
close: async () => {
|
|
7233
7268
|
this.mp4boxFile.flush();
|
|
7269
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
7270
|
+
this.videoController?.close();
|
|
7271
|
+
this.audioController?.close();
|
|
7234
7272
|
}
|
|
7235
7273
|
},
|
|
7236
|
-
// Queuing strategy: use configuration
|
|
7237
7274
|
{
|
|
7238
|
-
highWaterMark: this.demuxHighWaterMark
|
|
7239
|
-
size: () => 1
|
|
7275
|
+
highWaterMark: this.demuxHighWaterMark
|
|
7240
7276
|
}
|
|
7241
7277
|
);
|
|
7242
7278
|
}
|