Table of Contents

Core Concepts

Four ideas cover the whole extension. Read this page once and the rest of the documentation is detail.

Table of Contents

Players Are Configured, Not Constructed

One Service, One Client

The Extension Decodes, the Compositor Places

Inputs Differ Only in Bring-Up and Control

One Process per Feed

Graceful Failover

Players Are Configured, Not Constructed

A player is one configured video feed: an id, an input type, a source and a surface. Players are created in the Toolkit and saved to VideoPlayerConfiguration.json. Your application cannot add one at runtime — it reads the list with GetVideoPlayers() and plays them by VideoPlayerID.

A camera player's source is a logical port: GMSL0, ANALOG1, VCIC2. It is never a device path. At runtime the service resolves it:

Logical port Resolves to
GMSLn /usr/local/Ahsoka/devices/video/gmsln, a symlink the bring-up publishes to the real /dev/videoN
ANALOGn /usr/local/Ahsoka/devices/video/analogn, likewise
VCICn The camera's commissioned IP address and RTP port

Because /dev/videoN numbering shifts with what is plugged in, the logical name is what keeps a configuration portable across units of the same board.

A File player's source is a path — relative to the application folder, or absolute — or empty, in which case the application names the file when it plays. See Video Files.

One Service, One Client

VideoService is an OpenPV service hosted by your application's service manager. You talk to it through VideoServiceClient:

sequenceDiagram
    participant App as Your application
    participant Client as VideoServiceClient
    participant Svc as VideoService
    participant Exe as Ahsoka.VideoPlayer

    App->>Client: GetVideoPlayers()
    Client->>Svc: request
    Svc-->>Client: VideoPlayerInfo
    App->>Client: PlayVideo(id)
    Client->>Svc: request
    Svc->>Exe: launch with pipeline + SurfaceID
    Svc-->>Client: VideoStatus (Playing / Unavailable)
    loop every StatusUpdateInMs
        Svc-->>Client: StatusUpdated(VideoStatus)
    end
    App->>Client: StopVideo(id)
    Client->>Svc: request
    Svc->>Exe: shut down
    Svc-->>Client: VideoStatus (Stopped)

Every request is synchronous and returns a VideoStatus. Status also arrives asynchronously as a StatusUpdated notification if you asked for it. See The Client API.

The Extension Decodes, the Compositor Places

Each playing feed renders, via GStreamer's glimagesink, to the IVI surface whose id is the player's SurfaceID. That id is the only thing the extension knows about the screen.

Owned by the extension Owned by the screen configuration and LayerManager
Which surface a feed draws to (SurfaceID) Which screen the surface is on
The resolution the feed is rendered at Its x, y, width and height
Deinterlace and flip Its layer, z-order, visibility and opacity

So "move the camera to the right" is never a video-service call. It is a change to the surface's rectangle in PackageInfo.json, or a runtime LayerManagerServiceClient call. See Rendering & Surfaces.

Inputs Differ Only in Bring-Up and Control

The client API is identical for every input type. What differs is what has to happen before and during play:

GMSL / Analog VCIC File
Before the first play Boot-time bring-up loads the drivers, routes the media graph and publishes the port symlinks One-off commissioning gives each camera its own address Nothing — the file only has to be on the display
Presence A port with no camera has no symlink GetVcicStatus() reports which cameras answer and are commissioned PlayVideo checks the path and reads the file's header
Play Open the capture node SOME/IP Subscribe — the camera starts streaming Open the file
Stop Close the capture node SOME/IP UnSubscribe — the camera stops streaming Close the file; the end of the file also stops it
Decode None — raw UYVY Hardware H.264 (wave5) Hardware H.264 or H.265 (wave5)
Transport None — live None — live Pause, resume and restart

One Process per Feed

On the device, every playing player runs its own Ahsoka.VideoPlayer process. The service writes the pipeline (to a temporary file when it contains GL shader stages), sets GLIMAGESINK_SURFACE_ID and WAYLANDSINK_SURFACE_ID to the player's surface id, and starts the process. It reads the process's output for status lines and watches for it to exit.

Stopping a feed kills that process. glimagesink's GL/Wayland teardown does not let the process exit on its own, so the service ends it deliberately: GMSL and analog are killed straight away; VCIC and File first ask the helper to drain the hardware decoder and wait (up to three seconds) for it to report that it has, so the decoder is idle before the process goes. A File player's restart works the same way: the old process is stopped and a fresh one started.

A second PlayVideo on a player that is already playing does nothing and returns the current status. To change how a feed is rendered — the render size of a VCIC or File player, for example — stop it and play it again.

Graceful Failover

Nothing about a missing camera or file is fatal. A player whose camera is absent, whose port the board does not have, whose file is missing or not supported, or whose input type has no pipeline reports Unavailable from PlayVideo, logs why, and leaves every other player alone. Plug the camera in (and, for GMSL/analog, reboot so the bring-up sees it), or fix the file, and play it again.