View Source ExWebRTC.RTP.Payloader (ex_webrtc v0.6.2)

RTP payloader.

It packs audio/video frames into one or more RTP packets.

Summary

Functions

Creates a new payloader that matches the passed codec parameters.

Packs a frame into one or more RTP packets.

Types

@opaque payloader()

Functions

Link to this function

new(codec_params, opts \\ [])

View Source
@spec new(ExWebRTC.RTPCodecParameters.t(), [{:max_payload_size, integer()}]) ::
  {:ok, payloader()} | {:error, :no_payloader_for_codec}

Creates a new payloader that matches the passed codec parameters.

Opts:

  • max_payload_size - determines the maximum size of a single RTP packet outputted by the payloader. It must be greater than 100, and is set to 1000 by default.
Link to this function

payload(payloader, frame)

View Source
@spec payload(payloader(), binary()) :: {[ExRTP.Packet.t()], payloader()}

Packs a frame into one or more RTP packets.

Returns the packets together with the updated payloader.