@meframe/core 0.0.31 → 0.0.33
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/Meframe.d.ts +2 -2
- package/dist/Meframe.d.ts.map +1 -1
- package/dist/Meframe.js +3 -2
- package/dist/Meframe.js.map +1 -1
- package/dist/cache/CacheManager.d.ts +12 -17
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.js +18 -280
- package/dist/cache/CacheManager.js.map +1 -1
- package/dist/cache/l1/AudioL1Cache.d.ts +36 -19
- package/dist/cache/l1/AudioL1Cache.d.ts.map +1 -1
- package/dist/cache/l1/AudioL1Cache.js +182 -282
- package/dist/cache/l1/AudioL1Cache.js.map +1 -1
- package/dist/controllers/PlaybackController.d.ts +5 -3
- package/dist/controllers/PlaybackController.d.ts.map +1 -1
- package/dist/controllers/PlaybackController.js +58 -16
- package/dist/controllers/PlaybackController.js.map +1 -1
- package/dist/event/events.d.ts +1 -1
- package/dist/event/events.d.ts.map +1 -1
- package/dist/event/events.js.map +1 -1
- package/dist/model/CompositionModel.d.ts +8 -0
- package/dist/model/CompositionModel.d.ts.map +1 -1
- package/dist/model/CompositionModel.js +18 -0
- package/dist/model/CompositionModel.js.map +1 -1
- package/dist/model/types.d.ts +0 -4
- package/dist/model/types.d.ts.map +1 -1
- package/dist/model/types.js.map +1 -1
- package/dist/orchestrator/ExportScheduler.d.ts +10 -0
- package/dist/orchestrator/ExportScheduler.d.ts.map +1 -1
- package/dist/orchestrator/ExportScheduler.js +66 -83
- package/dist/orchestrator/ExportScheduler.js.map +1 -1
- package/dist/orchestrator/GlobalAudioSession.d.ts +35 -28
- package/dist/orchestrator/GlobalAudioSession.d.ts.map +1 -1
- package/dist/orchestrator/GlobalAudioSession.js +213 -422
- package/dist/orchestrator/GlobalAudioSession.js.map +1 -1
- package/dist/orchestrator/OnDemandVideoSession.d.ts +3 -3
- package/dist/orchestrator/OnDemandVideoSession.d.ts.map +1 -1
- package/dist/orchestrator/OnDemandVideoSession.js +4 -4
- package/dist/orchestrator/OnDemandVideoSession.js.map +1 -1
- package/dist/orchestrator/Orchestrator.d.ts +11 -4
- package/dist/orchestrator/Orchestrator.d.ts.map +1 -1
- package/dist/orchestrator/Orchestrator.js +75 -68
- package/dist/orchestrator/Orchestrator.js.map +1 -1
- package/dist/orchestrator/VideoClipSession.d.ts +0 -2
- package/dist/orchestrator/VideoClipSession.d.ts.map +1 -1
- package/dist/orchestrator/VideoClipSession.js +0 -49
- package/dist/orchestrator/VideoClipSession.js.map +1 -1
- package/dist/stages/compose/OfflineAudioMixer.d.ts.map +1 -1
- package/dist/stages/compose/OfflineAudioMixer.js +13 -18
- package/dist/stages/compose/OfflineAudioMixer.js.map +1 -1
- package/dist/stages/decode/AudioChunkDecoder.js +169 -0
- package/dist/stages/decode/AudioChunkDecoder.js.map +1 -0
- package/dist/stages/demux/MP3FrameParser.js +186 -0
- package/dist/stages/demux/MP3FrameParser.js.map +1 -0
- package/dist/stages/load/ResourceLoader.d.ts +49 -30
- package/dist/stages/load/ResourceLoader.d.ts.map +1 -1
- package/dist/stages/load/ResourceLoader.js +255 -189
- package/dist/stages/load/ResourceLoader.js.map +1 -1
- package/dist/stages/load/TaskManager.d.ts +4 -0
- package/dist/stages/load/TaskManager.d.ts.map +1 -1
- package/dist/stages/load/TaskManager.js +11 -0
- package/dist/stages/load/TaskManager.js.map +1 -1
- package/dist/stages/load/types.d.ts +1 -0
- package/dist/stages/load/types.d.ts.map +1 -1
- package/dist/utils/audio-data.d.ts +16 -0
- package/dist/utils/audio-data.d.ts.map +1 -0
- package/dist/utils/audio-data.js +111 -0
- package/dist/utils/audio-data.js.map +1 -0
- package/package.json +1 -1
- package/dist/cache/resource/ImageBitmapCache.d.ts +0 -65
- package/dist/cache/resource/ImageBitmapCache.d.ts.map +0 -1
- package/dist/cache/resource/ImageBitmapCache.js +0 -101
- package/dist/cache/resource/ImageBitmapCache.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CompositionModel } from '../../model';
|
|
1
|
+
import { Resource, CompositionModel } from '../../model';
|
|
2
2
|
import { ResourceLoadOptions, LoadTask, ResourceLoaderOptions } from './types';
|
|
3
3
|
|
|
4
4
|
export declare class ResourceConflictError extends Error {
|
|
@@ -13,20 +13,44 @@ export declare class ResourceLoader {
|
|
|
13
13
|
private eventBus?;
|
|
14
14
|
private onStateChange?;
|
|
15
15
|
private blobCache;
|
|
16
|
-
private pendingTransfers;
|
|
17
16
|
private parsingIndexes;
|
|
18
17
|
private isPreloadingEnabled;
|
|
19
18
|
private preloadQueue;
|
|
20
|
-
private activePreloads;
|
|
21
|
-
private readonly IDLE_PRELOAD_CONCURRENCY;
|
|
22
19
|
constructor(options: ResourceLoaderOptions);
|
|
23
20
|
setModel(model: CompositionModel): Promise<void>;
|
|
24
21
|
setPreloadingEnabled(enabled: boolean): void;
|
|
25
22
|
startPreloading(): void;
|
|
26
23
|
private processPreloadQueue;
|
|
27
24
|
private enqueueLoad;
|
|
28
|
-
private registerPendingTransfer;
|
|
29
25
|
private processQueue;
|
|
26
|
+
/**
|
|
27
|
+
* Check if resource is cached and ready (without loading)
|
|
28
|
+
*/
|
|
29
|
+
private isResourceCached;
|
|
30
|
+
/**
|
|
31
|
+
* Transfer video stream to worker
|
|
32
|
+
*/
|
|
33
|
+
private transferVideoToWorker;
|
|
34
|
+
/**
|
|
35
|
+
* Transfer image to worker
|
|
36
|
+
*/
|
|
37
|
+
private transferImageToWorker;
|
|
38
|
+
/**
|
|
39
|
+
* Load video resource (download + cache or read from cache)
|
|
40
|
+
*/
|
|
41
|
+
private loadVideoResource;
|
|
42
|
+
/**
|
|
43
|
+
* Load audio resource (download + parse or reuse cache)
|
|
44
|
+
*/
|
|
45
|
+
private loadAudioResource;
|
|
46
|
+
/**
|
|
47
|
+
* Load image resource (download + cache or read from cache) and transfer to worker
|
|
48
|
+
*/
|
|
49
|
+
private loadImageResource;
|
|
50
|
+
/**
|
|
51
|
+
* Load text resource (json/text)
|
|
52
|
+
*/
|
|
53
|
+
private loadTextResource;
|
|
30
54
|
/**
|
|
31
55
|
* Start loading a resource
|
|
32
56
|
* Handles state management (loading → ready/error) for all resource types
|
|
@@ -55,43 +79,38 @@ export declare class ResourceLoader {
|
|
|
55
79
|
*/
|
|
56
80
|
private writeToOPFS;
|
|
57
81
|
/**
|
|
58
|
-
*
|
|
82
|
+
* Load and parse audio file (MP3/WAV) in main thread
|
|
83
|
+
* Extract EncodedAudioChunk and cache to AudioSampleCache
|
|
84
|
+
* Aligned with video audio track extraction (unified architecture)
|
|
59
85
|
*/
|
|
60
|
-
private
|
|
61
|
-
/**
|
|
62
|
-
* Load text-based resources (json, text)
|
|
63
|
-
* Just download the content - state management is handled by startLoad()
|
|
64
|
-
*/
|
|
65
|
-
private loadTextResource;
|
|
86
|
+
private loadAndParseAudioFile;
|
|
66
87
|
/**
|
|
67
|
-
*
|
|
68
|
-
* Note: Images don't need streaming (typically < 5MB)
|
|
69
|
-
*
|
|
70
|
-
* Strategy for window cache architecture:
|
|
71
|
-
* - Store ImageBitmap in CacheManager.imageBitmapCache (main thread accessible)
|
|
72
|
-
* - OnDemandComposeSession retrieves from cache for composition
|
|
73
|
-
* - No longer transfer to Worker (composition is in main thread)
|
|
88
|
+
* Parse moov from stream and cache index + audio samples + decode first frame
|
|
74
89
|
*/
|
|
75
|
-
private
|
|
90
|
+
private parseIndexFromStream;
|
|
91
|
+
loadImage(resource: Resource): Promise<ImageBitmap>;
|
|
76
92
|
/**
|
|
77
93
|
* Fetch resource as blob (for images, json, etc.)
|
|
78
94
|
*/
|
|
79
95
|
private fetchBlob;
|
|
80
|
-
/**
|
|
81
|
-
* Transfer ImageBitmap to VideoComposeWorker
|
|
82
|
-
* Legacy: Not used in window cache architecture (images accessed via CacheManager)
|
|
83
|
-
*/
|
|
84
|
-
/**
|
|
85
|
-
* Transfer cached image to a session
|
|
86
|
-
* Creates new ImageBitmap from cached Blob and transfers to worker
|
|
87
|
-
*/
|
|
88
|
-
private transferCachedImage;
|
|
89
96
|
/**
|
|
90
97
|
* Transfer stream to demux worker (for audio files)
|
|
91
98
|
*/
|
|
92
99
|
private transferToDemuxWorker;
|
|
93
100
|
private updateResourceState;
|
|
94
|
-
|
|
101
|
+
/**
|
|
102
|
+
* Fetch a resource and wait for loading + parsing to complete
|
|
103
|
+
*
|
|
104
|
+
* Returns a Promise that resolves when:
|
|
105
|
+
* - Resource is fully loaded, parsed, and cached (state='ready')
|
|
106
|
+
* - Or rejects if loading/parsing fails
|
|
107
|
+
*
|
|
108
|
+
* Promise lifecycle:
|
|
109
|
+
* 1. enqueueLoad() creates LoadTask with promise/resolve/reject (or reuses existing)
|
|
110
|
+
* 2. processQueue() → startLoad() executes async in background
|
|
111
|
+
* 3. startLoad() completes → finally → completeTask() → task.resolve()/reject()
|
|
112
|
+
*/
|
|
113
|
+
load(resourceId?: string, options?: ResourceLoadOptions): Promise<void>;
|
|
95
114
|
cancel(resourceId: string): void;
|
|
96
115
|
/**
|
|
97
116
|
* Check if a resource is currently being loaded
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceLoader.d.ts","sourceRoot":"","sources":["../../../src/stages/load/ResourceLoader.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ResourceLoader.d.ts","sourceRoot":"","sources":["../../../src/stages/load/ResourceLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,gBAAgB,EAAiB,MAAM,aAAa,CAAC;AAClF,OAAO,KAAK,EAAE,mBAAmB,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAWpF,qBAAa,qBAAsB,SAAQ,KAAK;gBAClC,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,KAAK,CAAC,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