# `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.

The `reason` says why:

- `:interframe` - the format's frames depend on earlier frames (H.264 and
  friends). `BB.Camera.Hub` keeps only the latest frame and drops the rest,
  which is lossless for independently decodable frames and silently
  destructive for these. Rather than hand a consumer a stream that decodes to
  garbage, it refuses to carry it at all.
- `:not_implemented` - a format that could in principle be carried but isn't
  yet, raw pixel buffers being the obvious one.
- `:mismatch` - the caller asserted a format the camera doesn't produce.

# `reason`

```elixir
@type reason() :: :interframe | :not_implemented | :mismatch
```

# `t`

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

# `exception`

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

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

## Keys

- :format
- :expected
- :reason

---

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