@pictor-sdk/video-android 0.1.3 → 0.1.4
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/android/src/main/java/dev/pictor/video/CompositionSeek.kt +8 -0
- package/android/src/main/java/dev/pictor/video/CompositionSpike.kt +23 -13
- package/android/src/main/java/dev/pictor/video/CompositionVideoItem.kt +16 -0
- package/android/src/main/java/dev/pictor/video/CompositionWindow.kt +17 -0
- package/android/src/main/java/dev/pictor/video/FrameClock.kt +6 -1
- package/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/compositionSpike.ts +9 -0
package/package.json
CHANGED
package/src/compositionSpike.ts
CHANGED
|
@@ -34,6 +34,10 @@ export interface CompositionSpikeItem {
|
|
|
34
34
|
/** Clipping bounds in **source** time, which is where speed is applied. */
|
|
35
35
|
startUs: number
|
|
36
36
|
endUs: number
|
|
37
|
+
/** Full source duration, before trimming or speed. Omit only for legacy callers. */
|
|
38
|
+
sourceDurationUs?: number
|
|
39
|
+
/** Exclusive project-time end from the playlist compiler, after trim and speed. */
|
|
40
|
+
timelineEndUs?: number
|
|
37
41
|
speed: number
|
|
38
42
|
}
|
|
39
43
|
|
|
@@ -122,6 +126,8 @@ export interface CompositionSpikeState {
|
|
|
122
126
|
playbackState?: number
|
|
123
127
|
durationUs?: number
|
|
124
128
|
presentedUs?: number | null
|
|
129
|
+
/** Playlist window belonging to the latched frame, not the current playhead. */
|
|
130
|
+
presentedWindowIndex?: number
|
|
125
131
|
/** How old the presented frame was when it was read, so a stalled sample can be excluded. */
|
|
126
132
|
presentedAgeNs?: number
|
|
127
133
|
/** How long the paired read itself took. Bounds the pairing error. */
|
|
@@ -148,6 +154,7 @@ export function compositionSpikeSpec(
|
|
|
148
154
|
const playlist = playlistOf(project)
|
|
149
155
|
const items: CompositionSpikeItem[] = []
|
|
150
156
|
const unsupported = playlist.unsupported.map((u) => `${u.clipId}: ${u.reason}`)
|
|
157
|
+
const clips = new Map(project.clips.map((clip) => [clip.id, clip]))
|
|
151
158
|
for (const item of playlist.items) {
|
|
152
159
|
const uri = resolve(item.source as unknown as { kind: string; uri?: string })
|
|
153
160
|
if (uri === null) {
|
|
@@ -158,6 +165,8 @@ export function compositionSpikeSpec(
|
|
|
158
165
|
uri,
|
|
159
166
|
startUs: Number(item.startUs),
|
|
160
167
|
endUs: Number(item.endUs),
|
|
168
|
+
sourceDurationUs: clips.get(item.clipId)?.metadata.duration,
|
|
169
|
+
timelineEndUs: Number(item.timelineEndUs),
|
|
161
170
|
speed: item.speed,
|
|
162
171
|
})
|
|
163
172
|
}
|