Skip to content

FCameraShmWriter

Per-camera SHM publisher.

Writes raw pixel frames into a double-buffered SHM region named cam_<prefix>_<name>.shm. Same producer pattern as the state snapshot publisher: write into !latest, flip latest, bump sequence. No background thread -- the camera readback callback feeds this directly on the game / render-thread sidecar. Wire layout per slot: [u32 size][bytes...]. The byte format depends on the camera mode and is documented out-of-band via the handshake: - Real: width * height * 4 bytes BGRA8 (FColor). - Depth: width * height * 4 bytes float32 (single channel). - Semantic / Instance: width * height * 4 bytes BGRA8 with a per-class / per-instance color tint baked in. All four modes share the same 4 bytes-per-pixel stride, so the SHM region size is independent of mode.

Attribute Value
Kind Class

Properties

Public Properties

Property Type Description
default ``
Unmap **
Region private: FMjShmRegion

default

  • Type:

Unmap

  • Type: **

Region

Private Properties

Property Type Description
ExpectedPixels int32

ExpectedPixels

  • Type: int32

Functions

Public Functions

General

Function Returns Description
Open() bool Open / truncate the SHM file. The slot stride is sized to hold
Close() void Unmap; optionally remove the backing file.
PushFrame() void Push one frame's raw bytes. Silently drops if ByteCount doesn't
Open

Open / truncate the SHM file. The slot stride is sized to hold

  • Signature: Open(const FString& Path, FIntPoint Resolution)
  • Returns: bool
Close

Unmap; optionally remove the backing file.

  • Signature: Close(bool bDeleteFile)
PushFrame

Push one frame's raw bytes. Silently drops if ByteCount doesn't

  • Signature: PushFrame(const void* Data, uint32 ByteCount)