# `Membrane.Smelter.Lifecycle`
[🔗](https://github.com/membraneframework/membrane_smelter_plugin/blob/v0.12.2/lib/membrane/smelter/lifecycle.ex#L1)

Lifecycle of the input and output streams.

### Input pad

- `t:input_registered/0`
- `t:input_delivered/0`
- `t:input_playing/0`
- `t:input_eos/0`

### Output pad

- `t:output_registered/0`

### Notifications

`t:notification/0` defines notifications that will be sent to the parent process at the specific
moments of the stream lifecycle.

# `input_delivered`

```elixir
@type input_delivered() :: :input_delivered
```

The smelter instance received the input. The first frames/samples of that input are
ready to be used.

For example, if you want to ensure that some inputs are ready before you send the
`:start_composing` notification, you can wait for `t:input_delivered/0` for specific inputs.
Note that you need to set `composing_strategy:` to something other than `:real_time_auto_init`
if you want to send `:start_composing` message yourself.

# `input_eos`

```elixir
@type input_eos() :: :input_eos
```

Input finished processing. After this notification you can unregister without drooping any
frames/samples

# `input_playing`

```elixir
@type input_playing() :: :input_playing
```

The smelter instance received the input, and the first frames/samples of that input are used
for rendering. This notification can only be sent if Smelter was already started either via
`composing_strategy: :real_time_auto_init` or with `:start_composing` message.

This notification is usually sent at the same time as `t:input_delivered/0` except for 2 cases:
- First frames/samples of the input were delivered before composing was started.
- If input has the `offset` field defined.

# `input_registered`

```elixir
@type input_registered() :: :input_registered
```

The input pad was linked and the TCP connection was established between pipeline and
the smelter instance.

# `notification`

```elixir
@type notification() ::
  {input_registered()
   | input_delivered()
   | input_playing()
   | input_eos()
   | output_registered(), Membrane.Pad.ref(), Membrane.Smelter.Context.t()}
```

# `output_registered`

```elixir
@type output_registered() :: :output_registered
```

The output pad was linked and the TCP connection was established between pipeline and
the smelter instance.

---

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