View Source Membrane.RTP.Packet (Membrane RTP plugin v0.27.1)

Defines a struct describing an RTP packet and a way to parse and serialize it. Based on RFC3550

Supports only one-byte header from RFC8285, as according to the document this form is preferred and it must be supported by all receivers.

Summary

Types

Possible padding size.

t()

Types

@type padding_size() :: 0..255

Possible padding size.

It includes the last byte denoting the size of the padding.

@type t() :: %Membrane.RTP.Packet{header: Membrane.RTP.Header.t(), payload: binary()}

Functions

@spec identify(binary()) :: :rtp | :rtcp
Link to this function

parse(packet, encrypted?)

View Source
@spec parse(binary(), boolean()) ::
  {:ok,
   %{
     packet: t(),
     padding_size: padding_size(),
     total_header_size: non_neg_integer()
   }}
  | {:error, :wrong_version | :malformed_packet}
Link to this function

serialize(packet, opts \\ [])

View Source
@spec serialize(t(), [{:padding_size, padding_size()}]) :: binary()