OPAL  Version 3.14.3
H323Capabilities Class Reference

#include <h323caps.h>

Inherits PObject.

Collaboration diagram for H323Capabilities:

Public Member Functions

Construction
 H323Capabilities ()
 
 H323Capabilities (H323Connection &connection, const H245_TerminalCapabilitySet &pdu)
 
 H323Capabilities (const H323Capabilities &original)
 
H323Capabilitiesoperator= (const H323Capabilities &original)
 
Overrides from class PObject
void PrintOn (ostream &strm) const
 
Operations
PINDEX GetSize () const
 
H323Capabilityoperator[] (PINDEX i) const
 
PINDEX SetCapability (PINDEX descriptorNum, PINDEX simultaneous, H323Capability *cap, H323Capability *before=NULL)
 
PINDEX AddMediaFormat (PINDEX descriptorNum, PINDEX simultaneous, const OpalMediaFormat &mediaFormat, H323Capability::CapabilityDirection direction=H323Capability::e_Receive)
 
PINDEX AddAllCapabilities (PINDEX descriptorNum, PINDEX simultaneous, const PString &name, PBoolean exact=false)
 
PINDEX AddAllCapabilities (const H323EndPoint &, PINDEX descriptorNum, PINDEX simultaneous, const PString &name, PBoolean exact=false)
 
void Add (H323Capability *capability)
 
H323CapabilityCopy (const H323Capability &capability)
 
void Remove (H323Capability *capability)
 
void Remove (const PString &formatName)
 
void Remove (const PStringArray &formatNames)
 
void RemoveAll ()
 
H323CapabilityFindCapability (unsigned capabilityNumber) const
 
H323CapabilityFindCapability (const PString &formatName, H323Capability::CapabilityDirection direction=H323Capability::e_Unknown, PBoolean exact=false) const
 
H323CapabilityFindCapability (H323Capability::CapabilityDirection direction) const
 
H323CapabilityFindCapability (const H323Capability &capability) const
 
H323CapabilityFindCapability (const H245_Capability &cap) const
 
H323CapabilityFindCapability (const H245_DataType &dataType, const PString &mediaPacketization=PString::Empty()) const
 
H323CapabilityFindCapability (const H245_ModeElement &modeElement, const PString &mediaPacketization=PString::Empty()) const
 
H323CapabilityFindCapability (H323Capability::MainTypes mainType, unsigned subType=UINT_MAX) const
 
void BuildPDU (const H323Connection &connection, H245_TerminalCapabilitySet &pdu) const
 
PBoolean Merge (const H323Capabilities &newCaps)
 
void Reorder (const PStringArray &preferenceOrder)
 
PBoolean IsAllowed (const H323Capability &capability)
 
PBoolean IsAllowed (unsigned capabilityNumber)
 
PBoolean IsAllowed (const H323Capability &capability1, const H323Capability &capability2)
 
PBoolean IsAllowed (unsigned capabilityNumber1, unsigned capabilityNumber2)
 
OpalMediaFormatList GetMediaFormats () const
 
const PStringSet & GetMediaPacketizations () const
 
const H323CapabilitiesSetGetSet () const
 

Protected Attributes

H323CapabilitiesList m_table
 
H323CapabilitiesSet m_set
 
PStringSet m_mediaPacketizations
 

Detailed Description

This class contains all of the capabilities and their combinations.

Constructor & Destructor Documentation

H323Capabilities::H323Capabilities ( )

Construct an empty capability set.

H323Capabilities::H323Capabilities ( H323Connection connection,
const H245_TerminalCapabilitySet &  pdu 
)

Construct a capability set from the H.245 PDU provided.

Parameters
connectionConnection for capabilities
pduPDU to convert to a capability set.
H323Capabilities::H323Capabilities ( const H323Capabilities original)

Construct a copy of a capability set. Note this will completely duplicate the set by making clones of every capability in the original set.

Parameters
originalOriginal capabilities to duplicate

Member Function Documentation

void H323Capabilities::Add ( H323Capability capability)

Add a codec to the capabilities table. This will assure that the assignedCapabilityNumber field in the capability is unique for all capabilities installed on this set.

If the specific instance of the capability is already in the table, it is not added again. Ther can be multiple instances of the same capability class however.

Parameters
capabilityNew capability specification
PINDEX H323Capabilities::AddAllCapabilities ( PINDEX  descriptorNum,
PINDEX  simultaneous,
const PString &  name,
PBoolean  exact = false 
)

Add all matching capabilities to descriptor lists. All capabilities that match the specified name are added as in the other form of the SetCapability() function.

Parameters
descriptorNumThe member of the capabilityDescriptor to add
simultaneousThe member of the SimultaneousCapabilitySet to add
nameNew capabilities name, if using "known" one.
exactCapability name must be exact match
PINDEX H323Capabilities::AddAllCapabilities ( const H323EndPoint ,
PINDEX  descriptorNum,
PINDEX  simultaneous,
const PString &  name,
PBoolean  exact = false 
)
inline
Parameters
descriptorNumThe member of the capabilityDescriptor to add
simultaneousThe member of the SimultaneousCapabilitySet to add
nameNew capabilities name, if using "known" one.
exactCapability name must be exact match

References AddAllCapabilities().

Referenced by AddAllCapabilities().

PINDEX H323Capabilities::AddMediaFormat ( PINDEX  descriptorNum,
PINDEX  simultaneous,
const OpalMediaFormat mediaFormat,
H323Capability::CapabilityDirection  direction = H323Capability::e_Receive 
)

Add matching capability to media format.

Parameters
descriptorNumThe member of the capabilityDescriptor to add
simultaneousThe member of the SimultaneousCapabilitySet to add
mediaFormatMedia format to add.
directionIndicate capability direction
void H323Capabilities::BuildPDU ( const H323Connection connection,
H245_TerminalCapabilitySet &  pdu 
) const

Build a H.245 PDU from the information in the capability set.

Parameters
connectionConnection building PDU for
pduPDU to build
H323Capability* H323Capabilities::Copy ( const H323Capability capability)

Copy a codec to the capabilities table. This will make a clone of the capability and assure that the assignedCapabilityNumber field in the capability is unique for all capabilities installed on this set.

Returns the copy that is put in the table.

Parameters
capabilityNew capability specification
H323Capability* H323Capabilities::FindCapability ( unsigned  capabilityNumber) const

Find the capability given the capability number. This number is guarenteed to be unique for a give capability table. Note that is may not be the same as the index into the table.

Returns: NULL if no capability meeting the criteria was found

H323Capability* H323Capabilities::FindCapability ( const PString &  formatName,
H323Capability::CapabilityDirection  direction = H323Capability::e_Unknown,
PBoolean  exact = false 
) const

Find the capability given the capability format name string. This does a partial match for the supplied argument. If the argument matches a substring of the actual capabilities name, then it is returned. For example "GSM" or "0610" will match "GSM 0610". Note case is not significant.

The user should be carefull of using short strings such as "G"!

The direction parameter can further refine the search for specific receive or transmit capabilities. The default value of e_Unknown will wildcard that field.

Returns: NULL if no capability meeting the criteria was found

Parameters
formatNameWildcard format name to search for
directionOptional direction to include into search criteria
exactCapability name must be exact match
H323Capability* H323Capabilities::FindCapability ( H323Capability::CapabilityDirection  direction) const

Find the first capability in the table of the specified direction.

Returns: NULL if no capability meeting the criteria was found

Parameters
directionDirection to search for
H323Capability* H323Capabilities::FindCapability ( const H323Capability capability) const

Find the capability given the capability. This does a value compare of the two capabilities. Usually this means the mainType and subType are the same.

Returns: NULL if no capability meeting the criteria was found

Parameters
capabilityCapability to search for
H323Capability* H323Capabilities::FindCapability ( const H245_Capability &  cap) const

Find the capability given the H.245 capability PDU.

Returns: NULL if no capability meeting the criteria was found

Parameters
capH245 capability table entry
H323Capability* H323Capabilities::FindCapability ( const H245_DataType &  dataType,
const PString &  mediaPacketization = PString::Empty() 
) const

Find the capability given the H.245 data type PDU.

Returns: NULL if no capability meeting the criteria was found

Parameters
dataTypeH245 data type of codec
mediaPacketizationMedia packetization, if present
H323Capability* H323Capabilities::FindCapability ( const H245_ModeElement &  modeElement,
const PString &  mediaPacketization = PString::Empty() 
) const

Find the capability given the H.245 data type PDU.

Returns: NULL if no capability meeting the criteria was found

Parameters
modeElementH245 data type of codec
mediaPacketizationMedia packetization, if present
H323Capability* H323Capabilities::FindCapability ( H323Capability::MainTypes  mainType,
unsigned  subType = UINT_MAX 
) const

Find the capability given the type codecs.

Returns: NULL if no capability meeting the criteria was found

Parameters
mainTypeMain type to find
subTypeSub-type to find (UINT_MAX=ignore)
OpalMediaFormatList H323Capabilities::GetMediaFormats ( ) const

Get the list of capabilities as a list of media formats.

const PStringSet& H323Capabilities::GetMediaPacketizations ( ) const
inline

References m_mediaPacketizations.

const H323CapabilitiesSet& H323Capabilities::GetSet ( ) const
inline

References m_set.

PINDEX H323Capabilities::GetSize ( ) const
inline

Get the number of capabilities in the set.

References m_table.

PBoolean H323Capabilities::IsAllowed ( const H323Capability capability)

Test if the capability is allowed.

PBoolean H323Capabilities::IsAllowed ( unsigned  capabilityNumber)

Test if the capability is allowed.

PBoolean H323Capabilities::IsAllowed ( const H323Capability capability1,
const H323Capability capability2 
)

Test if the capabilities are an allowed combination.

PBoolean H323Capabilities::IsAllowed ( unsigned  capabilityNumber1,
unsigned  capabilityNumber2 
)

Test if the capabilities are an allowed combination.

PBoolean H323Capabilities::Merge ( const H323Capabilities newCaps)

Merge the capabilities into this set.

H323Capabilities& H323Capabilities::operator= ( const H323Capabilities original)

Assign a copy of a capability set. Note this will completely duplicate the set by making clones of every capability in the original set.

Parameters
originalOriginal capabilities to duplicate
H323Capability& H323Capabilities::operator[] ( PINDEX  i) const
inline

Get the capability at the specified index.

References m_table.

void H323Capabilities::PrintOn ( ostream &  strm) const

Print out the object to the stream, virtual version of << operator.

Parameters
strmStream to print out to.
void H323Capabilities::Remove ( H323Capability capability)

Remove a capability from the table. Note that the the parameter must be the actual instance of the capability in the table. The instance is deleted when removed from the table.

Parameters
capabilityExisting capability specification
void H323Capabilities::Remove ( const PString &  formatName)

Remove all capabilities matching the string. This uses FindCapability() to locate the first capability whose format name does a partial match for the argument.

Parameters
formatNameFormat name to search for.
void H323Capabilities::Remove ( const PStringArray &  formatNames)

Remove all capabilities matching any of the strings provided. This simply calls Remove() for each string in the list.

Parameters
formatNamesArray of format names to remove
void H323Capabilities::RemoveAll ( )

Remove all of the capabilities.

void H323Capabilities::Reorder ( const PStringArray &  preferenceOrder)

Change the order of capabilities in the table to the order specified. Note that this does not change the unique capability numbers assigned when the capability is first added to the set.

The string matching rules are as for the FindCapability() function.

Parameters
preferenceOrderNew order
PINDEX H323Capabilities::SetCapability ( PINDEX  descriptorNum,
PINDEX  simultaneous,
H323Capability cap,
H323Capability before = NULL 
)

Set the capability descriptor lists. This is three tier set of codecs. The top most level is a list of particular capabilities. Each of these consists of a list of alternatives that can operate simultaneously. The lowest level is a list of codecs that cannot operate together. See H323 section 6.2.8.1 and H245 section 7.2 for details.

If descriptorNum is P_MAX_INDEX, the the next available index in the array of descriptors is used. Similarly if simultaneous is P_MAX_INDEX the the next available SimultaneousCapabilitySet is used. The return value is the index used for the new entry. Note if both are P_MAX_INDEX then the return value is the descriptor index as the simultaneous index must be zero.

Note that the capability specified here is automatically added to the capability table using the AddCapability() function. A specific instance of a capability is only ever added once, so multiple SetCapability() calls with the same H323Capability pointer will only add that capability once.

Parameters
descriptorNumThe member of the capabilityDescriptor to add
simultaneousThe member of the SimultaneousCapabilitySet to add
capNew capability specification
beforeCapability to insert before

Field Documentation

PStringSet H323Capabilities::m_mediaPacketizations
protected

Referenced by GetMediaPacketizations().

H323CapabilitiesSet H323Capabilities::m_set
protected

Referenced by GetSet().

H323CapabilitiesList H323Capabilities::m_table
protected

Referenced by GetSize(), and operator[]().


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