ReferenceDevice capabilities
motion-detection
The motion-detection device capability: methods, state and events.
The definition carries no description.
At a glance
| Capability | motion-detection |
| Provided by | An addon wraps the device and provides it. It is bound to a device through the device bindings and can be bound automatically to compatible devices. |
| Active providers per device | one |
| Device types | camera |
| Source | packages/types/src/capabilities/motion-detection.cap.ts |
Methods
| Method | Kind | Required of a provider | Access |
|---|---|---|---|
analyze | mutation | yes | default |
removeCamera | mutation | yes | default |
reset | mutation | yes | default |
analyze
mutation
Exactly one of frame / frameHandle carries the pixels. frame ships gray pixels inline (today's path). frameHandle (CB5) names the same shm ring slot so a hub-local motion provider reads pixels back zero-copy instead of re-serialising them over UDS. A recycled slot / foreign handle yields a null read → empty result (the runner ships frame as the fallback, queue-depth gated). The pipeline's own frame analysis: never a viewer's call.
Input
| Field | Type | Required | Description |
|---|---|---|---|
deviceId | number | yes | |
frame | { data: binary or opaque value; format: "jpeg" | "rgb" | "bgr" | "yuv420" | "gray"; width: number; height: number; timestamp: number } | no | |
frameHandle | { shmId: string; slot: number; seq: number; width: number; height: number; format: "jpeg" | "rgb" | "bgr" | "yuv420" | "gray"; pts: number; byteLength: number; nodeId: string; slotCount: number } | no |
Output
| Field | Type | Required | Description |
|---|---|---|---|
detected | boolean | yes | |
regionCount | number | yes | |
regions | ({ bbox: { x: number; y: number; w: number; h: number }; pixelCount: number; intensity: number })[] | yes | Regions passing minArea filter — used for pipeline triggering. |
rawRegions | ({ bbox: { x: number; y: number; w: number; h: number }; pixelCount: number; intensity: number })[] | yes | All raw regions from CCL before minArea filter — used for UI debug overlay. |
frameWidth | number | yes | |
frameHeight | number | yes | |
analysisMs | number | yes |
removeCamera
mutation
Input
| Field | Type | Required | Description |
|---|---|---|---|
deviceId | number | yes |
Output
Nothing.
reset
mutation
Input
void
Output
Nothing.
Events
onMotion
| Field | Type | Required | Description |
|---|---|---|---|
deviceId | number | yes | |
detected | boolean | yes | |
regionCount | number | yes |