Yate
|
SDP media description. More...
#include <yatesdp.h>
Public Member Functions | |
SDPMedia (const char *media, const char *transport, const char *formats, int rport=-1, int lport=-1) | |
virtual | ~SDPMedia () |
bool | isAudio () const |
bool | isModified () const |
void | setModified (bool modified=true) |
const String & | suffix () const |
const String & | transport () const |
const String & | id () const |
const String & | format () const |
const String & | formats () const |
const String & | remotePort () const |
const String & | localPort () const |
const String & | mappings () const |
void | mappings (const char *newMap) |
const String & | rfc2833 () const |
void | rfc2833 (int payload) |
const String & | remoteCrypto () const |
const String & | localCrypto () const |
bool | securable () const |
bool | sameAs (const SDPMedia *other, bool ignorePort=false) const |
bool | localChanged () const |
void | setLocalChanged (bool chg=false) |
const char * | fmtList () const |
bool | update (const char *formats, int rport=-1, int lport=-1) |
void | update (const NamedList &msg, bool pickFormat) |
void | parameter (const char *name, const char *value, bool append) |
void | parameter (NamedString *param, bool append) |
void | crypto (const char *desc, bool remote) |
void | putMedia (NamedList &msg, bool putPort=true) |
SDP media description.
This class holds a single SDP media description
SDPMedia | ( | const char * | media, |
const char * | transport, | ||
const char * | formats, | ||
int | rport = -1 , |
||
int | lport = -1 |
||
) |
Constructor
media | Media type name |
transport | Transport name |
formats | Comma separated list of formats |
rport | Optional remote media port |
lport | Optional local media port |
virtual ~SDPMedia | ( | ) | [virtual] |
Destructor
void crypto | ( | const char * | desc, |
bool | remote | ||
) |
Set a new crypto description, set the modified flag if changed. Reset the media securable flag if the remote crypto is empty
desc | The new crypto description |
remote | True to set the remote crypto, false to set the local one |
const char* fmtList | ( | ) | const |
Retrieve a formats list from this media
const String& format | ( | ) | const [inline] |
Retrieve the current media format
const String& formats | ( | ) | const [inline] |
Retrieve the formats set for this media
Referenced by SDPMedia::sameAs().
const String& id | ( | ) | const [inline] |
Retrieve the media id
bool isAudio | ( | ) | const [inline] |
Check if this media type is audio
bool isModified | ( | ) | const [inline] |
Check if a media parameter changed
bool localChanged | ( | ) | const [inline] |
Check if local part of this media changed
const String& localCrypto | ( | ) | const [inline] |
Retrieve local crypto description
const String& localPort | ( | ) | const [inline] |
Retrieve the local media port
const String& mappings | ( | ) | const [inline] |
Retrieve rtp payload mappings
void mappings | ( | const char * | newMap | ) | [inline] |
Set rtp payload mappings for this media
newMap | New rtp payload mappings |
void parameter | ( | NamedString * | param, |
bool | append | ||
) |
Add or replace a parameter, set the modified flag
param | The parameter |
append | True to append, false to replace |
void parameter | ( | const char * | name, |
const char * | value, | ||
bool | append | ||
) |
Add or replace a parameter by name and value, set the modified flag
name | Parameter name |
value | Parameter value |
append | True to append, false to replace |
void putMedia | ( | NamedList & | msg, |
bool | putPort = true |
||
) |
Put this net media in a parameter list
msg | Destination list |
putPort | True to add remote media port |
const String& remoteCrypto | ( | ) | const [inline] |
Retrieve remote crypto description
const String& remotePort | ( | ) | const [inline] |
const String& rfc2833 | ( | ) | const [inline] |
Retrieve RFC2833 status or payload of this media
void rfc2833 | ( | int | payload | ) | [inline] |
Set RFC2833 status or payload of this media
payload | SDP numeric payload to set. Set it to a negative value to reset RFC2833 |
References String::boolText().
bool sameAs | ( | const SDPMedia * | other, |
bool | ignorePort = false |
||
) | const [inline] |
Compare this media with another one
other | The media to compare with |
ignorePort | Ignore differences caused only by port number |
References SDPMedia::formats(), SDPMedia::remotePort(), and SDPMedia::transport().
bool securable | ( | ) | const [inline] |
Check if this media is securable
void setLocalChanged | ( | bool | chg = false | ) | [inline] |
Set or reset local media changed flag
chg | The new value for local media changed flag |
void setModified | ( | bool | modified = true | ) | [inline] |
Set or reset media parameter changed flag
modified | The new value of the media parameter changed flag |
const String& suffix | ( | ) | const [inline] |
Retrieve the media suffix (built from type)
const String& transport | ( | ) | const [inline] |
Retrieve the media transport name
Referenced by SDPMedia::sameAs().
void update | ( | const NamedList & | msg, |
bool | pickFormat | ||
) |
Update from a chan.rtp message (rtp id and local port)
msg | The list of parameters |
pickFormat | True to update media format(s) from the list |
bool update | ( | const char * | formats, |
int | rport = -1 , |
||
int | lport = -1 |
||
) |
Update this media from formats and ports
formats | New media formats |
rport | Optional remote media port |
lport | Optional local media port |