# `Membrane.Buffer`
[🔗](https://github.com/membraneframework/membrane-core/blob/v1.2.7/lib/membrane/buffer.ex#L1)

Structure representing a single chunk of data that flows between elements.

For now, it is just a wrapper around bitstring with optionally some metadata
attached to it, but in future releases we plan to support different payload
types.

# `metadata`

```elixir
@type metadata() :: map()
```

# `t`

```elixir
@type t() :: %Membrane.Buffer{
  dts: Membrane.Time.t() | nil,
  metadata: metadata(),
  payload: Membrane.Payload.t(),
  pts: Membrane.Time.t() | nil
}
```

Structure representing a single chunk of data that flows between elements.

For now, it is just a wrapper around bitstring with optionally some metadata
attached to it, but in future releases we plan to support different payload
types.

# `get_dts_or_pts`

```elixir
@spec get_dts_or_pts(t()) :: Membrane.Time.t() | nil
```

Returns `t:Membrane.Buffer.t/0` `:dts` if available or `:pts` if `:dts` is not set.
If none of them is set `nil` is returned.

---

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