#include <codecs.h>
Inheritance diagram for H323VideoCodec:
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 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 |
An application may create a descendent off this class and override functions as required for descibing a specific codec.
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.
mediaFormat | Media format for codec |
direction | Direction in which this instance runs |
H323VideoCodec::~H323VideoCodec | ( | ) |
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.
connection | Connection between the endpoints |
Reimplemented from H323Codec.
virtual void H323VideoCodec::Close | ( | ) | [virtual] |
virtual void H323VideoCodec::OnMiscellaneousCommand | ( | const H245_MiscellaneousCommand_type & | type | ) | [virtual] |
Process a miscellaneous command on the logical channel. The default behaviour does nothing.
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.
type | Indication to process |
Reimplemented from H323Codec.
virtual void H323VideoCodec::OnFreezePicture | ( | ) | [virtual] |
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
int H323VideoCodec::GetHeight | ( | ) | const [inline] |
Get height of video
virtual void H323VideoCodec::SetTxQualityLevel | ( | int | qlevel | ) | [inline, virtual] |
Quality of the transmitted video. 1 is good, 31 is poor.
Reimplemented in H323_H261Codec.
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.
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.
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.
unsigned H323VideoCodec::GetVideoMode | ( | void | ) | [inline] |
Get the current value for video control mode
unsigned H323VideoCodec::SetVideoMode | ( | unsigned | mode | ) | [inline] |
Set the current value for video control mode return the resulting value video control mode
virtual BOOL H323VideoCodec::SetMaxBitRate | ( | unsigned | bitRate | ) | [virtual] |
Set maximum bitrate when transmitting video. 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.
bitRate | New bit rate |
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.
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.
int H323VideoCodec::frameWidth [protected] |
int H323VideoCodec::frameHeight [protected] |
int H323VideoCodec::fillLevel [protected] |
unsigned H323VideoCodec::videoBitRateControlModes [protected] |
int H323VideoCodec::bitRateHighLimit [protected] |
unsigned H323VideoCodec::oldLength [protected] |
PTimeInterval H323VideoCodec::oldTime [protected] |
PTimeInterval H323VideoCodec::newTime [protected] |
int H323VideoCodec::targetFrameTimeMs [protected] |
int H323VideoCodec::frameBytes [protected] |
int H323VideoCodec::sumFrameTimeMs [protected] |
int H323VideoCodec::sumAdjFrameTimeMs [protected] |
int H323VideoCodec::sumFrameBytes [protected] |
int H323VideoCodec::videoQMax [protected] |
int H323VideoCodec::videoQMin [protected] |
int H323VideoCodec::videoQuality [protected] |
PTimeInterval H323VideoCodec::frameStartTime [protected] |
PTimeInterval H323VideoCodec::grabInterval [protected] |
int H323VideoCodec::frameNum [protected] |
int H323VideoCodec::packetNum [protected] |
int H323VideoCodec::oldPacketNum [protected] |
int H323VideoCodec::framesPerSec [protected] |
PMutex H323VideoCodec::videoHandlerActive [protected] |