Membrane.RTCP.Packet behaviour (Membrane RTP plugin v0.31.5)

Copy Markdown View Source

Functions common to all RTCP Packets

Summary

Callbacks

Decodes binary with packet body (without header) into packet struct. Used by parse/1

Encodes packet struct into the tuple used by serialize/1

Functions

Converts packet structure into binary

Types

Callbacks

decode(binary, packet_specific)

@callback decode(binary(), packet_specific :: Membrane.RTCP.Header.packet_specific_t()) ::
  {:ok, struct()} | {:error, atom()}

Decodes binary with packet body (without header) into packet struct. Used by parse/1

encode(struct)

@callback encode(struct()) ::
  {body :: binary(),
   packet_specific :: Membrane.RTCP.Header.packet_specific_t()}

Encodes packet struct into the tuple used by serialize/1

Functions

parse(packets)

@spec parse(binary()) :: {:ok, [t()]} | {:error, :malformed_packet}

serialize(packet)

@spec serialize(t() | [t()]) :: binary()

Converts packet structure into binary