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

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

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

Link to this section Summary

Link to this section Types

Specs

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

Link to this section Functions

Specs

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

parse(packet, encrypted?)

View Source

Specs

parse(binary(), boolean()) ::
  {:ok,
   %{packet: t(), has_padding?: boolean(), total_header_size: non_neg_integer()}}
  | {:error, :wrong_version | :malformed_packet}
Link to this function

serialize(packet, list \\ [align_to: 1])

View Source

Specs

serialize(t(), [{:align_to, pos_integer()}]) :: binary()