Home Units Hierarchy Routines All identifiers

Class unaIPStreamer

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type unaIPStreamer = class(unavclInOutPipe)

Description

Basic IP streamer class. Contains code shared by IPReceiver and IPTransmitter.

Hierarchy

Overview

Methods

Public function sendRTCPApp(subtype: byte; const cmd: aString; data: pointer = nil; len: uint = 0; sendCNAME: bool = false; toAddr: PSockAddrIn = nil): int;
Protected function doGetRTCP(): unaRTCPstack; virtual; abstract;
Protected function doOpen(): bool; override;
Protected function doRead(data: pointer; len: uint): uint; override;
Protected function getAvailableDataLen(index: integer): uint; override;
Protected function getFormatExchangeData(out data: pointer): uint; override;
Protected function isActive(): bool; override;
Public procedure AfterConstruction(); override;
Public procedure BeforeDestruction(); override;
Protected procedure doClose(); override;
Protected procedure needHoles(st: int; const host, portRTP: string; const portRTCP: string = ''); virtual;
Protected procedure onFormatChange(rate, channels, bits, encoding, bitrate: int); virtual;
Protected procedure onIdle(); virtual;
Protected procedure onRTCP(ssrc: u_int32; addr: PSockAddrIn; hdr: prtcp_common_hdr; packetSize: int); virtual;
Protected procedure onRTCPBye(si: prtp_site_info; soft: bool); virtual;
Protected procedure setupSessionParams(); virtual;
Protected procedure setURI(const value: string); virtual;

Properties

Public property bind2ip: string read f_bind2ip write f_bind2ip;
Public property bind2port: string read f_bind2port;
Public property bitrate: int read f_br write f_br;
Published property customPayloadAware: boolean read f_cpa write f_cpa default true;
Public property descriptionError: string read f_descError;
Public property descriptionInfo: string read f_descInfo;
Published property doEncode: boolean read f_encode write f_encode default true;
Published property enableRTCP: boolean read f_enableRTCP write f_enableRTCP default true;
Public property exLib[index:unaKnownLibEnum]: string read getExLib write setExLib;
Protected property frameSize: int read f_frameSize write f_frameSize;
Public property ignoreLocalIPs: boolean read f_ignoreLocalIPs write f_ignoreLocalIPs;
Public property inBandwidth: int read f_bwIn;
Published property isFormatProvider;
Public property mapping: punaRTPMap read getMapping;
Public property mpegTS_aware: boolean read f_mpegTS_aware write f_mpegTS_aware;
Public property mpegTS_enabled: boolean read f_mpegTS_enabled;
Published property mpegTS_PID: TPID read f_mpegTS_PID write f_mpegTS_PID;
Published property onDataAvailable;
Published property onFormatChangeAfter;
Published property onFormatChangeBefore;
Published property onRTCPApp: unavcIPStreamOnRTCPApp read f_onRTCPApp write f_onRTCPApp;
Public property outBandwidth: int read f_bwOut;
Public property protocol: int read f_protocol;
Public property rtcp: unaRTCPstack read doGetRTCP;
Published property rtcpTimeoutReports: int32 read getTR write setTR default 6;
Public property SDP: string read f_SDP write setSDP;
Public property SDPignorePort: boolean read f_SDPignoreP write f_SDPignoreP;
Public property socketType: int read f_socketType;
Protected property STUNPort: string read f_STUNPort;
Protected property STUNserver: string read f_STUNserver write setSTUNserver;
Public property swapRAWbytes: boolean read f_swrb write f_swrb;
Public property TTL: int read f_ttl write f_ttl;
Protected property URI: string read f_URI write setURI;
Public property uriHost: string read f_URIHost;
Public property uriPort: string read f_URIPort;
Public property URIuserName: string read f_URIuserName write f_URIuserName;
Public property URIuserPass: string read f_URIuserPass write f_URIuserPass;
Public property _SSRC: u_int32 read f_ssrc write f_ssrc;

Description

Methods

Public function sendRTCPApp(subtype: byte; const cmd: aString; data: pointer = nil; len: uint = 0; sendCNAME: bool = false; toAddr: PSockAddrIn = nil): int;

Sends RTCP APP packet to remote side.

Parameters
subtype
command subtype, any integer from 0 to 255
cmd
APP command, any 4 ansi characters
data
optional data to send
len
optional data length (must be aligned to 32-bit)
sendCNAME
if True will send CNAME in same packet
toAddr
Send to this address only
Returns

0 if data was sent successfully, or specific WSA error otherwise.

Protected function doGetRTCP(): unaRTCPstack; virtual; abstract;
 
Protected function doOpen(): bool; override;
 
Protected function doRead(data: pointer; len: uint): uint; override;

Reads data from the pipe.

Protected function getAvailableDataLen(index: integer): uint; override;

Returns data size available in the pipe (bytes).

Protected function getFormatExchangeData(out data: pointer): uint; override;
 
Protected function isActive(): bool; override;

Returns component's active state.

Returns

True if component was activated succesfully.

Public procedure AfterConstruction(); override;

Sets initial properties values for streamer

Public procedure BeforeDestruction(); override;

Releases memory buffers, SDP parser and idle thread

Protected procedure doClose(); override;
 
Protected procedure needHoles(st: int; const host, portRTP: string; const portRTCP: string = ''); virtual;

Makes holes in NAT.

Parameters
st
remote socket type, refer c_ips_socket_XXX for valid values.
host
remote host
portRTP
remote RTP port
portRTCP
remote RTCP port. If not specified (default), RTP port + 1 will be used
Protected procedure onFormatChange(rate, channels, bits, encoding, bitrate: int); virtual;
 
Protected procedure onIdle(); virtual;

Got idle, do something useful.

Updates In/Out bandwidth.

Protected procedure onRTCP(ssrc: u_int32; addr: PSockAddrIn; hdr: prtcp_common_hdr; packetSize: int); virtual;

Got new RTCP packet.

Protected procedure onRTCPBye(si: prtp_site_info; soft: bool); virtual;

Some of destinations got BYE or timedout

Protected procedure setupSessionParams(); virtual;

Assigns RTCP parameters (like timeouts, etc). Override if additional RTCP configuration is needed.

Protected procedure setURI(const value: string); virtual;

Parses URI and assigns required properties.

Parameters
value
URI to parse

Properties

Public property bind2ip: string read f_bind2ip write f_bind2ip;

Bind internal socket to this IP. Default is '0.0.0.0', means bind to all.

Public property bind2port: string read f_bind2port;

Bind internal socket to this locat port. Default is '0', means use first available port.

2012.05.01: made read-only, use SDP to assign non-zero port

Public property bitrate: int read f_br write f_br;

Specifies bitrate to be used with encodings aware it.

Published property customPayloadAware: boolean read f_cpa write f_cpa default true;

When true the component will analyze custom payloads (such as c_ips_payload_speexNB and other) and initialize accordingly. Default is true.

Public property descriptionError: string read f_descError;

Stream error message (mostly for debugging).

Public property descriptionInfo: string read f_descInfo;

Stream description (usually received from remote side).

Published property doEncode: boolean read f_encode write f_encode default true;

Try to decode/encode supported payloads. Default is True.

Published property enableRTCP: boolean read f_enableRTCP write f_enableRTCP default true;

When true the component will use RTCP when applicable (for RTP streaming). Default is true.

Public property exLib[index:unaKnownLibEnum]: string read getExLib write setExLib;

External library name.

Protected property frameSize: int read f_frameSize write f_frameSize;

Internal, do not use.

Public property ignoreLocalIPs: boolean read f_ignoreLocalIPs write f_ignoreLocalIPs;

Do not treat local IPs as special case. This allows debugging IPTransmitter and IPReceiver on same machine.

Public property inBandwidth: int read f_bwIn;

Input bandwidth.

Published property isFormatProvider;
 
Public property mapping: punaRTPMap read getMapping;

RTP mapping used for dynamic payload.

Public property mpegTS_aware: boolean read f_mpegTS_aware write f_mpegTS_aware;

If True (default) - Reveiver: checks if payload is encapsulated in MPEG-TS stream and decode audio specifed by mpegTS_PID. Transmitter: encapsulate audio into MPEG-TS (not implemented yet).

Applies to RAW and RTP MP2T payloads only.

Public property mpegTS_enabled: boolean read f_mpegTS_enabled;

True (default) if MPEG TS streaming is anabled

Applies to RAW and RTP MP2T payloads only.

Published property mpegTS_PID: TPID read f_mpegTS_PID write f_mpegTS_PID;

MPEG TS PID to use.

Published property onDataAvailable;
 
Published property onFormatChangeAfter;
 
Published property onFormatChangeBefore;
 
Published property onRTCPApp: unavcIPStreamOnRTCPApp read f_onRTCPApp write f_onRTCPApp;
 
Public property outBandwidth: int read f_bwOut;

Output bandwidth.

Public property protocol: int read f_protocol;

Protocol to be used by streamer. See c_ips_protocol_XXX for valid values.

Public property rtcp: unaRTCPstack read doGetRTCP;

RTCP stack. Could be nil.

Published property rtcpTimeoutReports: int32 read getTR write setTR default 6;

RTCP stack timeout. Set to 0 to disable. Default is 6.

Public property SDP: string read f_SDP write setSDP;

Specifies additional parameters of audio stream.

Public property SDPignorePort: boolean read f_SDPignoreP write f_SDPignoreP;

Specifies whether port number from SDP will be ignored. Default is true.

Public property socketType: int read f_socketType;

Socket type to be used by streamer. See c_ips_socket_XXX for valid values.

Protected property STUNPort: string read f_STUNPort;

Read-ony, set STUNServer to change it

Protected property STUNserver: string read f_STUNserver write setSTUNserver;

STUN is needed for RTSP client, for example

Public property swapRAWbytes: boolean read f_swrb write f_swrb;

Swap bytes in 16bit words after receiving them from network before passing to consumer. Swap bytes in 16bit words before transmitting them into network.

Applies for RAW protocol and uncompressed encodings only. Default is False.

Public property TTL: int read f_ttl write f_ttl;

TTL for multicast.

Protected property URI: string read f_URI write setURI;
 
Public property uriHost: string read f_URIHost;

Host name provided in URI. (In case of multicast - this is multicast group address).

Public property uriPort: string read f_URIPort;

Port number provided in URI.

Public property URIuserName: string read f_URIuserName write f_URIuserName;

User name (used as SDES in RTCP)

Public property URIuserPass: string read f_URIuserPass write f_URIuserPass;

User password

Public property _SSRC: u_int32 read f_ssrc write f_ssrc;

SSRC

(c) 2012 Lake of Soft


Generated by PasDoc 0.12.1 on 2012-10-09