@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pictor-sdk/video-android",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Optional Android video playback and export adapter for Pictor. Requires Android API 29+.",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",
@@ -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
  }