Membrane.WebRTC.EndpointBin (Membrane WebRTC plugin v0.1.0-alpha) View Source

Module responsible for interacting with a WebRTC peer.

To send or receive tracks from a WebRTC peer, specify them with :inbound_tracks and :outbound_tracks options, and link corresponding :input and :output pads with ids matching the declared tracks' ids.

The tracks can be manipulated by sending track_message/0.

To initiate or modify the connection, the bin sends and expects to receive signal_message/0.

Bin options

Passed via struct Membrane.WebRTC.EndpointBin.t/0

  • inbound_tracks

    [Membrane.WebRTC.Track.t()]

    Default value: []
    List of initial inbound tracks

  • outbound_tracks

    [Membrane.WebRTC.Track.t()]

    Default value: []
    List of initial outbound tracks

  • stun_servers

    [ExLibnice.stun_server()]

    Default value: []
    List of stun servers

  • turn_servers

    [ExLibnice.relay_info()]

    Default value: []
    List of turn servers

  • port_range

    Range.t()

    Default value: 0..0
    Port range to be used by Membrane.ICE.Bin

  • handshake_opts

    Keyword.t()

    Default value: []
    Keyword list with options for handshake module. For more information please refer to Membrane.ICE.Bin

  • video_codecs

    [ExSDP.Attribute.t()]

    Default value: []
    Video codecs that will be passed for SDP offer generation

  • audio_codecs

    [ExSDP.Attribute.t()]

    Default value: []
    Audio codecs that will be passed for SDP offer generation

  • use_default_codecs

    [:audio | :video]

    Default value: [:audio, :video]
    Defines whether to use default codecs or not. Default codecs are those required by WebRTC standard - OPUS, VP8 and H264

  • log_metadata

    :list

    Default value: []
    Logger metadata used for endpoint bin and all its descendants

Pads

:input

Availability:on_request
Caps:any
Demand unit:buffers
Direction:input
Mode:pull
Name:input

Options:

  • encoding

    :OPUS | :H264

    Required
    Track encoding

  • track_enabled

    boolean()

    Default value: true
    Enable or disable track

:output

Availability:on_request
Caps:any
Demand unit:buffers
Direction:output
Mode:pull
Name:output

Options:

  • track_enabled

    boolean()

    Default value: true
    Enable or disable track

  • extensions

    [Membrane.RTP.SessionBin.extension_t()]

    Default value: []
    List of tuples representing rtp extensions

Link to this section Summary

Types

Message that adds or removes tracks.

Message that disables track.

Message that enables track.

Options for pad :input

Options for pad :output

t()

Struct containing options for Membrane.WebRTC.EndpointBin

Functions

Returns pads descriptions for Membrane.WebRTC.EndpointBin

Returns description of options available for this module

Link to this section Types

Link to this type

alter_tracks_message()

View Source

Specs

alter_tracks_message() ::
  {:add_tracks, [Membrane.WebRTC.Track.t()]}
  | {:remove_tracks, [Membrane.WebRTC.Track.id()]}

Message that adds or removes tracks.

Link to this type

disable_track_message()

View Source

Specs

disable_track_message() :: {:disable_track, Membrane.WebRTC.Track.id()}

Message that disables track.

Link to this type

enable_track_message()

View Source

Specs

enable_track_message() :: {:disable_track, Membrane.WebRTC.Track.id()}

Message that enables track.

Specs

input_pad_opts_t() :: [encoding: :OPUS | :H264, track_enabled: boolean()]

Options for pad :input

Specs

output_pad_opts_t() :: [
  track_enabled: boolean(),
  extensions: [Membrane.RTP.SessionBin.extension_t()]
]

Options for pad :output

Specs

signal_message() ::
  {:signal, {:sdp_offer | :sdp_answer, String.t()} | {:candidate, String.t()}}

Specs

t() :: %Membrane.WebRTC.EndpointBin{
  audio_codecs: [ExSDP.Attribute.t()],
  handshake_opts: Keyword.t(),
  inbound_tracks: [Membrane.WebRTC.Track.t()],
  log_metadata: :list,
  outbound_tracks: [Membrane.WebRTC.Track.t()],
  port_range: Range.t(),
  stun_servers: [ExLibnice.stun_server()],
  turn_servers: [ExLibnice.relay_info()],
  use_default_codecs: [:audio | :video],
  video_codecs: [ExSDP.Attribute.t()]
}

Struct containing options for Membrane.WebRTC.EndpointBin

Specs

Link to this section Functions

Specs

membrane_pads() :: [{Membrane.Pad.name_t(), Membrane.Pad.description_t()}]

Returns pads descriptions for Membrane.WebRTC.EndpointBin

Specs

options() :: keyword()

Returns description of options available for this module