View Source ExRTCP.Packet (ex_rtcp v0.1.0)
RTCP packet encoding and decoding functionalities.
Summary
Functions
Decodes RTCP packet. Returns a struct representing the packet based on its type.
Encodes the packet and returns the resulting binary.
Types
@type decode_error() :: :invalid_packet | :unknown_type
Possible decode/1 errors.
:invalid_packet- this binary could not be parsed as a valid RTCP packet:unknown_type- this type of RTCP packet is not supported or does not exist
@type packet() :: ExRTCP.Packet.SenderReport.t() | ExRTCP.Packet.ReceiverReport.t() | ExRTCP.Packet.SourceDescription.t() | ExRTCP.Packet.Goodbye.t()
@type uint8() :: 0..255
@type uint16() :: 0..65535
@type uint24() :: 0..16_777_216
@type uint32() :: 0..4_294_967_295
@type uint64() :: 0..18_446_744_073_709_551_615
Functions
@spec decode(binary()) :: {:ok, packet()} | {:error, decode_error()}
Decodes RTCP packet. Returns a struct representing the packet based on its type.
This function assumes that passed binary is a packet of valid length and
ignores length field in the header.
Encodes the packet and returns the resulting binary.
Options:
padding- number of padding bytes added to packet, no padding is added by default, must be multiple of 4, and smaller than 256