H323Channel Class Reference

#include <channels.h>

Inheritance diagram for H323Channel:

H323_H224Channel H323BidirectionalChannel H323UnidirectionalChannel H323_RealTimeChannel H323DataChannel H323_ExternalRTPChannel H323_RTPChannel H323_T120Channel H323_T38Channel List of all members.

Operations

enum  Directions { IsBidirectional, IsTransmitter, IsReceiver, NumDirections }
virtual Directions GetDirection () const=0
virtual unsigned GetSessionID () const
virtual BOOL SetInitialBandwidth ()
virtual BOOL Open ()
virtual BOOL Start ()=0
virtual void CleanUpOnTermination ()
virtual BOOL IsRunning () const
virtual void Receive ()=0
virtual void Transmit ()=0
virtual BOOL OnSendingPDU (H245_OpenLogicalChannel &openPDU) const =0
virtual void OnSendOpenAck (const H245_OpenLogicalChannel &open, H245_OpenLogicalChannelAck &ack) const
virtual BOOL OnReceivedPDU (const H245_OpenLogicalChannel &pdu, unsigned &errorCode)
virtual BOOL 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)
void SendMiscCommand (unsigned command)

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)
unsigned GetBandwidthUsed () const
BOOL SetBandwidthUsed (unsigned bandwidth)
const H323CapabilityGetCapability () const
H323CodecGetCodec () const
BOOL IsPaused () const
void SetPause (BOOL pause)

Protected Attributes

H323EndPointendpoint
H323Connectionconnection
H323Capabilitycapability
H323ChannelNumber number
H323ChannelNumber reverseChannel
H323Codeccodec
PThread * receiveThread
PThread * transmitThread
BOOL opened
BOOL paused
BOOL terminating

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.

Definition at line 237 of file channels.h.


Member Enumeration Documentation

enum H323Channel::Directions

Enumerator:
IsBidirectional 
IsTransmitter 
IsReceiver 
NumDirections 

Definition at line 267 of file channels.h.


Constructor & Destructor Documentation

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

Create a new channel.

Parameters:
connection  Connection to endpoint for channel
capability  Capability channel is using

Definition at line 653 of file channels.cxx.

References capability, codec, opened, paused, receiveThread, terminating, and transmitThread.

H323Channel::~H323Channel (  ) 

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

Definition at line 668 of file channels.cxx.

References capability, codec, connection, and H323Connection::UseBandwidth().


Member Function Documentation

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 H323UnidirectionalChannel, H323BidirectionalChannel, and H323_H224Channel.

Referenced by H323Connection::DecodeFastStartCaps(), GetCodec(), H245NegLogicalChannel::HandleOpen(), H245NegLogicalChannel::HandleOpenAck(), H245NegLogicalChannel::HandleRequestClose(), and H323Connection::SendLogicalChannelMiscCommand().

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 H323_RTPChannel, H323_ExternalRTPChannel, and H323DataChannel.

Definition at line 683 of file channels.cxx.

Referenced by H245NegLogicalChannel::HandleRequestClose(), H323Connection::OnConflictingLogicalChannel(), and H323Connection::OnStartLogicalChannel().

BOOL H323Channel::SetInitialBandwidth (  )  [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.

Reimplemented in H323_H224Channel.

Definition at line 797 of file channels.cxx.

References codec, OpalMediaFormat::GetBandwidth(), GetCodec(), H323Codec::GetMediaFormat(), and SetBandwidthUsed().

Referenced by H323Connection::CreateLogicalChannel(), and H245NegLogicalChannel::OpenWhileLocked().

BOOL H323Channel::Open (  )  [virtual]

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

Reimplemented in H323_RTPChannel, and H323_H224Channel.

Definition at line 823 of file channels.cxx.

References connection, H323Connection::OnStartLogicalChannel(), and opened.

Referenced by H245NegLogicalChannel::OpenWhileLocked(), H323_ExternalRTPChannel::Start(), and H323UnidirectionalChannel::Start().

virtual BOOL H323Channel::Start (  )  [pure virtual]

This is called when the channel can start transferring data.

Implemented in H323UnidirectionalChannel, H323BidirectionalChannel, H323_ExternalRTPChannel, and H323_H224Channel.

Referenced by H245NegLogicalChannel::HandleOpen(), H245NegLogicalChannel::HandleOpenAck(), and H245NegLogicalChannel::HandleOpenConfirm().

void H323Channel::CleanUpOnTermination (  )  [virtual]

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

Reimplemented in H323_RTPChannel, H323DataChannel, and H323_T38Channel.

Definition at line 689 of file channels.cxx.

References H323Codec::Close(), codec, connection, number, H323Connection::OnClosedLogicalChannel(), opened, receiveThread, terminating, and transmitThread.

Referenced by H323DataChannel::CleanUpOnTermination(), H323_RTPChannel::CleanUpOnTermination(), H245NegLogicalChannel::HandleOpen(), H323Connection::OnConflictingLogicalChannel(), H245NegLogicalChannel::OpenWhileLocked(), H245NegLogicalChannel::Release(), and H245NegLogicalChannels::RemoveAll().

BOOL H323Channel::IsRunning (  )  const [virtual]

Indicate if background thread(s) are running.

Reimplemented in H323_ExternalRTPChannel.

Definition at line 726 of file channels.cxx.

References receiveThread, and transmitThread.

Referenced by H323Connection::MonitorCallStatus().

virtual void H323Channel::Receive (  )  [pure virtual]

Handle channel data reception.

This is called by the thread started by the Start() function and is typically a loop writing to the codec and reading from the transport (eg RTP_session).

Implemented in H323_RTPChannel, H323_ExternalRTPChannel, H323_H224Channel, H323_T120Channel, and H323_T38Channel.

Referenced by H323LogicalChannelThread::Main().

virtual void H323Channel::Transmit (  )  [pure virtual]

Handle channel data transmission.

This is called by the thread started by the Start() function and is typically a loop reading from the codec and writing to the transport (eg an RTP_session).

Implemented in H323_RTPChannel, H323_ExternalRTPChannel, H323_H224Channel, H323_T120Channel, and H323_T38Channel.

Referenced by H323LogicalChannelThread::Main().

virtual BOOL H323Channel::OnSendingPDU ( H245_OpenLogicalChannel openPDU  )  const [pure virtual]

Fill out the OpenLogicalChannel PDU for the particular channel type.

Parameters:
openPDU  Open PDU to send.

Implemented in H323_RealTimeChannel, H323DataChannel, H323_H224Channel, H323_T120Channel, and H323_T38Channel.

Referenced by H245NegLogicalChannel::OpenWhileLocked().

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:
open  Open PDU
ack  Acknowledgement PDU

Reimplemented in H323_RealTimeChannel, H323DataChannel, H323_H224Channel, and H323_T120Channel.

Definition at line 751 of file channels.cxx.

Referenced by H245NegLogicalChannel::HandleOpen().

BOOL 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:
pdu  Open PDU
errorCode  Error code on failure

Reimplemented in H323_RealTimeChannel, H323DataChannel, H323_H224Channel, H323_T120Channel, and H323_T38Channel.

Definition at line 738 of file channels.cxx.

Referenced by H323Connection::CreateLogicalChannel().

BOOL 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:
pdu  Acknowledgement PDU

Reimplemented in H323_RealTimeChannel, H323DataChannel, H323_H224Channel, and H323_T120Channel.

Definition at line 745 of file channels.cxx.

Referenced by H245NegLogicalChannel::HandleOpenAck().

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:
bitRateRestriction  Bit rate limitation

Definition at line 757 of file channels.cxx.

References codec, GetCodec(), and H323Codec::OnFlowControl().

Referenced by H323Connection::OnLogicalChannelFlowControl().

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:
type  Command to process

Definition at line 766 of file channels.cxx.

References codec, GetCodec(), number, and H323Codec::OnMiscellaneousCommand().

Referenced by H323Connection::OnH245_MiscellaneousCommand().

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:
type  Indication to process

Definition at line 776 of file channels.cxx.

References codec, GetCodec(), number, and H323Codec::OnMiscellaneousIndication().

Referenced by H323Connection::OnH245_MiscellaneousIndication().

virtual void H323Channel::OnJitterIndication ( DWORD  jitter,
int  skippedFrameCount,
int  additionalBuffer 
) [virtual]

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

Parameters:
jitter  Estimated received jitter in microseconds
skippedFrameCount  Frames skipped by decodec
additionalBuffer  Additional size of video decoder buffer

Referenced by H323Connection::OnLogicalChannelJitter().

void H323Channel::SendMiscCommand ( unsigned  command  ) 

Send a miscellanous command to the remote transmitting video codec. Typically, used to indicate a problem in the received video stream.

Definition at line 855 of file channels.cxx.

References connection, and H323Connection::SendLogicalChannelMiscCommand().

const H323ChannelNumber& H323Channel::GetNumber (  )  const [inline]

Get the number of the channel.

Definition at line 411 of file channels.h.

References number.

Referenced by H245NegLogicalChannels::Add(), H323Connection::CloseAllLogicalChannels(), H323Connection::OnConflictingLogicalChannel(), H323Connection::OnReceivedCapabilitySet(), H323Connection::OnStartLogicalChannel(), H323Connection::SendLogicalChannelMiscCommand(), and H323Connection::SetBandwidthAvailable().

void H323Channel::SetNumber ( const H323ChannelNumber num  )  [inline]

Set the number of the channel.

Definition at line 415 of file channels.h.

References number.

Referenced by H323Connection::DecodeFastStartCaps(), H245NegLogicalChannel::HandleOpen(), H323Connection::InternalEstablishedConnectionCheck(), H323Connection::OpenLogicalChannel(), and H245NegLogicalChannel::OpenWhileLocked().

const H323ChannelNumber& H323Channel::GetReverseChannel (  )  const [inline]

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

Definition at line 419 of file channels.h.

References reverseChannel.

void H323Channel::SetReverseChannel ( const H323ChannelNumber num  )  [inline]

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

Definition at line 423 of file channels.h.

References reverseChannel.

unsigned H323Channel::GetBandwidthUsed (  )  const [inline]

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

Definition at line 427 of file channels.h.

Referenced by H323Connection::GetBandwidthUsed(), and H323Connection::SetBandwidthAvailable().

BOOL H323Channel::SetBandwidthUsed ( unsigned  bandwidth  ) 

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

Parameters:
bandwidth  New bandwidth

Definition at line 806 of file channels.cxx.

References connection, and H323Connection::UseBandwidth().

Referenced by SetInitialBandwidth().

const H323Capability& H323Channel::GetCapability (  )  const [inline]

Get the capability that created this channel.

Definition at line 437 of file channels.h.

References capability.

Referenced by H245NegLogicalChannel::HandleRequestClose(), and H323Connection::OnConflictingLogicalChannel().

H323Codec * H323Channel::GetCodec (  )  const

Get the codec, if any, associated with the channel.

Definition at line 840 of file channels.cxx.

References capability, codec, H323Capability::CreateCodec(), H323Codec::Decoder, H323Codec::Encoder, endpoint, GetDirection(), H323EndPoint::GetSilenceDetectionMode(), and IsReceiver.

Referenced by OnFlowControl(), OnMiscellaneousCommand(), OnMiscellaneousIndication(), H323_RTP_UDP::OnReceivedPDU(), H323_RTP_UDP::OnSendingPDU(), H323Connection::OnStartLogicalChannel(), H323_RTPChannel::Open(), and SetInitialBandwidth().

BOOL H323Channel::IsPaused (  )  const [inline]

Get the "pause" flag. A paused channel is one that prevents the annunciation of the channels data. For example for audio this would mute the data, for video it would still frame.

Note that channel is not stopped, and may continue to actually receive data, it is just that nothing is done with it.

Definition at line 451 of file channels.h.

References paused.

void H323Channel::SetPause ( BOOL  pause  )  [inline]

Set the "pause" flag. A paused channel is one that prevents the annunciation of the channels data. For example for audio this would mute the data, for video it would still frame.

Note that channel is not stopped, and may continue to actually receive data, it is just that nothing is done with it.

Parameters:
pause  New pause flag

Definition at line 461 of file channels.h.

References paused.


The documentation for this class was generated from the following files:
Generated on Thu Oct 25 13:45:20 2007 for h323plus by  doxygen 1.5.2