View Source Membrane.WebRTC.Extension behaviour (Membrane WebRTC plugin v0.14.1)
A module that provides mappings between ExSDP.Attribute.Extmap
and modules implementing
Membrane.WebRTC.Extension
behaviour.
Link to this section Summary
Types
- module - extension specific module which implement
Membrane.WebRTC.Extension
behaviour - rtp_opts - options for RTP module. This allows configuring RTP module to your needs
- uri - a URI that identifies extension in SDP
- name - an atom identifying the extension in
Membrane.RTP.SessionBin
Callbacks
Adds information about extension to an SDP media.
Returns a boolean indicating whether an extension is compatible with given encoding.
Returns a module that implements the extension in Membrane.RTP.SessionBin
or :no_rtp_module
if such
such module would only forward buffers to next element.
Creates a Membrane.WebRTC.Extension
struct for a specific extension.
Returns an URI that identifies extension in SDP
Functions
Given an SDP media, a list of supported extensions and supported Extmap
s, adds corresponding
extensions to the media.
Given a list of supported extensions, maps a supported Extmap
to an RTP.SessionBin.rtp_extension_t()
.
Given a list of supported extensions and a supported Extmap
, generates a mapping from a name provided
by an extension to an ID provided by the Extmap
.
Given a list of supported extensions, returns an extension that corresponds to given Extmap
or :not_supported
if there is no such extension.
Given a list of supported extensions, checks if there is an extension that corresponds to
given Extmap
and encoding.
Link to this section Types
@type maybe_t() :: t() | :not_supported
@type t() :: %Membrane.WebRTC.Extension{ module: module(), name: atom(), rtp_opts: Keyword.t(), uri: String.t() }
- module - extension specific module which implement
Membrane.WebRTC.Extension
behaviour - rtp_opts - options for RTP module. This allows configuring RTP module to your needs
- uri - a URI that identifies extension in SDP
- name - an atom identifying the extension in
Membrane.RTP.SessionBin
Link to this section Callbacks
@callback add_to_media( ExSDP.Media.t(), ExSDP.Attribute.Extmap.extension_id(), ExSDP.Attribute.Extmap.direction(), [Membrane.RTP.payload_type_t()] ) :: ExSDP.Media.t()
Adds information about extension to an SDP media.
@callback compatible?(Membrane.WebRTC.Track.encoding_key()) :: boolean()
Returns a boolean indicating whether an extension is compatible with given encoding.
@callback get_rtp_module( ExSDP.Attribute.Extmap.extension_id(), Keyword.t(), :inbound | :outbound ) :: Membrane.ChildrenSpec.child_definition_t() | :no_rtp_module
Returns a module that implements the extension in Membrane.RTP.SessionBin
or :no_rtp_module
if such
such module would only forward buffers to next element.
:inbound
/:outbound
denotes track type this extension was specified for.
Creates a Membrane.WebRTC.Extension
struct for a specific extension.
@callback uri() :: String.t()
Returns an URI that identifies extension in SDP
Link to this section Functions
@spec add_to_media( ExSDP.Media.t(), [t()], [ExSDP.Attribute.Extmap.t()], ExSDP.Attribute.Extmap.direction(), [Membrane.RTP.payload_type_t()] ) :: ExSDP.Media.t()
Given an SDP media, a list of supported extensions and supported Extmap
s, adds corresponding
extensions to the media.
@spec as_rtp_extension([t()], ExSDP.Attribute.Extmap.t(), :inbound | :outbound) :: Membrane.RTP.SessionBin.rtp_extension_option_t()
Given a list of supported extensions, maps a supported Extmap
to an RTP.SessionBin.rtp_extension_t()
.
:inbound
/:outbound
denotes track type extmap
was specified for.
@spec as_rtp_mapping([t()], ExSDP.Attribute.Extmap.t()) :: {Membrane.RTP.SessionBin.rtp_extension_name_t(), ExSDP.Attribute.Extmap.extension_id()}
Given a list of supported extensions and a supported Extmap
, generates a mapping from a name provided
by an extension to an ID provided by the Extmap
.
@spec from_extmap([t()], ExSDP.Attribute.Extmap.t()) :: maybe_t()
Given a list of supported extensions, returns an extension that corresponds to given Extmap
or :not_supported
if there is no such extension.
@spec supported?([t()], ExSDP.Attribute.Extmap.t(), atom()) :: boolean()
Given a list of supported extensions, checks if there is an extension that corresponds to
given Extmap
and encoding.