📄 rtpsourcedata.h
字号:
/** Returns the reason for leaving contained in the BYE packet of this participant. * Returns the reason for leaving contained in the BYE packet of this participant. The length of * the reason is stored in \c len. */ uint8_t *GetBYEReason(size_t *len) const { *len = byereasonlen; return byereason; } /** Returns the time at which the BYE packet was received. */ RTPTime GetBYETime() const { return byetime; } /** Sets the value for the timestamp unit to be used in jitter calculations for data received from this participant. * Sets the value for the timestamp unit to be used in jitter calculations for data received from this participant. * If not set, the library uses an approximation for the timestamp unit which is calculated from two consecutive * RTCP sender reports. The timestamp unit is defined as a time interval divided by the corresponding timestamp * interval. For 8000 Hz audio this would be 1/8000. For video, often a timestamp unit of 1/90000 is used. */ void SetTimestampUnit(double tsu) { timestampunit = tsu; } /** Returns the timestamp unit used for this participant. */ double GetTimestampUnit() const { return timestampunit; } /** Returns \c true if an RTCP sender report has been received from this participant. */ bool SR_HasInfo() const { return SRinf.HasInfo(); } /** Returns the NTP timestamp contained in the last sender report. */ RTPNTPTime SR_GetNTPTimestamp() const { return SRinf.GetNTPTimestamp(); } /** Returns the RTP timestamp contained in the last sender report. */ uint32_t SR_GetRTPTimestamp() const { return SRinf.GetRTPTimestamp(); } /** Returns the packet count contained in the last sender report. */ uint32_t SR_GetPacketCount() const { return SRinf.GetPacketCount(); } /** Returns the octet count contained in the last sender report. */ uint32_t SR_GetByteCount() const { return SRinf.GetByteCount(); } /** Returns the time at which the last sender report was received. */ RTPTime SR_GetReceiveTime() const { return SRinf.GetReceiveTime(); } /** Returns \c true if more than one RTCP sender report has been received. */ bool SR_Prev_HasInfo() const { return SRprevinf.HasInfo(); } /** Returns the NTP timestamp contained in the second to last sender report. */ RTPNTPTime SR_Prev_GetNTPTimestamp() const { return SRprevinf.GetNTPTimestamp(); } /** Returns the RTP timestamp contained in the second to last sender report. */ uint32_t SR_Prev_GetRTPTimestamp() const { return SRprevinf.GetRTPTimestamp(); } /** Returns the packet count contained in the second to last sender report. */ uint32_t SR_Prev_GetPacketCount() const { return SRprevinf.GetPacketCount(); } /** Returns the octet count contained in the second to last sender report. */ uint32_t SR_Prev_GetByteCount() const { return SRprevinf.GetByteCount(); } /** Returns the time at which the second to last sender report was received. */ RTPTime SR_Prev_GetReceiveTime() const { return SRprevinf.GetReceiveTime(); } /** Returns \c true if this participant sent a receiver report with information about the reception of our data. */ bool RR_HasInfo() const { return RRinf.HasInfo(); } /** Returns the fraction lost value from the last report. */ double RR_GetFractionLost() const { return RRinf.GetFractionLost(); } /** Returns the number of lost packets contained in the last report. */ int32_t RR_GetPacketsLost() const { return RRinf.GetPacketsLost(); } /** Returns the extended highest sequence number contained in the last report. */ uint32_t RR_GetExtendedHighestSequenceNumber() const { return RRinf.GetExtendedHighestSequenceNumber(); } /** Returns the jitter value from the last report. */ uint32_t RR_GetJitter() const { return RRinf.GetJitter(); } /** Returns the LSR value from the last report. */ uint32_t RR_GetLastSRTimestamp() const { return RRinf.GetLastSRTimestamp(); } /** Returns the DLSR value from the last report. */ uint32_t RR_GetDelaySinceLastSR() const { return RRinf.GetDelaySinceLastSR(); } /** Returns the time at which the last report was received. */ RTPTime RR_GetReceiveTime() const { return RRinf.GetReceiveTime(); } /** Returns \c true if this participant sent more than one receiver report with information * about the reception of our data. */ bool RR_Prev_HasInfo() const { return RRprevinf.HasInfo(); } /** Returns the fraction lost value from the second to last report. */ double RR_Prev_GetFractionLost() const { return RRprevinf.GetFractionLost(); } /** Returns the number of lost packets contained in the second to last report. */ int32_t RR_Prev_GetPacketsLost() const { return RRprevinf.GetPacketsLost(); } /** Returns the extended highest sequence number contained in the second to last report. */ uint32_t RR_Prev_GetExtendedHighestSequenceNumber() const { return RRprevinf.GetExtendedHighestSequenceNumber(); } /** Returns the jitter value from the second to last report. */ uint32_t RR_Prev_GetJitter() const { return RRprevinf.GetJitter(); } /** Returns the LSR value from the second to last report. */ uint32_t RR_Prev_GetLastSRTimestamp() const { return RRprevinf.GetLastSRTimestamp(); } /** Returns the DLSR value from the second to last report. */ uint32_t RR_Prev_GetDelaySinceLastSR() const { return RRprevinf.GetDelaySinceLastSR(); } /** Returns the time at which the second to last report was received. */ RTPTime RR_Prev_GetReceiveTime() const { return RRprevinf.GetReceiveTime(); } /** Returns \c true if validated RTP packets have been received from this participant. */ bool INF_HasSentData() const { return stats.HasSentData(); } /** Returns the total number of received packets from this participant. */ int32_t INF_GetNumPacketsReceived() const { return stats.GetNumPacketsReceived(); } /** Returns the base sequence number of this participant. */ uint32_t INF_GetBaseSequenceNumber() const { return stats.GetBaseSequenceNumber(); } /** Returns the extended highest sequence number received from this participant. */ uint32_t INF_GetExtendedHighestSequenceNumber() const { return stats.GetExtendedHighestSequenceNumber(); } /** Returns the current jitter value for this participant. */ uint32_t INF_GetJitter() const { return stats.GetJitter(); } /** Returns the time at which something was last heard from this member. */ RTPTime INF_GetLastMessageTime() const { return stats.GetLastMessageTime(); } /** Returns the time at which the last RTP packet was received. */ RTPTime INF_GetLastRTPPacketTime() const { return stats.GetLastRTPPacketTime(); } /** Returns the estimated timestamp unit, calculated from two consecutive sender reports. */ double INF_GetEstimatedTimestampUnit() const; /** Returns the number of packets received since a new interval was started with INF_StartNewInterval. */ uint32_t INF_GetNumPacketsReceivedInInterval() const { return stats.GetNumPacketsReceivedInInterval(); } /** Returns the extended sequence number which was stored by the INF_StartNewInterval call. */ uint32_t INF_GetSavedExtendedSequenceNumber() const { return stats.GetSavedExtendedSequenceNumber(); } /** Starts a new interval to count received packets in; this also stores the current extended highest sequence * number to be able to calculate the packet loss during the interval. */ void INF_StartNewInterval() { stats.StartNewInterval(); } /** Estimates the round trip time by using the LSR and DLSR info from the last receiver report. */ RTPTime INF_GetRoundtripTime() const; /** Returns the time at which the last SDES NOTE item was received. */ RTPTime INF_GetLastSDESNoteTime() const { return stats.GetLastNoteTime(); } /** Returns a pointer to the SDES CNAME item of this participant and stores its length in \c len. */ uint8_t *SDES_GetCNAME(size_t *len) const { return SDESinf.GetCNAME(len); } /** Returns a pointer to the SDES name item of this participant and stores its length in \c len. */ uint8_t *SDES_GetName(size_t *len) const { return SDESinf.GetName(len); } /** Returns a pointer to the SDES e-mail item of this participant and stores its length in \c len. */ uint8_t *SDES_GetEMail(size_t *len) const { return SDESinf.GetEMail(len); } /** Returns a pointer to the SDES phone item of this participant and stores its length in \c len. */ uint8_t *SDES_GetPhone(size_t *len) const { return SDESinf.GetPhone(len); } /** Returns a pointer to the SDES location item of this participant and stores its length in \c len. */ uint8_t *SDES_GetLocation(size_t *len) const { return SDESinf.GetLocation(len); } /** Returns a pointer to the SDES tool item of this participant and stores its length in \c len. */ uint8_t *SDES_GetTool(size_t *len) const { return SDESinf.GetTool(len); } /** Returns a pointer to the SDES note item of this participant and stores its length in \c len. */ uint8_t *SDES_GetNote(size_t *len) const { return SDESinf.GetNote(len); } #ifdef RTP_SUPPORT_SDESPRIV /** Starts the iteration over the stored SDES private item prefixes and their associated values. */ void SDES_GotoFirstPrivateValue() { SDESinf.GotoFirstPrivateValue(); } /** If available, returns \c true and stores the next SDES private item prefix in \c prefix and its length in * \c prefixlen; the associated value and its length are then stored in \c value and \c valuelen. */ bool SDES_GetNextPrivateValue(uint8_t **prefix,size_t *prefixlen,uint8_t **value,size_t *valuelen) { return SDESinf.GetNextPrivateValue(prefix,prefixlen,value,valuelen); } /** Looks for the entry which corresponds to the SDES private item prefix \c prefix with length * \c prefixlen; if found, the function returns \c true and stores the associated value and * its length in \c value and \c valuelen respectively. */ bool SDES_GetPrivateValue(uint8_t *prefix,size_t prefixlen,uint8_t **value,size_t *valuelen) const { return SDESinf.GetPrivateValue(prefix,prefixlen,value,valuelen); }#endif // RTP_SUPPORT_SDESPRIV#ifdef RTPDEBUG virtual void Dump();#endif // RTPDEBUGprotected: std::list<RTPPacket *> packetlist; uint32_t ssrc; bool ownssrc; bool iscsrc; double timestampunit; bool receivedbye; bool validated; bool processedinrtcp; bool issender; RTCPSenderReportInfo SRinf,SRprevinf; RTCPReceiverReportInfo RRinf,RRprevinf; RTPSourceStats stats; RTCPSDESInfo SDESinf; bool isrtpaddrset,isrtcpaddrset; RTPAddress *rtpaddr,*rtcpaddr; RTPTime byetime; uint8_t *byereason; size_t byereasonlen;};inline RTPPacket *RTPSourceData::GetNextPacket(){ if (!validated) return 0; RTPPacket *p; if (packetlist.empty()) return 0; p = *(packetlist.begin()); packetlist.pop_front(); return p;}inline void RTPSourceData::FlushPackets(){ std::list<RTPPacket *>::const_iterator it; for (it = packetlist.begin() ; it != packetlist.end() ; ++it) RTPDelete(*it,GetMemoryManager()); packetlist.clear();}#endif // RTPSOURCEDATA_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -