Home Units Hierarchy Routines All identifiers

Class TunaConfRTPclient

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TunaConfRTPclient = class(unavclInOutPipe)

Description

A simple but powerfull RTP conference client.

Hierarchy

Overview

Methods

Public constructor Create(aOwner: tComponent); override;
Public constructor createDummy();
Public destructor Destroy(); override;
Public function connect(const userName, roomName: wString; const srvAddress, srvPort: string): bool; overload;
Public function getConnectStatus(var stat: unaConfClientConnStat; needFullInfo: bool = false): int;
Public function getInStreamSSRC(index: int): u_int32;
Public function getMicVolume(): int;
Public function getPlaybackVolume(): int;
Public function getRemoteName(ssrc: u_int32; out cname: wString): bool;
Public function roomJoin(const roomName: wString): int;
Public function roomLeave(const roomName: wString): int;
Protected function connect(): HRESULT; overload;
Protected function doOpen(): bool; override;
Protected function doRead(data: pointer; len: uint): uint; override;
Protected function doWrite(data: pointer; len: uint; provider: pointer = nil): uint; override;
Protected function getAvailableDataLen(index: integer): uint; override;
Protected function isActive(): bool; override;
Protected function sendClnCmd(const cmd: aString; idata: int32 = 0; data: pointer = nil; len: uint = 0): int;
Public procedure feedOut(data: pointer; len: unsigned; inbuf: unsigned);
Public procedure setEncoding(value: int; sps: int);
Protected procedure disconnect(newConnStatus: int);
Protected procedure doClose(); override;
Protected procedure handlePayload(addr: pSockAddrIn; hdr: prtp_hdr; data: pointer; len: uint); virtual;
Protected procedure handleSrvCmd(userID: u_int32; addr: pSockAddrIn; const cmd: aString; cmdData: punaConfRTPcmd); virtual;
Protected procedure onDecodedData(samples: pointer; size: int; index: int; sps: int); virtual;
Protected procedure onEncodedData(sampleDelta: int; data: pointer; size: int); virtual;
Protected procedure onIdle(rtcpIdle: bool);

Properties

Public property audioSrcIsPCM: boolean read f_audioSrcIsPCM write f_audioSrcIsPCM;
Published property bind2ip: string read f_b2ip write f_b2ip;
Published property bind2port: string read f_b2port write f_b2port;
Public property bw_in: int read f_bwIn;
Public property bw_out: int read f_bwOut;
Public property channelInfo[index:int]: punaConfChannelInfo read getChInfo;
Public property connected: bool read getConnected;
Protected property dsp: unaSpeexDSP read f_dsp;
Public property dsp_aec: bool index 3 read getDSPbool write setDSPbool;
Public property dsp_agc: bool index 1 read getDSPbool write setDSPbool;
Public property dsp_ns: bool index 0 read getDSPbool write setDSPbool;
Public property dsp_vad: bool index 2 read getDSPbool write setDSPbool;
Public property encoding: int read f_encoding;
Public property error: HRESULT read f_error;
Public property errorDataInt: int32 read getEDInt;
Public property frameSize: int32 read f_frameSize write f_frameSize;
Public property lastRoomName: wString read f_lastRoomName;
Public property mixer: unaWaveMixerDevice read f_mixer;
Published property onConnect: evonConnected read f_onConn write f_onConn;
Published property onDisconnect: evonConnected read f_onDisconn write f_onDisconn;
Protected property payload: int read f_payload;
Public property playbackEnabled: bool read f_playbackON write f_playbackON;
Public property playbackLevel: int read f_playbackLevel write f_playbackLevel;
Public property recordingEnabled: bool read f_micON write f_micON;
Public property recordingLevel: int read f_micLevel write f_micLevel;
Public property sps: int read f_sps;
Public property srvCNAME: wString read f_srvCNAME;
Public property srvMasterkey: string write setSrvMasterkey;
Public property srvSSRC: u_int32 read f_srvSSRC;
Public property SSRC: u_int32 read getSSRC write setSSRC;
Public property trans: unaRTPTransmitter read f_trans;
Published property URI: string read f_URI write setURI;
Public property userName: wString read f_userName;

Description

Methods

Public constructor Create(aOwner: tComponent); override;

Creates an RTP Conference client.

Public constructor createDummy();

Creates dummy RTP Conference client (mostly for debug).

Public destructor Destroy(); override;

Destroys RTP Conference client.

Public function connect(const userName, roomName: wString; const srvAddress, srvPort: string): bool; overload;

Connects to server. Constructs URI property and call open().

Parameters
userName
user name.
roomName
room name to join.
srvAddress
server address.
srvPort
server port (UDP).
Returns

True if no error occured.

Public function getConnectStatus(var stat: unaConfClientConnStat; needFullInfo: bool = false): int;

Returns status of client connection.

Public function getInStreamSSRC(index: int): u_int32;

Returns SSRC of remote user.

Returns

SSRC of client with specified index

Public function getMicVolume(): int;
 
Returns

current level of recording signal.

Public function getPlaybackVolume(): int;
 
Returns

current level of played back signal.

Public function getRemoteName(ssrc: u_int32; out cname: wString): bool;

Returns CNAME or remote user.

Returns

CNAME of remote client with specified SSRC

Public function roomJoin(const roomName: wString): int;

Joins another room.

Returns

0 if request was sent successfully.

Public function roomLeave(const roomName: wString): int;

Leaves some room.

Returns

0 if request was sent successfully.

Protected function connect(): HRESULT; overload;

Connects to server.

Protected function doOpen(): bool; override;

Opens/connects the client.

Returns

true if successfull

Protected function doRead(data: pointer; len: uint): uint; override;

Does nothing.

Returns

0

Protected function doWrite(data: pointer; len: uint; provider: pointer = nil): uint; override;

Resamples and passes data to encoder.

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

Does nothing.

Returns

0

Protected function isActive(): bool; override;
 
Returns

True if client is active/connected.

Protected function sendClnCmd(const cmd: aString; idata: int32 = 0; data: pointer = nil; len: uint = 0): int;
 
Returns

0 if successfull

Public 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.

Public procedure setEncoding(value: int; sps: int);

Specifies new sps/encoding to use.

Parameters
value
One of c_rtp_enc_XXXXX
sps
Sampling rate
Protected procedure disconnect(newConnStatus: int);

Disconnect from server.

Protected procedure doClose(); override;

Closes/disconnects the client.

Protected procedure handlePayload(addr: pSockAddrIn; hdr: prtp_hdr; data: pointer; len: uint); virtual;

Handles remote data received over network

Protected procedure handleSrvCmd(userID: u_int32; addr: pSockAddrIn; const cmd: aString; cmdData: punaConfRTPcmd); virtual;

Handles server command

Protected procedure onDecodedData(samples: pointer; size: int; index: int; sps: int); virtual;

Resamples and sends decompressed data to internal mixer.

Protected procedure onEncodedData(sampleDelta: int; data: pointer; size: int); virtual;

Sends data to server. Updates BW.

Protected procedure onIdle(rtcpIdle: bool);

Called from context of idle thread.

Properties

Public property audioSrcIsPCM: boolean read f_audioSrcIsPCM write f_audioSrcIsPCM;

If data is already encoded, set this property to False. Default is True

Published property bind2ip: string read f_b2ip write f_b2ip;

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

Published property bind2port: string read f_b2port write f_b2port;

Bind to this local port (default is 0, means auto-select first available port).

Public property bw_in: int read f_bwIn;

Input bandwidth in bits per second.

Public property bw_out: int read f_bwOut;

Output bandwidth in bits per second.

Public property channelInfo[index:int]: punaConfChannelInfo read getChInfo;

Channel info

Public property connected: bool read getConnected;

True when connection was established.

Protected property dsp: unaSpeexDSP read f_dsp;

Speex DSP object. *internal*

Public property dsp_aec: bool index 3 read getDSPbool write setDSPbool;

SpeexDSP: acoustic echo cancellation ON/OFF

Public property dsp_agc: bool index 1 read getDSPbool write setDSPbool;

SpeexDSP: auto-gain control ON/OFF

Public property dsp_ns: bool index 0 read getDSPbool write setDSPbool;

SpeexDSP: noise suppression ON/OFF

Public property dsp_vad: bool index 2 read getDSPbool write setDSPbool;

SpeexDSP: voice activity detection ON/OFF

Public property encoding: int read f_encoding;

Encoding type. Must be one of supported c_rtp_enc_XXXX.

Public property error: HRESULT read f_error;

Last error code.

Public property errorDataInt: int32 read getEDInt;

Additional error data.

Public property frameSize: int32 read f_frameSize write f_frameSize;

If audioSrcIsPCM is False, this property should specify frame size in samples.

Public property lastRoomName: wString read f_lastRoomName;

Last room name client was joining.

Public property mixer: unaWaveMixerDevice read f_mixer;

Mixer object *use as read-only*

Published property onConnect: evonConnected read f_onConn write f_onConn;

Fired when client is connected.

Published property onDisconnect: evonConnected read f_onDisconn write f_onDisconn;

Fired when client is disconnected.

Protected property payload: int read f_payload;

Payload type. *internal*

Public property playbackEnabled: bool read f_playbackON write f_playbackON;

Enable/disable playback.

Public property playbackLevel: int read f_playbackLevel write f_playbackLevel;

Modify playback level (from 0 to 100). Default is 100 (no modify).

Public property recordingEnabled: bool read f_micON write f_micON;

Enable/disable recording.

Public property recordingLevel: int read f_micLevel write f_micLevel;

Modify recording level (from 0 to 100). Default is 100 (no modify).

Public property sps: int read f_sps;

Sampling rate. Must be 8000, 16000 or 32000.

Public property srvCNAME: wString read f_srvCNAME;

CNAME of server

Public property srvMasterkey: string write setSrvMasterkey;

Server master key (write-only).

Public property srvSSRC: u_int32 read f_srvSSRC;

SSRC of server

Public property SSRC: u_int32 read getSSRC write setSSRC;

Client's RTP SSRC

Public property trans: unaRTPTransmitter read f_trans;

RTP/RTCP transmitter.

Published property URI: string read f_URI write setURI;

URI, like:

rtp://lake:hackme@servername:8000/room_name

Public property userName: wString read f_userName;

Local user Name.

(c) 2012 Lake of Soft


Generated by PasDoc 0.12.1 on 2012-10-09