📄 rtpsources.h
字号:
* no report block was meant for us), this function can e used to indicate that something was received from * this source. This will prevent a premature timeout for this participant. The message was received at time * \c receivetime from address \c senderaddress. The \c senderaddress parameter must be NULL if the * packet was sent by the local participant. */ int UpdateReceiveTime(uint32_t ssrc,const RTPTime &receivetime,const RTPAddress *senderaddress); /** Starts the iteration over the participants by going to the first member in the table. * Starts the iteration over the participants by going to the first member in the table. * If a member was found, the function returns \c true, otherwise it returns \c false. */ bool GotoFirstSource(); /** Sets the current source to be the next source in the table. * Sets the current source to be the next source in the table. If we're already at the last source, * the function returns \c false, otherwise it returns \c true. */ bool GotoNextSource(); /** Sets the current source to be the previous source in the table. * Sets the current source to be the previous source in the table. If we're at the first source, * the function returns \c false, otherwise it returns \c true. */ bool GotoPreviousSource(); /** Sets the current source to be the first source in the table which has RTPPacket instances * that we haven't extracted yet. * Sets the current source to be the first source in the table which has RTPPacket instances * that we haven't extracted yet. If no such member was found, the function returns \c false, * otherwise it returns \c true. */ bool GotoFirstSourceWithData(); /** Sets the current source to be the next source in the table which has RTPPacket instances that * we haven't extracted yet. * Sets the current source to be the next source in the table which has RTPPacket instances that * we haven't extracted yet. If no such member was found, the function returns \c false, * otherwise it returns \c true. */ bool GotoNextSourceWithData(); /** Sets the current source to be the previous source in the table which has RTPPacket instances * that we haven't extracted yet. * Sets the current source to be the previous source in the table which has RTPPacket instances * that we haven't extracted yet. If no such member was found, the function returns \c false, * otherwise it returns \c true. */ bool GotoPreviousSourceWithData(); /** Returns the RTPSourceData instance for the currently selected participant. */ RTPSourceData *GetCurrentSourceInfo(); /** Returns the RTPSourceData instance for the participant identified by \c ssrc, or * NULL if no such entry exists. */ RTPSourceData *GetSourceInfo(uint32_t ssrc); /** Extracts the next packet from the received packets queue of the current participant. */ RTPPacket *GetNextPacket(); /** Returns \c true if an entry for participant \c ssrc exists and \c false otherwise. */ bool GotEntry(uint32_t ssrc); /** If present, it returns the RTPSourceData instance of the entry which was created by CreateOwnSSRC. */ RTPSourceData *GetOwnSourceInfo() { return (RTPSourceData *)owndata; } /** Assuming that the current time is \c curtime, time out the members from whom we haven't heard * during the previous time interval \c timeoutdelay. */ void Timeout(const RTPTime &curtime,const RTPTime &timeoutdelay); /** Assuming that the current time is \c curtime, remove the sender flag for senders from whom we haven't * received any RTP packets during the previous time interval \c timeoutdelay. */ void SenderTimeout(const RTPTime &curtime,const RTPTime &timeoutdelay); /** Assuming that the current time is \c curtime, remove the members who sent a BYE packet more than * the time interval \c timeoutdelay ago. */ void BYETimeout(const RTPTime &curtime,const RTPTime &timeoutdelay); /** Assuming that the current time is \c curtime, clear the SDES NOTE items which haven't been updated * during the previous time interval \c timeoutdelay. */ void NoteTimeout(const RTPTime &curtime,const RTPTime &timeoutdelay); /** Combines the functions SenderTimeout, BYETimeout, Timeout and NoteTimeout. * Combines the functions SenderTimeout, BYETimeout, Timeout and NoteTimeout. This is more efficient * than calling all four functions since only one iteration is needed in this function. */ void MultipleTimeouts(const RTPTime &curtime,const RTPTime &sendertimeout, const RTPTime &byetimeout,const RTPTime &generaltimeout, const RTPTime ¬etimeout); /** Returns the number of participants which are marked as a sender. */ int GetSenderCount() const { return sendercount; } /** Returns the total number of entries in the source table. */ int GetTotalCount() const { return totalcount; } /** Returns the number of members which have been validated and which haven't sent a BYE packet yet. */ int GetActiveMemberCount() const { return activecount; } #ifdef RTPDEBUG void Dump(); void SafeCountTotal(); void SafeCountSenders(); void SafeCountActive();#endif // RTPDEBUGprotected: /** Is called when an RTP packet is about to be processed. */ virtual void OnRTPPacket(RTPPacket *pack,const RTPTime &receivetime, const RTPAddress *senderaddress) { } /** Is called when an RTCP compound packet is about to be processed. */ virtual void OnRTCPCompoundPacket(RTCPCompoundPacket *pack,const RTPTime &receivetime, const RTPAddress *senderaddress) { } /** Is called when an SSRC collision was detected. * Is called when an SSRC collision was detected. The instance \c srcdat is the one present in * the table, the address \c senderaddress is the one that collided with one of the addresses * and \c isrtp indicates against which address of \c srcdat the check failed. */ virtual void OnSSRCCollision(RTPSourceData *srcdat,const RTPAddress *senderaddress,bool isrtp) { } /** Is called when another CNAME was received than the one already present for source \c srcdat. */ virtual void OnCNAMECollision(RTPSourceData *srcdat,const RTPAddress *senderaddress, const uint8_t *cname,size_t cnamelength) { } /** Is called when a new entry \c srcdat is added to the source table. */ virtual void OnNewSource(RTPSourceData *srcdat) { } /** Is called when the entry \c srcdat is about to be deleted from the source table. */ virtual void OnRemoveSource(RTPSourceData *srcdat) { } /** Is called when participant \c srcdat is timed out. */ virtual void OnTimeout(RTPSourceData *srcdat) { } /** Is called when participant \c srcdat is timed after having sent a BYE packet. */ virtual void OnBYETimeout(RTPSourceData *srcdat) { } /** Is called when a BYE packet has been processed for source \c srcdat. */ virtual void OnBYEPacket(RTPSourceData *srcdat) { } /** Is called when an RTCP APP packet \c apppacket has been received at time \c receivetime * from address \c senderaddress. */ virtual void OnAPPPacket(RTCPAPPPacket *apppacket,const RTPTime &receivetime, const RTPAddress *senderaddress) { } /** Is called when an unknown RTCP packet type was detected. */ virtual void OnUnknownPacketType(RTCPPacket *rtcppack,const RTPTime &receivetime, const RTPAddress *senderaddress) { } /** Is called when an unknown packet format for a known packet type was detected. */ virtual void OnUnknownPacketFormat(RTCPPacket *rtcppack,const RTPTime &receivetime, const RTPAddress *senderaddress) { } /** Is called when the SDES NOTE item for source \c srcdat has been timed out. */ virtual void OnNoteTimeout(RTPSourceData *srcdat) { }private: void ClearSourceList(); int ObtainSourceDataInstance(uint32_t ssrc,RTPInternalSourceData **srcdat,bool *created); int GetRTCPSourceData(uint32_t ssrc,const RTPAddress *senderaddress,RTPInternalSourceData **srcdat,bool *newsource); bool CheckCollision(RTPInternalSourceData *srcdat,const RTPAddress *senderaddress,bool isrtp); RTPKeyHashTable<const uint32_t,RTPInternalSourceData*,RTPSources_GetHashIndex,RTPSOURCES_HASHSIZE> sourcelist; int sendercount; int totalcount; int activecount;#ifdef RTP_SUPPORT_PROBATION ProbationType probationtype;#endif // RTP_SUPPORT_PROBATION RTPInternalSourceData *owndata;};#endif // RTPSOURCES_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -