Yate
JGSessionContent Class Reference

A Jingle session content. More...

#include <yatejingle.h>

Inheritance diagram for JGSessionContent:
RefObject GenObject

Public Types

enum  Type {
  Unknown = -1 , UnknownFileTransfer = -2 , RtpIceUdp = 1 , RtpRawUdp ,
  RtpP2P , RtpGoogleRawUdp , FileBSBOffer , FileBSBRequest
}
 
enum  Senders { SendUnknown = 0 , SendBoth = 1 , SendInitiator = 2 , SendResponder = 3 }
 
enum  Creator { CreatorUnknown = 0 , CreatorInitiator = 1 , CreatorResponder = 2 }
 

Public Member Functions

 JGSessionContent (Type t, const char *name, Senders senders, Creator creator, const char *disposition=0)
 
Type type () const
 
Senders senders () const
 
Creator creator () const
 
bool isValidAudio () const
 
virtual const StringtoString () const
 
bool isSession () const
 
bool isEarlyMedia () const
 
void setEarlyMedia ()
 
XmlElementtoXml (bool minimum, bool addDesc, bool addTrans, bool addCandidates, bool addAuth) const
 
- Public Member Functions inherited from RefObject
 RefObject ()
 
virtual ~RefObject ()
 
virtual void * getObject (const String &name) const
 
virtual bool alive () const
 
bool ref ()
 
bool deref ()
 
int refcount () const
 
virtual void destruct ()
 
- Public Member Functions inherited from GenObject
 GenObject ()
 
virtual ~GenObject ()
 
virtual const StringtraceId () const
 
NamedCountergetObjCounter () const
 
NamedCountersetObjCounter (NamedCounter *counter)
 

Static Public Member Functions

static JGSessionContentfromXml (XmlElement *xml, XMPPError::Type &err, String &error)
 
- Static Public Member Functions inherited from RefObject
static bool alive (const RefObject *obj)
 
static bool efficientIncDec ()
 
- 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 ()
 

Public Attributes

JGRtpMediaList m_rtpMedia
 
JGRtpCandidates m_rtpLocalCandidates
 
JGRtpCandidates m_rtpRemoteCandidates
 
NamedList m_fileTransfer
 

Static Public Attributes

static const TokenDict s_senders []
 
static const TokenDict s_creator []
 

Additional Inherited Members

- Protected Member Functions inherited from RefObject
virtual void zeroRefs ()
 
bool resurrect ()
 
virtual void destroyed ()
 

Detailed Description

A Jingle session content.

This class holds a Jingle content negotiated during a session It can be built from a received xml element and it can build an xml element from itself

Member Enumeration Documentation

◆ Creator

enum Creator

Enumeration values for the 'creator' attribute (required)

◆ Senders

enum Senders

Enumeration values for the 'senders' attribute (required)

◆ Type

enum Type

Enumeration of content type

Constructor & Destructor Documentation

◆ JGSessionContent()

JGSessionContent ( Type t,
const char * name,
Senders senders,
Creator creator,
const char * disposition = 0 )

Constructor

Parameters
tContent type as enumeration
nameContent name
sendersContent senders as enumeration
creatorContent creator as enumeration
dispositionOptional content disposition (defauls to 'session' if empty)

References creator(), and senders().

Referenced by fromXml().

Member Function Documentation

◆ creator()

Creator creator ( ) const
inline

Get the content creator

Returns
Content creator as enumeration

Referenced by JGSessionContent().

◆ fromXml()

static JGSessionContent * fromXml ( XmlElement * xml,
XMPPError::Type & err,
String & error )
static

Decode 'content' element attributes

Parameters
xmlThe XML element
errThe error on failure
errorError text to be sent on failure
Returns
Valid JGSessionContent pointer on success

References JGSessionContent().

◆ isEarlyMedia()

bool isEarlyMedia ( ) const
inline

Check if the content disposition is early media

Returns
True if this content is an early media one

◆ isSession()

bool isSession ( ) const
inline

Check if the content disposition is session XEP-0166: true if disposition is missing

Returns
True if this content should be processed at session level

◆ isValidAudio()

bool isValidAudio ( ) const
inline

Check if this content is a valid audio one: it's media list type is Audio and the payload list is not empty

Returns
True if this content can be used for audio purposes

References m_rtpMedia.

◆ senders()

Senders senders ( ) const
inline

Get the senders

Returns
Senders as enumeration

Referenced by JGSessionContent().

◆ setEarlyMedia()

void setEarlyMedia ( )
inline

Set this content's disposition to early media

◆ toString()

virtual const String & toString ( ) const
inlinevirtual

Get the name of this content

Reimplemented from GenObject.

◆ toXml()

XmlElement * toXml ( bool minimum,
bool addDesc,
bool addTrans,
bool addCandidates,
bool addAuth ) const

Build a 'content' XML element from this object

Parameters
minimumMinimum data (only creator and name)
addDescTrue to add the description child
addTransTrue to add the transport child
addCandidatesTrue to add the transport candidate children
addAuthRtpIceUdp only: add auth data
Returns
Valid XmlElement pointer

◆ type()

Type type ( ) const
inline

Get the content type

Returns
Content type as enumeration

Member Data Documentation

◆ m_fileTransfer

NamedList m_fileTransfer

File info (for file transfer)

◆ m_rtpLocalCandidates

JGRtpCandidates m_rtpLocalCandidates

The RTP local candidates

◆ m_rtpMedia

JGRtpMediaList m_rtpMedia

The RTP media description if used

Referenced by isValidAudio().

◆ m_rtpRemoteCandidates

JGRtpCandidates m_rtpRemoteCandidates

The RTP remote candidates

◆ s_creator

const TokenDict s_creator[]
static

The list containing the text values for Creator enumeration

◆ s_senders

const TokenDict s_senders[]
static

The list containing the text values for Senders enumeration


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