Bayonne2 / Common C++ 2 Framework
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends
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
 

Private Member Functions

void build (const InetHostAddress &ia, tpport_t dataPort, tpport_t controlPort)
 
void build (const InetMcastAddress &ia, tpport_t dataPort, tpport_t controlPort, uint32 iface)
 
tpport_t odd_port (tpport_t port)
 Ensure a port number is odd. More...
 
tpport_t even_port (tpport_t port)
 Ensure a port number is even. More...
 

Private Attributes

tpport_t dataBasePort
 
tpport_t controlBasePort
 

Friends

class RTPSessionBaseHandler
 

Detailed Description

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

Definition at line 88 of file rtp.h.

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.

Definition at line 100 of file rtp.h.

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.

Definition at line 117 of file rtp.h.

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.

Definition at line 136 of file rtp.h.

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.

Definition at line 156 of file rtp.h.

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
virtual TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::~TRTPSessionBase ( )
inlinevirtual

Definition at line 187 of file rtp.h.

Member Function Documentation

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
void TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::build ( const InetHostAddress ia,
tpport_t  dataPort,
tpport_t  controlPort 
)
inlineprivate

Definition at line 344 of file rtp.h.

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
void TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::build ( const InetMcastAddress ia,
tpport_t  dataPort,
tpport_t  controlPort,
uint32  iface 
)
inlineprivate

Definition at line 359 of file rtp.h.

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

Reimplemented in SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >.

Definition at line 163 of file rtp.h.

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

Definition at line 328 of file rtp.h.

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
tpport_t TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::even_port ( tpport_t  port)
inlineprivate

Ensure a port number is even.

If it is an odd number, return the next lower (even) port number.

Parameters
portnumber to filter
Returns
filtered (even) port number

Definition at line 393 of file rtp.h.

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
SOCKET TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::getControlRecvSocket ( ) const
inlineprotected

Definition at line 280 of file rtp.h.

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
InetHostAddress TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::getControlSender ( tpport_t port = NULL) const
inlineprotected

Definition at line 250 of file rtp.h.

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
SOCKET TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::getDataRecvSocket ( ) const
inlineprotected

Definition at line 238 of file rtp.h.

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
InetHostAddress TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::getDataSender ( tpport_t port = NULL) const
inlineprotected

Definition at line 204 of file rtp.h.

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
RTPDataChannel* TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::getDSO ( void  )
inline

Definition at line 192 of file rtp.h.

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
size_t TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::getNextDataPacketSize ( ) const
inlineprotected

Definition at line 208 of file rtp.h.

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

Definition at line 246 of file rtp.h.

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

Definition at line 200 of file rtp.h.

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

Definition at line 290 of file rtp.h.

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

Definition at line 316 of file rtp.h.

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
tpport_t TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::odd_port ( tpport_t  port)
inlineprivate

Ensure a port number is odd.

If it is an even number, return the next lower (odd) port number.

Parameters
portnumber to filter
Returns
filtered (odd) port number

Definition at line 382 of file rtp.h.

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.

Definition at line 263 of file rtp.h.

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.

Definition at line 221 of file rtp.h.

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

Definition at line 277 of file rtp.h.

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

Definition at line 235 of file rtp.h.

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
void TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::setControlPeer ( const InetAddress host,
tpport_t  port 
)
inlineprotected

Definition at line 268 of file rtp.h.

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
void TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::setDataPeer ( const InetAddress host,
tpport_t  port 
)
inlineprotected

Definition at line 226 of file rtp.h.

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

Definition at line 175 of file rtp.h.

Friends And Related Function Documentation

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

Definition at line 402 of file rtp.h.

Field Documentation

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
tpport_t TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::controlBasePort
private

Definition at line 397 of file rtp.h.

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

Definition at line 401 of file rtp.h.

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
tpport_t TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::dataBasePort
private

Definition at line 396 of file rtp.h.

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

Definition at line 400 of file rtp.h.


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