View Source Membrane.RTCP.Packet behaviour (Membrane RTP plugin v0.23.0)

Functions common to all RTCP Packets

Link to this section 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

Link to this section Types

Link to this section Callbacks

Link to this callback

decode(binary, packet_specific)

View Source
@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

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

Encodes packet struct into the tuple used by serialize/1

Link to this section Functions

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

Converts packet structure into binary