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

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

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 Extmaps, 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

Link to this callback

add_to_media(t, extension_id, direction, list)

View Source

Adds information about extension to an SDP media.

Link to this callback

compatible?(encoding_key)

View Source
@callback compatible?(Membrane.WebRTC.Track.encoding_key()) :: boolean()

Returns a boolean indicating whether an extension is compatible with given encoding.

Link to this callback

get_rtp_module(extension_id, t, arg3)

View Source
@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.

@callback new(opts :: Keyword.t()) :: t()

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

Link to this function

add_to_media(media, extensions, list, direction, payload_types)

View Source

Given an SDP media, a list of supported extensions and supported Extmaps, adds corresponding extensions to the media.

Link to this function

as_rtp_extension(extensions, extmap, track_type)

View Source
@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.

Link to this function

as_rtp_mapping(extensions, extmap)

View Source

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.

Link to this function

from_extmap(extensions, extmap)

View Source
@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.

Link to this function

supported?(extensions, extmap, encoding)

View Source
@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.