ccRTP
Public Member Functions | Protected Member Functions | List of all members
SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue > Class Template Reference

This template class adds the threading aspect to the RTPSessionBase template in one of the many possible ways. More...

#include <rtp.h>

Inheritance diagram for SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >:
Inheritance graph
[legend]
Collaboration diagram for SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >:
Collaboration graph
[legend]

Public Member Functions

 SingleThreadRTPSession (const InetHostAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0, int pri=0, uint32 memberssize=MembershipBookkeeping::defaultMembersHashSize, RTPApplication &app=defaultApplication())
 
 SingleThreadRTPSession (uint32 ssrc, const InetHostAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0, int pri=0, uint32 memberssize=MembershipBookkeeping::defaultMembersHashSize, RTPApplication &app=defaultApplication())
 
 SingleThreadRTPSession (const InetMcastAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0, int pri=0, uint32 memberssize=MembershipBookkeeping::defaultMembersHashSize, RTPApplication &app=defaultApplication(), uint32 iface=0)
 
 SingleThreadRTPSession (uint32 ssrc, const InetMcastAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0, int pri=0, uint32 memberssize=MembershipBookkeeping::defaultMembersHashSize, RTPApplication &app=defaultApplication(), uint32 iface=0)
 
 ~SingleThreadRTPSession ()
 
void startRunning ()
 Activate stack and start service thread. More...
 
- Public Member Functions inherited from TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >
 TRTPSessionBase (const InetHostAddress &ia, tpport_t dataPort, tpport_t controlPort, uint32 membersSize, RTPApplication &app)
 Builds a session waiting for packets in a host address. More...
 
 TRTPSessionBase (uint32 ssrc, const InetHostAddress &ia, tpport_t dataPort, tpport_t controlPort, uint32 membersSize, RTPApplication &app)
 Builds a session with the specified ssrc identifier for the local source. More...
 
 TRTPSessionBase (const InetMcastAddress &ia, tpport_t dataPort, tpport_t controlPort, uint32 membersSize, RTPApplication &app, uint32 iface)
 Builds a session waiting for packets in a multicast address. More...
 
 TRTPSessionBase (uint32 ssrc, const InetMcastAddress &ia, tpport_t dataPort, tpport_t controlPort, uint32 membersSize, RTPApplication &app, uint32 iface)
 Builds a session waiting for packets in a multicast address, with the specified ssrc identifier for the local source. More...
 
Socket::Error setMcastTTL (uint8 ttl)
 Set the value of the TTL field in the sent packets. More...
 
virtual ~TRTPSessionBase ()
 
RTPDataChannel * getDSO (void)
 

Protected Member Functions

void disableStack (void)
 
void enableStack (void)
 
microtimeout_t getSchedulingTimeout (void)
 
void controlReceptionService (void)
 
void controlTransmissionService (void)
 
timeval getRTCPCheckInterval (void)
 
size_t dispatchDataPacket (void)
 
virtual void timerTick (void)
 
virtual bool isPendingData (microtimeout_t timeout)
 
virtual void run (void)
 Single runnable method for this RTP stacks, schedules outgoing and incoming RTP data and RTCP packets. More...
 
size_t takeInDataPacket (void)
 
size_t dispatchBYE (const std::string &str)
 
- Protected Member Functions inherited from TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >
bool isPendingData (microtimeout_t timeout)
 
InetHostAddress getDataSender (tpport_t *port=NULL) const
 
size_t getNextDataPacketSize () const
 
size_t recvData (unsigned char *buffer, size_t len, InetHostAddress &na, tpport_t &tp)
 Receive data from the data channel/socket. More...
 
void setDataPeer (const InetAddress &host, tpport_t port)
 
size_t sendData (const unsigned char *const buffer, size_t len)
 
SOCKET getDataRecvSocket () const
 
bool isPendingControl (microtimeout_t timeout)
 
InetHostAddress getControlSender (tpport_t *port=NULL) const
 
size_t recvControl (unsigned char *buffer, size_t len, InetHostAddress &na, tpport_t &tp)
 Receive data from the control channel/socket. More...
 
void setControlPeer (const InetAddress &host, tpport_t port)
 
size_t sendControl (const unsigned char *const buffer, size_t len)
 
SOCKET getControlRecvSocket () const
 
Socket::Error joinGroup (const InetMcastAddress &ia, uint32 iface)
 Join a multicast group. More...
 
Socket::Error leaveGroup (const InetMcastAddress &ia)
 Leave a multicast group. More...
 
void endSocket ()
 

Additional Inherited Members

- Protected Attributes inherited from TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >
RTPDataChannel * dso
 
RTCPChannel * cso
 

Detailed Description

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
class SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >

This template class adds the threading aspect to the RTPSessionBase template in one of the many possible ways.

It inherits from a single execution thread that schedules sending of outgoing packets and receipt of incoming packets.

Author
Federico Montesino Pouzols fedem.nosp@m.p@al.nosp@m.tern..nosp@m.org
Examples:
audiorx.cpp, audiotx.cpp, ccrtptest.cpp, rtphello.cpp, rtplisten.cpp, and rtpsend.cpp.

Constructor & Destructor Documentation

◆ SingleThreadRTPSession() [1/4]

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >::SingleThreadRTPSession ( const InetHostAddress &  ia,
tpport_t  dataPort = DefaultRTPDataPort,
tpport_t  controlPort = 0,
int  pri = 0,
uint32  memberssize = MembershipBookkeeping::defaultMembersHashSize,
RTPApplication app = defaultApplication() 
)
inline

◆ SingleThreadRTPSession() [2/4]

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >::SingleThreadRTPSession ( uint32  ssrc,
const InetHostAddress &  ia,
tpport_t  dataPort = DefaultRTPDataPort,
tpport_t  controlPort = 0,
int  pri = 0,
uint32  memberssize = MembershipBookkeeping::defaultMembersHashSize,
RTPApplication app = defaultApplication() 
)
inline

◆ SingleThreadRTPSession() [3/4]

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >::SingleThreadRTPSession ( const InetMcastAddress &  ia,
tpport_t  dataPort = DefaultRTPDataPort,
tpport_t  controlPort = 0,
int  pri = 0,
uint32  memberssize = MembershipBookkeeping::defaultMembersHashSize,
RTPApplication app = defaultApplication(),
uint32  iface = 0 
)
inline

◆ SingleThreadRTPSession() [4/4]

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >::SingleThreadRTPSession ( uint32  ssrc,
const InetMcastAddress &  ia,
tpport_t  dataPort = DefaultRTPDataPort,
tpport_t  controlPort = 0,
int  pri = 0,
uint32  memberssize = MembershipBookkeeping::defaultMembersHashSize,
RTPApplication app = defaultApplication(),
uint32  iface = 0 
)
inline

◆ ~SingleThreadRTPSession()

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >::~SingleThreadRTPSession ( )
inline

Member Function Documentation

◆ controlReceptionService()

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
void SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >::controlReceptionService ( void  )
inlineprotected

◆ controlTransmissionService()

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
void SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >::controlTransmissionService ( void  )
inlineprotected

◆ disableStack()

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
void SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >::disableStack ( void  )
inlineprotected

◆ dispatchBYE()

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
size_t SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >::dispatchBYE ( const std::string &  str)
inlineprotectedvirtual

◆ dispatchDataPacket()

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
size_t SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >::dispatchDataPacket ( void  )
inlineprotected

◆ enableStack()

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
void SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >::enableStack ( void  )
inlineprotected

◆ getRTCPCheckInterval()

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
timeval SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >::getRTCPCheckInterval ( void  )
inlineprotected

◆ getSchedulingTimeout()

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
microtimeout_t SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >::getSchedulingTimeout ( void  )
inlineprotected

◆ isPendingData()

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
virtual bool SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >::isPendingData ( microtimeout_t  timeout)
inlineprotectedvirtual

◆ run()

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
virtual void SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >::run ( void  )
inlineprotectedvirtual

Single runnable method for this RTP stacks, schedules outgoing and incoming RTP data and RTCP packets.

◆ startRunning()

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
void SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >::startRunning ( )
inline

Activate stack and start service thread.

Examples:
audiorx.cpp, audiotx.cpp, ccrtptest.cpp, and rtphello.cpp.

◆ takeInDataPacket()

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
size_t SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >::takeInDataPacket ( void  )
inlineprotected

◆ timerTick()

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
virtual void SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >::timerTick ( void  )
inlineprotectedvirtual

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