H323VideoCodec Class Reference

#include <codecs.h>

Inheritance diagram for H323VideoCodec:

H323Codec H323_Cu30Codec H323_H261Codec OpalDynaVideoCodec

List of all members.

Public Types

enum  BitRateModeBits { None = 0x00, DynamicVideoQuality = 0x01, AdaptivePacketDelay = 0x02 }

Public Member Functions

 H323VideoCodec (const char *mediaFormat, Direction direction)
 ~H323VideoCodec ()
virtual BOOL Open (H323Connection &connection)
virtual void Close ()
virtual void OnMiscellaneousCommand (const H245_MiscellaneousCommand_type &type)
virtual void OnMiscellaneousIndication (const H245_MiscellaneousIndication_type &type)
virtual void OnFreezePicture ()
virtual void OnFastUpdatePicture ()
virtual void OnFastUpdateGOB (unsigned firstGOB, unsigned numberOfGOBs)
virtual void OnFastUpdateMB (int firstGOB, int firstMB, unsigned numberOfMBs)
virtual void OnVideoIndicateReadyToActivate ()
virtual void OnVideoTemporalSpatialTradeOffCommand (int newQuality)
virtual void OnVideoTemporalSpatialTradeOffIndication (int newQuality)
virtual void OnVideoNotDecodedMBs (unsigned firstMB, unsigned numberOfMBs, unsigned temporalReference)
virtual void OnLostPartialPicture ()
virtual void OnLostPicture ()
int GetWidth () const
int GetHeight () const
virtual void SetTxQualityLevel (int qlevel)
virtual void SetTxMinQuality (int qlevel)
virtual void SetTxMaxQuality (int qlevel)
virtual void SetBackgroundFill (int idle)
unsigned GetVideoMode (void)
unsigned SetVideoMode (unsigned mode)
virtual BOOL SetMaxBitRate (unsigned bitRate)
virtual unsigned GetMaxBitRate () const
virtual BOOL SetTargetFrameTimeMs (unsigned ms)
void SendMiscCommand (unsigned command)
virtual int GetFrameNum ()

Protected Attributes

int frameWidth
int frameHeight
int fillLevel
unsigned videoBitRateControlModes
int bitRateHighLimit
unsigned oldLength
PTimeInterval oldTime
PTimeInterval newTime
int targetFrameTimeMs
int frameBytes
int sumFrameTimeMs
int sumAdjFrameTimeMs
int sumFrameBytes
int videoQMax
int videoQMin
int videoQuality
PTimeInterval frameStartTime
PTimeInterval grabInterval
int frameNum
int packetNum
int oldPacketNum
int framesPerSec
PMutex videoHandlerActive


Detailed Description

This class defines a codec class that will use the standard platform image output device.

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


Member Enumeration Documentation

Enumerator:
None 
DynamicVideoQuality 
AdaptivePacketDelay 


Constructor & Destructor Documentation

H323VideoCodec::H323VideoCodec ( const char *  mediaFormat,
Direction  direction 
)

Create a new video codec. This opens the standard image output device, for input and output and allows descendent codec classes to do video I/O after decoding/encoding.

Parameters:
mediaFormat  Media format for codec
direction  Direction in which this instance runs

H323VideoCodec::~H323VideoCodec (  ) 


Member Function Documentation

virtual BOOL H323VideoCodec::Open ( H323Connection connection  )  [virtual]

Open the codec. This will open the codec for encoding or decoding. This is primarily used to delay allocation of resources until the last minute.

The default behaviour calls the H323EndPoint::OpenVideoDevice() function and assigns the result of that function to the raw data channel in the H323Codec class.

Parameters:
connection  Connection between the endpoints

Reimplemented from H323Codec.

virtual void H323VideoCodec::Close (  )  [virtual]

Close down the codec. This will close the codec breaking any block on the Read() or Write() functions.

The default behaviour will close the rawDataChannel if it is not NULL and thene delete it if delteChannel is TRUE.

Implements H323Codec.

virtual void H323VideoCodec::OnMiscellaneousCommand ( const H245_MiscellaneousCommand_type type  )  [virtual]

Process a miscellaneous command on the logical channel. The default behaviour does nothing.

Parameters:
type  Command to process

Reimplemented from H323Codec.

virtual void H323VideoCodec::OnMiscellaneousIndication ( const H245_MiscellaneousIndication_type type  )  [virtual]

Process a miscellaneous indication on the logical channel. The default behaviour does nothing.

Parameters:
type  Indication to process

Reimplemented from H323Codec.

virtual void H323VideoCodec::OnFreezePicture (  )  [virtual]

Attach the raw data device for use by codec. Note the device provided will be deleted on destruction of the codec.Process a FreezePicture command from remote endpoint. The default behaviour does nothing.

virtual void H323VideoCodec::OnFastUpdatePicture (  )  [virtual]

Process a FastUpdatePicture command from remote endpoint. The default behaviour does nothing.

Reimplemented in H323_H261Codec.

virtual void H323VideoCodec::OnFastUpdateGOB ( unsigned  firstGOB,
unsigned  numberOfGOBs 
) [virtual]

Process a FastUpdateGOB command from remote endpoint. The default behaviour does nothing.

virtual void H323VideoCodec::OnFastUpdateMB ( int  firstGOB,
int  firstMB,
unsigned  numberOfMBs 
) [virtual]

Process a FastUpdateMB command from remote endpoint. The default behaviour does nothing.

virtual void H323VideoCodec::OnVideoIndicateReadyToActivate (  )  [virtual]

Process a H.245 videoIndicateReadyToActivate indication from remote endpoint. The default behaviour does nothing.

virtual void H323VideoCodec::OnVideoTemporalSpatialTradeOffCommand ( int  newQuality  )  [virtual]

Process a H.245 ideoTemporalSpatialTradeOff command from remote endpoint. The default behaviour does nothing.

virtual void H323VideoCodec::OnVideoTemporalSpatialTradeOffIndication ( int  newQuality  )  [virtual]

Process a H.245 videoTemporalSpatialTradeOff indication from remote endpoint. The default behaviour does nothing.

virtual void H323VideoCodec::OnVideoNotDecodedMBs ( unsigned  firstMB,
unsigned  numberOfMBs,
unsigned  temporalReference 
) [virtual]

Process a H.245 videoNotDecodedMBs indication from remote endpoint. The default behaviour does nothing.

virtual void H323VideoCodec::OnLostPartialPicture (  )  [virtual]

Process a request for a new frame, as part of the picture has been lost.

Reimplemented in H323_Cu30Codec, and H323_H261Codec.

virtual void H323VideoCodec::OnLostPicture (  )  [virtual]

Process a request for a new frame, as the entire picture has been lost.

Reimplemented in H323_Cu30Codec, and H323_H261Codec.

int H323VideoCodec::GetWidth (  )  const [inline]

Get width of video

References frameWidth.

int H323VideoCodec::GetHeight (  )  const [inline]

Get height of video

References frameHeight.

virtual void H323VideoCodec::SetTxQualityLevel ( int  qlevel  )  [inline, virtual]

Quality of the transmitted video. 1 is good, 31 is poor.

Reimplemented in H323_H261Codec.

References videoQuality.

virtual void H323VideoCodec::SetTxMinQuality ( int  qlevel  )  [inline, virtual]

Minimum quality limit for the transmitted video. Default is 1. Encode quality will not be set below this value.

Reimplemented in H323_H261Codec.

References videoQMin.

virtual void H323VideoCodec::SetTxMaxQuality ( int  qlevel  )  [inline, virtual]

Maximum quality limit for the transmitted video. Default is 24. Encode quality will not be set above this value.

Reimplemented in H323_H261Codec.

References videoQMax.

virtual void H323VideoCodec::SetBackgroundFill ( int  idle  )  [inline, virtual]

number of blocks (that haven't changed) transmitted with each frame. These blocks fill in the background

Reimplemented in H323_H261Codec.

References fillLevel.

unsigned H323VideoCodec::GetVideoMode ( void   )  [inline]

Get the current value for video control mode

References videoBitRateControlModes.

unsigned H323VideoCodec::SetVideoMode ( unsigned  mode  )  [inline]

Set the current value for video control mode return the resulting value video control mode

References videoBitRateControlModes.

virtual BOOL H323VideoCodec::SetMaxBitRate ( unsigned  bitRate  )  [virtual]

Set maximum bitrate when transmitting video, in bps. A value of 0 disables bit rate control. The average bitrate will be less depending on channel dead time, i.e. time that the channel could be transmitting bits but is not.

Returns:
TRUE if success
Parameters:
bitRate  New bit rate

virtual unsigned H323VideoCodec::GetMaxBitRate (  )  const [inline, virtual]

Get the current value of the maximum bitrate, in bps. If SetMaxBitRate was never called, the return value depends on the derived class implementation.

References bitRateHighLimit.

virtual BOOL H323VideoCodec::SetTargetFrameTimeMs ( unsigned  ms  )  [virtual]

Set target time in milliseconds between video frames going through the channel. This sets the video frame rate through the channel, which is <= grabber frame rate. Encoder quality will be adjusted dynamically by the codec to find a frame size that allows sending at this rate. Default = 167 ms = 6 frames per second. A value of 0 means the channel will attempt to run at the video grabber frame rate Sometimes the channel cannot transmit as fast as the video grabber.

Parameters:
ms  new time between frames

void H323VideoCodec::SendMiscCommand ( unsigned  command  ) 

Send a miscellaneous command to the remote transmitting video codec. This message is sent via the H245 Logical Channel.

virtual int H323VideoCodec::GetFrameNum (  )  [inline, virtual]

Returns the number of frames transmitted or received so far.

References frameNum.


Member Data Documentation

int H323VideoCodec::frameWidth [protected]

Referenced by GetWidth().

int H323VideoCodec::frameHeight [protected]

Referenced by GetHeight().

int H323VideoCodec::fillLevel [protected]

Referenced by SetBackgroundFill().

Referenced by GetVideoMode(), and SetVideoMode().

Referenced by GetMaxBitRate().

unsigned H323VideoCodec::oldLength [protected]

PTimeInterval H323VideoCodec::oldTime [protected]

PTimeInterval H323VideoCodec::newTime [protected]

int H323VideoCodec::frameBytes [protected]

int H323VideoCodec::videoQMax [protected]

Referenced by SetTxMaxQuality().

int H323VideoCodec::videoQMin [protected]

Referenced by SetTxMinQuality().

Referenced by SetTxQualityLevel().

PTimeInterval H323VideoCodec::frameStartTime [protected]

PTimeInterval H323VideoCodec::grabInterval [protected]

int H323VideoCodec::frameNum [protected]

Referenced by GetFrameNum().

int H323VideoCodec::packetNum [protected]


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

Generated on Mon Sep 1 12:39:57 2008 for OpenH323 by  doxygen 1.5.6