# H323AudioCapability Class Reference

`#include <h323caps.h>`

Inheritance diagram for H323AudioCapability:

[legend]
Collaboration diagram for H323AudioCapability:
[legend]

## Public Member Functions

Construction
| H323AudioCapability ()
Identification functions
virtual MainTypes | GetMainType () const
Operations
virtual unsigned | GetDefaultSessionID () const
virtual void | SetTxFramesInPacket (unsigned frames)
virtual unsigned | GetTxFramesInPacket () const
virtual unsigned | GetRxFramesInPacket () const
Protocol manipulation
virtual PBoolean | OnSendingPDU (H245_Capability &pdu) const
virtual PBoolean | OnSendingPDU (H245_DataType &pdu) const
virtual PBoolean | OnSendingPDU (H245_ModeElement &pdu) const
virtual PBoolean | OnSendingPDU (H245_AudioCapability &pdu, unsigned packetSize) const
virtual PBoolean | OnSendingPDU (H245_AudioCapability &pdu, unsigned packetSize, CommandType type) const
virtual PBoolean | OnSendingPDU (H245_AudioMode &pdu) const
virtual PBoolean | OnReceivedPDU (const H245_Capability &pdu)
virtual PBoolean | OnReceivedPDU (const H245_DataType &pdu, PBoolean receiver)
virtual PBoolean | OnReceivedPDU (const H245_AudioCapability &pdu, unsigned &packetSize)
virtual PBoolean | OnReceivedPDU (const H245_AudioCapability &pdu, unsigned &packetSize, CommandType type)

## Detailed Description

This class describes the interface to an audio codec used to transfer data via the logical channels opened and managed by the H323 control channel.

An application may create a descendent off this class and override functions as required for descibing the codec.

## Constructor & Destructor Documentation

H323AudioCapability::H323AudioCapability | ( |  | ) |

Create an audio based capability.

## Member Function Documentation

virtual unsigned H323AudioCapability::GetDefaultSessionID | ( |  | ) | const`[virtual]`

Get the default RTP session. This function gets the default RTP session ID for the capability type. For example audio capabilities return the value H323Capability::DefaultAudioSessionID etc.

The default behaviour returns zero, indicating it is not an RTP based capability.

Reimplemented from H323Capability.

virtual MainTypes H323AudioCapability::GetMainType | ( |  | ) | const`[virtual]`

Get the main type of the capability. Always returns e_Audio.

Implements H323Capability.

virtual unsigned H323AudioCapability::GetRxFramesInPacket | ( |  | ) | const`[virtual]`

Get the maximum size (in frames) of data that can be received in a single PDU.

The default behaviour sends the rxFramesInPacket variable.

Reimplemented from H323Capability.

virtual unsigned H323AudioCapability::GetTxFramesInPacket | ( |  | ) | const`[virtual]`

Get the maximum size (in frames) of data that will be transmitted in a single PDU.

The default behaviour sends the txFramesInPacket variable.

Reimplemented from H323Capability.

virtual PBoolean H323AudioCapability::OnReceivedPDU | ( | const H245_AudioCapability & | pdu,
|  | unsigned & | packetSize,
|  | CommandType | type |
| ) |  |  | `[virtual]`

Parameters:

  pdu | PDU to get information from
  packetSize | Packet size to use in capability
  type | Type of PDU to send in

Reimplemented in H323GenericAudioCapability.

virtual PBoolean H323AudioCapability::OnReceivedPDU | ( | const H245_AudioCapability & | pdu,
|  | unsigned & | packetSize |
| ) |  |  | `[virtual]`

This function is called whenever and incoming TerminalCapabilitySet or OpenLogicalChannel PDU has been used to construct the control channel. It allows the capability to set from the PDU fields, information in members specific to the class.

The default behaviour assumes the pdu is an integer number of frames per packet.

Parameters:

  pdu | PDU to get information from
  packetSize | Packet size to use in capability

Reimplemented in H323PluginG7231Capability, and H323NonStandardAudioCapability.

virtual PBoolean H323AudioCapability::OnReceivedPDU | ( | const H245_DataType & | pdu,
|  | PBoolean | receiver |
| ) |  |  | `[virtual]`

This function is called whenever and incoming OpenLogicalChannel PDU has been used to construct the control channel. It allows the capability to set from the PDU fields, information in members specific to the class.

The default behaviour calls the OnReceivedPDU() that takes a H245_AudioCapability and clamps the txFramesInPacket or rxFramesInPacket.

Parameters:

  pdu | PDU to get information from
  receiver | Is receiver OLC

Reimplemented from H323Capability.

virtual PBoolean H323AudioCapability::OnReceivedPDU | ( | const H245_Capability & | pdu | ) | `[virtual]`

This function is called whenever and incoming TerminalCapabilitySet PDU is received on the control channel, and a new H323Capability descendent was created. This completes reading fields from the PDU into the classes members.

If the function returns false then the received PDU codec description is not supported, so will be ignored.

The default behaviour calls the OnReceivedPDU() that takes a H245_AudioCapability and clamps the txFramesInPacket.

Parameters:

  pdu | PDU to get information from

Reimplemented from H323Capability.

virtual PBoolean H323AudioCapability::OnSendingPDU | ( | H245_AudioMode & | pdu | ) | const`[virtual]`

This function is called whenever and outgoing RequestMode PDU is being constructed for the control channel. It allows the capability to set the PDU fields from information in members specific to the class.

The default behaviour sets the PDUs tag according to the GetSubType() function (translated to different enum).

Parameters:

  pdu | PDU to set information on

Reimplemented in H323NonStandardAudioCapability, and H323GenericAudioCapability.

virtual PBoolean H323AudioCapability::OnSendingPDU | ( | H245_AudioCapability & | pdu,
|  | unsigned | packetSize,
|  | CommandType | type |
| ) |  |  | const`[virtual]`

Parameters:

  pdu | PDU to set information on
  packetSize | Packet size to use in capability
  type | Type of PDU to send in

Reimplemented in H323GenericAudioCapability.

virtual PBoolean H323AudioCapability::OnSendingPDU | ( | H245_AudioCapability & | pdu,
|  | unsigned | packetSize |
| ) |  |  | const`[virtual]`

This function is called whenever and outgoing TerminalCapabilitySet or OpenLogicalChannel PDU is being constructed for the control channel. It allows the capability to set the PDU fields from information in members specific to the class.

The default behaviour assumes the pdu is an integer number of frames per packet.

Parameters:

  pdu | PDU to set information on
  packetSize | Packet size to use in capability

Reimplemented in H323PluginG7231Capability, and H323NonStandardAudioCapability.

virtual PBoolean H323AudioCapability::OnSendingPDU | ( | H245_ModeElement & | pdu | ) | const`[virtual]`

This function is called whenever and outgoing RequestMode PDU is being constructed for the control channel. It allows the capability to set the PDU fields from information in members specific to the class.

The default behaviour calls the OnSendingPDU() function with a more specific PDU type.

Parameters:

  pdu | PDU to set information on

Implements H323Capability.

virtual PBoolean H323AudioCapability::OnSendingPDU | ( | H245_DataType & | pdu | ) | const`[virtual]`

This function is called whenever and outgoing OpenLogicalChannel PDU is being constructed for the control channel. It allows the capability to set the PDU fields from information in members specific to the class.

The default behaviour calls the OnSendingPDU() function with a more specific PDU type.

Parameters:

  pdu | PDU to set information on

Reimplemented from H323Capability.

virtual PBoolean H323AudioCapability::OnSendingPDU | ( | H245_Capability & | pdu | ) | const`[virtual]`

This function is called whenever and outgoing TerminalCapabilitySet PDU is being constructed for the control channel. It allows the capability to set the PDU fields from information in members specific to the class.

The default behaviour calls the OnSendingPDU() function with a more specific PDU type.

Parameters:

  pdu | PDU to set information on

Implements H323Capability.

virtual void H323AudioCapability::SetTxFramesInPacket | ( | unsigned | frames | ) | `[virtual]`

Set the maximum size (in frames) of data that will be transmitted in a single PDU.

This will also be the desired number that will be sent by most codec implemetations.

The default behaviour sets the txFramesInPacket variable.

Parameters:

  frames | Number of frames per packet

Reimplemented from H323Capability.

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

- h323caps.h