|
Yate
|
Full RTP session. More...
#include <yatertp.h>
Public Types | |
| enum | Direction { FullStop = 0 , RecvOnly = 1 , SendOnly = 2 , SendRecv = 3 } |
Public Member Functions | |
| RTPSession (DebugEnabler *dbg=0, const char *traceId=0) | |
| virtual | ~RTPSession () |
| virtual void | getStats (String &stats) const |
| virtual void | rtpData (const void *data, int len) |
| virtual void | rtcpData (const void *data, int len) |
| virtual bool | rtpRecvData (bool marker, unsigned int timestamp, const void *data, int len) |
| virtual bool | rtpRecvEvent (int event, char key, int duration, int volume, unsigned int timestamp) |
| virtual void | rtpNewPayload (int payload, unsigned int timestamp) |
| virtual void | rtpNewSSRC (u_int32_t newSsrc, bool marker) |
| virtual RTPSender * | createSender () |
| virtual RTPReceiver * | createReceiver () |
| virtual Cipher * | createCipher (const String &name, Cipher::Direction dir) |
| virtual bool | checkCipher (const String &name) |
| bool | rtpSend (bool marker, int payload, unsigned int timestamp, const void *data, int len) |
| bool | rtpSendData (bool marker, unsigned int timestamp, const void *data, int len) |
| bool | rtpSendEvent (int event, int duration, int volume=0, unsigned int timestamp=0) |
| bool | rtpSendKey (char key, int duration, int volume=0, unsigned int timestamp=0) |
| u_int32_t | ioPacketsLost () const |
| int | padding () const |
| bool | padding (int chunk) |
| void | setDejitter (unsigned int mindelay=20, unsigned int maxdelay=50) |
| virtual void | transport (RTPTransport *trans) |
| RTPSender * | sender () const |
| void | sender (RTPSender *send) |
| RTPReceiver * | receiver () const |
| void | receiver (RTPReceiver *recv) |
| Direction | direction () const |
| bool | direction (Direction dir) |
| bool | addDirection (Direction dir) |
| bool | delDirection (Direction dir) |
| bool | dataPayload (int type) |
| bool | eventPayload (int type) |
| bool | silencePayload (int type) |
| bool | localAddr (SocketAddr &addr, bool rtcp=true) |
| RTPSecure * | security () const |
| void | security (RTPSecure *secure) |
| void | setReports (int interval) |
| virtual void | getStats (NamedList &stats) const |
| virtual void | incWrongSrc () |
| void | setWarnSeq (bool on) |
| void | initDebugData (const NamedList ¶ms) |
Public Member Functions inherited from UDPSession | |
| virtual | ~UDPSession () |
| virtual RTPTransport * | createTransport () |
| bool | initTransport () |
| bool | initGroup (int msec=0, Thread::Priority prio=Thread::Normal, const String &affinity=String::empty()) |
| bool | remoteAddr (SocketAddr &addr, bool sniff=false) |
| bool | setBuffer (int bufLen=4096) |
| bool | setTOS (int tos) |
| Socket * | rtpSock () |
| bool | drillHole () |
| void | setTimeout (int interval) |
| RTPTransport * | transport () const |
Public Member Functions inherited from RTPProcessor | |
| RTPProcessor (DebugEnabler *dbg=0, const char *traceId=0) | |
| virtual | ~RTPProcessor () |
| RTPGroup * | group () const |
| unsigned int | wrongSrc () |
Public Member Functions inherited from GenObject | |
| GenObject () | |
| virtual | ~GenObject () |
| virtual bool | alive () const |
| virtual void | destruct () |
| virtual const String & | toString () const |
| virtual const String & | traceId () const |
| virtual void * | getObject (const String &name) const |
| NamedCounter * | getObjCounter () const |
| NamedCounter * | setObjCounter (NamedCounter *counter) |
Public Member Functions inherited from RTPDebug | |
| RTPDebug (DebugEnabler *dbg, const char *traceId) | |
| RTPDebug (RTPSession *session) | |
| DebugEnabler * | dbg () const |
| const String & | dbgTraceId () const |
Public Member Functions inherited from Mutex | |
| Mutex (bool recursive=false, const char *name=0) | |
| Mutex (const Mutex &original) | |
| ~Mutex () | |
| Mutex & | operator= (const Mutex &original) |
| virtual bool | lock (long maxwait=-1) |
| virtual bool | unlock () |
| virtual bool | locked () const |
| const char * | owner () const |
| bool | recursive () const |
Public Member Functions inherited from Lockable | |
| virtual | ~Lockable () |
| virtual bool | check (long maxwait=-1) |
| virtual bool | unlockAll () |
Protected Member Functions | |
| virtual void | timerTick (const Time &when) |
| void | sendRtcpReport (const Time &when) |
| void | sendRtcpBye () |
Protected Member Functions inherited from UDPSession | |
| UDPSession (DebugEnabler *dbg=0, const char *traceId=0) | |
| virtual void | timeout (bool initial) |
Protected Member Functions inherited from RTPProcessor | |
| void | group (RTPGroup *newgrp) |
Protected Member Functions inherited from RTPDebug | |
| void | setDebug (DebugEnabler *dbg, const char *traceId) |
Additional Inherited Members | |
Static Public Member Functions inherited from GenObject | |
| static void * | getObject (const String &name, const GenObject *obj) |
| static bool | getObjCounting () |
| static void | setObjCounting (bool enable) |
| static NamedCounter * | getObjCounter (const String &name, bool create=true) |
| static ObjList & | getObjCounters () |
Static Public Member Functions inherited from Mutex | |
| static int | count () |
| static int | locks () |
| static bool | efficientTimedLock () |
Static Public Member Functions inherited from Lockable | |
| static void | wait (unsigned long maxwait) |
| static unsigned long | wait () |
| static void | startUsingNow () |
| static void | enableSafety (bool safe=true) |
| static bool | safety () |
Protected Attributes inherited from UDPSession | |
| RTPTransport * | m_transport |
| u_int64_t | m_timeoutTime |
| u_int64_t | m_timeoutInterval |
Protected Attributes inherited from RTPProcessor | |
| unsigned int | m_wrongSrc |
Protected Attributes inherited from RTPDebug | |
| DebugEnabler * | m_dbg |
| String | m_traceId |
Full RTP session.
An unidirectional or bidirectional RTP session
| RTPSession | ( | DebugEnabler * | dbg = 0, |
| const char * | traceId = 0 ) |
Default constructor, creates a detached session
| dbg | Session DebugEnabler |
| traceId | Session trace ID |
References RTPDebug::dbg(), and GenObject::traceId().
|
virtual |
Destructor - shuts down the session and destroys the transport
|
inline |
Add a direction of this session. A transport must exist for this method to succeed.
| dir | New Direction to add for this session |
References direction().
|
virtual |
Check if a cipher is supported for SRTP
| name | Name of the cipher to check |
|
virtual |
|
virtual |
Create a new RTP receiver for this session. Override this method to create objects derived from RTPReceiver.
|
virtual |
Create a new RTP sender for this session. Override this method to create objects derived from RTPSender.
| bool dataPayload | ( | int | type | ) |
Set the data payload type for both receiver and sender.
| type | Payload type, -1 to disable |
|
inline |
Delete a direction of this session. A transport must exist for this method to succeed.
| dir | Direction to remove for this session |
References direction().
|
inline |
Get the direction of this session
Referenced by addDirection(), and delDirection().
| bool direction | ( | Direction | dir | ) |
Set the direction of this session. A transport must exist for this method to succeed.
| dir | New Direction for this session |
| bool eventPayload | ( | int | type | ) |
Set the event payload type for both receiver and sender.
| type | Payload type, -1 to disable |
|
virtual |
Put the collected statistical data
| stats | NamedList to populate with the data |
|
virtual |
Retrieve MGCP P: style comma separated session parameters
| stats | String to append parameters to |
Reimplemented from RTPProcessor.
|
virtual |
Increase the counter for number of RTP packets received from a wrong source
Reimplemented from RTPProcessor.
|
inline |
Initialize data debug
| params | Parameters list |
|
inline |
Retrieve the number of lost packets in current received
|
inline |
Set the local network address of the RTP transport of this session
| addr | New local RTP transport address |
| rtcp | Enable RTCP in this session |
|
inline |
Get the payload padding size
|
inline |
Set the padding to a multiple of a data chunk
| chunk | Size to pad the payload to a multiple of |
|
inline |
Get the RTP/RTCP receiver of this session
| void receiver | ( | RTPReceiver * | recv | ) |
Set the RTP/RTCP receiver of this session
| recv | A pointer to the new RTPReceiver of this session or NULL |
|
virtual |
This method is called to process a RTCP packet.
| data | Pointer to raw RTCP data |
| len | Length of the data packet |
Reimplemented from RTPProcessor.
|
virtual |
This method is called to process a RTP packet.
| data | Pointer to raw RTP data |
| len | Length of the data packet |
Reimplemented from RTPProcessor.
|
virtual |
Method called for unknown payload types just before attempting to call rtpRecvData(). This is a good opportunity to change the payload type and continue.
| payload | Payload number |
| timestamp | Sampling instant of the unexpected packet data |
|
virtual |
Method called when a packet with an unexpected SSRC is received just before processing further. This is a good opportunity to change the SSRC and continue
| newSsrc | SSRC received in packet |
| marker | True if marker bit is set in the RTP packet |
|
virtual |
Process one RTP data packet
| marker | Set to true if the marker bit is set |
| timestamp | Sampling instant of the packet data |
| data | Pointer to data block to process |
| len | Length of the data block in bytes |
|
virtual |
Process one RTP event
| event | Received event code |
| key | Received key (for events 0-16) or zero |
| duration | Duration of the event as number of samples |
| volume | Attenuation of the tone, zero for don't care |
| timestamp | Sampling instant of the initial packet data |
|
inline |
Send one RTP payload packet
| marker | Set to true if the marker bit must be set |
| payload | Payload number |
| timestamp | Sampling instant of the packet data |
| data | Pointer to data block to send |
| len | Length of the data block |
|
inline |
Send one RTP data packet
| marker | Set to true if the marker bit must be set |
| timestamp | Sampling instant of the packet data |
| data | Pointer to data block to send |
| len | Length of the data block |
|
inline |
Send one RTP event
| event | Event code to send |
| duration | Duration of the event as number of samples |
| volume | Attenuation of the tone, zero for don't care |
| timestamp | Sampling instant of the packet data, zero to use current |
|
inline |
Send one RTP key event
| key | Key to send |
| duration | Duration of the event as number of samples |
| volume | Attenuation of the tone, zero for don't care |
| timestamp | Sampling instant of the packet data, zero to use current |
|
inline |
Get the stored security provider or of the sender
| void security | ( | RTPSecure * | secure | ) |
Store a security provider for the sender
| secure | Pointer to the new RTPSecure or NULL |
|
inline |
Get the RTP/RTCP sender of this session
| void sender | ( | RTPSender * | send | ) |
Set the RTP/RTCP sender of this session
| send | A pointer to the new RTPSender of this session or NULL |
|
protected |
Send a RTCP BYE when the sender is stopped or replaced
|
protected |
Send a RTCP report
| when | Time to use as base for timestamps |
|
inline |
Allocate and set a new dejitter buffer for the receiver in the session
| mindelay | Minimum length of the dejitter buffer in microseconds |
| maxdelay | Maximum length of the dejitter buffer in microseconds |
| void setReports | ( | int | interval | ) |
Set the RTCP report interval
| interval | Average interval between reports in msec, zero to disable |
|
inline |
Set the packet with invalid sequence warn mode
| on | True to show a message at DebugWarn level, false to show at DebugInfo level |
| bool silencePayload | ( | int | type | ) |
Set the silence payload type for both receiver and sender.
| type | Payload type, -1 to disable |
|
protectedvirtual |
Method called periodically to push any asynchronous data or statistics
| when | Time to use as base in all computing |
Implements RTPProcessor.
|
virtual |
Set the RTP/RTCP transport of data handled by this session
| trans | A pointer to the new RTPTransport for this session |
Reimplemented from UDPSession.