

Membrane.RTCP — Membrane RTP format v0.7.0

 try {

 var settings = JSON.parse(localStorage.getItem('ex\_doc:settings') || '{}');

 if (settings.theme === 'dark' ||

 ((settings.theme === 'system' || settings.theme == null) &&

 window.matchMedia('(prefers-color-scheme: dark)').matches)

 ) {

 document.body.classList.add('dark')

 }

 } catch (error) { }

 

Settings

[View Source](https://github.com/membraneframework/membrane_rtp_format/blob/v0.7.0/lib/rtcp.ex#L1 "View Source")

Membrane.RTCP

(Membrane RTP format v0.7.0)

========================================================================================================================================================================

Description of RTCP stream.

[Link to this section](#summary)

 Summary

==========================================

[Types](#types)

----------------

[t()](#t:t/0)

[Link to this section](#types)

Types

=====================================

[Link to this type](#t:t/0 "Link to this type")

t()

===

[View Source](https://github.com/membraneframework/membrane_rtp_format/blob/v0.7.0/lib/rtcp.ex#L6 "View Source")

```

@type t() :: %Membrane.RTCP{}

```





Membrane.RTP — Membrane RTP format v0.7.0

 try {

 var settings = JSON.parse(localStorage.getItem('ex\_doc:settings') || '{}');

 if (settings.theme === 'dark' ||

 ((settings.theme === 'system' || settings.theme == null) &&

 window.matchMedia('(prefers-color-scheme: dark)').matches)

 ) {

 document.body.classList.add('dark')

 }

 } catch (error) { }

 

Settings

[View Source](https://github.com/membraneframework/membrane_rtp_format/blob/v0.7.0/lib/rtp.ex#L1 "View Source")

Membrane.RTP

(Membrane RTP format v0.7.0)

======================================================================================================================================================================

This module provides caps struct for RTP packet.

[Link to this section](#summary)

 Summary

==========================================

[Types](#types)

----------------

[clock\_rate\_t()](#t:clock_rate_t/0)

Rate of the clock used for RTP timestamps in Hz

[dynamic\_encoding\_name\_t()](#t:dynamic_encoding_name_t/0)

Dynamically assigned encoding names for payload types >= 96

[dynamic\_payload\_type\_t()](#t:dynamic_payload_type_t/0)

RTP payload type that can be dynamically mapped to encoding and clock rate.

[encoding\_name\_t()](#t:encoding_name_t/0)

Encoding name of RTP payload.

[payload\_type\_t()](#t:payload_type_t/0)

RTP payload type.

[ssrc\_t()](#t:ssrc_t/0)

The source of a stream of RTP packets, identified by a 32-bit numeric identifier.

[static\_encoding\_name\_t()](#t:static_encoding_name_t/0)

Predefined names of encoding for static payload types (< 96).

[static\_payload\_type\_t()](#t:static_payload_type_t/0)

RTP payload type that is statically mapped to encoding and clock rate.

[t()](#t:t/0)

[Functions](#functions)

------------------------

[is\_payload\_type\_dynamic(payload\_type)](#is_payload_type_dynamic/1)

Determines if payload type is [`dynamic_payload_type_t/0`](#t:dynamic_payload_type_t/0).

[is\_payload\_type\_static(payload\_type)](#is_payload_type_static/1)

Determines if payload type is [`static_payload_type_t/0`](#t:static_payload_type_t/0).

[Link to this section](#types)

Types

=====================================

[Link to this type](#t:clock_rate_t/0 "Link to this type")

clock\_rate\_t()

================

[View Source](https://github.com/membraneframework/membrane_rtp_format/blob/v0.7.0/lib/rtp.ex#L63 "View Source")

```

@type clock_rate_t() :: [non\_neg\_integer](https://hexdocs.pm/elixir/typespecs.html#basic-types)()

```

Rate of the clock used for RTP timestamps in Hz

[Link to this type](#t:dynamic_encoding_name_t/0 "Link to this type")

dynamic\_encoding\_name\_t()

============================

[View Source](https://github.com/membraneframework/membrane_rtp_format/blob/v0.7.0/lib/rtp.ex#L53 "View Source")

```

@type dynamic_encoding_name_t() :: [atom](https://hexdocs.pm/elixir/typespecs.html#basic-types)()

```

Dynamically assigned encoding names for payload types >= 96

They should be atoms matching the encoding name in SDP's attribute `rtpmap`. This is usually defined by

RFC for that payload format (e.g. for H264 there's RFC 6184 defining it must be "H264", so the atom `:H264` should be used

<https://tools.ietf.org/html/rfc6184#section-8.2.1>)

[Link to this type](#t:dynamic_payload_type_t/0 "Link to this type")

dynamic\_payload\_type\_t()

===========================

[View Source](https://github.com/membraneframework/membrane_rtp_format/blob/v0.7.0/lib/rtp.ex#L14 "View Source")

```

@type dynamic_payload_type_t() :: 96..127

```

RTP payload type that can be dynamically mapped to encoding and clock rate.

[Link to this type](#t:encoding_name_t/0 "Link to this type")

encoding\_name\_t()

===================

[View Source](https://github.com/membraneframework/membrane_rtp_format/blob/v0.7.0/lib/rtp.ex#L58 "View Source")

```

@type encoding_name_t() :: [static\_encoding\_name\_t](#t:static_encoding_name_t/0)() | [dynamic\_encoding\_name\_t](#t:dynamic_encoding_name_t/0)()

```

Encoding name of RTP payload.

[Link to this type](#t:payload_type_t/0 "Link to this type")

payload\_type\_t()

==================

[View Source](https://github.com/membraneframework/membrane_rtp_format/blob/v0.7.0/lib/rtp.ex#L19 "View Source")

```

@type payload_type_t() :: [static\_payload\_type\_t](#t:static_payload_type_t/0)() | [dynamic\_payload\_type\_t](#t:dynamic_payload_type_t/0)()

```

RTP payload type.

[Link to this type](#t:ssrc_t/0 "Link to this type")

ssrc\_t()

=========

[View Source](https://github.com/membraneframework/membrane_rtp_format/blob/v0.7.0/lib/rtp.ex#L68 "View Source")

```

@type ssrc_t() :: [pos\_integer](https://hexdocs.pm/elixir/typespecs.html#basic-types)()

```

The source of a stream of RTP packets, identified by a 32-bit numeric identifier.

[Link to this type](#t:static_encoding_name_t/0 "Link to this type")

static\_encoding\_name\_t()

===========================

[View Source](https://github.com/membraneframework/membrane_rtp_format/blob/v0.7.0/lib/rtp.ex#L24 "View Source")

```

@type static_encoding_name_t() ::

  :PCMU

  | :GSM

  | :G732

  | :DVI4

  | :LPC

  | :PCMA

  | :G722

  | :L16

  | :QCELP

  | :CN

  | :MPA

  | :G728

  | :G729

  | :CELB

  | :JPEG

  | :NV

  | :H261

  | :MPV

  | :MP2T

  | :H263

```

Predefined names of encoding for static payload types (< 96).

[Link to this type](#t:static_payload_type_t/0 "Link to this type")

static\_payload\_type\_t()

==========================

[View Source](https://github.com/membraneframework/membrane_rtp_format/blob/v0.7.0/lib/rtp.ex#L9 "View Source")

```

@type static_payload_type_t() :: 0..95

```

RTP payload type that is statically mapped to encoding and clock rate.

[Link to this type](#t:t/0 "Link to this type")

t()

===

[View Source](https://github.com/membraneframework/membrane_rtp_format/blob/v0.7.0/lib/rtp.ex#L70 "View Source")

```

@type t() :: %Membrane.RTP{}

```

[Link to this section](#functions)

Functions

=============================================

[Link to this macro](#is_payload_type_dynamic/1 "Link to this macro")

is\_payload\_type\_dynamic(payload\_type)

=========================================

[View Source](https://github.com/membraneframework/membrane_rtp_format/blob/v0.7.0/lib/rtp.ex#L82 "View Source")

(macro)

Determines if payload type is [`dynamic_payload_type_t/0`](#t:dynamic_payload_type_t/0).

[Link to this macro](#is_payload_type_static/1 "Link to this macro")

is\_payload\_type\_static(payload\_type)

========================================

[View Source](https://github.com/membraneframework/membrane_rtp_format/blob/v0.7.0/lib/rtp.ex#L77 "View Source")

(macro)

Determines if payload type is [`static_payload_type_t/0`](#t:static_payload_type_t/0).





Membrane.RTP.PayloadFormat — Membrane RTP format v0.7.0

 try {

 var settings = JSON.parse(localStorage.getItem('ex\_doc:settings') || '{}');

 if (settings.theme === 'dark' ||

 ((settings.theme === 'system' || settings.theme == null) &&

 window.matchMedia('(prefers-color-scheme: dark)').matches)

 ) {

 document.body.classList.add('dark')

 }

 } catch (error) { }

 

Settings

[View Source](https://github.com/membraneframework/membrane_rtp_format/blob/v0.7.0/lib/rtp/payload_format.ex#L1 "View Source")

Membrane.RTP.PayloadFormat

(Membrane RTP format v0.7.0)

===================================================================================================================================================================================================

This module contains utilities for resolving RTP default payload types,

encoding names, clock rates and (de)payloaders.

[Link to this section](#summary)

 Summary

==========================================

[Types](#types)

----------------

[t()](#t:t/0)

[Functions](#functions)

------------------------

[get(encoding\_name)](#get/1)

Returns payload format registered for given encoding name.

[get\_payload\_type\_mapping(payload\_type)](#get_payload_type_mapping/1)

Returns encoding name and clock rate for given payload type, if registered.

[register(payload\_format)](#register/1)

Registers payload format.

[register\_payload\_type\_mapping(payload\_type, encoding\_name, clock\_rate)](#register_payload_type_mapping/3)

Registers default encoding name and clock rate for a dynamic payload\_type

[Link to this section](#types)

Types

=====================================

[Link to this type](#t:t/0 "Link to this type")

t()

===

[View Source](https://github.com/membraneframework/membrane_rtp_format/blob/v0.7.0/lib/rtp/payload_format.ex#L52 "View Source")

```

@type t() :: %Membrane.RTP.PayloadFormat{

  depayloader: [module](https://hexdocs.pm/elixir/typespecs.html#built-in-types)() | nil,

  encoding_name: [Membrane.RTP.encoding\_name\_t](Membrane.RTP.html#t:encoding_name_t/0)(),

  frame_detector: ([binary](https://hexdocs.pm/elixir/typespecs.html#built-in-types)() -> [boolean](https://hexdocs.pm/elixir/typespecs.html#built-in-types)()) | nil,

  keyframe_detector: ([binary](https://hexdocs.pm/elixir/typespecs.html#built-in-types)() -> [boolean](https://hexdocs.pm/elixir/typespecs.html#built-in-types)()) | nil,

  payload_type: [Membrane.RTP.payload\_type\_t](Membrane.RTP.html#t:payload_type_t/0)() | nil,

  payloader: [module](https://hexdocs.pm/elixir/typespecs.html#built-in-types)() | nil

}

```

[Link to this section](#functions)

Functions

=============================================

[Link to this function](#get/1 "Link to this function")

get(encoding\_name)

===================

[View Source](https://github.com/membraneframework/membrane_rtp_format/blob/v0.7.0/lib/rtp/payload_format.ex#L110 "View Source")

```

@spec get([Membrane.RTP.encoding\_name\_t](Membrane.RTP.html#t:encoding_name_t/0)()) :: [t](#t:t/0)()

```

Returns payload format registered for given encoding name.

[Link to this function](#get_payload_type_mapping/1 "Link to this function")

get\_payload\_type\_mapping(payload\_type)

==========================================

[View Source](https://github.com/membraneframework/membrane_rtp_format/blob/v0.7.0/lib/rtp/payload_format.ex#L79 "View Source")

```

@spec get_payload_type_mapping([Membrane.RTP.payload\_type\_t](Membrane.RTP.html#t:payload_type_t/0)()) :: %{

  optional(:encoding_name) => [Membrane.RTP.encoding\_name\_t](Membrane.RTP.html#t:encoding_name_t/0)(),

  optional(:clock_rate) => [Membrane.RTP.clock\_rate\_t](Membrane.RTP.html#t:clock_rate_t/0)()

}

```

Returns encoding name and clock rate for given payload type, if registered.

[Link to this function](#register/1 "Link to this function")

register(payload\_format)

=========================

[View Source](https://github.com/membraneframework/membrane_rtp_format/blob/v0.7.0/lib/rtp/payload_format.ex#L120 "View Source")

```

@spec register([t](#t:t/0)()) :: :ok | [no\_return](https://hexdocs.pm/elixir/typespecs.html#built-in-types)()

```

Registers payload format.

Raises if some payload format field was already registered and set to different value.

[Link to this function](#register_payload_type_mapping/3 "Link to this function")

register\_payload\_type\_mapping(payload\_type, encoding\_name, clock\_rate)

============================================================================

[View Source](https://github.com/membraneframework/membrane_rtp_format/blob/v0.7.0/lib/rtp/payload_format.ex#L95 "View Source")

```

@spec register_payload_type_mapping(

  [Membrane.RTP.dynamic\_payload\_type\_t](Membrane.RTP.html#t:dynamic_payload_type_t/0)(),

  [Membrane.RTP.encoding\_name\_t](Membrane.RTP.html#t:encoding_name_t/0)(),

  [Membrane.RTP.clock\_rate\_t](Membrane.RTP.html#t:clock_rate_t/0)()

) :: :ok | [no\_return](https://hexdocs.pm/elixir/typespecs.html#built-in-types)()

```

Registers default encoding name and clock rate for a dynamic payload\_type





Membrane.SRTP.KeyingMaterialEvent — Membrane RTP format v0.7.0

 try {

 var settings = JSON.parse(localStorage.getItem('ex\_doc:settings') || '{}');

 if (settings.theme === 'dark' ||

 ((settings.theme === 'system' || settings.theme == null) &&

 window.matchMedia('(prefers-color-scheme: dark)').matches)

 ) {

 document.body.classList.add('dark')

 }

 } catch (error) { }

 

Settings

[View Source](https://github.com/membraneframework/membrane_rtp_format/blob/v0.7.0/lib/srtp_keying_material_event.ex#L1 "View Source")

Membrane.SRTP.KeyingMaterialEvent

(Membrane RTP format v0.7.0)

==================================================================================================================================================================================================================

Event containing keying material for SRTP encryptor and decryptor.

[Link to this section](#summary)

 Summary

==========================================

[Types](#types)

----------------

[t()](#t:t/0)

Type describing [`Membrane.SRTP.KeyingMaterialEvent`](Membrane.SRTP.KeyingMaterialEvent.html#content) struct.

[Link to this section](#types)

Types

=====================================

[Link to this type](#t:t/0 "Link to this type")

t()

===

[View Source](https://github.com/membraneframework/membrane_rtp_format/blob/v0.7.0/lib/srtp_keying_material_event.ex#L20 "View Source")

```

@type t() :: %Membrane.SRTP.KeyingMaterialEvent{

  local_keying_material: [binary](https://hexdocs.pm/elixir/typespecs.html#built-in-types)(),

  protection_profile: [pos\_integer](https://hexdocs.pm/elixir/typespecs.html#basic-types)(),

  remote_keying_material: [binary](https://hexdocs.pm/elixir/typespecs.html#built-in-types)()

}

```

Type describing [`Membrane.SRTP.KeyingMaterialEvent`](Membrane.SRTP.KeyingMaterialEvent.html#content) struct.

Keying material consists of master key and master salt and is used

by SRTP internally to generate actual keys.

`local_keying_material` is used for deriving key for encryption while

`remote_keying_material` is used for deriving key for decryption.

For more information refer to RFC 3711 section 4.3 or RFC 5764 section 4.2.

`protection_profile` is `pos_integer()` refering to cryptographic algorithm

used for negotiating local and remote keying material.

For more information refer to <https://www.iana.org/assignments/srtp-protection/srtp-protection.xhtml>





Membrane Multimedia Framework: RTP format description — Membrane RTP format v0.7.0

 try {

 var settings = JSON.parse(localStorage.getItem('ex\_doc:settings') || '{}');

 if (settings.theme === 'dark' ||

 ((settings.theme === 'system' || settings.theme == null) &&

 window.matchMedia('(prefers-color-scheme: dark)').matches)

 ) {

 document.body.classList.add('dark')

 }

 } catch (error) { }

 

Settings

[View Source](https://github.com/membraneframework/membrane_rtp_format/blob/v0.7.0/README.md#L1 "View Source")

Membrane Multimedia Framework: RTP format description

=================================================================================================================================================================================

[![Hex.pm](https://img.shields.io/hexpm/v/membrane_rtp_format.svg)](https://hex.pm/packages/membrane_rtp_format)

[![API Docs](https://img.shields.io/badge/api-docs-yellow.svg?style=flat)](https://hexdocs.pm/membrane_rtp_format/)

[![CircleCI](https://circleci.com/gh/membraneframework/membrane_rtp_format.svg?style=svg)](https://circleci.com/gh/membraneframework/membrane_rtp_format)

This package provides structures describing RTP/RTCP streams. They can be used to define capabilities of pads for the [Membrane](https://membraneframework.org) Elements.

[installation](#installation)

 Installation

--------------------------------------------

Unless you're developing an Membrane Element it's unlikely that you need to use this package directly in your app, as normally it is going to be fetched as a dependency of any element that operates on RTP packets.

However, if you are developing an Element or need to add it due to any other reason, just add the following line to your `deps` in the `mix.exs` and run [`mix deps.get`](https://hexdocs.pm/mix/Mix.Tasks.Deps.Get.html).

```

 {:membrane\_rtp\_format, "~> 0.7.0"}

```

[copyright-and-license](#copyright-and-license)

 Copyright and License

-----------------------------------------------------------------------

Copyright 2018, [Software Mansion](https://swmansion.com/?utm_source=git&utm_medium=readme&utm_campaign=membrane_rtp_format)

[![Software Mansion](https://logo.swmansion.com/logo?color=white&variant=desktop&width=200&tag=membrane-github)](https://swmansion.com/?utm_source=git&utm_medium=readme&utm_campaign=membrane_rtp_format)

Licensed under the [Apache License, Version 2.0](license.html)

[← Previous Page

 

API Reference](api-reference.html)

[Next Page →

 

LICENSE](license.html)

