Membrane.WebRTC.SDP (Membrane WebRTC plugin v0.1.0) View Source

Module containing helper functions for creating SPD offer.

Link to this section Summary

Link to this section Types

Specs

fingerprint() :: {ExSDP.Attribute.hash_function(), binary()}

Link to this section Functions

Specs

create_answer(
  ice_ufrag: String.t(),
  ice_pwd: String.t(),
  fingerprint: fingerprint(),
  audio_codecs: [ExSDP.Attribute.t()],
  video_codecs: [ExSDP.Attribute.t()],
  inbound_tracks: [Membrane.WebRTC.Track.t()],
  outbound_tracks: [Membrane.WebRTC.Track.t()]
) :: ExSDP.t()

Creates Unified Plan SDP answer.

The mandatory options are:

  • ice_ufrag - ICE username fragment
  • ice_pwd - ICE password
  • fingerprint - DTLS fingerprint
  • inbound_tracks - list of inbound tracks
  • outbound_tracks - list of outbound tracks
  • mappings - dictionary where keys are tracks_id and value are mapping got from SDP offer.

Additionally accepts audio_codecs and video_codecs options, that should contain lists of SDP attributes for desired codecs, for example:

video_codecs: [
  %RTPMapping{payload_type: 98, encoding: "VP9", clock_rate: 90_000}
]
Link to this function

filter_mappings(rtp_fmtp_pair)

View Source

Specs

filter_mappings({ExSDP.Attribute.RTPMapping, ExSDP.Attribute.FMTP}) :: boolean()
Link to this function

get_tracks(sdp, codecs_filter, old_inbound_tracks, outbound_tracks, mid_to_track_id)

View Source

Specs

get_tracks(
  sdp :: ExSDP.t(),
  codecs_filter ::
    ({ExSDP.Attribute.RTPMapping, ExSDP.Attribute.FMTP} -> boolean()),
  old_inbound_tracks :: [Membrane.WebRTC.Track.t()],
  outbound_tracks :: [Membrane.WebRTC.Track.t()],
  mid_to_track_id :: %{}
) ::
  {new_inbound_tracks :: [Membrane.WebRTC.Track.t()],
   inbound_tracks :: [Membrane.WebRTC.Track.t()],
   outbound_tracks :: [Membrane.WebRTC.Track.t()]}