Yate
JGRtpMediaList Class Reference

A List of Jingle RTP data payloads. More...

#include <yatejingle.h>

Inheritance diagram for JGRtpMediaList:
ObjList GenObject

Public Types

enum  Media { MediaMissing = -1 , MediaUnknown = 0 , Audio = 1 }
 

Public Member Functions

 JGRtpMediaList (Media m=MediaMissing, bool cryptoRequired=false)
 
 ~JGRtpMediaList ()
 
Media media () const
 
void add (const char *id, const char *name, const char *clockrate, const char *synonym=0, const char *channels=0, const char *pTime=0, const char *maxPTime=0, const char *bitRate=0)
 
void reset ()
 
void setMedia (const JGRtpMediaList &src, const String &only=String::empty())
 
void filterMedia (const String &only)
 
JGRtpMediafindMedia (const String &id)
 
JGRtpMediafindSynonym (const String &value) const
 
XmlElementtoXml () const
 
void fromXml (XmlElement *xml)
 
bool createList (String &dest, bool synonym, const char *sep=",")
 
void addTelEvent (XmlElement *xml, const char *name=0) const
 
- Public Member Functions inherited from ObjList
 ObjList ()
 
virtual ~ObjList ()
 
virtual void * getObject (const String &name) const
 
unsigned int length () const
 
unsigned int count () const
 
GenObjectget () const
 
GenObjectset (const GenObject *obj, bool delold=true)
 
ObjListnext () const
 
ObjListlast () const
 
ObjListskipNull () const
 
ObjListskipNext () const
 
GenObjectat (int index) const
 
ObjListoperator+ (int index) const
 
GenObjectoperator[] (signed int index) const
 
GenObjectoperator[] (unsigned int index) const
 
GenObjectoperator[] (const String &str) const
 
ObjListfind (const GenObject *obj) const
 
ObjListfind (const String &str) const
 
int index (const GenObject *obj) const
 
int index (const String &str) const
 
ObjListinsert (const GenObject *obj, bool compact=true)
 
ObjListappend (const GenObject *obj, bool compact=true)
 
ObjListsetUnique (const GenObject *obj, bool compact=true)
 
GenObjectremove (bool delobj=true)
 
GenObjectremove (GenObject *obj, bool delobj=true)
 
GenObjectremove (const String &str, bool delobj=true)
 
void clear ()
 
void compact ()
 
bool autoDelete ()
 
void setDelete (bool autodelete)
 
void sort (int(*callbackCompare)(GenObject *obj1, GenObject *obj2, void *context), void *context=0)
 
- Public Member Functions inherited from GenObject
 GenObject ()
 
virtual ~GenObject ()
 
virtual bool alive () const
 
virtual void destruct ()
 
virtual const StringtoString () const
 
virtual const StringtraceId () const
 
NamedCountergetObjCounter () const
 
NamedCountersetObjCounter (NamedCounter *counter)
 

Public Attributes

Media m_media
 
String m_ssrc
 
NamedStringm_bandwidth
 
bool m_cryptoRequired
 
ObjList m_cryptoLocal
 
ObjList m_cryptoRemote
 
bool m_ready
 
int m_telEvent
 
String m_telEventName
 
String m_telEventName2
 

Static Public Attributes

static const TokenDict s_media []
 

Additional Inherited Members

- Static Public Member Functions inherited from ObjList
static const ObjListempty ()
 
- Static Public Member Functions inherited from GenObject
static void * getObject (const String &name, const GenObject *obj)
 
static bool getObjCounting ()
 
static void setObjCounting (bool enable)
 
static NamedCountergetObjCounter (const String &name, bool create=true)
 
static ObjListgetObjCounters ()
 

Detailed Description

A List of Jingle RTP data payloads.

Hold a list of RTP data payloads

Member Enumeration Documentation

◆ Media

enum Media

Media type enumeration

Constructor & Destructor Documentation

◆ JGRtpMediaList()

JGRtpMediaList ( Media m = MediaMissing,
bool cryptoRequired = false )
inline

Constructor

Parameters
mMedia type as enumeration
cryptoRequiredTrue to require media encryption

References m_bandwidth, m_cryptoRequired, m_media, m_ready, m_telEvent, and m_telEventName.

Referenced by setMedia().

◆ ~JGRtpMediaList()

~JGRtpMediaList ( )
inline

Destructor

References m_bandwidth.

Member Function Documentation

◆ add()

void add ( const char * id,
const char * name,
const char * clockrate,
const char * synonym = 0,
const char * channels = 0,
const char * pTime = 0,
const char * maxPTime = 0,
const char * bitRate = 0 )
inline

Append a new data payload

Parameters
idThe 'id' attribute
nameThe 'name' attribute
clockrateThe 'clockrate' attribute
synonymOptional application synonym for the payload
channelsOptional 'channels' attribute (the number of channels)
pTimeOptional "ptime" attribute (packet time)
maxPTimeOptional "maxptime" attribute (maximum packet time)
bitRateOptional "bitrate" attribute

References ObjList::append().

◆ addTelEvent()

void addTelEvent ( XmlElement * xml,
const char * name = 0 ) const

Build and add telephone-event media child to a parent xml element. Add a second telephone event media child if set

Parameters
xmlParent element
nameOptional event name. Defaults to set event name

◆ createList()

bool createList ( String & dest,
bool synonym,
const char * sep = "," )

Create a list from data payloads

Parameters
destDestination string
synonymTrue to create from synonyms, false to create from names
sepList item separator
Returns
False if the list is empty

◆ filterMedia()

void filterMedia ( const String & only)

Filter media list preserving only some formats

Parameters
onlyList of synonyms to preserve, do not filter media if this parameter is empty

◆ findMedia()

JGRtpMedia * findMedia ( const String & id)

Find a data payload by its id

Parameters
idIdentifier of media to find
Returns
JGRtpMedia pointer or 0 if not found

◆ findSynonym()

JGRtpMedia * findSynonym ( const String & value) const

Find a data payload by its synonym

Parameters
valueThe value to compare with
Returns
JGRtpMedia pointer or 0 if not found

◆ fromXml()

void fromXml ( XmlElement * xml)

Fill this list from an XML element's children. Clear before attempting to fill

Parameters
xmlThe source XML element

◆ media()

Media media ( ) const
inline

Get the media type of the payloads owned by this list

Returns
Media type as enumeration

References m_media.

◆ reset()

void reset ( )

Reset the list and data

◆ setMedia()

void setMedia ( const JGRtpMediaList & src,
const String & only = String::empty() )

Set media type and payloads from another list

Parameters
srcMedia list to copy into this one
onlyOptional list of synonyms to set if found in src. Copy the whole list if this parameter is empty

References String::empty(), and JGRtpMediaList().

◆ toXml()

XmlElement * toXml ( ) const

Create a 'description' element and add payload children to it

Returns
Valid XmlElement pointer

Member Data Documentation

◆ m_bandwidth

NamedString* m_bandwidth

Optional SDP media bandwith. The name of the string keeps the type ('bwtype') and its value keeps the actual bandwith

Referenced by JGRtpMediaList(), and ~JGRtpMediaList().

◆ m_cryptoRequired

bool m_cryptoRequired

Crypto (SRTP) params

Referenced by JGRtpMediaList().

◆ m_media

Media m_media

The media type

Referenced by JGRtpMediaList(), and media().

◆ m_ready

bool m_ready

Flag indicating wether media was negotiated

Referenced by JGRtpMediaList().

◆ m_ssrc

String m_ssrc

Synchronization source

◆ m_telEvent

int m_telEvent

Telephone event payload id

Referenced by JGRtpMediaList().

◆ m_telEventName

String m_telEventName

Telephone event payload name

Referenced by JGRtpMediaList().

◆ m_telEventName2

String m_telEventName2

Second telephone event payload name

◆ s_media

const TokenDict s_media[]
static

The list of media type names


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