Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::sdp::MediaDescription Class Reference

SDP media description. More...

#include <media_description.h>

Inheritance diagram for roc::sdp::MediaDescription:
Collaboration diagram for roc::sdp::MediaDescription:

Public Member Functions

 MediaDescription (core::IArena &arena)
 Initialize empty media description. More...
 
void clear ()
 Clear all fields. More...
 
MediaType type () const
 Media type. More...
 
int port () const
 Transport port. More...
 
int nb_ports () const
 Number of transport port(s). More...
 
MediaTransport transport () const
 Transport protocol. More...
 
unsigned default_payload_id () const
 Default media payload id. More...
 
size_t nb_payload_ids () const
 Number of payload ids. More...
 
unsigned payload_id (size_t i) const
 Get the payload id that was listed at the i position in the media description. More...
 
size_t nb_connection_data () const
 Number of connection data. More...
 
const ConnectionDataconnection_data (size_t i) const
 Get the reference of the i-th connection data that was listed just after the media description. More...
 
ROC_ATTR_NODISCARD bool set_type (MediaType type)
 Set media type. More...
 
ROC_ATTR_NODISCARD bool set_transport (MediaTransport transport)
 Set proto. More...
 
ROC_ATTR_NODISCARD bool set_port (long port)
 Set transport port. More...
 
ROC_ATTR_NODISCARD bool set_nb_ports (long nb_ports)
 Set number of transport port(s). More...
 
ROC_ATTR_NODISCARD bool add_payload_id (unsigned payload_id)
 Add a media payload id. More...
 
ROC_ATTR_NODISCARD bool add_connection_data (address::AddrFamily addrtype, const char *str, size_t str_len)
 Add a connection field from a string. More...
 
- Public Member Functions inherited from roc::core::RefCounted< MediaDescription, core::ArenaAllocation >
 RefCounted ()
 Initialize. More...
 
 RefCounted (const core::ArenaAllocation &policy)
 Initialize. More...
 
int getref () const
 Get reference counter. More...
 
void incref () const
 Increment reference counter. More...
 
void decref () const
 Decrement reference counter. More...
 
- Public Member Functions inherited from roc::core::ListNode< Tag >
ListDatalist_data () const
 Get pointer to internal data. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from roc::core::ListNode< Tag >
static ListNodelist_node (ListData *data)
 Get pointer to parent node from pointer to internal data. More...
 
- Protected Member Functions inherited from roc::core::ArenaAllocation
IArenaarena () const
 Get arena. More...
 
 ArenaAllocation (IArena &arena)
 Initialize. More...
 
template<class T >
void destroy (T &object)
 Destroy object and return memory to arena. More...
 

Detailed Description

SDP media description.

m=<type> <port> <proto> <fmt>
int port() const
Transport port.
MediaType type() const
Media type.

Definition at line 36 of file media_description.h.

Constructor & Destructor Documentation

◆ MediaDescription()

roc::sdp::MediaDescription::MediaDescription ( core::IArena arena)

Initialize empty media description.

Member Function Documentation

◆ add_connection_data()

ROC_ATTR_NODISCARD bool roc::sdp::MediaDescription::add_connection_data ( address::AddrFamily  addrtype,
const char *  str,
size_t  str_len 
)

Add a connection field from a string.

◆ add_payload_id()

ROC_ATTR_NODISCARD bool roc::sdp::MediaDescription::add_payload_id ( unsigned  payload_id)

Add a media payload id.

◆ clear()

void roc::sdp::MediaDescription::clear ( )

Clear all fields.

◆ connection_data()

const ConnectionData& roc::sdp::MediaDescription::connection_data ( size_t  i) const

Get the reference of the i-th connection data that was listed just after the media description.

◆ default_payload_id()

unsigned roc::sdp::MediaDescription::default_payload_id ( ) const

Default media payload id.

◆ nb_connection_data()

size_t roc::sdp::MediaDescription::nb_connection_data ( ) const

Number of connection data.

◆ nb_payload_ids()

size_t roc::sdp::MediaDescription::nb_payload_ids ( ) const

Number of payload ids.

◆ nb_ports()

int roc::sdp::MediaDescription::nb_ports ( ) const

Number of transport port(s).

◆ payload_id()

unsigned roc::sdp::MediaDescription::payload_id ( size_t  i) const

Get the payload id that was listed at the i position in the media description.

◆ port()

int roc::sdp::MediaDescription::port ( ) const

Transport port.

◆ set_nb_ports()

ROC_ATTR_NODISCARD bool roc::sdp::MediaDescription::set_nb_ports ( long  nb_ports)

Set number of transport port(s).

◆ set_port()

ROC_ATTR_NODISCARD bool roc::sdp::MediaDescription::set_port ( long  port)

Set transport port.

◆ set_transport()

ROC_ATTR_NODISCARD bool roc::sdp::MediaDescription::set_transport ( MediaTransport  transport)

Set proto.

◆ set_type()

ROC_ATTR_NODISCARD bool roc::sdp::MediaDescription::set_type ( MediaType  type)

Set media type.

◆ transport()

MediaTransport roc::sdp::MediaDescription::transport ( ) const

Transport protocol.

◆ type()

MediaType roc::sdp::MediaDescription::type ( ) const

Media type.


The documentation for this class was generated from the following file: