BB.Camera.StreamInfo (bb_camera v0.1.1)

Copy Markdown View Source

What a camera produces: format and geometry.

There are two of these in play for any running camera, and the difference matters.

The declared one comes from BB.Camera.stream_info/1, which runs during discovery against robots that aren't started. It can only describe what the DSL asked for.

The live one is whatever the driver handed to BB.Camera.Hub once it had opened the device and seen a real frame. A camera asked for 1280x720 that negotiated 640x480 reports the latter, as soon as it knows it, via BB.Camera.Hub.update_stream_info/2.

Consumers are told about a change before the first frame it describes, so nothing ever attributes a frame to the wrong geometry.

Summary

Functions

Build a stream info, rejecting formats this package won't carry.

Like new/1, but raises.

Types

t()

@type t() :: %BB.Camera.StreamInfo{
  format: BB.Camera.Format.t(),
  frame_rate: float() | nil,
  height: pos_integer(),
  metadata: map(),
  width: pos_integer()
}

Functions

new(opts)

@spec new(keyword()) :: {:ok, t()} | {:error, term()}

Build a stream info, rejecting formats this package won't carry.

new!(opts)

@spec new!(keyword()) :: t()

Like new/1, but raises.