Home Units Hierarchy Routines All identifiers

Class TunaIPTransmitter

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TunaIPTransmitter = class(unaIPStreamer)

Description

Basic IP transmitting class.

Hierarchy

Overview

Methods

Public function destAdd(dstatic: bool; const URI: string; enabled: bool = true; const session: string = ''; recSSRC: uint32 = 0; ttl: int = -1): int;
Public function destEnable(const URI: string; const session: string = ''; doEnable: bool = true): bool; overload;
Public function destEnable(index: int; doEnable: bool = true): bool; overload;
Public function destRemove(index: int): bool; overload;
Public function destRemove(const URI: string; const session: string = ''): bool; overload;
Public function sendText(const text: wString): HRESULT;
Protected function doGetRTCP(): unaRTCPstack; override;
Protected function doOpen(): bool; override;
Protected function doWrite(_data: pointer; _len: uint; provider: pointer = nil): uint; override;
Protected function ExTransCmd(cmd: int32; var data: string; udata: uint32 = 0): HRESULT; virtual;
Protected function hasSession(const session: string): bool;
Protected function sessionAcqByDestURI(const destURI: string; ro: bool = true): unaIPTransRTSPSession;
Protected function sessionAcqByIndex(index: int; ro: bool = true): unaIPTransRTSPSession;
Protected function sessionAcqBySession(const session: string; ro: bool = true): unaIPTransRTSPSession;
Public procedure AfterConstruction(); override;
Public procedure BeforeDestruction(); override;
Protected procedure doClose(); override;
Protected procedure onDataEncoded(sampleDelta: uint; _data: pointer; _len: int; provider: pointer = nil; marker: bool = false; tpayload: int = -1); virtual;
Protected procedure onFormatChange(rate, channels, bits, encoding, bitrate: int); override;
Protected procedure onIdle(); override;
Protected procedure onPayload(addr: PSockAddrIn; hdr: prtp_hdr; data: pointer; len, packetSize: uint); virtual;
Protected procedure onRTCPBye(si: prtp_site_info; soft: bool); override;
Protected procedure RTSPSrvReqest(reqInt: int; const fromIP: string; request: unaRTSPServerParser; var headers, body, msg: string; var respcode: int); virtual;
Protected procedure setupSessionParams(); override;
Protected procedure setURI(const value: string); override;

Properties

Public property autoAddDestFromHolePacket: bool read f_autoAddDestFromHolePacket write f_autoAddDestFromHolePacket;
Published property bitrate;
Public property destCount: int read getDestCount;
Public property frameSize;
Published property onAfterEncodeWrite: unavcIPDataWrite read f_onAfterEncodeWrite write f_onAfterEncodeWrite;
Published property onBeforeEncodeWrite: unavcIPDataWrite read f_onBeforeEncodeWrite write f_onBeforeEncodeWrite;
Published property onExTransCmd: unavcIPTransmitterExTransCmd read f_onExTransCmd write f_onExTransCmd;
Public property srvRTSP: unaRTSPServer read f_transRTSP;
Public property srvSHOUT: unaSHOUTtransmitter read f_transSHOUT;
Public property transRoot: unaRTPTransmitter read f_transRTP_root;
Published property URI;

Description

Methods

Public function destAdd(dstatic: bool; const URI: string; enabled: bool = true; const session: string = ''; recSSRC: uint32 = 0; ttl: int = -1): int;

Adds new destination/session for transmitter.

Parameters
dstatic
True if destination is static (permanent)
URI
destination address
enabled
True if destination should be enabled
session
RTSP session assosiated with this dest (optional)
recSSRC
receiver SSRC for this RTSP session (optional)
ttl
TTL for multicast destination
Returns

destination index

Public function destEnable(const URI: string; const session: string = ''; doEnable: bool = true): bool; overload;

Enables or disables streaming to specified destination.

Parameters
URI
destination URI
session
RTSP session (optional)
doEnable
enable or disable streaming
Returns

True if successfull

Public function destEnable(index: int; doEnable: bool = true): bool; overload;

Enables or disables streaming to specified destination.

Parameters
index
destination index
doEnable
enable or disable streaming
Returns

True if successfull

Public function destRemove(index: int): bool; overload;

Removes destination.

Parameters
URI
destination URI
session
RTSP session (optional)
Returns

True if successfull

Public function destRemove(const URI: string; const session: string = ''): bool; overload;

Removes destination.

Parameters
URI
destination URI
session
RTSP session (optional)
Returns

True if successfull

Public function sendText(const text: wString): HRESULT;

Sends text to remote side.

Protected function doGetRTCP(): unaRTCPstack; override;

Returns RTCP stack object.

Protected function doOpen(): bool; override;
 
Protected function doWrite(_data: pointer; _len: uint; provider: pointer = nil): uint; override;

Writes data into transmitter.

Protected function ExTransCmd(cmd: int32; var data: string; udata: uint32 = 0): HRESULT; virtual;

Prepares transmitter for streaming

Protected function hasSession(const session: string): bool;
 
Returns

True if this transmitter has specified session

Protected function sessionAcqByDestURI(const destURI: string; ro: bool = true): unaIPTransRTSPSession;

Acquires session object by destination URI

Protected function sessionAcqByIndex(index: int; ro: bool = true): unaIPTransRTSPSession;

Acquires session object by session name

Protected function sessionAcqBySession(const session: string; ro: bool = true): unaIPTransRTSPSession;

Acquires session object by session name

Public procedure AfterConstruction(); override;

Creates transmitter and assigns unaRTPTransmitter as transmitter class

Public procedure BeforeDestruction(); override;

Disposes various transmitters and encoders.

Protected procedure doClose(); override;
 
Protected procedure onDataEncoded(sampleDelta: uint; _data: pointer; _len: int; provider: pointer = nil; marker: bool = false; tpayload: int = -1); virtual;
 
Protected procedure onFormatChange(rate, channels, bits, encoding, bitrate: int); override;
 
Protected procedure onIdle(); override;
 
Protected procedure onPayload(addr: PSockAddrIn; hdr: prtp_hdr; data: pointer; len, packetSize: uint); virtual;

Transmitter can also receive data in some cases.

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

Some of destinations got BYE or timedout

Protected procedure RTSPSrvReqest(reqInt: int; const fromIP: string; request: unaRTSPServerParser; var headers, body, msg: string; var respcode: int); virtual;

Handle RTSP Server request

Protected procedure setupSessionParams(); override;

Sets user name, SSRC, session destinations.

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

Assigns unicast bind2ip/bind2port.

Properties

Public property autoAddDestFromHolePacket: bool read f_autoAddDestFromHolePacket write f_autoAddDestFromHolePacket;

Automatically add destinations gathered from RTP "hole" packets. Default is True

Published property bitrate;

Bitrate for codecs that support it (like MPEG Audio codec)

Public property destCount: int read getDestCount;

Number of sessions/destinations

Public property frameSize;

Frame size (in samples) for transmitter. Usually used when doEncode is false.

Published property onAfterEncodeWrite: unavcIPDataWrite read f_onAfterEncodeWrite write f_onAfterEncodeWrite;

Fired when data is encoded and is about to be passed to network

Published property onBeforeEncodeWrite: unavcIPDataWrite read f_onBeforeEncodeWrite write f_onBeforeEncodeWrite;

Fired before data received from provider is about to be passed to encoders

Published property onExTransCmd: unavcIPTransmitterExTransCmd read f_onExTransCmd write f_onExTransCmd;

Fired when RTSP server needs some action on exteranl RTP Transmitters.

Public property srvRTSP: unaRTSPServer read f_transRTSP;

Internal RTSP server

Public property srvSHOUT: unaSHOUTtransmitter read f_transSHOUT;

Internal SHOUTcast stream "pusher"

Public property transRoot: unaRTPTransmitter read f_transRTP_root;

Low-level "root" RTP transmitter. May be nil.

Published property URI;

Transmitter network options. Possible values:

——– RAW ——–

udp://0.0.0.0:7654 - RAW unicast stream (set SDP to specify stream format) 0.0.0.0 - bind to this IP 7654 - bind to this Port

udp://224.0.1.2:7654 - RAW multicast stream (set SDP to specify stream format) 224.0.1.2 - join this multicast group 7654 - use this port

——– RTP ——–

rtp://username@0.0.0.0:1254 - RTP unicast stream (may need additional SDP in case of dynamic payload) username - assign this user name (optional) 0.0.0.0 - bind to this IP 1254 - bind to this port

rtp://username@192.168.0.200:1254 - RTP unicast stream (may need additional SDP in case of dynamic payload) username - assign this user name (optional) 192.168.0.200 - "push" RTP stream to this destination 1254 - destination port port

rtp://username@224.0.1.2:1254 - RTP multicast stream (may need additional SDP in case of dynamic payload) username - assign this user name (optional) 224.0.1.2 - join this multicast group 1254 - use this port

——– RTSP ——–

rtsp://username@0.0.0.0:15000 - RTSP server username - assign this user name to internal RTP transmitter (optional) 0.0.0.0 - bind to this IP 15000 - use this port

——– SHOUTcast ——–

http://source:hackme@192.168.0.174:8000/stream_name - streams audio to IceCast/DNAS server source – user/source name hackme – password 192.168.0.174 – server IP/name 8000 – port stream_name – name of stream

(c) 2012 Lake of Soft


Generated by PasDoc 0.12.1 on 2012-10-09