Membrane Core v0.5.0 Membrane.Payload protocol View Source

This protocol describes actions common to all payload types.

The most basic payload type is simply a binary for which Elixir.Membrane.Payload is implemented by the Membrane Core.

Link to this section Summary

Functions

Concatenates the contents of two payloads.

Drops first n bytes of payload.

Returns a module responsible for this type of payload and implementing Membrane.Payload.Behaviour

Returns total size of payload in bytes

Splits the payload at given position (1st part has the size equal to at_pos argument)

Converts payload into binary

Link to this section Types

Link to this section Functions

Link to this function

concat(left, right)

View Source
concat(left :: t(), right :: t()) :: t()

Concatenates the contents of two payloads.

Link to this function

drop(payload, n)

View Source
drop(payload :: t(), n :: non_neg_integer()) :: t()

Drops first n bytes of payload.

Link to this function

module(payload)

View Source
module(t()) :: module()

Returns a module responsible for this type of payload and implementing Membrane.Payload.Behaviour

Link to this function

size(payload)

View Source
size(payload :: t()) :: non_neg_integer()

Returns total size of payload in bytes

Link to this function

split_at(payload, at_pos)

View Source
split_at(payload :: t(), at_pos :: pos_integer()) :: {t(), t()}

Splits the payload at given position (1st part has the size equal to at_pos argument)

at_pos has to be greater than 0 and smaller than the size of payload, otherwise an error is raised. This guarantees returned payloads are never empty.

Link to this function

to_binary(payload)

View Source
to_binary(t()) :: binary()

Converts payload into binary