Home Units Hierarchy Routines All identifiers

Class unaRTPReceiver

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type unaRTPReceiver = class(unaRTPStreamer)

Description

Basic RTP receiver (UDP only)

Hierarchy

Overview

Methods

Public constructor create(isRAW: bool = false); overload;
Public constructor create(const bind2addr: TSockAddrIn; remoteAddr: PSockAddrIn = nil; noRTCP: bool = false; transmitter: unaRTPTransmitter = nil; ttl: int = -1; isUDP: bool = true; isRAW: bool = false); overload;
Public function sendRTP_CN_To(addr: PSockAddrIn): int;
Protected function execute(threadID: unsigned): int; override;
Public procedure AfterConstruction(); override;
Public procedure setNewSSRC(newssrc: u_int32);
Protected procedure onBye(si: prtp_site_info; soft: bool); override;
Protected procedure onIdle(rtcpIdle: bool); override;
Protected procedure onNeedRTPHole(si: prtp_site_info); virtual;
Protected procedure onPayload(addr: PSockAddrIn; hdr: prtp_hdr; data: pointer; len, packetSize: uint); override;
Protected procedure onRTCPPacket(ssrc: u_int32; addr: PSockAddrIn; hdr: prtcp_common_hdr; packetSize: uint); override;
Protected procedure onSsrcCNAME(ssrc: u_int32; cname: prtcp_sdes_item); override;
Protected procedure pushRTCPPacket(packet: pointer; len: uint); override;
Protected procedure startIn(); override;
Protected procedure startOut(); override;
Protected procedure weSent(addr: PSockAddrIn; data: pointer; len: uint);

Properties

Public property bind2ip: string read f_bind2ip;
Public property bind2port: string read f_bind2port;
Public property CN_resendInterval: int read f_CN_resendInterval write f_CN_resendInterval;
Public property ip: string read f_ip;
Public property isServer: bool read f_isServer;
Public property portLocal: string read f_portL;

Description

Methods

Public constructor create(isRAW: bool = false); overload;

Creates a new instance without a socket.

Public constructor create(const bind2addr: TSockAddrIn; remoteAddr: PSockAddrIn = nil; noRTCP: bool = false; transmitter: unaRTPTransmitter = nil; ttl: int = -1; isUDP: bool = true; isRAW: bool = false); overload;

Creates a new receiver instance.

Parameters
bind2port
Bind to this local port (could be 0)
ip
Remote IP (where to send packets)
isRAW
true if non-RTP streaming
bind2ip
Bind to this local IP (default is '0.0.0.0')
transmitter
Master transmitter
isUDP
True for UDP, False for TCP
noRTCP
Enable RTCP for RTP
ttl
TTL for multicast
mcport
multicast group port (needed only for sending data, for receiving use bind2port parameter)
ignoreLocalIPs
do not treat this PCs IPs as special case
Public function sendRTP_CN_To(addr: PSockAddrIn): int;

Sends RTP CN (comfort noise) packet (payload = c_rtpPTa_CN) to remote side. Used mostly at beginning of streaming to make holes in NAT.

Parameters
addr
Remote address to send ping to
Returns

0 if successfull or winsock error code otherwise.

Protected function execute(threadID: unsigned): int; override;
 
Public procedure AfterConstruction(); override;

Initializes required fields

Public procedure setNewSSRC(newssrc: u_int32);

Not everyday function.

Protected procedure onBye(si: prtp_site_info; soft: bool); override;
 
Protected procedure onIdle(rtcpIdle: bool); override;

Called from context of idle thread.

Protected procedure onNeedRTPHole(si: prtp_site_info); virtual;
 
Protected procedure onPayload(addr: PSockAddrIn; hdr: prtp_hdr; data: pointer; len, packetSize: uint); override;
 
Protected procedure onRTCPPacket(ssrc: u_int32; addr: PSockAddrIn; hdr: prtcp_common_hdr; packetSize: uint); override;

New RTCP packed was received.

Parameters
ssrc
Generator of packet
addr
Remote address packet was received from.
hdr
RTCP packet header.
packetSize
Packet size including padding.
Protected procedure onSsrcCNAME(ssrc: u_int32; cname: prtcp_sdes_item); override;
 
Protected procedure pushRTCPPacket(packet: pointer; len: uint); override;

Notify transmitter (if any) of new RTCP packet

Protected procedure startIn(); override;
 
Protected procedure startOut(); override;
 
Protected procedure weSent(addr: PSockAddrIn; data: pointer; len: uint);

Should be called just after new RTP packet was sent.

Properties

Public property bind2ip: string read f_bind2ip;

Bind to this interface (default is 0.0.0.0 means bind to all interfaces).

Public property bind2port: string read f_bind2port;

Port number (to receive RTP payload on). In case of TCP socket - remote port number to connect to.

Public property CN_resendInterval: int read f_CN_resendInterval write f_CN_resendInterval;

Re-send interval for CN packets

Public property ip: string read f_ip;

In case of multicast - group IP In case of unicast UDP/TCP sockets - remote host IP (set to '0.0.0.0' for TCP server)

Public property isServer: bool read f_isServer;

True if TCP server.

Public property portLocal: string read f_portL;

Actual local RTP port number used in this session. Could be used to get port number assigned by system when bind2port property is 0.

(c) 2012 Lake of Soft


Generated by PasDoc 0.12.1 on 2012-10-09