Bayonne2 / Common C++ 2 Framework
Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes
SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue > Class Template Reference
RTP sessions.

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 (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)
 
 
void  startRunning ()
  Activate stack and start service thread. More...
 
Socket::Error  setMcastTTL (uint8 ttl)
  Set the value of the TTL field in the sent packets. More...
 
RTPDataChannel *  getDSO (void)
 

Protected Types

  How to raise error. More...
 
typedef enum Thread::Throw  Throw
  How to raise error. More...
 
  How work cancellation. More...
 
typedef enum Thread::Cancel  Cancel
  How work cancellation. More...
 
  How work suspend. More...
 
typedef enum Thread::Suspend  Suspend
  How work suspend. More...
 

Protected Member Functions

void  disableStack (void)
 
void  enableStack (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)
 
void  setName (const char *text)
  Set the name of the current thread. More...
 
virtual void  final (void)
  A thread that is self terminating, either by invoking exit() or leaving it's run(), will have this method called. More...
 
virtual void  initial (void)
  The initial method is called by a newly created thread when it starts execution. More...
 
virtual void *  getExtended (void)
  Since getParent() and getThread() only refer to an object of the Thread "base" type, this virtual method can be replaced in a derived class with something that returns data specific to the derived class that can still be accessed through the pointer returned by getParent() and getThread(). More...
 
virtual void  notify (Thread *)
  When a thread terminates, it now sends a notification message to the parent thread which created it. More...
 
void  exit (void)
  Used to properly exit from a Thread derived run() or initial() method. More...
 
void  sync (void)
  Used to wait for a join or cancel, in place of explicit exit. More...
 
bool  testCancel (void)
  test a cancellation point for deferred thread cancellation. More...
 
void  setCancel (Cancel mode)
  Sets thread cancellation mode. More...
 
void  setSuspend (Suspend mode)
  Sets the thread's ability to be suspended from execution. More...
 
void  terminate (void)
  Used by another thread to terminate the current thread. More...
 
void  clrParent (void)
  clear parent thread relationship. More...
 
int  start (Semaphore *start=0)
  When a new thread is created, it does not begin immediate execution. More...
 
int  detach (Semaphore *start=0)
  Start a new thread as "detached". More...
 
ThreadgetParent (void)
  Gets the pointer to the Thread class which created the current thread object. More...
 
void  suspend (void)
  Suspends execution of the selected thread. More...
 
void  resume (void)
  Resumes execution of the selected thread. More...
 
Cancel  getCancel (void)
  Used to retrieve the cancellation mode in effect for the selected thread. More...
 
bool  isRunning (void) const
  Verifies if the thread is still running or has already been terminated but not yet deleted. More...
 
bool  isDetached (void) const
  Check if this thread is detached. More...
 
void  join (void)
  Blocking call which unlocks when thread terminates. More...
 
bool  isThread (void) const
  Tests to see if the current execution context is the same as the specified thread object. More...
 
cctid_t  getId (void) const
  Get system thread numeric identifier. More...
 
const char *  getName (void) const
  Get the name string for this thread, to use in debug messages. More...
 
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)
 
 
 
 
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::Error  joinGroup (const InetMcastAddress &ia, uint32 iface)
  Join a multicast group. More...
 
  Leave a multicast group. More...
 
void  endSocket ()
 

Static Protected Member Functions

static Threadget (void)
 
static void  setStack (size_t size=0)
  Set base stack limit before manual stack sizes have effect. More...
 
static void  sleep (timeout_t msec)
  A thread-safe sleep call. More...
 
static void  yield (void)
  Yields the current thread's CPU time slice to allow another thread to begin immediate execution. More...
 
static Throw  getException (void)
  Get exception mode of the current thread. More...
 
static void  setException (Throw mode)
  Set exception mode of the current thread. More...
 
static Cancel  enterCancel (void)
  This is used to help build wrapper functions in libraries around system calls that should behave as cancellation points but don't. More...
 
static void  exitCancel (Cancel cancel)
  This is used to restore a cancel block. More...
 

Protected Attributes

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

Definition at line 419 of file rtp.h.

Member Typedef Documentation

inherited

How work cancellation.

inherited

How work suspend.

inherited

How to raise error.

Member Enumeration Documentation

inherited

How work cancellation.

Enumerator
cancelInitial 

used internally, do not use

cancelDeferred 

exit thread on cancellation pointsuch as yield

cancelImmediate 

exit befor cancellation

cancelDisabled 

ignore cancellation

cancelManual 

unimplemented (working in progress)

Todo:
implement
cancelDefault 

default you should use this for compatibility instead of deferred

Definition at line 1108 of file thread.h.

inherited

How work suspend.

Enumerator
suspendEnable 

suspend enabled

suspendDisable 

suspend disabled, Suspend do nothing

Definition at line 1122 of file thread.h.

inherited

How to raise error.

Enumerator
throwNothing 

continue without throwing error

throwObject 

throw object that cause error (throw this)

throwException 

throw an object relative to error

Definition at line 1099 of file thread.h.

Constructor & Destructor Documentation

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >::SingleThreadRTPSession ( const InetHostAddressia,
tpport_t  dataPort = DefaultRTPDataPort ,
tpport_t  controlPort = 0,
int  pri = 0,
)
inline

Definition at line 424 of file rtp.h.

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >::SingleThreadRTPSession ( uint32  ssrc,
const InetHostAddressia,
tpport_t  dataPort = DefaultRTPDataPort ,
tpport_t  controlPort = 0,
int  pri = 0,
)
inline

Definition at line 441 of file rtp.h.

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >::SingleThreadRTPSession ( const InetMcastAddressia,
tpport_t  dataPort = DefaultRTPDataPort ,
tpport_t  controlPort = 0,
int  pri = 0,
uint32  iface = 0 
)
inline

Definition at line 458 of file rtp.h.

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >::SingleThreadRTPSession ( uint32  ssrc,
const InetMcastAddressia,
tpport_t  dataPort = DefaultRTPDataPort ,
tpport_t  controlPort = 0,
int  pri = 0,
uint32  iface = 0 
)
inline

Definition at line 476 of file rtp.h.

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

Definition at line 495 of file rtp.h.

Member Function Documentation

void Thread::clrParent ( void  )
inlineprotectedinherited

clear parent thread relationship.

Definition at line 1295 of file thread.h.

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

Definition at line 524 of file rtp.h.

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

Definition at line 527 of file rtp.h.

int Thread::detach ( Semaphorestart = 0 )
inherited

Start a new thread as "detached".

This is an alternative start() method that resolves some issues with later glibc implimentations which incorrectly impliment self-detach.

Returns
error code if execution fails.
Parameters
start optional starting semaphore to alternately use.
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
void SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >::disableStack ( void  )
inlineprotected

Definition at line 515 of file rtp.h.

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

Reimplemented from TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >.

Definition at line 596 of file rtp.h.

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

Definition at line 533 of file rtp.h.

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

Definition at line 518 of file rtp.h.

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

Definition at line 328 of file rtp.h.

static Cancel Thread::enterCancel ( void  )
staticinherited

This is used to help build wrapper functions in libraries around system calls that should behave as cancellation points but don't.

Returns
saved cancel type.
void Thread::exit ( void  )
protectedinherited

Used to properly exit from a Thread derived run() or initial() method.

Terminates execution of the current thread and calls the derived classes final() method.

static void Thread::exitCancel ( Cancel  cancel )
staticinherited

This is used to restore a cancel block.

Parameters
cancel type that was saved.
virtual void Thread::final ( void  )
protectedvirtualinherited

A thread that is self terminating, either by invoking exit() or leaving it's run(), will have this method called.

It can be used to self delete the current object assuming the object was created with new on the heap rather than stack local, hence one may often see final defined as "delete this" in a derived thread class. A final method, while running, cannot be terminated or cancelled by another thread. Final is called for all cancellation type (even immediate).

You can safe delete thread ("delete this") class on final, but you should exit ASAP (or do not try to call CommonC++ methods...)

Note
A thread cannot delete its own context or join itself. To make a thread that is a self running object that self-deletes, one has to detach the thread by using detach() instead of start().
See Also
exit
run

Reimplemented in ThreadQueue.

static Thread* Thread::get ( void  )
staticinherited
Cancel Thread::getCancel ( void  )
inlineinherited

Used to retrieve the cancellation mode in effect for the selected thread.

Returns
cancellation mode constant.

Definition at line 1419 of file thread.h.

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

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_tport = NULL ) const
inlineprotectedinherited

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
inlineprotectedinherited

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_tport = NULL ) const
inlineprotectedinherited

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

Definition at line 192 of file rtp.h.

static Throw Thread::getException ( void  )
staticinherited

Get exception mode of the current thread.

Returns
exception mode.
virtual void* Thread::getExtended ( void  )
protectedvirtualinherited

Since getParent() and getThread() only refer to an object of the Thread "base" type, this virtual method can be replaced in a derived class with something that returns data specific to the derived class that can still be accessed through the pointer returned by getParent() and getThread().

Returns
pointer to derived class specific data.
cctid_t Thread::getId ( void  ) const
inherited

Get system thread numeric identifier.

Returns
numeric identifier of this thread.
const char* Thread::getName ( void  ) const
inlineinherited

Get the name string for this thread, to use in debug messages.

Returns
debug name.

Definition at line 1463 of file thread.h.

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

Definition at line 208 of file rtp.h.

Thread* Thread::getParent ( void  )
inlineinherited

Gets the pointer to the Thread class which created the current thread object.

Returns
a Thread *, or "(Thread *)this" if no parent.

Definition at line 1397 of file thread.h.

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

Definition at line 530 of file rtp.h.

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

Definition at line 521 of file rtp.h.

virtual void Thread::initial ( void  )
protectedvirtualinherited

The initial method is called by a newly created thread when it starts execution.

This method is ran with deferred cancellation disabled by default. The Initial method is given a separate handler so that it can create temporary objects on it's own stack frame, rather than having objects created on run() that are only needed by startup and yet continue to consume stack space.

See Also
run
final

Reimplemented in TCPSession, and UnixSession.

bool Thread::isDetached ( void  ) const
inherited

Check if this thread is detached.

Returns
true if the thread is detached.
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
bool TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::isPendingControl ( microtimeout_t  timeout )
inlineprotectedinherited
Parameters
timeout maximum 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>
virtual bool SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >::isPendingData ( microtimeout_t  timeout )
inlineprotectedvirtual

Definition at line 547 of file rtp.h.

bool Thread::isRunning ( void  ) const
inherited

Verifies if the thread is still running or has already been terminated but not yet deleted.

Returns
true if the thread is still executing.
bool Thread::isThread ( void  ) const
inherited

Tests to see if the current execution context is the same as the specified thread object.

Returns
true if the current context is this object.
void Thread::join ( void  )
inherited

Blocking call which unlocks when thread terminates.

template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
Socket::Error TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::joinGroup ( const InetMcastAddressia,
uint32  iface 
)
inlineprotectedinherited

Join a multicast group.

Parameters
ia address 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 InetMcastAddressia )
inlineprotectedinherited

Leave a multicast group.

Parameters
ia address of the multicast group
Returns
error code from the socket operation

Definition at line 316 of file rtp.h.

virtual void Thread::notify ( Thread *  )
protectedvirtualinherited

When a thread terminates, it now sends a notification message to the parent thread which created it.

The actual use of this notification is left to be defined in a derived class.

Parameters
- the thread that has terminated.
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
size_t TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::recvControl ( unsigned char *  buffer,
size_t  len,
InetHostAddressna,
tpport_ttp 
)
inlineprotectedinherited

Receive data from the control channel/socket.

Parameters
buffer Buffer where to get data.
len Maximum number of octets to get.
na Source network address.
tp Source 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,
InetHostAddressna,
tpport_ttp 
)
inlineprotectedinherited

Receive data from the data channel/socket.

Parameters
buffer Memory region to read to.
len Maximum number of octets to get.
na Source network address.
tp Source transport port.
Returns
Number of octets actually read.

Definition at line 221 of file rtp.h.

void Thread::resume ( void  )
inherited

Resumes execution of the selected thread.

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.

Implements Thread.

Definition at line 554 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 
)
inlineprotectedinherited
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 
)
inlineprotectedinherited
Parameters
buffer memory region to write from
len number of octets to write

Definition at line 235 of file rtp.h.

void Thread::setCancel ( Cancel  mode )
protectedinherited

Sets thread cancellation mode.

Threads can either be set immune to termination (cancelDisabled), can be set to terminate when reaching specific "thread cancellation points" (cancelDeferred) or immediately when Terminate is requested (cancelImmediate).

Parameters
mode for cancellation of the current thread.
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
void TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::setControlPeer ( const InetAddresshost,
tpport_t  port 
)
inlineprotectedinherited

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 InetAddresshost,
tpport_t  port 
)
inlineprotectedinherited

Definition at line 226 of file rtp.h.

static void Thread::setException ( Throw  mode )
staticinherited

Set exception mode of the current thread.

Returns
exception mode.
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
Socket::Error TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::setMcastTTL ( uint8  ttl )
inlineinherited

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

Parameters
ttl Time To Live
Returns
error code from the socket operation

Definition at line 175 of file rtp.h.

void Thread::setName ( const char *  text )
protectedinherited

Set the name of the current thread.

If the name is passed as NULL, then the default name is set (usually object pointer).

Parameters
text name to use.
static void Thread::setStack ( size_t  size = 0 )
inlinestaticinherited

Set base stack limit before manual stack sizes have effect.

Parameters
size stack size to set, or use 0 to clear autostack.

Definition at line 1347 of file thread.h.

void Thread::setSuspend ( Suspend  mode )
protectedinherited

Sets the thread's ability to be suspended from execution.

The thread may either have suspend enabled (suspendEnable) or disabled (suspendDisable).

Parameters
mode for suspend.
static void Thread::sleep ( timeout_t  msec )
staticinherited

A thread-safe sleep call.

On most Posix systems, "sleep()" is implimented with SIGALRM making it unusable from multipe threads. Pthread libraries often define an alternate "sleep" handler such as usleep(), nanosleep(), or nap(), that is thread safe, and also offers a higher timer resolution.

Parameters
msec timeout in milliseconds.
int Thread::start ( Semaphorestart = 0 )
inherited

When a new thread is created, it does not begin immediate execution.

This is because the derived class virtual tables are not properly loaded at the time the C++ object is created within the constructor itself, at least in some compiler/system combinations. The thread can either be told to wait for an external semaphore, or it can be started directly after the constructor completes by calling the start() method.

Returns
error code if execution fails.
Parameters
start optional starting semaphore to alternately use.
template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue>
void SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >::startRunning ( )
inline

Activate stack and start service thread.

Definition at line 509 of file rtp.h.

void Thread::suspend ( void  )
inherited

Suspends execution of the selected thread.

Pthreads do not normally support suspendable threads, so the behavior is simulated with signals. On systems such as Linux that define threads as processes, SIGSTOP and SIGCONT may be used.

void Thread::sync ( void  )
protectedinherited

Used to wait for a join or cancel, in place of explicit exit.

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

Definition at line 593 of file rtp.h.

void Thread::terminate ( void  )
protectedinherited

Used by another thread to terminate the current thread.

Termination actually occurs based on the current setCancel() mode. When the current thread does terminate, control is returned to the requesting thread. terminate() should always be called at the start of any destructor of a class derived from Thread to assure the remaining part of the destructor is called without the thread still executing.

bool Thread::testCancel ( void  )
protectedinherited

test a cancellation point for deferred thread cancellation.

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

Definition at line 544 of file rtp.h.

static void Thread::yield ( void  )
staticinherited

Yields the current thread's CPU time slice to allow another thread to begin immediate execution.

Field Documentation

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

Definition at line 401 of file rtp.h.

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

Definition at line 400 of file rtp.h.


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

Generated on Dec 21, 2017 for commoncpp2-1.8.1, ccrtp-1.7.2, libzrtpcpp-2.3.4, ccscript3-1.1.7, ccaudio2-1.0.0 and bayonne2-2.3.2 (after installation in /usr/local/) by   doxygen 1.8.6

AltStyle によって変換されたページ (->オリジナル) /