43#ifndef CCXX_RTP_CQUEUE_H_
44#define CCXX_RTP_CQUEUE_H_
115 { leavingDelay = delay; }
133 { end2EndDelay = t; }
137 {
return defaultEnd2EndDelay; }
141 {
return end2EndDelay; }
158 { sendControlBwFract = fraction; recvControlBwFract = 1 - fraction;}
171 { rtcpMinInterval = interval; }
178 {
return ctrlSendCount; }
260 {
return queueApplication; }
264 { controlBwFract = fraction; }
268 {
return controlBwFract; }
297 InetAddress& na, tpport_t tp);
363 {
return rtcpCheckInterval; }
371 {
return lastSendPacketCount; }
378 { reconsInfo.rtcpPMembers = n; }
382 {
return reconsInfo.rtcpPMembers; }
420 dispatchControlPacket();
434 takeInControlPacket();
450 computeRTCPInterval();
475 end2EndDelayed(IncomingRTPPktLink& p);
486 onGotRRSRExtension(
unsigned char*,
size_t)
499 onGotGoodbye(
const SyncSource&,
const std::string&)
515 getBYE(RTCPPacket &pkt,
size_t &pointer,
size_t len);
521 packReportBlocks(RRBlock* blocks, uint16& len, uint16& available);
532 packSDES(uint16& len);
546 updateAvgRTCPSize(
size_t len);
554 reverseReconsideration();
557 timerReconsideration();
582 const char*
const value,
size_t len);
589 setPRIVPrefix(Participant* part,
const char*
const value,
size_t len);
602 inline virtual uint16
617 inline virtual uint16
618 transportHeaderSize()
622 int32 protect(uint8* pkt,
size_t len, CryptoContextCtrl* cc);
623 int32 unprotect(uint8* pkt,
size_t len, CryptoContextCtrl* cc);
630 sendControl(
const unsigned char*
const buffer,
size_t len) = 0;
633 recvControl(
unsigned char* buffer,
size_t len,
634 InetHostAddress& na, tpport_t& tp) = 0;
640 volatile bool controlServiceActive;
641 float controlBwFract, sendControlBwFract, recvControlBwFract;
643 uint32 ctrlSendCount;
647 uint16 lowerHeadersSize;
658 timeval rtcpTp, rtcpTc, rtcpTn;
665 timeval rtcpLastCheck;
667 timeval rtcpCheckInterval;
669 timeval rtcpNextCheck;
673 uint32 lastSendPacketCount;
686 RTPApplication& queueApplication;
689 static const uint16 TIMEOUT_MULTIPLIER;
690 static const double RECONSIDERATION_COMPENSATION;
692 mutable Mutex outCryptoMutex;
693 std::list<CryptoContextCtrl *> outCryptoContexts;
696 mutable Mutex inCryptoMutex;
697 std::list<CryptoContextCtrl *> inCryptoContexts;
uint32 microtimeout_t
Time interval expressed in microseconds.
Definition base.h:67
void setControlBandwidth(float fraction)
Specify the bandwith available for control (RTCP) packets.
Definition cqueue.h:727
AVPQueue(uint32 ssrc, uint32 size=RTPDataQueue::defaultMembersHashSize, RTPApplication &app=defaultApplication())
Local SSRC is given instead of computed by the queue.
Definition cqueue.h:743
float getControlBandwidth() const
Definition cqueue.h:731
virtual ~AVPQueue()
Definition cqueue.h:748
AVPQueue(uint32 size=RTPDataQueue::defaultMembersHashSize, RTPApplication &app=defaultApplication())
Definition cqueue.h:735
The implementation for a SRTCP cryptographic context.
Definition CryptoContextCtrl.h:61
static const size_t defaultMembersHashSize
Definition iqueue.h:854
void setMinRTCPInterval(microtimeout_t interval)
Manually set the minimum interval for sending RTP compound packets.
Definition cqueue.h:170
RTCPSenderInfo * getMRSenderInfo(SyncSource &src)
Get the most recent sender report received from a synchronization source.
void setInQueueCryptoContextCtrl(CryptoContextCtrl *cc)
Set input queue CryptoContext.
void controlReceptionService()
Process incoming RTCP packets pending in the control reception socket.
uint32 getSendRTCPPacketCount() const
Get the total number of RTCP packets sent until now.
Definition cqueue.h:177
void controlTransmissionService()
Build and send RTCP packets following timing rules (including the "timer reconsideration" algorithm).
CryptoContextCtrl * getOutQueueCryptoContextCtrl(uint32 ssrc)
Get an output queue CryptoContext identified by SSRC.
uint32 getLastSendPacketCount() const
Get the number of data packets sent at the time the last SR was generated.
Definition cqueue.h:370
void setPrevMembersNum(uint32 n)
Definition cqueue.h:377
virtual ~QueueRTCPManager()
uint32 getPrevMembersCount() const
Definition cqueue.h:381
bool checkSSRCInRTCPPkt(SyncSourceLink &sourceLink, bool is_new, InetAddress &na, tpport_t tp)
Appy collision and loop detection and correction algorithm when receiving RTCP packets.
virtual bool onGotSDESChunk(SyncSource &source, SDESChunk &chunk, size_t len)
Plug-in for handling of SDES chunks.
void setOutQueueCryptoContextCtrl(CryptoContextCtrl *cc)
Set ouput queue CryptoContext.
microtimeout_t getDefaultEnd2EndDelay() const
Definition cqueue.h:136
void removeInQueueCryptoContextCtrl(CryptoContextCtrl *cc)
Remove input queue CryptoContext.
bool onGotSDES(SyncSource &source, RTCPPacket &pkt)
void setSendersControlFraction(float fraction)
Specify the fraction of the total control bandwith to be dedicated to senders reports.
Definition cqueue.h:157
RTCPReceiverInfo * getMRReceiverInfo(SyncSource &srcFrom)
Ask for the info in the most recent receiver report about the local source received from the source g...
timeval getRTCPCheckInterval()
Definition cqueue.h:362
QueueRTCPManager(uint32 ssrc, uint32 size=RTPDataQueue::defaultMembersHashSize, RTPApplication &app=defaultApplication())
virtual void onGotSR(SyncSource &source, SendReport &SR, uint8 blocks)
Plug-in for processing (acquire information carried in) an incoming RTCP Sender Report.
size_t dispatchBYE(const std::string &reason)
This method is used to send an RTCP BYE packet.
float getControlBandwidth() const
Definition cqueue.h:267
void setLeavingDelay(microtimeout_t delay)
Set how much time the stack will wait before deleting a synchronization source that has sent an RTCP ...
Definition cqueue.h:114
const RTPApplication & getApplication()
Definition cqueue.h:259
void endQueueRTCPManager()
microtimeout_t getEnd2EndDelay() const
Definition cqueue.h:140
void removeOutQueueCryptoContextCtrl(CryptoContextCtrl *cc)
Remove output queue CryptoContext.
void setEnd2EndDelay(microtimeout_t t)
This method sets the maximum end to end delay allowed.
Definition cqueue.h:132
virtual void onGotAPP(SyncSource &, RTCPCompoundHandler::APPPacket &, size_t)
Plug-in for handling of APP (application specific) RTCP packets.
Definition cqueue.h:357
virtual void onGotRR(SyncSource &source, RecvReport &RR, uint8 blocks)
Plug-in for processing (acquire information carried in) an incoming RTCP Receiver Report.
void setControlBandwidth(float fraction)
Definition cqueue.h:263
size_t sendControlToDestinations(unsigned char *buffer, size_t len)
QueueRTCPManager(uint32 size=RTPDataQueue::defaultMembersHashSize, RTPApplication &app=defaultApplication())
CryptoContextCtrl * getInQueueCryptoContextCtrl(uint32 ssrc)
Get an input queue CryptoContext identified by SSRC.
friend class RTCPSenderInfo
Definition rtcppkt.h:357
RTCPCompoundHandler(uint16 mtu=defaultPathMTU)
friend class RTCPReceiverInfo
Definition rtcppkt.h:358
An RTP application, holding identifying RTCP SDES item values.
Definition sources.h:365
RTPDataQueue(uint32 size=defaultMembersHashSize)
Constructor.
Synchronization source in an RTP session.
Definition sources.h:193
SDESItemType
SDES items that may be carried in a Source DEScription RTCP packet.
Definition rtcppkt.h:65
__EXPORT RTPApplication & defaultApplication()
Get the RTPApplication object for the "default" application (the only one used by common applications...
Generic RTP input/output queues.
Synchronization Source internal handler within the incoming packets queue.
Definition iqueue.h:470
Struct for APP (application specific) RTCP packets.
Definition rtcppkt.h:213
Struct representing general RTCP packet headers as they are sent through the network.
Definition rtcppkt.h:278
raw structure of the source and every receiver report in an SR or RR RTCP packet.
Definition rtcppkt.h:138
Struct for a chunk of items in a SDES RTCP packet.
Definition rtcppkt.h:188
Struct for SR (sender report) RTCP packets.
Definition rtcppkt.h:164