OPAL  Version 3.18.8
H323Channel Class Referenceabstract

#include <channels.h>

Inheritance diagram for H323Channel:
Collaboration diagram for H323Channel:

Public Member Functions

Construction
 H323Channel (H323Connection &connection, const H323Capability &capability)
 
 ~H323Channel ()
 
Overrides from PObject
virtual void PrintOn (ostream &strm) const
 
Member variable access
const H323ChannelNumberGetNumber () const
 
void SetNumber (const H323ChannelNumber &num)
 
const H323ChannelNumberGetReverseChannel () const
 
void SetReverseChannel (const H323ChannelNumber &num)
 
OpalBandwidth GetBandwidthUsed () const
 
bool SetBandwidthUsed (OpalBandwidth bandwidth)
 
const H323CapabilityGetCapability () const
 
OpalMediaFormat GetMediaFormat () const
 Get the media format (from capability) More...
 
virtual bool UpdateMediaFormat (const OpalMediaFormat &mediaFormat)
 Update media format options. More...
 

Protected Member Functions

virtual void InternalClose ()
 

Protected Attributes

H323EndPointendpoint
 
H323Connectionconnection
 
H323Capabilitycapability
 
H323ChannelNumber number
 
H323ChannelNumber reverseChannel
 
bool opened
 
atomic< bool > m_terminating
 

Operations

enum  Directions { IsBidirectional, IsTransmitter, IsReceiver, NumDirections }
 
virtual Directions GetDirection () const =0
 
virtual unsigned GetSessionID () const
 
virtual bool SetSessionID (unsigned sessionID)
 
virtual PBoolean GetMediaTransportAddress (OpalTransportAddress &data, OpalTransportAddress &control) const
 
virtual PBoolean SetInitialBandwidth ()=0
 
virtual bool PreOpen ()
 
virtual PBoolean Open ()
 
virtual void Close ()
 
PBoolean IsOpen () const
 
virtual OpalMediaStreamPtr GetMediaStream () const
 
virtual void SetMediaStream (OpalMediaStreamPtr mediaStream)
 
virtual PBoolean OnSendingPDU (H245_OpenLogicalChannel &openPDU) const
 
virtual void OnSendOpenAck (const H245_OpenLogicalChannel &open, H245_OpenLogicalChannelAck &ack) const
 
virtual PBoolean OnReceivedPDU (const H245_OpenLogicalChannel &pdu, unsigned &errorCode)
 
virtual PBoolean OnReceivedAckPDU (const H245_OpenLogicalChannelAck &pdu)
 
virtual void OnFlowControl (long bitRateRestriction)
 
virtual void OnMiscellaneousCommand (const H245_MiscellaneousCommand_type &type)
 
virtual void OnMiscellaneousIndication (const H245_MiscellaneousIndication_type &type)
 
virtual void OnJitterIndication (DWORD jitter, int skippedFrameCount, int additionalBuffer)
 

Detailed Description

This class describes a logical channel between the two endpoints. They may be created and deleted as required in the H245 protocol.

An application may create a descendent off this class and override functions as required for operating the channel protocol.

Member Enumeration Documentation

Enumerator
IsBidirectional 
IsTransmitter 
IsReceiver 
NumDirections 

Constructor & Destructor Documentation

H323Channel::H323Channel ( H323Connection connection,
const H323Capability capability 
)

Create a new channel.

Parameters
connectionConnection to endpoint for channel
capabilityCapability channel is using
H323Channel::~H323Channel ( )

Destroy new channel. To avoid usage of deleted objects in background threads, this waits for the H323LogicalChannelThread to terminate before continuing.

Member Function Documentation

virtual void H323Channel::Close ( )
virtual

This is called to clean up any threads on connection termination.

OpalBandwidth H323Channel::GetBandwidthUsed ( ) const
inline

Get the bandwidth used by the channel in 100's of bits/sec.

const H323Capability& H323Channel::GetCapability ( ) const
inline

Get the capability that created this channel.

References capability.

virtual Directions H323Channel::GetDirection ( ) const
pure virtual

Indicate the direction of the channel. Return if the channel is bidirectional, or unidirectional, and which direction for the latter case.

Implemented in H323BidirectionalChannel, and H323UnidirectionalChannel.

OpalMediaFormat H323Channel::GetMediaFormat ( ) const

Get the media format (from capability)

virtual OpalMediaStreamPtr H323Channel::GetMediaStream ( ) const
virtual

Get the media stream associated with this logical channel.

If the argument is set to true, the mediaStream is about to be deleted so all internal references to the mediaStream must be removed.

The default behaviour returns NULL.

Reimplemented in H323UnidirectionalChannel.

virtual PBoolean H323Channel::GetMediaTransportAddress ( OpalTransportAddress data,
OpalTransportAddress control 
) const
virtual

Get the media transport address for the connection. This is primarily used to determine if media bypass is possible for the call between two connections.

The default behaviour returns false.

Parameters
dataData channel address
controlControl channel address

Reimplemented in H323_RTPChannel.

const H323ChannelNumber& H323Channel::GetNumber ( ) const
inline

Get the number of the channel.

References number.

const H323ChannelNumber& H323Channel::GetReverseChannel ( ) const
inline

Get the number of the reverse channel (if present).

References reverseChannel.

virtual unsigned H323Channel::GetSessionID ( ) const
virtual

Indicate the session number of the channel. Return session for channel. This is primarily for use by RTP based channels, for channels for which the concept of a session is not meaningfull, the default simply returns 0.

Reimplemented in H323DataChannel, and H323_RTPChannel.

virtual void H323Channel::InternalClose ( )
protectedvirtual
PBoolean H323Channel::IsOpen ( ) const
inline

Indicate if has been opened.

References m_terminating, and opened.

virtual void H323Channel::OnFlowControl ( long  bitRateRestriction)
virtual

Limit bit flow for the logical channel. The default behaviour passes this on to the codec if not NULL.

Parameters
bitRateRestrictionBit rate limitation
virtual void H323Channel::OnJitterIndication ( DWORD  jitter,
int  skippedFrameCount,
int  additionalBuffer 
)
virtual

Limit bit flow for the logical channel. The default behaviour does nothing.

Parameters
jitterEstimated received jitter in microseconds
skippedFrameCountFrames skipped by decodec
additionalBufferAdditional size of video decoder buffer
virtual void H323Channel::OnMiscellaneousCommand ( const H245_MiscellaneousCommand_type &  type)
virtual

Process a miscellaneous command on the logical channel. The default behaviour passes this on to the codec if not NULL.

Parameters
typeCommand to process
virtual void H323Channel::OnMiscellaneousIndication ( const H245_MiscellaneousIndication_type &  type)
virtual

Process a miscellaneous indication on the logical channel. The default behaviour passes this on to the codec if not NULL.

Parameters
typeIndication to process
virtual PBoolean H323Channel::OnReceivedAckPDU ( const H245_OpenLogicalChannelAck &  pdu)
virtual

This is called after a request to create a channel occurs from the local machine via the H245LogicalChannelDict::Open() function, and the request has been acknowledged by the remote endpoint.

The default behaviour just returns true.

Parameters
pduAcknowledgement PDU

Reimplemented in H323DataChannel, H323_RealTimeChannel, and H323_T120Channel.

virtual PBoolean H323Channel::OnReceivedPDU ( const H245_OpenLogicalChannel &  pdu,
unsigned &  errorCode 
)
virtual

This is called after a request to create a channel occurs from the local machine via the H245LogicalChannelDict::Open() function, and the request has been acknowledged by the remote endpoint.

The default behaviour just returns true.

Parameters
pduOpen PDU
errorCodeError code on failure

Reimplemented in H323DataChannel, H323_RealTimeChannel, and H323_T120Channel.

virtual PBoolean H323Channel::OnSendingPDU ( H245_OpenLogicalChannel &  openPDU) const
virtual

Fill out the OpenLogicalChannel PDU for the particular channel type.

Parameters
openPDUOpen PDU to send.

Reimplemented in H323DataChannel, H323_RealTimeChannel, and H323_T120Channel.

virtual void H323Channel::OnSendOpenAck ( const H245_OpenLogicalChannel &  open,
H245_OpenLogicalChannelAck &  ack 
) const
virtual

This is called when request to create a channel is received from a remote machine and is about to be acknowledged.

The default behaviour does nothing.

Parameters
openOpen PDU
ackAcknowledgement PDU

Reimplemented in H323DataChannel, H323_RealTimeChannel, and H323_T120Channel.

virtual PBoolean H323Channel::Open ( )
virtual

Open the channel. The default behaviour just calls connection.OnStartLogicalChannel() and if successful sets the opened member variable.

Reimplemented in H323UnidirectionalChannel.

virtual bool H323Channel::PreOpen ( )
virtual

PreOpen the channel. This occurs when we send an OLC, full open happens when the OLC comes back.

Default behaviour calls Open().

Reimplemented in H323UnidirectionalChannel.

virtual void H323Channel::PrintOn ( ostream &  strm) const
virtual
bool H323Channel::SetBandwidthUsed ( OpalBandwidth  bandwidth)

Get the bandwidth used by the channel in 100's of bits/sec.

Parameters
bandwidthNew bandwidth
virtual PBoolean H323Channel::SetInitialBandwidth ( )
pure virtual

Set the initial bandwidth for the channel. This calculates the initial bandwidth required by the channel and returns true if the connection can support this bandwidth.

The default behaviour gets the bandwidth requirement from the codec object created by the channel.

Implemented in H323UnidirectionalChannel.

virtual void H323Channel::SetMediaStream ( OpalMediaStreamPtr  mediaStream)
virtual

Set the media stream associated with this logical channel. The default behaviour does nothing.

Reimplemented in H323UnidirectionalChannel.

void H323Channel::SetNumber ( const H323ChannelNumber num)
inline

Set the number of the channel.

References number.

void H323Channel::SetReverseChannel ( const H323ChannelNumber num)
inline

Set the number of the reverse channel (if present).

References reverseChannel.

virtual bool H323Channel::SetSessionID ( unsigned  sessionID)
virtual

Set the session number of the channel. During OLC negotations teh master may change the session number being used for the logical channel.

Returns false if the session could not be renumbered.

Parameters
sessionIDNew session ID

Reimplemented in H323_RTPChannel.

virtual bool H323Channel::UpdateMediaFormat ( const OpalMediaFormat mediaFormat)
virtual

Update media format options.

Reimplemented in H323UnidirectionalChannel.

Field Documentation

H323Capability* H323Channel::capability
protected

Referenced by GetCapability().

H323Connection& H323Channel::connection
protected
H323EndPoint& H323Channel::endpoint
protected
atomic<bool> H323Channel::m_terminating
protected

Referenced by IsOpen().

H323ChannelNumber H323Channel::number
protected

Referenced by GetNumber(), and SetNumber().

bool H323Channel::opened
protected

Referenced by IsOpen().

H323ChannelNumber H323Channel::reverseChannel
protected

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