Description | Hierarchy | Fields | Methods | Properties |
type unaRTCPstack = class(unaThread)
Basic RTCP stack (UDP only)
constructor create(streamer: unaRTPStreamer; useNTP: bool = false); |
|
function copyMember(ssrc: u_int32; var info: rtp_site_info): bool; |
|
function getMemberCNAME(ssrc: u_int32; out cname: wString): bool; |
|
function getMemberTimeout(ssrc: u_int32): int; |
|
function memberByAddrAcq(isRTP: bool; addr: pSockAddrIn; ro: bool; timeout: tTimeout = 100): prtp_site_info; |
|
function memberBySSRCAcq(ssrc: u_int32; ro: bool; timeout: tTimeout = 100): prtp_site_info; |
|
function memberSSRCbyIndex(index: int; out ssrc: u_int32): bool; |
|
function sendAPPto(addr: PSockAddrIn; subtype: byte; const cmd: aString; data: pointer = nil; len: uint = 0; sendCNAMEasWell: bool = false): int; |
|
function timeNTPnow(var st: SYSTEMTIME): bool; |
|
function execute(threadID: unsigned): int; override; |
|
function getMemberCount(): int; |
|
function getNextSeq(): unsigned; |
|
function memberByIndexAcq(index: int; ro: bool; timeout: tTimeout = 100): prtp_site_info; |
|
function newMemberAcq(ssrc: u_int32): prtp_site_info; |
|
function sendDataRTCP(addr: pSockAddrIn; data: pointer; len: uint): int; |
|
function update_seq(ssrc: u_int32; seq: u_int16): bool; |
|
procedure BeforeDestruction(); override; |
|
procedure memberReleaseRO(member: prtp_site_info); |
|
procedure memberReleaseWO(member: prtp_site_info); |
|
procedure gotIdle(); virtual; |
|
procedure gotPacket(addr: pSockAddrIn; hdr: prtcp_common_hdr; packetSize: uint; firstOne: bool); virtual; |
|
procedure gotRTPpacket(addr: pSockAddr; hdr: prtp_hdr; packetSize: uint); virtual; |
|
procedure init_seq(si: prtp_site_info; seq: u_int16); |
|
procedure startIn(); override; |
|
procedure startOut(); override; |
|
procedure udapteOnAPP(addr: pSockAddrIn; hdr: prtcp_APP_packet; subtype: int; const cmd: aString; data: pointer; size: int); virtual; |
|
procedure updateOnRR(addr: pSockAddrIn; hdr: prtcp_RR_packet); |
|
procedure updateOnSDES(ssrc: u_int32; item: prtcp_sdes_item); overload; |
|
procedure updateOnSR(addr: pSockAddrIn; hdr: prtcp_SR_packet); |
|
procedure weSentRTP(addr: PSockAddrIn; hdr: prtp_hdr; payloadLen: uint); |
property addrChangeAutoResolve: bool read f_acar; |
|
property bind2port: string read f_b2portRTCP write f_b2portRTCP; |
|
property conferenceMode: bool read f_confMode write f_confMode; |
|
property memberCount: int read getMemberCount; |
|
property memberTimeoutReports: int read f_memberTR write f_memberTR; |
|
property rttEnabled: bool read f_rttEnabled write f_rttEnabled; |
|
property seqNum: int read f_seq; |
|
property socketError: int read f_socketError; |
|
property socketObjRTCP: unaSocket read getSocket; |
|
property streamer: unaRTPStreamer read f_streamer; |
constructor create(streamer: unaRTPStreamer; useNTP: bool = false); |
|
Creates RTCP stack |
function copyMember(ssrc: u_int32; var info: rtp_site_info): bool; |
|
Copies member info.
Parameters
ReturnsTrue if successfull |
function getMemberCNAME(ssrc: u_int32; out cname: wString): bool; |
|
Returns member CNAME.
Parameters
ReturnsCNAME or '' |
function getMemberTimeout(ssrc: u_int32): int; |
|
Returns member timeout. If memberTimeoutReports is not 0 and no RR will be received from this member after memberTimeoutReports reports, BYE will be sent to remote side and it will be removed from the members table.
Parameters
ReturnsTimeout in ms. |
function memberByAddrAcq(isRTP: bool; addr: pSockAddrIn; ro: bool; timeout: tTimeout = 100): prtp_site_info; |
|
Returns member info. Always call memberRelease() when done working with member.
Parameters
ReturnsSession member or nil. |
function memberBySSRCAcq(ssrc: u_int32; ro: bool; timeout: tTimeout = 100): prtp_site_info; |
|
Returns member info. Always call memberRelease() when done working with member.
Parameters
ReturnsSession member or nil. |
function memberSSRCbyIndex(index: int; out ssrc: u_int32): bool; |
|
Returns member SSRC by index.
Parameters
ReturnsTrue if successfull |
function sendAPPto(addr: PSockAddrIn; subtype: byte; const cmd: aString; data: pointer = nil; len: uint = 0; sendCNAMEasWell: bool = false): int; |
|
Sends custom APP packet to remote side.
Parameters
Returns0 if data was sent successfully, or specific WSA error otherwise. |
function timeNTPnow(var st: SYSTEMTIME): bool; |
|
Returns current NTP time if available.
Parameters
ReturnsTrue if successfull |
function execute(threadID: unsigned): int; override; |
|
Runs RTCP receiving socket cycle. Calls gotPacket() each time new chunk of bytes is received. |
function getMemberCount(): int; |
|
Returns number of memebers. When active there is always one member - we. |
function getNextSeq(): unsigned; |
|
Returns next RTP seq# |
function memberByIndexAcq(index: int; ro: bool; timeout: tTimeout = 100): prtp_site_info; |
|
Returns member info. Always call memberRelease() when done working with member.
Parameters
ReturnsSession member or nil. |
function newMemberAcq(ssrc: u_int32): prtp_site_info; |
|
Creates new session member record. Locks new member with WO access, so it must be released by memberReleaseWO()
Parameters
Returnsmember info |
function sendDataRTCP(addr: pSockAddrIn; data: pointer; len: uint): int; |
|
Sends data using RTCP socket Returns0 if data was sent successfully, or specific WSA error otherwise. |
function update_seq(ssrc: u_int32; seq: u_int16): bool; |
|
procedure BeforeDestruction(); override; |
|
Cleans the instance. |
procedure memberReleaseRO(member: prtp_site_info); |
|
Releases member info after RO acquision.. Must always be called after memberGet(). Parameters
|
procedure memberReleaseWO(member: prtp_site_info); |
|
Releases member info after WO acquision. Must always be called after successfull memberByXXX(). Parameters
|
procedure gotIdle(); virtual; |
|
Time to send RTCP packets (if needed). |
procedure gotPacket(addr: pSockAddrIn; hdr: prtcp_common_hdr; packetSize: uint; firstOne: bool); virtual; |
|
Received new RTCP packet. |
procedure gotRTPpacket(addr: pSockAddr; hdr: prtp_hdr; packetSize: uint); virtual; |
|
Received new RTP packet. |
procedure init_seq(si: prtp_site_info; seq: u_int16); |
|
procedure startIn(); override; |
|
procedure startOut(); override; |
|
procedure udapteOnAPP(addr: pSockAddrIn; hdr: prtcp_APP_packet; subtype: int; const cmd: aString; data: pointer; size: int); virtual; |
|
Received APP packet. |
procedure updateOnRR(addr: pSockAddrIn; hdr: prtcp_RR_packet); |
|
Received new RTCP RR packet. |
procedure updateOnSDES(ssrc: u_int32; item: prtcp_sdes_item); overload; |
|
Received new RTCP SDES packet. |
procedure updateOnSR(addr: pSockAddrIn; hdr: prtcp_SR_packet); |
|
Received new RTCP SR packet. |
procedure weSentRTP(addr: PSockAddrIn; hdr: prtp_hdr; payloadLen: uint); |
|
Should be called to maintain RTCP sanity just after new RTP packet was sent. |
property addrChangeAutoResolve: bool read f_acar; |
|
Resolve remote address change automatically. Default is true. |
property bind2port: string read f_b2portRTCP write f_b2portRTCP; |
|
Port number to receive RTCP payload on. |
property conferenceMode: bool read f_confMode write f_confMode; |
|
When in conference mode, client should send RTCP packets to conference server only. |
property memberCount: int read getMemberCount; |
|
Number of session members. |
property memberTimeoutReports: int read f_memberTR write f_memberTR; |
|
Number of reports for session member to timeout. Default value is 6, means a member will be removed from table if 6 successive reports are missing from it. Set to 0 to disable timeout check. |
property rttEnabled: bool read f_rttEnabled write f_rttEnabled; |
|
When true (default) will query for and reply on RTT requests. |
property seqNum: int read f_seq; |
|
Last seq#, mostly for stat display. |
property socketError: int read f_socketError; |
|
property socketObjRTCP: unaSocket read getSocket; |
|
Internal socket object |
property streamer: unaRTPStreamer read f_streamer; |
|
RTP transport. |
(c) 2012 Lake of Soft