# `BB.Camera.StreamInfo`
[🔗](https://github.com/beam-bots/bb_camera/blob/main/lib/bb/camera/stream_info.ex#L5)

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 `c: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.

# `t`

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

# `new`

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

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

# `new!`

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

Like `new/1`, but raises.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
