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
[legend]

Public Types

enum  State {
  stateUnknown, statePrevalid, stateActive, stateInactive,
  stateLeaving
}
 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
 
Participantparticipant
 
InetAddress networkAddress
 
tpport_t dataTransportPort
 
tpport_t controlTransportPort
 
void * link
 

Friends

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.

Author
Federico Montesino Pouzols fedem.nosp@m.p@al.nosp@m.tern..nosp@m.org

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.

Enumerator
stateUnknown 

No valid packet has been received.

statePrevalid 

Some packets have been.

stateActive 

received, but source validity not yet guaranteed.

We currently receive packets

stateInactive 

(data or control) from this source.

Was active in the near past but

stateLeaving 

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)
Parameters
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)
protected
Parameters
sourceThe RTPSource object being copied

Member Function Documentation

tpport_t SyncSource::getControlTransportPort ( ) const
inline

Definition at line 274 of file sources.h.

tpport_t SyncSource::getDataTransportPort ( ) const
inline

Definition at line 271 of file sources.h.

uint32 SyncSource::getID ( ) const
inline

Definition at line 257 of file sources.h.

void* SyncSource::getLink ( ) const
inlineprivate

Definition at line 320 of file sources.h.

const InetAddress& SyncSource::getNetworkAddress ( ) const
inline

Definition at line 277 of file sources.h.

Participant* SyncSource::getParticipant ( ) const
inline

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
inline

Definition at line 248 of file sources.h.

bool SyncSource::isSender ( ) const
inline

Whether this source sends RTP data packets.

Definition at line 254 of file sources.h.

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

Definition at line 310 of file sources.h.

void SyncSource::setDataTransportPort ( tpport_t  p)
inlineprivate

Definition at line 307 of file sources.h.

void SyncSource::setLink ( void *  l)
inlineprivate

Definition at line 317 of file sources.h.

void SyncSource::setNetworkAddress ( InetAddress  addr)
inlineprivate

Definition at line 313 of file sources.h.

void SyncSource::setParticipant ( Participant p)
inlineprivate

Definition at line 304 of file sources.h.

void SyncSource::setSender ( bool  active)
inlineprivate

Mark this source as an active sender.

Definition at line 300 of file sources.h.

void SyncSource::setState ( State  st)
inlineprivate

Definition at line 293 of file sources.h.

Friends And Related Function Documentation

friend class SyncSourceHandler
friend

Definition at line 290 of file sources.h.

Field Documentation

bool SyncSource::activeSender
private

Definition at line 328 of file sources.h.

tpport_t SyncSource::controlTransportPort
private

Definition at line 336 of file sources.h.

tpport_t SyncSource::dataTransportPort
private

Definition at line 335 of file sources.h.

void* SyncSource::link
private

Definition at line 341 of file sources.h.

InetAddress SyncSource::networkAddress
private

Definition at line 334 of file sources.h.

Participant* SyncSource::participant
private

Definition at line 330 of file sources.h.

uint32 SyncSource::SSRC
private

Definition at line 326 of file sources.h.

State SyncSource::state
private

Definition at line 324 of file sources.h.


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