Description | Hierarchy | Fields | Methods | Properties |
type TunaConfRTPclient = class(unavclInOutPipe)
A simple but powerfull RTP conference client.
constructor Create(aOwner: tComponent); override; |
|
constructor createDummy(); |
|
destructor Destroy(); override; |
|
function connect(const userName, roomName: wString; const srvAddress, srvPort: string): bool; overload; |
|
function getConnectStatus(var stat: unaConfClientConnStat; needFullInfo: bool = false): int; |
|
function getInStreamSSRC(index: int): u_int32; |
|
function getMicVolume(): int; |
|
function getPlaybackVolume(): int; |
|
function getRemoteName(ssrc: u_int32; out cname: wString): bool; |
|
function roomJoin(const roomName: wString): int; |
|
function roomLeave(const roomName: wString): int; |
|
function connect(): HRESULT; overload; |
|
function doOpen(): bool; override; |
|
function doRead(data: pointer; len: uint): uint; override; |
|
function doWrite(data: pointer; len: uint; provider: pointer = nil): uint; override; |
|
function getAvailableDataLen(index: integer): uint; override; |
|
function isActive(): bool; override; |
|
function sendClnCmd(const cmd: aString; idata: int32 = 0; data: pointer = nil; len: uint = 0): int; |
|
procedure feedOut(data: pointer; len: unsigned; inbuf: unsigned); |
|
procedure setEncoding(value: int; sps: int); |
|
procedure disconnect(newConnStatus: int); |
|
procedure doClose(); override; |
|
procedure handlePayload(addr: pSockAddrIn; hdr: prtp_hdr; data: pointer; len: uint); virtual; |
|
procedure handleSrvCmd(userID: u_int32; addr: pSockAddrIn; const cmd: aString; cmdData: punaConfRTPcmd); virtual; |
|
procedure onDecodedData(samples: pointer; size: int; index: int; sps: int); virtual; |
|
procedure onEncodedData(sampleDelta: int; data: pointer; size: int); virtual; |
|
procedure onIdle(rtcpIdle: bool); |
property audioSrcIsPCM: boolean read f_audioSrcIsPCM write f_audioSrcIsPCM; |
|
property bind2ip: string read f_b2ip write f_b2ip; |
|
property bind2port: string read f_b2port write f_b2port; |
|
property bw_in: int read f_bwIn; |
|
property bw_out: int read f_bwOut; |
|
property channelInfo[index:int]: punaConfChannelInfo read getChInfo; |
|
property connected: bool read getConnected; |
|
property dsp: unaSpeexDSP read f_dsp; |
|
property dsp_aec: bool index 3 read getDSPbool write setDSPbool; |
|
property dsp_agc: bool index 1 read getDSPbool write setDSPbool; |
|
property dsp_ns: bool index 0 read getDSPbool write setDSPbool; |
|
property dsp_vad: bool index 2 read getDSPbool write setDSPbool; |
|
property encoding: int read f_encoding; |
|
property error: HRESULT read f_error; |
|
property errorDataInt: int32 read getEDInt; |
|
property frameSize: int32 read f_frameSize write f_frameSize; |
|
property lastRoomName: wString read f_lastRoomName; |
|
property mixer: unaWaveMixerDevice read f_mixer; |
|
property onConnect: evonConnected read f_onConn write f_onConn; |
|
property onDisconnect: evonConnected read f_onDisconn write f_onDisconn; |
|
property payload: int read f_payload; |
|
property playbackEnabled: bool read f_playbackON write f_playbackON; |
|
property playbackLevel: int read f_playbackLevel write f_playbackLevel; |
|
property recordingEnabled: bool read f_micON write f_micON; |
|
property recordingLevel: int read f_micLevel write f_micLevel; |
|
property sps: int read f_sps; |
|
property srvCNAME: wString read f_srvCNAME; |
|
property srvMasterkey: string write setSrvMasterkey; |
|
property srvSSRC: u_int32 read f_srvSSRC; |
|
property SSRC: u_int32 read getSSRC write setSSRC; |
|
property trans: unaRTPTransmitter read f_trans; |
|
property URI: string read f_URI write setURI; |
|
property userName: wString read f_userName; |
constructor Create(aOwner: tComponent); override; |
|
Creates an RTP Conference client. |
constructor createDummy(); |
|
Creates dummy RTP Conference client (mostly for debug). |
destructor Destroy(); override; |
|
Destroys RTP Conference client. |
function connect(const userName, roomName: wString; const srvAddress, srvPort: string): bool; overload; |
|
Connects to server. Constructs URI property and call open().
Parameters
ReturnsTrue if no error occured. |
function getConnectStatus(var stat: unaConfClientConnStat; needFullInfo: bool = false): int; |
|
Returns status of client connection. |
function getInStreamSSRC(index: int): u_int32; |
|
Returns SSRC of remote user. ReturnsSSRC of client with specified index |
function getMicVolume(): int; |
|
Returnscurrent level of recording signal. |
function getPlaybackVolume(): int; |
|
Returnscurrent level of played back signal. |
function getRemoteName(ssrc: u_int32; out cname: wString): bool; |
|
Returns CNAME or remote user. ReturnsCNAME of remote client with specified SSRC |
function roomJoin(const roomName: wString): int; |
|
Joins another room. Returns0 if request was sent successfully. |
function roomLeave(const roomName: wString): int; |
|
Leaves some room. Returns0 if request was sent successfully. |
function connect(): HRESULT; overload; |
|
Connects to server. |
function doOpen(): bool; override; |
|
Opens/connects the client. Returnstrue if successfull |
function doRead(data: pointer; len: uint): uint; override; |
|
Does nothing. Returns0 |
function doWrite(data: pointer; len: uint; provider: pointer = nil): uint; override; |
|
Resamples and passes data to encoder. |
function getAvailableDataLen(index: integer): uint; override; |
|
Does nothing. Returns0 |
function isActive(): bool; override; |
|
ReturnsTrue if client is active/connected. |
function sendClnCmd(const cmd: aString; idata: int32 = 0; data: pointer = nil; len: uint = 0): int; |
|
Returns0 if successfull |
procedure feedOut(data: pointer; len: unsigned; inbuf: unsigned); |
|
Must be called right after new audio chunk was released from WaveOut queue. NOTE: This is needed mostly for Speex AEC module to work. |
procedure setEncoding(value: int; sps: int); |
|
Specifies new sps/encoding to use.
Parameters
|
procedure disconnect(newConnStatus: int); |
|
Disconnect from server. |
procedure doClose(); override; |
|
Closes/disconnects the client. |
procedure handlePayload(addr: pSockAddrIn; hdr: prtp_hdr; data: pointer; len: uint); virtual; |
|
Handles remote data received over network |
procedure handleSrvCmd(userID: u_int32; addr: pSockAddrIn; const cmd: aString; cmdData: punaConfRTPcmd); virtual; |
|
Handles server command |
procedure onDecodedData(samples: pointer; size: int; index: int; sps: int); virtual; |
|
Resamples and sends decompressed data to internal mixer. |
procedure onEncodedData(sampleDelta: int; data: pointer; size: int); virtual; |
|
Sends data to server. Updates BW. |
procedure onIdle(rtcpIdle: bool); |
|
Called from context of idle thread. |
property audioSrcIsPCM: boolean read f_audioSrcIsPCM write f_audioSrcIsPCM; |
|
If data is already encoded, set this property to False. Default is True |
property bind2ip: string read f_b2ip write f_b2ip; |
|
Bind to this interface (default is 0.0.0.0, means bind to all interfaces). |
property bind2port: string read f_b2port write f_b2port; |
|
Bind to this local port (default is 0, means auto-select first available port). |
property bw_in: int read f_bwIn; |
|
Input bandwidth in bits per second. |
property bw_out: int read f_bwOut; |
|
Output bandwidth in bits per second. |
property channelInfo[index:int]: punaConfChannelInfo read getChInfo; |
|
Channel info |
property connected: bool read getConnected; |
|
True when connection was established. |
property dsp: unaSpeexDSP read f_dsp; |
|
Speex DSP object. *internal* |
property dsp_aec: bool index 3 read getDSPbool write setDSPbool; |
|
SpeexDSP: acoustic echo cancellation ON/OFF |
property dsp_agc: bool index 1 read getDSPbool write setDSPbool; |
|
SpeexDSP: auto-gain control ON/OFF |
property dsp_ns: bool index 0 read getDSPbool write setDSPbool; |
|
SpeexDSP: noise suppression ON/OFF |
property dsp_vad: bool index 2 read getDSPbool write setDSPbool; |
|
SpeexDSP: voice activity detection ON/OFF |
property encoding: int read f_encoding; |
|
Encoding type. Must be one of supported c_rtp_enc_XXXX. |
property error: HRESULT read f_error; |
|
Last error code. |
property errorDataInt: int32 read getEDInt; |
|
Additional error data. |
property frameSize: int32 read f_frameSize write f_frameSize; |
|
If audioSrcIsPCM is False, this property should specify frame size in samples. |
property lastRoomName: wString read f_lastRoomName; |
|
Last room name client was joining. |
property mixer: unaWaveMixerDevice read f_mixer; |
|
Mixer object *use as read-only* |
property onConnect: evonConnected read f_onConn write f_onConn; |
|
Fired when client is connected. |
property onDisconnect: evonConnected read f_onDisconn write f_onDisconn; |
|
Fired when client is disconnected. |
property payload: int read f_payload; |
|
Payload type. *internal* |
property playbackEnabled: bool read f_playbackON write f_playbackON; |
|
Enable/disable playback. |
property playbackLevel: int read f_playbackLevel write f_playbackLevel; |
|
Modify playback level (from 0 to 100). Default is 100 (no modify). |
property recordingEnabled: bool read f_micON write f_micON; |
|
Enable/disable recording. |
property recordingLevel: int read f_micLevel write f_micLevel; |
|
Modify recording level (from 0 to 100). Default is 100 (no modify). |
property sps: int read f_sps; |
|
Sampling rate. Must be 8000, 16000 or 32000. |
property srvCNAME: wString read f_srvCNAME; |
|
CNAME of server |
property srvMasterkey: string write setSrvMasterkey; |
|
Server master key (write-only). |
property srvSSRC: u_int32 read f_srvSSRC; |
|
SSRC of server |
property SSRC: u_int32 read getSSRC write setSSRC; |
|
Client's RTP SSRC |
property trans: unaRTPTransmitter read f_trans; |
|
RTP/RTCP transmitter. |
property URI: string read f_URI write setURI; |
|
URI, like: |
property userName: wString read f_userName; |
|
Local user Name. |
(c) 2012 Lake of Soft