ccRTP 2.1.2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends

Synchronization source in an RTP session. More...

#include <sources.h>

Collaboration diagram for SyncSource:
Collaboration graph

Public Types

enum  State {
  stateUnknown, statePrevalid, stateActive, stateInactive,
 Synchronization source states during an RTP session. More...

Public Member Functions

 SyncSource (uint32 ssrc)
 ~SyncSource ()
State getState () const
bool isSender () const
 Whether this source sends RTP data packets. More...
uint32 getID () const
ParticipantgetParticipant () const
 Get the participant this synchronization source is asociated to. More...
tpport_t getDataTransportPort () const
tpport_t getControlTransportPort () const
const InetAddress & getNetworkAddress () const

Protected Member Functions

 SyncSource (const SyncSource &source)
SyncSourceoperator= (const SyncSource &source)

Private Member Functions

void setState (State st)
void setSender (bool active)
 Mark this source as an active sender. More...
void setParticipant (Participant &p)
void setDataTransportPort (tpport_t p)
void setControlTransportPort (tpport_t p)
void setNetworkAddress (InetAddress addr)
void setLink (void *l)
void * getLink () const

Private Attributes

State state
uint32 SSRC
bool activeSender
InetAddress networkAddress
tpport_t dataTransportPort
tpport_t controlTransportPort
void * link


class SyncSourceHandler

Detailed Description

Synchronization source in an RTP session.

Each synchronization source in an RTP session is identified by a 32-bit numeric SSRC identifier. Each SyncSource object is related to a Participant object, which can be retrieved through the getParticipant() method.

Federico Montesino Pouzols

Definition at line 192 of file sources.h.

Member Enumeration Documentation

Synchronization source states during an RTP session.

In general, new synchronization sources are not considered valid until multiple valid data packets or a valid RTCP compound packet has been received from the new source (

See Also
IncomingDataQueue::setMinValidPacketSequence()). Thus, the source will probably be in statePrevalid before reaching one of the two states that indicate a valid source: stateActive and stateInactive.

A valid participant is in stateActive state if RTP and/or RTCP packets are currently being received from it. If, after a small number of RTCP report intervals (see IncomingDataQueue::setSourceExpirationPeriod() ), no packets are received, it will reach the stateInactive state. If, after a small number of RTCP report intervals, no packet is received from an inactive source, it will be deleted.

If RTCP is being used, after receiving a BYE RTCP packet from a synchronization source, it will reach the stateLeaving state and will be deleted after a delay (see QueueRTCPManager::setLeavingDelay()).

Sources in statePrevalid and stateLeaving are not counted for the number of session members estimation.


No valid packet has been received.


Some packets have been.


received, but source validity not yet guaranteed.

We currently receive packets


(data or control) from this source.

Was active in the near past but


no packet from this source has been received lately.

An RTCP BYE has been received from the source.

Definition at line 225 of file sources.h.

Constructor & Destructor Documentation

SyncSource::SyncSource ( uint32  ssrc)
ssrcSSRC identifier of the source, unique in each session.

Definition at line 107 of file source.cpp.

SyncSource::~SyncSource ( )

Definition at line 112 of file source.cpp.

SyncSource::SyncSource ( const SyncSource source)
sourceThe RTPSource object being copied

Member Function Documentation

tpport_t SyncSource::getControlTransportPort ( ) const

Definition at line 274 of file sources.h.

tpport_t SyncSource::getDataTransportPort ( ) const

Definition at line 271 of file sources.h.

uint32 SyncSource::getID ( ) const

Definition at line 257 of file sources.h.

void* SyncSource::getLink ( ) const

Definition at line 320 of file sources.h.

const InetAddress& SyncSource::getNetworkAddress ( ) const

Definition at line 277 of file sources.h.

Participant* SyncSource::getParticipant ( ) const

Get the participant this synchronization source is asociated to.

Return values
NULLif the stack has not been yet able to identify the participant this source is associated to.

Definition at line 268 of file sources.h.

State SyncSource::getState ( ) const

Definition at line 248 of file sources.h.

bool SyncSource::isSender ( ) const

Whether this source sends RTP data packets.

Definition at line 254 of file sources.h.

SyncSource& SyncSource::operator= ( const SyncSource source)
void SyncSource::setControlTransportPort ( tpport_t  p)

Definition at line 310 of file sources.h.

void SyncSource::setDataTransportPort ( tpport_t  p)

Definition at line 307 of file sources.h.

void SyncSource::setLink ( void *  l)

Definition at line 317 of file sources.h.

void SyncSource::setNetworkAddress ( InetAddress  addr)

Definition at line 313 of file sources.h.

void SyncSource::setParticipant ( Participant p)

Definition at line 304 of file sources.h.

void SyncSource::setSender ( bool  active)

Mark this source as an active sender.

Definition at line 300 of file sources.h.

void SyncSource::setState ( State  st)

Definition at line 293 of file sources.h.

Friends And Related Function Documentation

friend class SyncSourceHandler

Definition at line 290 of file sources.h.

Field Documentation

bool SyncSource::activeSender

Definition at line 328 of file sources.h.

tpport_t SyncSource::controlTransportPort

Definition at line 336 of file sources.h.

tpport_t SyncSource::dataTransportPort

Definition at line 335 of file sources.h.

void* SyncSource::link

Definition at line 341 of file sources.h.

InetAddress SyncSource::networkAddress

Definition at line 334 of file sources.h.

Participant* SyncSource::participant

Definition at line 330 of file sources.h.

uint32 SyncSource::SSRC

Definition at line 326 of file sources.h.

State SyncSource::state

Definition at line 324 of file sources.h.

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