View Source ExSDP.Media (ExSDP v0.11.0)

This module represents the Media field of SDP.

For more details please see RFC4566 Section 5.14

Link to this section Summary

Types

t()

Represents type of media. In RFC4566 there are defined "audio", "video", "text", "application", and "message" types.

Link to this section Types

@type t() :: %ExSDP.Media{
  attributes: [ExSDP.Attribute.t()],
  bandwidth: [ExSDP.Bandwidth.t()],
  connection_data: [ExSDP.ConnectionData.t()],
  encryption: ExSDP.Encryption.t() | nil,
  fmt: binary() | [0..127],
  port: :inet.port_number(),
  port_count: non_neg_integer(),
  protocol: binary(),
  title: binary() | nil,
  type: type()
}
@type type() :: :audio | :video | :text | :application | :message | binary()

Represents type of media. In RFC4566 there are defined "audio", "video", "text", "application", and "message" types.

Known types are represented as atoms others are binaries.

Link to this section Functions

Link to this function

add_attribute(media, attribute)

View Source
@spec add_attribute(media :: t(), attribute :: ExSDP.Attribute.t()) :: t()
Link to this function

add_attributes(media, attributes)

View Source
@spec add_attributes(media :: t(), attributes :: [ExSDP.Attribute.t()]) :: t()
Link to this function

apply_session(media, session)

View Source
@spec apply_session(t(), ExSDP.t()) :: t()
Link to this function

get_attribute(media, key)

View Source
@spec get_attribute(media :: t(), key :: module() | atom() | binary()) ::
  ExSDP.Attribute.t() | nil
Link to this function

get_attributes(media, key)

View Source
@spec get_attributes(media :: t(), key :: module() | atom() | binary()) :: [
  ExSDP.Attribute.t()
]
Link to this function

new(type, port, protocol, fmt, opts \\ [])

View Source
@spec new(
  type :: type(),
  port :: :inet.port_number(),
  protocol :: binary(),
  fmt :: binary() | 0..127 | [0..127],
  opts :: [{:port_count, non_neg_integer()}]
) :: t()
@spec parse(binary()) ::
  {:ok, t()} | {:error, :invalid_media_spec | :malformed_port_number}
Link to this function

parse_optional(lines, media)

View Source
@spec parse_optional([binary()], t()) :: {:ok, {[binary()], t()}} | {:error, atom()}