ExWebRTC.RTP.Depayloader (ex_webrtc v0.15.0)

View Source

RTP depayloader.

It unpacks RTP packets into audio/video frames.

Summary

Functions

Processes binary data from a single RTP packet, and outputs a frame if assembled.

Creates a new depayloader that matches the passed codec parameters.

Types

depayloader()

@opaque depayloader()

Functions

depayload(depayloader, packet)

@spec depayload(depayloader(), ExRTP.Packet.t()) ::
  {(frame :: binary()) | (dtmf_event :: map()) | nil, depayloader()}

Processes binary data from a single RTP packet, and outputs a frame if assembled.

Returns a tuple where the first element is a frame, dtmf event (map), or nil if a frame/dtmf event could not be depayloaded yet, and the second element is the updated depayloader.

new(codec_params)

@spec new(ExWebRTC.RTPCodecParameters.t()) ::
  {:ok, depayloader()} | {:error, :no_depayloader_for_codec}

Creates a new depayloader that matches the passed codec parameters.