View Source ExRTP.Packet.Extension behaviour (ex_rtp v0.4.0)

RTP header extension functionalities.

Summary

Types

t()

Struct representing raw RTP header extension as defined in RFC 8285.

Callbacks

Converts raw extension to extension struct.

Converts extension struct to raw extension which can be used in ExRTP.Packet.add_extension/2.

Types

@type t() :: %ExRTP.Packet.Extension{data: binary(), id: non_neg_integer() | nil}

Struct representing raw RTP header extension as defined in RFC 8285.

Callbacks

@callback from_raw(raw :: t()) :: {:ok, struct()} | {:error, :invalid_extension}

Converts raw extension to extension struct.

@callback to_raw(extension :: struct(), id :: non_neg_integer()) :: t()

Converts extension struct to raw extension which can be used in ExRTP.Packet.add_extension/2.

Functions

@spec new(non_neg_integer() | nil, binary()) :: t()

Create new ExRTP.Packet.Extension.t/0 struct.