# `BB.Error.Invalid.Camera.UnsupportedFormat`
[🔗](https://github.com/beam-bots/bb_camera/blob/main/lib/bb/error/invalid/camera/unsupported_format.ex#L5)

A media format this package will not carry.

`bb_camera` carries raw frames only; see `BB.Camera.Format`. The `reason`
says what was wrong:

- `:encoded` - the format is a codec (JPEG, H.264, ...) rather than
  `{:raw, pixel_format}`. Drivers decode before handing frames to the hub.
- `:unknown_pixel_format` - a raw format whose pixel format
  `Membrane.RawVideo` doesn't name.
- `:invalid_dimensions` - dimensions the pixel format can't take, such as an
  odd width for chroma-subsampled `:I420`.
- `:mismatch` - the caller asserted a format the camera doesn't produce.

# `reason`

```elixir
@type reason() :: :encoded | :unknown_pixel_format | :invalid_dimensions | :mismatch
```

# `t`

```elixir
@type t() :: %BB.Error.Invalid.Camera.UnsupportedFormat{
  __exception__: term(),
  bread_crumbs: term(),
  class: term(),
  expected: term(),
  format: term(),
  height: pos_integer() | nil,
  path: term(),
  reason: reason(),
  splode: term(),
  stacktrace: term(),
  vars: term(),
  width: pos_integer() | nil
}
```

# `exception`

```elixir
@spec exception(opts :: Keyword.t()) :: %BB.Error.Invalid.Camera.UnsupportedFormat{
  __exception__: term(),
  bread_crumbs: term(),
  class: term(),
  expected: term(),
  format: term(),
  height: term(),
  path: term(),
  reason: term(),
  splode: term(),
  stacktrace: term(),
  vars: term(),
  width: term()
}
```

Create an `Elixir.BB.Error.Invalid.Camera.UnsupportedFormat` without raising it.

## Keys

- :format
- :expected
- :width
- :height
- :reason

---

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