SDPMedia Class Reference
SDP media description.
More...
#include <yatesdp.h>
List of all members.
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) |
Detailed Description
SDP media description.
This class holds a single SDP media description
Constructor & Destructor Documentation
SDPMedia |
( |
const char * |
media, |
|
|
const char * |
transport, |
|
|
const char * |
formats, |
|
|
int |
rport = -1 , |
|
|
int |
lport = -1 | |
|
) |
| | |
Constructor
- Parameters:
-
| media | Media type name |
| transport | Transport name |
| formats | Comma separated list of formats |
| rport | Optional remote media port |
| lport | Optional local media port |
Member Function Documentation
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
- Parameters:
-
| 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
- Returns:
- Comma separated list of media formats (from formats list, current format or a default G711, 'alaw,mulaw', list
const String& format |
( |
|
) |
const [inline] |
Retrieve the current media format
- Returns:
- The current media format
const String& formats |
( |
|
) |
const [inline] |
Retrieve the formats set for this media
- Returns:
- Comma separated list of media formats
Referenced by SDPMedia::sameAs().
const String& id |
( |
|
) |
const [inline] |
Retrieve the media id
- Returns:
- The media id
bool isAudio |
( |
|
) |
const [inline] |
Check if this media type is audio
- Returns:
- True if this media describe an audio one
bool isModified |
( |
|
) |
const [inline] |
Check if a media parameter changed
- Returns:
- True if a media changed
bool localChanged |
( |
|
) |
const [inline] |
Check if local part of this media changed
- Returns:
- True if local part of this media changed
const String& localCrypto |
( |
|
) |
const [inline] |
Retrieve local crypto description
- Returns:
- Local crypto description
const String& localPort |
( |
|
) |
const [inline] |
Retrieve the local media port
- Returns:
- The local media port
void mappings |
( |
const char * |
newMap |
) |
[inline] |
Set rtp payload mappings for this media
- Parameters:
-
| newMap | New rtp payload mappings |
const String& mappings |
( |
|
) |
const [inline] |
Retrieve rtp payload mappings
- Returns:
- Rtp payload mappings
Add or replace a parameter, set the modified flag
- Parameters:
-
| 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
- Parameters:
-
| 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
- Parameters:
-
| msg | Destination list |
| putPort | True to add remote media port |
const String& remoteCrypto |
( |
|
) |
const [inline] |
Retrieve remote crypto description
- Returns:
- Remote crypto description
const String& remotePort |
( |
|
) |
const [inline] |
Retrieve the remote media port
- Returns:
- The remote media port
Referenced by SDPMedia::sameAs().
void rfc2833 |
( |
int |
payload |
) |
[inline] |
Set RFC2833 status or payload of this media
- Parameters:
-
| payload | SDP numeric payload to set. Set it to a negative value to reset RFC2833 |
References String::boolText().
const String& rfc2833 |
( |
|
) |
const [inline] |
Retrieve RFC2833 status or payload of this media
- Returns:
- RFC2833 status or payload of this media
bool sameAs |
( |
const SDPMedia * |
other, |
|
|
bool |
ignorePort = false | |
|
) |
| | const [inline] |
bool securable |
( |
|
) |
const [inline] |
Check if this media is securable
- Returns:
- True if this media is securable
void setLocalChanged |
( |
bool |
chg = false |
) |
[inline] |
Set or reset local media changed flag
- Parameters:
-
| chg | The new value for local media changed flag |
void setModified |
( |
bool |
modified = true |
) |
[inline] |
Set or reset media parameter changed flag
- Parameters:
-
| modified | The new value of the media parameter changed flag |
const String& suffix |
( |
|
) |
const [inline] |
Retrieve the media suffix (built from type)
- Returns:
- Media suffix
const String& transport |
( |
|
) |
const [inline] |
Retrieve the media transport name
- Returns:
- 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)
- Parameters:
-
| 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
- Parameters:
-
| formats | New media formats |
| rport | Optional remote media port |
| lport | Optional local media port |
- Returns:
- True if media changed
The documentation for this class was generated from the following file: