class H323Codec |
This class embodies the implementation of a specific codec instance used to transfer data via the logical channels opened and managed by the H323 control channel.
![]() | Open ( H323Connection & connection ) Open the codec. |
![]() | Close () Close the codec |
![]() | Read ( BYTE* buffer, unsigned & length, RTP_DataFrame & rtpFrame ) Encode the data from the appropriate device. |
![]() | Write ( const BYTE* buffer, unsigned length, const RTP_DataFrame & frame, unsigned & written ) Decode the data and output it to appropriate device. |
![]() | GetFrameRate () const Get the frame rate in RTP timestamp units |
![]() | OnFlowControl ( long bitRateRestriction ) Limit bit flow for the logical channel. |
![]() | OnMiscellaneousCommand ( const H245_MiscellaneousCommand_type & type ) Process a miscellaneous command on the logical channel. |
![]() | OnMiscellaneousIndication ( const H245_MiscellaneousIndication_type & type ) Process a miscellaneous indication on the logical channel. |
![]() | AttachChannel ( PChannel* channel, BOOL autoDelete = TRUE ) Attach the raw data channel for use by codec. |
![]() | SwapChannel ( PChannel* newChannel, BOOL autoDelete = TRUE ) Attach a new channel and returns the previous one, without neither deleting it nor closing it. |
![]() | CloseRawDataChannel () Close the raw data channel, described in H323Codec::AttachChannel |
![]() | GetRawDataChannel () Return a pointer to the raw data channel, which can then be used to access the recording/playing device. |
![]() | IsRawDataChannelNative () const Return flag indicating raw channel is native. |
![]() | ReadRaw ( void* data, PINDEX size, PINDEX & length ) Read from the raw data channel |
![]() | WriteRaw ( void* data, PINDEX length ) Write from the raw data channel |
![]() | AttachLogicalChannel (H323Channel* channel) Attach the logical channel, for use by the codec. |
![]() | AddFilter ( const PNotifier & notifier ) Add a filter to the codec. |
This class embodies the implementation of a specific codec instance 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 a codec.
A descendent class may be created by the application and it may cast the connection parameter to the application defined descendent of H323Connection to obtain information needed to open the codec.
The default behaviour does nothing.
The length parameter is filled with the actual length of the encoded data, often this will be the same as OpalMediaFormat::GetFrameSize().
This function is called every GetFrameRate() timestamp units, so MUST take less than (or equal to) that amount of time to complete. It should always return the amount of data that corresponds to the GetFrameRate() timestamp units as well.
A returned length of zero indicates that time has passed but there is no data encoded. This is typically used for silence detection in an audio codec.
It is expected this function anunciates the data. That is, for example with audio data, the sound is output on a speaker.
This function is called every GetFrameRate() timestamp units, so MUST take less than that amount of time to complete!
The channel connects the codec (audio or video) with hardware to read/write data. Thus, the video codec provides a pointer to the data, which the renderer/grabber then accesses to display/grab the image from/to.
The default behaviour returns FALSE.
The logical channel provides a means for the codec to send control messages. E.G. the receive video codec wants to receive a frame update.
To use define: PDECLARE_NOTIFIER(H323Codec::FilterInfo, YourClass, YourFunction); and void YourClass::YourFunction(H323Codec::FilterInfo & info, INT) { DO something with data } and to connect to a codec: BOOL YourClass::OnStartLogicalChannel(H323Channel & channel) { H323Codec * codec = channel.GetCodec(); codec->AddFilter(PCREATE_NOTIFIER(YourFunction)); } for example. Other places can be used to set the filter.
Alphabetic index HTML hierarchy of classes or Java