Files
baji-vc/docs/AVATAR_RUNTIME_03_INTERFACE.md
T
zenord 9ea5eb31c1 feat: deliver clean avatar home in 0.6.2 UI debug candidate
Keep the avatar mounted while all connection, permission, privacy and diagnostic controls live in a settings sheet. Save the tested continuous-body renderer, safe transition driver and foreground HELLO/permission workflow from this session. Pin runtime03 for the code14 UI-only candidate; mouth deformation remains unresolved. Add source UI contracts, an optional sensor-free device probe, exact asset import and candidate packaging checks. Portrait binaries and diagnostics remain private and untracked.
2026-10-12 22:19:56 +08:00

47 lines
3.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Continuous body / registered mouth runtime engineering interface
仅 debug 自然工程候选,不是五 wholeframe clip graph,不改 pending/final 审核状态。素材 owner 独立导出,Android 不实时 SSD。导出 partial 不算完成;须最后写 manifest,核所有文件 SHA。
```json
{
"schemaVersion": 1,
"identityId": "a01",
"publishApproval": false,
"packId": "a01-neutral-graph-v1-runtime-03",
"runtimeReady": true,
"patchFormat": {"format": "PNG RGBA 8bit", "alphaEncoding": "straight_unassociated"},
"body": {
"path": "body/body.mp4", "sha256": "<actual SHA256>",
"width": 480, "height": 848, "frameCount": 97,
"fpsNumerator": 24, "fpsDenominator": 1,
"frameDurationUsNumerator": 1000000, "frameDurationUsDenominator": 24,
"durationUs": 4041667, "hasAudio": false
},
"patches": [
{"frameIndex": 0, "ptsUs": 0, "path": "patches/f000.png",
"sha256": "<actual SHA256>", "x": 210, "y": 111, "width": 42, "height": 24}
],
"mouthStates": [
{"id": "opening", "durationMs": 250, "frameCount": 6,
"fpsNumerator": 24, "fpsDenominator": 1,
"entryMouthAnchor": "A", "exitMouthAnchor": "B",
"globalAlphaByFrame": [0, 0.0954915, 0.3454915, 0.6545085, 0.9045085, 1]}
],
"stateRouting": {
"idle": ["idle", "opening"],
"opening": ["talk1", "talk2", "end-talk"],
"talk1": ["talk1", "talk2", "end-talk"],
"talk2": ["talk1", "talk2", "end-talk"],
"end-talk": ["idle"]
}
}
```
上面是字段示例,不是可直接导入的真实数据/批准 hash。mouthStates 必须完整五种:idle12个alpha0;opening6个0→1;talk1/talk2各12个1→1且中间min<.5;end-talk6个1→0。对应500/250ms,不伪增安全审核。patches 需要按真实 frameIndex0..96 完整有序列出;ptsUs=floor(index*1000000/24),容差2us。每帧 RGBA patch 可已烘焙亚像素平移、tone 和空间 mask;x/y 是在480×848 top-left 像素空间的摆放位置,不是 UV,允许有限小数。width/height 1..128,总 decoded RGBA <=8MB,每路径必须唯一。颜色按 sRGB encoded 值混合以复现当前离线 NumPy 算法;不是 linear-light 质量认证。
runtime 没有静态 loopOrdinal 表:ContinuousFrameClock 检查每个实际 decoded PTS/frame 连续顺序;SurfaceTexture updateTexImage 后核 timestamp,合法完成97帧后 flush/seek0 时 ordinal+1。patch 按 latched index 选,不取 MediaPlayer position。共用一个 EGL window、GLES pass 和 Fit,body OES texture 与 patch 2D texture 原子绘制后 swap;最新 mouth 曲线独立于 body loop,不因 intent seek/restart body。
Android Bitmap PNG 可能内部 premultiply,因此用 getPixels 提取 straight ARGB,再明确写 RGBA ByteBuffer 上传;shader global alpha g 只乘一次空间 alpha a:out=body*(1-g*a)+patchRGB*(g*a),g=0 完全原 body。所有97个小 patch 仅启动时解码/cache/upload,不每帧 allocate 全身图。音频线程不等待 GL;后台关闭 decoder/EGL/texture,旧 generation callbacks 丢弃。
必须提供真实 body loop 审核范围、preview/source SHA、方法与风险,仍为工程 candidate;稀疏 safe graph 不伪补 approved。runtime03 可以记录 pending,因为 debug 精确 manifest hash 准入代表本次实验授权,不代表 final quality/1sSLA。实际输出字段若不同,先发送真实 manifest 供适配,不需要覆盖既有包。