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

A camera has stopped capturing.

`reason` distinguishes the three ways that happens:

- `:no_subscribers` - the last consumer went away, so the hub asked the
  driver to stop. The ordinary case.
- `:driver_stopped` - the driver stopped of its own accord.
- `:error` - capture failed. `error` carries the `BB.Error` the driver
  reported, and every subscriber is told separately rather than being left
  waiting on a stream that will not resume.

# `t`

```elixir
@type t() :: %BB.Message.Camera.EndCapture{
  error: struct() | nil,
  frame_count: non_neg_integer(),
  reason: :no_subscribers | :driver_stopped | :error
}
```

# `new`

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

---

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