rtp Class Reference

#include <rtp.h>

List of all members.


Detailed Description

Definition at line 297 of file mythplugins/mythphone/mythphone/rtp.h.


Public Member Functions

 rtp (QWidget *callingApp, int localPort, QString remoteIP, int remotePort, int mediaPay, int playout, int dtmfPay, QString micDev, QString spkDev, rtpTxMode txm=RTP_TX_AUDIO_FROM_MICROPHONE, rtpRxMode rxm=RTP_RX_AUDIO_TO_SPEAKER)
 ~rtp ()
virtual void run ()
void Transmit (short *pcmBuffer, int Samples)
void Transmit (int ms)
void Record (short *pcmBuffer, int Samples)
void StopTransmitRecord ()
bool Finished ()
int GetRecordSamples ()
bool checkDtmf ()
QString getDtmf ()
void sendDtmf (char d)
bool toggleMute ()
void getPower (short &m, short &s)
bool queueVideo (VIDEOBUFFER *v)
bool readyForVideo ()
VIDEOBUFFERgetRxedVideo ()
VIDEOBUFFERgetVideoBuffer (int len=0)
void freeVideoBuffer (VIDEOBUFFER *Buf)
void PlayToneToSpeaker (short *tone, int Samples)
void setMaxBandwidth (int kbps)
int getCodecBandwidth ()
void changePlayoutDelay (int ms)

Private Member Functions

void rtpThreadWorker ()
void rtpAudioThreadWorker ()
void rtpVideoThreadWorker ()
void rtpInitialise ()
void OpenSocket ()
void CloseSocket ()
void StreamInVideo ()
int appendVideoPacket (VIDEOBUFFER *picture, int curLen, RTPPACKET *JBuf, int mLen)
void StreamInAudio ()
void PlayOutAudio ()
bool isSpeakerHungry ()
void recordInPacket (short *data, int dataBytes)
void HandleRxDTMF (RTPPACKET *RTPpacket)
void SendWaitingDtmf ()
void StreamOut (void *pData, int nLen)
void StreamOut (RTPPACKET &RTPpacket)
void fillPacketwithSilence (RTPPACKET &RTPpacket)
bool fillPacketfromMic (RTPPACKET &RTPpacket)
void fillPacketfromBuffer (RTPPACKET &RTPpacket)
void initVideoBuffers (int Num)
void destroyVideoBuffers ()
void transmitQueuedVideo ()
void AddToneToAudio (short *buffer, int Samples)
void Debug (QString dbg)
void CheckSendStatistics ()
void SendRtcpStatistics ()
void RtcpSendReceive (bool forceSend=false)
void sendRtcpSenderReport (uint txPkCnt, uint txOctetCnt, long rxSsrc, uint rxPkCnt, uint rxPkLost, ushort highestRxSeq)
void parseRtcpMessage (RTCPPACKET *rtcpPacket, int len)
int GetAdjustPlayout ()
int measurePlayoutDelay (int seqNum)
bool CheckAnyAudioQueued (int i)

Private Attributes

AudioDriveraudio
DtmfFilterDTMFFilter
QObject * eventWindow
QMutex rtpMutex
QSocketDevice * rtpSocket
QSocketDevice * rtcpSocket
QWaitCondition * eventCond
QTime timeNextRtcpTx
codecCodec
JitterpJitter
TxShaperpTxShaper
int rxMsPacketSize
int txMsPacketSize
int rxPCMSamplesPerPacket
int txPCMSamplesPerPacket
ushort rxSeqNum
bool rxFirstFrame
ushort txSequenceNumber
ulong txTimeStamp
uchar rtpMPT
uchar rtpMarker
ulong peerSsrc
QHostAddress yourIP
int myPort
int yourPort
int myRtcpPort
int yourRtcpPort
rtpTxMode txMode
rtpRxMode rxMode
bool oobError
bool killRtpThread
short * txBuffer
int txBufferLen
int txBufferPtr
ulong lastDtmfTimestamp
QString dtmfIn
QString dtmfOut
short * recBuffer
int recBufferLen
int recBufferMaxLen
int audioPayload
int dtmfPayload
bool micMuted
int adjustPlayoutDelay
short * ToneToSpk
int ToneToSpkSamples
int ToneToSpkPlayed
int videoPayload
QPtrList< VIDEOBUFFERFreeVideoBufferQ
QPtrList< VIDEOBUFFERrxedVideoFrames
VIDEOBUFFERvideoToTx
int videoFrameFirstSeqNum
QTime timeNextStatistics
QTime timeLastStatistics
QTime timeLastRtcpStatistics
int pkIn
int pkOut
int pkMissed
int pkLate
int pkOutDrop
int pkInDisc
int bytesIn
int bytesOut
int bytesToSpeaker
int framesIn
int framesOut
int framesInDiscarded
int framesOutDiscarded
short micPower
short spkPower
uint prevRxPkLost
uint prevRxPkCnt
int rtcpFractionLoss
int rtcpTotalLoss
int minPlayout
int maxPlayout
int totPlayout
int cntPlayout
int avgPlayout
int nominalPlayout

Constructor & Destructor Documentation

rtp::rtp ( QWidget *  callingApp,
int  localPort,
QString  remoteIP,
int  remotePort,
int  mediaPay,
int  playout,
int  dtmfPay,
QString  micDev,
QString  spkDev,
rtpTxMode  txm = RTP_TX_AUDIO_FROM_MICROPHONE,
rtpRxMode  rxm = RTP_RX_AUDIO_TO_SPEAKER 
)

Definition at line 41 of file rtp.cpp.

rtp::~rtp (  ) 

Definition at line 131 of file rtp.cpp.


Member Function Documentation

void rtp::run ( void   )  [virtual]

Definition at line 227 of file rtp.cpp.

void rtp::Transmit ( short *  pcmBuffer,
int  Samples 
)

void rtp::Transmit ( int  ms  ) 

Definition at line 541 of file rtp.cpp.

void rtp::Record ( short *  pcmBuffer,
int  Samples 
)

Definition at line 578 of file rtp.cpp.

Referenced by vxmlParser::RecordAudio().

void rtp::StopTransmitRecord (  )  [inline]

bool rtp::Finished (  )  [inline]

int rtp::GetRecordSamples (  )  [inline]

Definition at line 310 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by vxmlParser::RecordAudio().

bool rtp::checkDtmf (  )  [inline]

QString rtp::getDtmf (  )  [inline]

Definition at line 312 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by vxmlParser::parseField().

void rtp::sendDtmf ( char  d  )  [inline]

Definition at line 313 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by PhoneUIBox::keypadPressed().

bool rtp::toggleMute ( void   )  [inline]

Definition at line 314 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by PhoneUIBox::toggleMute().

void rtp::getPower ( short &  m,
short &  s 
) [inline]

bool rtp::queueVideo ( VIDEOBUFFER v  )  [inline]

bool rtp::readyForVideo (  )  [inline]

VIDEOBUFFER* rtp::getRxedVideo (  )  [inline]

VIDEOBUFFER * rtp::getVideoBuffer ( int  len = 0  ) 

Definition at line 1095 of file rtp.cpp.

Referenced by StreamInVideo(), and PhoneUIBox::TransmitLocalWebcamImage().

void rtp::freeVideoBuffer ( VIDEOBUFFER Buf  ) 

void rtp::PlayToneToSpeaker ( short *  tone,
int  Samples 
)

Definition at line 512 of file rtp.cpp.

Referenced by PhoneUIBox::keypadPressed().

void rtp::setMaxBandwidth ( int  kbps  )  [inline]

Definition at line 322 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by PhoneUIBox::startRTP().

int rtp::getCodecBandwidth (  )  [inline]

Definition at line 323 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by PhoneUIBox::startRTP().

void rtp::changePlayoutDelay ( int  ms  )  [inline]

Definition at line 324 of file mythplugins/mythphone/mythphone/rtp.h.

void rtp::rtpThreadWorker (  )  [private]

Definition at line 233 of file rtp.cpp.

Referenced by run().

void rtp::rtpAudioThreadWorker (  )  [private]

Definition at line 241 of file rtp.cpp.

Referenced by rtpThreadWorker().

void rtp::rtpVideoThreadWorker (  )  [private]

Definition at line 318 of file rtp.cpp.

Referenced by rtpThreadWorker().

void rtp::rtpInitialise (  )  [private]

Definition at line 146 of file rtp.cpp.

Referenced by rtp().

void rtp::OpenSocket (  )  [private]

Definition at line 410 of file rtp.cpp.

Referenced by rtpAudioThreadWorker(), and rtpVideoThreadWorker().

void rtp::CloseSocket (  )  [private]

Definition at line 471 of file rtp.cpp.

Referenced by rtpAudioThreadWorker(), and rtpVideoThreadWorker().

void rtp::StreamInVideo (  )  [private]

Definition at line 877 of file rtp.cpp.

Referenced by rtpVideoThreadWorker().

int rtp::appendVideoPacket ( VIDEOBUFFER picture,
int  curLen,
RTPPACKET JBuf,
int  mLen 
) [private]

Definition at line 1066 of file rtp.cpp.

Referenced by StreamInVideo().

void rtp::StreamInAudio (  )  [private]

Definition at line 593 of file rtp.cpp.

Referenced by rtpAudioThreadWorker().

void rtp::PlayOutAudio (  )  [private]

Definition at line 698 of file rtp.cpp.

Referenced by rtpAudioThreadWorker().

bool rtp::isSpeakerHungry (  )  [private]

Definition at line 487 of file rtp.cpp.

Referenced by rtpAudioThreadWorker().

void rtp::recordInPacket ( short *  data,
int  dataBytes 
) [private]

Definition at line 1128 of file rtp.cpp.

Referenced by PlayOutAudio().

void rtp::HandleRxDTMF ( RTPPACKET RTPpacket  )  [private]

Definition at line 1149 of file rtp.cpp.

Referenced by StreamInAudio().

void rtp::SendWaitingDtmf (  )  [private]

Definition at line 1166 of file rtp.cpp.

Referenced by rtpAudioThreadWorker().

void rtp::StreamOut ( void *  pData,
int  nLen 
) [private]

Definition at line 1286 of file rtp.cpp.

Referenced by rtpAudioThreadWorker().

void rtp::StreamOut ( RTPPACKET RTPpacket  )  [private]

Definition at line 1294 of file rtp.cpp.

void rtp::fillPacketwithSilence ( RTPPACKET RTPpacket  )  [private]

Definition at line 1322 of file rtp.cpp.

Referenced by fillPacketfromBuffer(), fillPacketfromMic(), and rtpAudioThreadWorker().

bool rtp::fillPacketfromMic ( RTPPACKET RTPpacket  )  [private]

Definition at line 1327 of file rtp.cpp.

Referenced by rtpAudioThreadWorker().

void rtp::fillPacketfromBuffer ( RTPPACKET RTPpacket  )  [private]

Definition at line 1345 of file rtp.cpp.

Referenced by rtpAudioThreadWorker().

void rtp::initVideoBuffers ( int  Num  )  [private]

Definition at line 1089 of file rtp.cpp.

Referenced by rtp().

void rtp::destroyVideoBuffers (  )  [private]

Definition at line 1116 of file rtp.cpp.

Referenced by ~rtp().

void rtp::transmitQueuedVideo (  )  [private]

Definition at line 1210 of file rtp.cpp.

Referenced by rtpVideoThreadWorker().

void rtp::AddToneToAudio ( short *  buffer,
int  Samples 
) [private]

Definition at line 523 of file rtp.cpp.

Referenced by PlayOutAudio().

void rtp::Debug ( QString  dbg  )  [private]

Definition at line 367 of file rtp.cpp.

void rtp::CheckSendStatistics (  )  [private]

Definition at line 378 of file rtp.cpp.

Referenced by rtpAudioThreadWorker(), and rtpVideoThreadWorker().

void rtp::SendRtcpStatistics (  )  [private]

Definition at line 399 of file rtp.cpp.

Referenced by parseRtcpMessage().

void rtp::RtcpSendReceive ( bool  forceSend = false  )  [private]

Definition at line 1368 of file rtp.cpp.

Referenced by rtpAudioThreadWorker(), rtpVideoThreadWorker(), and StreamInVideo().

void rtp::sendRtcpSenderReport ( uint  txPkCnt,
uint  txOctetCnt,
long  rxSsrc,
uint  rxPkCnt,
uint  rxPkLost,
ushort  highestRxSeq 
) [private]

Definition at line 1391 of file rtp.cpp.

Referenced by RtcpSendReceive().

void rtp::parseRtcpMessage ( RTCPPACKET rtcpPacket,
int  len 
) [private]

Definition at line 1432 of file rtp.cpp.

Referenced by RtcpSendReceive().

int rtp::GetAdjustPlayout (  )  [private]

Definition at line 806 of file rtp.cpp.

Referenced by PlayOutAudio().

int rtp::measurePlayoutDelay ( int  seqNum  )  [private]

Definition at line 853 of file rtp.cpp.

Referenced by StreamInAudio().

bool rtp::CheckAnyAudioQueued ( int  i  )  [private]


Member Data Documentation

AudioDriver* rtp::audio [private]

Definition at line 362 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by PlayOutAudio(), rtp(), and ~rtp().

QObject* rtp::eventWindow [private]

QMutex rtp::rtpMutex [private]

QSocketDevice* rtp::rtpSocket [private]

QSocketDevice* rtp::rtcpSocket [private]

QWaitCondition* rtp::eventCond [private]

Definition at line 368 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by rtp(), rtpVideoThreadWorker(), and ~rtp().

QTime rtp::timeNextRtcpTx [private]

Definition at line 369 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by RtcpSendReceive(), and rtp().

codec* rtp::Codec [private]

Jitter* rtp::pJitter [private]

Definition at line 372 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by rtp(), transmitQueuedVideo(), and ~rtp().

int rtp::rxMsPacketSize [private]

int rtp::txMsPacketSize [private]

Definition at line 374 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by fillPacketwithSilence(), and rtpInitialise().

ushort rtp::rxSeqNum [private]

ushort rtp::txSequenceNumber [private]

uchar rtp::rtpMPT [private]

uchar rtp::rtpMarker [private]

Definition at line 382 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by rtpInitialise(), and StreamOut().

ulong rtp::peerSsrc [private]

QHostAddress rtp::yourIP [private]

int rtp::myPort [private]

Definition at line 385 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by OpenSocket(), and rtp().

int rtp::yourPort [private]

int rtp::myRtcpPort [private]

Definition at line 385 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by OpenSocket(), and rtp().

int rtp::yourRtcpPort [private]

Definition at line 385 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by rtp(), and sendRtcpSenderReport().

bool rtp::oobError [private]

Definition at line 388 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by rtpInitialise(), and StreamInAudio().

short* rtp::txBuffer [private]

int rtp::txBufferLen [private]

Definition at line 391 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by fillPacketfromBuffer(), and Transmit().

int rtp::txBufferPtr [private]

Definition at line 391 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by fillPacketfromBuffer(), and Transmit().

Definition at line 392 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by HandleRxDTMF(), and rtpInitialise().

QString rtp::dtmfIn [private]

QString rtp::dtmfOut [private]

Definition at line 394 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by rtp(), rtpInitialise(), and SendWaitingDtmf().

short* rtp::recBuffer [private]

Definition at line 395 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by Record(), recordInPacket(), rtp(), and rtpInitialise().

int rtp::recBufferLen [private]

Definition at line 396 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by Record(), recordInPacket(), and rtpInitialise().

int rtp::recBufferMaxLen [private]

Definition at line 396 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by Record(), recordInPacket(), and rtpInitialise().

int rtp::audioPayload [private]

Definition at line 397 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by rtp(), and rtpInitialise().

int rtp::dtmfPayload [private]

Definition at line 398 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by rtp(), SendWaitingDtmf(), and StreamInAudio().

bool rtp::micMuted [private]

Definition at line 399 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by fillPacketfromMic(), and rtpInitialise().

int rtp::adjustPlayoutDelay [private]

Definition at line 400 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by GetAdjustPlayout(), and rtp().

short* rtp::ToneToSpk [private]

int rtp::ToneToSpkSamples [private]

int rtp::ToneToSpkPlayed [private]

int rtp::videoPayload [private]

Definition at line 407 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by rtp(), rtpInitialise(), and transmitQueuedVideo().

QPtrList<VIDEOBUFFER> rtp::FreeVideoBufferQ [private]

QPtrList<VIDEOBUFFER> rtp::rxedVideoFrames [private]

Definition at line 409 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by rtpVideoThreadWorker(), and StreamInVideo().

Definition at line 411 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by StreamInVideo().

QTime rtp::timeNextStatistics [private]

Definition at line 414 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by CheckSendStatistics(), and rtpInitialise().

QTime rtp::timeLastStatistics [private]

Definition at line 415 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by CheckSendStatistics(), and rtpInitialise().

QTime rtp::timeLastRtcpStatistics [private]

Definition at line 416 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by rtpInitialise(), and SendRtcpStatistics().

int rtp::pkIn [private]

int rtp::pkOut [private]

int rtp::pkMissed [private]

int rtp::pkLate [private]

int rtp::pkOutDrop [private]

int rtp::pkInDisc [private]

int rtp::bytesIn [private]

int rtp::bytesOut [private]

int rtp::bytesToSpeaker [private]

int rtp::framesIn [private]

int rtp::framesOut [private]

int rtp::framesInDiscarded [private]

Definition at line 428 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by CheckSendStatistics(), rtp(), and StreamInVideo().

int rtp::framesOutDiscarded [private]

Definition at line 429 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by CheckSendStatistics(), rtp(), and rtpInitialise().

short rtp::micPower [private]

short rtp::spkPower [private]

Definition at line 431 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by PlayOutAudio(), and rtpInitialise().

Definition at line 432 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by rtp(), and sendRtcpSenderReport().

Definition at line 433 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by rtp(), and sendRtcpSenderReport().

int rtp::rtcpFractionLoss [private]

int rtp::rtcpTotalLoss [private]

int rtp::minPlayout [private]

int rtp::maxPlayout [private]

int rtp::totPlayout [private]

int rtp::cntPlayout [private]

int rtp::avgPlayout [private]

int rtp::nominalPlayout [private]

Definition at line 442 of file mythplugins/mythphone/mythphone/rtp.h.

Referenced by GetAdjustPlayout(), rtp(), and StreamInAudio().


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

Generated on Sat Dec 18 05:16:10 2010 for MythTV by  doxygen 1.5.5