TSDuck v3.46-4819
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::SRTArgs Class Reference

Secure Reliable Transport (SRT) socket options. More...

#include <tsSRTArgs.h>

Collaboration diagram for ts::SRTArgs:

Public Member Functions

 SRTArgs ()=default
 Constructor.
 
void defineArgs (Args &args)
 Add command line option definitions in an Args.
 
bool loadArgs (DuckContext &duck, Args &args)
 Load arguments from command line.
 
void reset ()
 Reset to default values.
 
bool setAddresses (Report &report, const IPSocketAddress &listener, const IPSocketAddress &caller, const IPAddress &local=IPAddress())
 Preset local and remote socket addresses in string form.
 
bool setMinVersion (Report &report, const UString &version)
 Set the minimum version field from a "x.y.z" string.
 
bool setURL (Report &report, const URL &url)
 Set options from an srt: URL.
 
bool setURL (Report &report, const UString &url)
 Set options from an srt: URL.
 

Static Public Member Functions

static bool IsSRTURL (const URL &url)
 Check if an URL is a possible srt: URL.
 
static bool IsSRTURL (const UString &url)
 Check if a string is a possible srt: URL.
 

Public Attributes

int backlog = 1
 Max waiting incoming client in listener mode.
 
UString congestion {}
 Congestion controller, "live", "file" (SRTO_CONGESTION, v1.3.0).
 
cn::milliseconds connection_timeout {-1}
 Connection timeout (SRTO_CONNTIMEO, v1.1.2).
 
int32_t crypto_mode = -1
 Encryption mode, 0=negotiate, 1=AES-CTR, 2=AES-GCM (SRTO_CRYPTOMODE, v1.5.2)
 
std::optional< bool > drift_tracer {}
 Enables or disables time drift tracer (SRTO_DRIFTTRACER, v1.4.2).
 
std::optional< bool > enforce_encryption {}
 Enforce same encryption (SRTO_ENFORCEDENCRYPTION, v1.3.2).
 
int32_t fc_packets = -1
 Flow Control, limit max packets "in flight" (SRTO_FC).
 
bool final_stats = false
 Report SRT usage statistics when the SRT socket is closed.
 
int32_t group_connect = -1
 Listener accept group connection, 0 or 1 (SRTO_GROUPCONNECT, v1.5.0).
 
cn::milliseconds groupminstabletimeo {-1}
 Group minimum stability timeout (SRTO_GROUPMINSTABLETIMEO, v1.5.0).
 
int64_t input_bw = -1
 Maximum input bandwidth (SRTO_INPUTBW, v1.0.5).
 
int32_t iptos = -1
 IPv4 Type of Service (SRTO_IPTOS, v1.0.5).
 
int32_t ipttl = -1
 IPv4 Time To Live (SRTO_IPTTL, v1.0.5).
 
int32_t ipv6_only = -2
 -1=system default, 0=IPv4 and v6, 1=IPv6 only (SRTO_IPV6ONLY, v1.4.0).
 
bool json_line = false
 Report statistics in JSON format on one line.
 
UString json_prefix {}
 Noticeable prefix on JSON statistics lines.
 
int32_t kmpreannounce = -1
 Interval in packets between new SEK and SEK switch (SRTO_KMPREANNOUNCE, v1.3.2).
 
int32_t kmrefreshrate = -1
 Interval in packets between SEK (SRTO_KMREFRESHRATE, 1.3.2).
 
cn::milliseconds latency {-1}
 Configured latency, set both SRTO_RCVLATENCY and SRTO_PEERLATENCY (SRTO_LATENCY, v1.0.2).
 
::linger linger_opt {0, 0}
 Linger time on close (SRTO_LINGER).
 
bool live_mode = true
 Live transmission type, not file (SRTO_TRANSTYPE, v1.3.0).
 
IPSocketAddress local_address {}
 Local socket address (any mode).
 
int32_t lossmaxttl = -1
 Value (in packets) up to which the Reorder Tolerance may grow (SRTO_LOSSMAXTTL, v1.2.0).
 
int64_t max_bw = -2
 Maximum send bandwidth, -1 means infinite (SRTO_MAXBW, v1.0.5).
 
int64_t max_rexmit_bw = -2
 Maximum bandwidth for retransmission, -1 means infinite (SRTO_MAXREXMITBW, v1.5.3).
 
std::optional< bool > message_api {}
 Use message API, not buffer API (SRTO_MESSAGEAPI, v1.3.0).
 
int64_t min_input_bw = -1
 Minimum allowed input bandwidth (SRTO_MININPUTBW, v1.4.3).
 
int32_t min_version = -1
 Minimum SRT version that is required from the peer (SRTO_MINVERSION, v1.3.0).
 
SRTSocketMode mode = SRTSocketMode::DEFAULT
 SRT socket mode (SRTO_RENDEZVOUS, SRTO_SENDER, v1.0.4).
 
int32_t mss = -1
 Maximum Segment Size (SRTO_MSS).
 
std::optional< bool > nakreport {}
 Periodically send NAK reports for missed packets (SRTO_NAKREPORT, v1.1.0).
 
int32_t ohead_bw = -1
 Recovery bandwidth overhead above input rate, in percent (SRTO_OHEADBW, v1.0.5).
 
UString packet_filter {}
 Packet filter string (SRTO_PACKETFILTER, v1.4.0).
 
UString passphrase {}
 Passphrase for encryption (SRTO_PASSPHRASE).
 
int32_t payload_size = -1
 Maximum size of a single send in Live mode (SRTO_PAYLOADSIZE, v1.3.0).
 
int32_t pbkeylen = -1
 Sender encryption key length, in bytes, 0=default, 16, 24, 32 (SRTO_PBKEYLEN).
 
cn::milliseconds peer_idle_timeout {-1}
 Max time to wait until another packet is received (SRTO_PEERIDLETIMEO, v1.3.3).
 
cn::milliseconds peer_latency {-1}
 Latency provided by sender as min value for the receiver (SRTO_PEERLATENCY, v1.3.0).
 
cn::milliseconds rcv_latency {-1}
 Latency value in the receiving direction of the socket (SRTO_RCVLATENCY, v1.3.0).
 
int32_t rcvbuf = -1
 Receive Buffer Size, in bytes (SRTO_RCVBUF).
 
IPSocketAddress remote_address {}
 Remote socket address (caller or rendezvous mode).
 
int32_t retransmit_algo = -1
 Choose between retransmission algorithms (SRTO_RETRANSMITALGO, v1.4.2).
 
bool reuse_port = true
 Reuse UDP port in listener mode (SRTO_REUSEADDR).
 
cn::milliseconds snd_drop_delay {-2}
 Extra delay before TLPKTDROP, -1 = do not drop packets (SRTO_SNDDROPDELAY, v1.3.2).
 
int32_t sndbuf = -1
 Send Buffer Size (SRTO_SNDBUF).
 
cn::milliseconds stats_interval {-1}
 If positive, interval between statistics reports.
 
SRTStatMode stats_mode = SRTStatMode::ALL
 Amount of statistics to report.
 
UString stream_id {}
 Stream identification string (SRTO_STREAMID, v1.3.0).
 
std::optional< bool > tlpktdrop {}
 Too-late Packet Drop (SRTO_TLPKTDROP, v1.0.6).
 
std::optional< bool > tsbpdmode {}
 Use Timestamp-based Packet Delivery mode (SRTO_TSBPDMODE).
 
int32_t udp_rcvbuf = -1
 UDP socket receive buffer size (SRTO_UDP_RCVBUF).
 
int32_t udp_sndbuf = -1
 UDP socket send buffer size (SRTO_UDP_SNDBUF).
 

Detailed Description

Secure Reliable Transport (SRT) socket options.

A negative value in an option means "unspecified value". Options which have default values which depend on the context are in a std::optional so that no value at is used when unspecified.

Member Function Documentation

◆ defineArgs()

void ts::SRTArgs::defineArgs ( Args &  args)

Add command line option definitions in an Args.

Parameters
[in,out]argsCommand line arguments to update.

◆ loadArgs()

bool ts::SRTArgs::loadArgs ( DuckContext &  duck,
Args &  args 
)

Load arguments from command line.

Args error indicator is set in case of incorrect arguments.

Parameters
[in,out]duckTSDuck execution context.
[in,out]argsCommand line arguments.
Returns
True on success, false on error in argument line.

◆ setMinVersion()

bool ts::SRTArgs::setMinVersion ( Report &  report,
const UString &  version 
)

Set the minimum version field from a "x.y.z" string.

Parameters
[in,out]reportWhere to report errors.
[in]versionVersion string in "x.y.z" format. Ignored if empty (min_version is left unmodified).
Returns
True on success, false on error in version syntax.

◆ setURL() [1/2]

bool ts::SRTArgs::setURL ( Report &  report,
const UString &  url 
)
inline

Set options from an srt: URL.

See TSDuck user guide for a complete description of SRT URLs.

Parameters
[in,out]reportWhere to report errors.
[in]urlURL with srt: scheme.
Returns
True on success, false on error in URL syntax.

◆ setURL() [2/2]

bool ts::SRTArgs::setURL ( Report &  report,
const URL &  url 
)

Set options from an srt: URL.

See TSDuck user guide for a complete description of SRT URLs.

Parameters
[in]urlURL with srt: scheme.
[in,out]reportWhere to report errors.
Returns
True on success, false on error in URL syntax.

◆ IsSRTURL() [1/2]

static bool ts::SRTArgs::IsSRTURL ( const UString &  url)
inlinestatic

Check if a string is a possible srt: URL.

Only check the URL scheme, not the complete syntax.

Parameters
[in]urlURL.
Returns
True if url is a possible srt: URL.

◆ IsSRTURL() [2/2]

static bool ts::SRTArgs::IsSRTURL ( const URL &  url)
inlinestatic

Check if an URL is a possible srt: URL.

Only check the URL scheme, not the complete syntax.

Parameters
[in]urlURL.
Returns
True if url is a possible srt: URL.

◆ setAddresses()

bool ts::SRTArgs::setAddresses ( Report &  report,
const IPSocketAddress &  listener,
const IPSocketAddress &  caller,
const IPAddress &  local = IPAddress() 
)
inline

Preset local and remote socket addresses in string form.

  • If only listener is not empty, the socket is set in listener mode.
  • If only caller is not empty, the socket is set in caller mode.
  • If both addresses are not empty, the socket is set in rendezvous mode.
  • If both addresses are empty, the current mode of the socket is reset and local and/or remote addresses must be specified by command line arguments or through open().
    Parameters
    [in,out]reportWhere to report errors.
    [in]listenerLocal "[address:]port".
    [in]callerRemote "address:port".
    [in]localOptional, can be empty. In caller mode, specify the local outgoing IP address.
    Returns
    True on success, false on error.

The documentation for this class was generated from the following file: