View Source Membrane.WebRTC.EndpointBin (Membrane WebRTC plugin v0.6.0)

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

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

  • direction

    direction()

    Default value: :sendrecv
    Direction of EndpointBin. Determines whether EndpointBin can send, receive or both send and receive media. For more information refer to t:direction/0.

  • handshake_opts

    Keyword.t()

    Default value: []
    Keyword list with options for handshake module. For more information please refer to ExDTLS.opts_t/0

  • rtcp_receiver_report_interval

    Membrane.Time.t() | nil

    Default value: nil
    Receiver reports's generation interval, set to nil to avoid reports generation

  • rtcp_sender_report_interval

    Membrane.Time.t() | nil

    Default value: nil
    Sender reports's generation interval, set to nil to avoid reports generation

  • filter_codecs

    ({RTPMapping.t(), FMTP.t() | nil} -> boolean())

    Default value: &Membrane.WebRTC.SDP.filter_mappings/1
    Defines function which will filter SDP m-line by codecs

  • extensions

    [Extension.t()]

    Default value: []
    List of WebRTC extensions that should be enabled

  • log_metadata

    :list

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

  • integrated_turn_options

    [ICE.Endpoint.integrated_turn_options_t()]

    Default value: []
    Integrated TURN Options

  • simulcast?

    boolean()

    Default value: true
    Whether to accept simulcast tracks or not. If set to false, simulcast tracks will be disabled i.e. sender will not send them.

  • trace_metadata

    :list

    Default value: []
    A list of tuples to merge into Otel spans

  • trace_context

    :list | any()

    Default value: []
    Trace context for otel propagation

  • telemetry_label

    Membrane.TelemetryMetrics.label()

    Default value: []
    Label passed to Membrane.TelemetryMetrics functions

pads

Pads

input

:input

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

Options:

  • use_payloader?

    boolean()

    Default value: true
    Defines if incoming stream should be payloaded based on given encoding. Otherwise the stream is assumed be in RTP format.

output

:output

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

Options:

  • extensions

    [Membrane.RTP.SessionBin.extension_t()]

    Default value: []
    List of general extensions that will be applied to the SessionBin's output pad

  • use_depayloader?

    boolean()

    Default value: true
    Defines if the outgoing stream should get depayloaded.

    This option should be used as a convenience, it is not necessary as the new track notification returns a depayloading filter's definition that can be attached to the output pad to work the same way as with the option set to true.

  • rtcp_fir_interval

    Membrane.Time.t() | nil

    Default value: 1000000000
    Defines how often FIR should be sent.

    For more information refer to RFC 5104 section 4.3.1.

Link to this section Summary

Types

Message that adds or removes tracks.

Type describing possible media flow directions.

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
@type alter_tracks_message() ::
  {:add_tracks, [Membrane.WebRTC.Track.t()]}
  | {:remove_tracks, [Membrane.WebRTC.Track.id()]}

Message that adds or removes tracks.

@type direction() :: :recvonly | :sendonly | :sendrecv

Type describing possible media flow directions.

  • :recvonly - only receive media from the peer
  • :sendonly - only send media to the peer
  • :sendrecv - both send and receive media from the peer
@type input_pad_opts_t() :: [{:use_payloader?, boolean()}]

Options for pad :input

@type output_pad_opts_t() :: [
  extensions: [Membrane.RTP.SessionBin.extension_t()],
  use_depayloader?: boolean(),
  rtcp_fir_interval: Membrane.Time.t() | nil
]

Options for pad :output

@type signal_message() ::
  {:signal, {:sdp_offer | :sdp_answer, String.t()} | {:candidate, String.t()}}
@type t() :: %Membrane.WebRTC.EndpointBin{
  direction: direction(),
  extensions: [Membrane.WebRTC.Extension.t()],
  filter_codecs:
    ({ExSDP.Attribute.RTPMapping.t(), ExSDP.Attribute.FMTP.t() | nil} ->
       boolean()),
  handshake_opts: Keyword.t(),
  inbound_tracks: [Membrane.WebRTC.Track.t()],
  integrated_turn_options: [Membrane.ICE.Endpoint.integrated_turn_options_t()],
  log_metadata: :list,
  outbound_tracks: [Membrane.WebRTC.Track.t()],
  rtcp_receiver_report_interval: Membrane.Time.t() | nil,
  rtcp_sender_report_interval: Membrane.Time.t() | nil,
  simulcast?: boolean(),
  telemetry_label: Membrane.TelemetryMetrics.label(),
  trace_context: :list | any(),
  trace_metadata: :list
}

Struct containing options for Membrane.WebRTC.EndpointBin

@type track_message() :: alter_tracks_message()

Link to this section Functions

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

Returns pads descriptions for Membrane.WebRTC.EndpointBin

@spec options() :: keyword()

Returns description of options available for this module