Membrane.WebRTC.EndpointBin (Membrane WebRTC plugin v0.1.0) 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 tracksoutbound_tracks
[Membrane.WebRTC.Track.t()]
Default value:
[]
List of initial outbound tracksstun_servers
[ExLibnice.stun_server()]
Default value:
[]
List of stun serversturn_servers
[ExLibnice.relay_info()]
Default value:
[]
List of turn serversport_range
Range.t()
Default value:
0..0
Port range to be used byMembrane.ICE.Bin
handshake_opts
Keyword.t()
Default value:
[]
Keyword list with options for handshake module. For more information please refer toMembrane.ICE.Bin
video_codecs
[ExSDP.Attribute.t()]
Default value:
[]
Video codecs that will be passed for SDP offer generationaudio_codecs
[ExSDP.Attribute.t()]
Default value:
[]
Audio codecs that will be passed for SDP offer generationfilter_codecs
({RTPMapping.t(), FMTP.t() | nil} -> boolean())
Default value:
&Membrane.WebRTC.SDP.filter_mappings/1
Defines function which will filter SDP m-line by codecslog_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 | :VP8
Required
Track encodingtrack_enabled
boolean()
Default value:
true
Enable or disable trackuse_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
Availability | :on_request |
Caps | :any |
Demand unit | :buffers |
Direction | :output |
Mode | :pull |
Name | :output |
Options:
track_enabled
boolean()
Default value:
true
Enable or disable trackpacket_filters
[Membrane.RTP.SessionBin.packet_filter_t()]
Default value:
[]
List of packet filters that will be applied to the SessionBin's output padextensions
[Membrane.RTP.SessionBin.extension_t()]
Default value:
[]
List of tuples representing rtp extensionsuse_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.
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
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
Specs
alter_tracks_message() :: {:add_tracks, [Membrane.WebRTC.Track.t()]} | {:remove_tracks, [Membrane.WebRTC.Track.id()]}
Message that adds or removes tracks.
Specs
disable_track_message() :: {:disable_track, Membrane.WebRTC.Track.id()}
Message that disables track.
Specs
enable_track_message() :: {:disable_track, Membrane.WebRTC.Track.id()}
Message that enables track.
Specs
input_pad_opts_t() :: [ encoding: :OPUS | :H264 | :VP8, track_enabled: boolean(), use_payloader?: boolean() ]
Options for pad :input
Specs
output_pad_opts_t() :: [ track_enabled: boolean(), packet_filters: [Membrane.RTP.SessionBin.packet_filter_t()], extensions: [Membrane.RTP.SessionBin.extension_t()], use_depayloader?: boolean() ]
Options for pad :output
Specs
Specs
t() :: %Membrane.WebRTC.EndpointBin{ audio_codecs: [ExSDP.Attribute.t()], filter_codecs: ({ExSDP.Attribute.RTPMapping.t(), ExSDP.Attribute.FMTP.t() | nil} -> boolean()), 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()], video_codecs: [ExSDP.Attribute.t()] }
Struct containing options for Membrane.WebRTC.EndpointBin
Specs
track_message() :: alter_tracks_message() | enable_track_message() | disable_track_message()
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