Description | Hierarchy | Fields | Methods | Properties |
type unaRTPTransmitter = class(unaObject)
Basic RTP transmitter (UDP only)
![]() |
constructor create(const bind2addr: TSockAddrIn; payload: int; isRAW: bool = false; noRTCP: bool = false; ttl: int = -1; primaryDest: PSockAddrIn = nil); |
![]() |
function destAdd(dstatic: bool; addrRTP, addrRTCP: PSockAddrIn; doOpen: bool = false; fromHole: bool = false; recSSRC: uint32 = 0): int; overload; |
![]() |
function destAdd(dstatic: bool; const remoteHost, remotePortRTP, remotePortRTCP: string; doOpen: bool = false; ttl: int = -1; recSSRC: uint32 = 0; fromHole: bool = false): int; overload; |
![]() |
function destAdd(dstatic: bool; const uri: string; doOpen: bool = false; ttl: int = -1; recSSRC: uint32 = 0): int; overload; |
![]() |
function destAdd(dstatic: bool; const ipN: TIPv4N): int; overload; |
![]() |
function destGetAcq(index: int; ro: bool): unaRTPDestination; overload; |
![]() |
function destGetAcq(const addrRTP: sockaddr_in; ro: bool): unaRTPDestination; overload; |
![]() |
function destGetCount(): int; |
![]() |
function destHas(const addr: sockaddr_in): bool; |
![]() |
function open(waitForThreadsToStart: bool = true): bool; |
![]() |
function retransmit(data: pointer; len: uint; updateWeSent: bool = true; isRTCP: bool = false): int; |
![]() |
function sendTo(addr: PSockAddrIn; data: pointer; len: uint; isRTCP: bool; ownPacket: bool = true): int; |
![]() |
function transmit(samplesDelta: uint; data: pointer; len: uint; marker: bool = false; tpayload: int = -1; addr: PSockAddrIn = nil; prebufData: pointer = nil; prebufDataLen: uint = 0; updateWeSent: bool = true): int; |
![]() |
function doOpen(waitForThreadsToStart: bool = true): bool; virtual; |
![]() |
function okAddDest(destRTP, destRTCP: PSockAddrIn; fromHole: bool): bool; virtual; |
![]() |
procedure BeforeDestruction(); override; |
![]() |
procedure close(clearAllDest: bool = false); |
![]() |
procedure destEnable(index: int; doEnable: bool); overload; |
![]() |
procedure destEnable(const uri: string; doEnable: bool); overload; |
![]() |
procedure destRemove(const addrRTP: sockaddr_in); overload; |
![]() |
procedure destRemove(const uri: string); overload; |
![]() |
procedure destRemove(index: int); overload; |
![]() |
procedure destRemove(dest: unaRTPDestination); overload; |
![]() |
procedure setNewSSRC(newssrc: u_int32); |
![]() |
procedure doClose(); virtual; |
![]() |
procedure notifyBye(si: prtp_site_info; soft: bool); virtual; |
![]() |
procedure onIdle(rtcpIdle: bool); virtual; |
![]() |
procedure onPayload(addr: PSockAddrIn; hdr: prtp_hdr; data: pointer; len, packetSize: uint); virtual; |
![]() |
procedure onRTCPPacket(ssrc: u_int32; addr: PSockAddrIn; hdr: prtcp_common_hdr; packetSize: uint); virtual; |
![]() |
procedure onSsrcCNAME(ssrc: u_int32; cname: prtcp_sdes_item); virtual; |
![]() |
procedure pushRTCPPacket(packet: pointer; len: uint); virtual; |
![]() |
property active: bool read getActive write setActive; |
![]() |
property bind2ip: string read f_bind2ip write f_bind2ip; |
![]() |
property bind2port: string read f_bind2port; |
![]() |
property dest[index:int]: unaRTPDestination read getDest; |
![]() |
property isRAW: bool read f_isRAW write f_isRAW; |
![]() |
property isTranslator: bool read f_isTranslator write f_isTranslator; |
![]() |
property onAddDest: unaRTPOnAddDestination read f_onAddDest write f_onAddDest; |
![]() |
property paused: bool read f_paused write f_paused; |
![]() |
property payload: int read f_payload write setPayload; |
![]() |
property receiver: unaRTPReceiver read f_receiver; |
![]() |
property rtcp: unaRTCPstack read getRTCP; |
![]() |
property RTPclockRate: unsigned read f_RTPclockRate write f_RTPclockRate; |
![]() |
property rtpPing: bool read f_rtpPing write f_rtpPing; |
![]() |
property samplingRate: unsigned read f_sr write f_sr; |
![]() |
property socketError: int read f_socketError; |
![]() |
property ttl: int read f_ttl write f_ttl; |
![]() |
property _SSRC: u_int32 read getSsrc; |
![]() |
constructor create(const bind2addr: TSockAddrIn; payload: int; isRAW: bool = false; noRTCP: bool = false; ttl: int = -1; primaryDest: PSockAddrIn = nil); |
Creates a new instance of IPTransmitter.
Parameters
|
![]() |
function destAdd(dstatic: bool; addrRTP, addrRTCP: PSockAddrIn; doOpen: bool = false; fromHole: bool = false; recSSRC: uint32 = 0): int; overload; |
Adds new destination for transmission. Returnsindex of new dest |
![]() |
function destAdd(dstatic: bool; const remoteHost, remotePortRTP, remotePortRTCP: string; doOpen: bool = false; ttl: int = -1; recSSRC: uint32 = 0; fromHole: bool = false): int; overload; |
Adds new destination for transmission. Returnsindex of just added destination. |
![]() |
function destAdd(dstatic: bool; const uri: string; doOpen: bool = false; ttl: int = -1; recSSRC: uint32 = 0): int; overload; |
Adds new destination for transmission. Returnsindex of just added destination. |
![]() |
function destAdd(dstatic: bool; const ipN: TIPv4N): int; overload; |
Adds new destination for transmission. It will use receiver's socket for communication. This method is mostly used for multicast sockets. Returnsindex of new dest |
![]() |
function destGetAcq(index: int; ro: bool): unaRTPDestination; overload; |
Returns destination by index. Acquires it as well. |
![]() |
function destGetAcq(const addrRTP: sockaddr_in; ro: bool): unaRTPDestination; overload; |
Returns destination by RTP address. Acquires it as well. |
![]() |
function destGetCount(): int; |
Returns number of destinations. |
![]() |
function destHas(const addr: sockaddr_in): bool; |
Checks if specified dest was already added. ReturnsTrue if dest already exsits |
![]() |
function open(waitForThreadsToStart: bool = true): bool; |
Opens transmitter. |
![]() |
function retransmit(data: pointer; len: uint; updateWeSent: bool = true; isRTCP: bool = false): int; |
Re-transmits data to all destinations. Assumes data is already points to RTP header, or is pure payload in RAW mode. |
![]() |
function sendTo(addr: PSockAddrIn; data: pointer; len: uint; isRTCP: bool; ownPacket: bool = true): int; |
Sends data to specified destination. Returns 0 if all data was send successfully, or WinSock error otherwise. |
![]() |
function transmit(samplesDelta: uint; data: pointer; len: uint; marker: bool = false; tpayload: int = -1; addr: PSockAddrIn = nil; prebufData: pointer = nil; prebufDataLen: uint = 0; updateWeSent: bool = true): int; |
Transmits data over RTP. Adds RTP header if required.
Parameters
Returnsnumber of bytes actually sent to network |
![]() |
function doOpen(waitForThreadsToStart: bool = true): bool; virtual; |
![]() |
function okAddDest(destRTP, destRTCP: PSockAddrIn; fromHole: bool): bool; virtual; |
Called just before adding a new destination. Fires onAddDest if assigned, otherwise always return True Override for different behaviour
Parameters
ReturnsTrue if it is OK to add this destination |
![]() |
procedure BeforeDestruction(); override; |
Releases destinations and other resources. |
![]() |
procedure close(clearAllDest: bool = false); |
Closes transmitter. |
![]() |
procedure destEnable(index: int; doEnable: bool); overload; |
Temporarely enables/disables streaming to specified destination. |
![]() |
procedure destEnable(const uri: string; doEnable: bool); overload; |
Temporarely enables/disables streaming to specified destination. |
![]() |
procedure destRemove(const addrRTP: sockaddr_in); overload; |
Removes destination. |
![]() |
procedure destRemove(const uri: string); overload; |
Removes destination. |
![]() |
procedure destRemove(index: int); overload; |
Removes destination. |
![]() |
procedure destRemove(dest: unaRTPDestination); overload; |
Removes destination. |
![]() |
procedure setNewSSRC(newssrc: u_int32); |
Not everyday function. |
![]() |
procedure doClose(); virtual; |
![]() |
procedure notifyBye(si: prtp_site_info; soft: bool); virtual; |
Called from context of receiver thread. |
![]() |
procedure onIdle(rtcpIdle: bool); virtual; |
Called from context of idle thread. |
![]() |
procedure onPayload(addr: PSockAddrIn; hdr: prtp_hdr; data: pointer; len, packetSize: uint); virtual; |
![]() |
procedure onRTCPPacket(ssrc: u_int32; addr: PSockAddrIn; hdr: prtcp_common_hdr; packetSize: uint); virtual; |
New RTCP packed was received.
Parameters
|
![]() |
procedure onSsrcCNAME(ssrc: u_int32; cname: prtcp_sdes_item); virtual; |
![]() |
procedure pushRTCPPacket(packet: pointer; len: uint); virtual; |
Transmitter could have own set of destinations, give it a chance to push RTCP data over |
![]() |
property active: bool read getActive write setActive; |
![]() |
property bind2ip: string read f_bind2ip write f_bind2ip; |
![]() |
property bind2port: string read f_bind2port; |
![]() |
property dest[index:int]: unaRTPDestination read getDest; |
Destination |
![]() |
property isRAW: bool read f_isRAW write f_isRAW; |
True if receiver is RAW (no RTP/RTCP will be used). |
![]() |
property isTranslator: bool read f_isTranslator write f_isTranslator; |
![]() |
property onAddDest: unaRTPOnAddDestination read f_onAddDest write f_onAddDest; |
Fired when new destination is about to be added |
![]() |
property paused: bool read f_paused write f_paused; |
When true, no packets are sent |
![]() |
property payload: int read f_payload write setPayload; |
Payload for own transmits. |
![]() |
property receiver: unaRTPReceiver read f_receiver; |
![]() |
property rtcp: unaRTCPstack read getRTCP; |
![]() |
property RTPclockRate: unsigned read f_RTPclockRate write f_RTPclockRate; |
Timestamp clock rate. |
![]() |
property rtpPing: bool read f_rtpPing write f_rtpPing; |
Send CN packets over RTP when not streaming data. Default is true. |
![]() |
property samplingRate: unsigned read f_sr write f_sr; |
Sampling rate of a stream. |
![]() |
property socketError: int read f_socketError; |
![]() |
property ttl: int read f_ttl write f_ttl; |
TTL value |
![]() |
property _SSRC: u_int32 read getSsrc; |
SSRC |
(c) 2012 Lake of Soft