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

#include <rtp.h>

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

Public Member Functions

 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...
 
virtual size_t dispatchBYE (const std::string &str)
 
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

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 ()
 

Protected Attributes

RTPDataChannel * dso
 
RTCPChannel * cso
 

Friends

class RTPSessionBaseHandler
 

Constructor & Destructor Documentation

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::TRTPSessionBase ( const InetHostAddress &  ia,
tpport_t  dataPort,
tpport_t  controlPort,
uint32  membersSize,
RTPApplication app 
)
inline

Builds a session waiting for packets in a host address.

Parameters
iaNetwork address this socket is to be bound.
dataPortTransport port the data socket is to be bound.
controlPortTransport port the control socket is to be bound.
membersSizeInitial size of the membership table.
appApplication this session is associated to.
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::TRTPSessionBase ( uint32  ssrc,
const InetHostAddress &  ia,
tpport_t  dataPort,
tpport_t  controlPort,
uint32  membersSize,
RTPApplication app 
)
inline

Builds a session with the specified ssrc identifier for the local source.

Parameters
ssrcSSRC identifier for the local source.
iaNetwork address this socket is to be bound.
dataPortTransport port the data socket is to be bound.
controlPortTransport port the control socket is to be bound.
membersSizeInitial size of the membership table.
appApplication this session is associated to.
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::TRTPSessionBase ( const InetMcastAddress &  ia,
tpport_t  dataPort,
tpport_t  controlPort,
uint32  membersSize,
RTPApplication app,
uint32  iface 
)
inline

Builds a session waiting for packets in a multicast address.

TODO: ssrc constructor for multicast!

Parameters
iaMulticast address this socket is to be bound.
dataPortTransport port the data socket is to be bound.
controlPortTransport port the control socket is to be bound.
membersSizeInitial size of the membership table.
appApplication this session is associated to.
ifaceIndex (from 0 to n) of network interface to join to multicast group.
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::TRTPSessionBase ( uint32  ssrc,
const InetMcastAddress &  ia,
tpport_t  dataPort,
tpport_t  controlPort,
uint32  membersSize,
RTPApplication app,
uint32  iface 
)
inline

Builds a session waiting for packets in a multicast address, with the specified ssrc identifier for the local source.

Parameters
ssrcSSRC identifier for the local source.
iaMulticast address this socket is to be bound.
dataPortTransport port the data socket is to be bound.
controlPortTransport port the control socket is to be bound.
membersSizeInitial size of the membership table.
appApplication this session is associated to.
ifaceIndex (from 0 to n) of network interface to join to multicast group.
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
virtual TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::~TRTPSessionBase ( )
inlinevirtual

Member Function Documentation

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
virtual size_t TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::dispatchBYE ( const std::string &  str)
inlinevirtual
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
void TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::endSocket ( )
inlineprotected
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
SOCKET TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::getControlRecvSocket ( ) const
inlineprotected
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
InetHostAddress TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::getControlSender ( tpport_t *  port = NULL) const
inlineprotected
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
SOCKET TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::getDataRecvSocket ( ) const
inlineprotected
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
InetHostAddress TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::getDataSender ( tpport_t *  port = NULL) const
inlineprotected
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
RTPDataChannel* TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::getDSO ( void  )
inline
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
size_t TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::getNextDataPacketSize ( ) const
inlineprotected
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
bool TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::isPendingControl ( microtimeout_t  timeout)
inlineprotected
Parameters
timeoutmaximum timeout to wait, in microseconds
Returns
whether there are packets waiting to be picked
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
bool TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::isPendingData ( microtimeout_t  timeout)
inlineprotected
Parameters
timeoutmaximum timeout to wait, in microseconds
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
Socket::Error TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::joinGroup ( const InetMcastAddress &  ia,
uint32  iface 
)
inlineprotected

Join a multicast group.

Parameters
iaaddress of the multicast group
Returns
error code from the socket operation
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
Socket::Error TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::leaveGroup ( const InetMcastAddress &  ia)
inlineprotected

Leave a multicast group.

Parameters
iaaddress of the multicast group
Returns
error code from the socket operation
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
size_t TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::recvControl ( unsigned char *  buffer,
size_t  len,
InetHostAddress &  na,
tpport_t &  tp 
)
inlineprotected

Receive data from the control channel/socket.

Parameters
bufferBuffer where to get data.
lenMaximum number of octets to get.
naSource network address.
tpSource transport port.
Returns
Number of octets actually read.
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
size_t TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::recvData ( unsigned char *  buffer,
size_t  len,
InetHostAddress &  na,
tpport_t &  tp 
)
inlineprotected

Receive data from the data channel/socket.

Parameters
bufferMemory region to read to.
lenMaximum number of octets to get.
naSource network address.
tpSource transport port.
Returns
Number of octets actually read.
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
size_t TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::sendControl ( const unsigned char *const  buffer,
size_t  len 
)
inlineprotected
Returns
number of octets actually written
Parameters
buffer
len
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
size_t TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::sendData ( const unsigned char *const  buffer,
size_t  len 
)
inlineprotected
Parameters
buffermemory region to write from
lennumber of octets to write
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
void TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::setControlPeer ( const InetAddress &  host,
tpport_t  port 
)
inlineprotected
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
void TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::setDataPeer ( const InetAddress &  host,
tpport_t  port 
)
inlineprotected
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
Socket::Error TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::setMcastTTL ( uint8  ttl)
inline

Set the value of the TTL field in the sent packets.

Parameters
ttlTime To Live
Returns
error code from the socket operation

Friends And Related Function Documentation

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
friend class RTPSessionBaseHandler
friend

Member Data Documentation

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
RTCPChannel* TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::cso
protected
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
RTPDataChannel* TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::dso
protected

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