TSDuck v3.40-3963
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::UDPReceiverArgs Class Reference

Command line arguments for the class UDPReceiver. More...

#include <tsUDPReceiverArgs.h>

Collaboration diagram for ts::UDPReceiverArgs:

Public Member Functions

 UDPReceiverArgs ()=default
 Constructor.
 
void defineArgs (Args &args, bool with_short_options, bool destination_is_parameter)
 Add command line option definitions in an Args.
 
bool loadArgs (DuckContext &duck, Args &args, cn::milliseconds default_receive_timeout=cn::milliseconds(-1))
 Load arguments from command line.
 
void setUnicast (const IPv4SocketAddress &local_address, bool reuse_port=true, size_t buffer_size=0)
 Set application-specified parameters to receive unicast traffic.
 

Public Attributes

bool default_interface = false
 Use default local interface only for multicast (--default-interface).
 
IPv4SocketAddress destination {}
 Destination of packets to read ([address:]port).
 
IPv4Address local_address {}
 Optional local addresses on which to listen (--local-address).
 
bool mc_loopback = true
 Multicast loopback option (--disable-multicast-loop not present).
 
size_t receive_bufsize = 0
 Socket receive buffer size in bytes (--buffer-size).
 
cn::milliseconds receive_timeout = cn::milliseconds(-1)
 Receive timeout (--receive-timeout).
 
bool receive_timestamps = true
 Get receive timestamps, currently hardcoded, is there a reason to disable it?
 
bool reuse_port = true
 Reuse port socket option (--no-reuse-port not present).
 
IPv4SocketAddress source {}
 Optional source (--source address[:port]).
 
bool use_first_source = false
 Use socket address of first received packet to filter subsequent packets (--first-source).
 
bool use_ssm = false
 Use source-specific multicast (--ssm or SSM syntax used in destination).
 

Detailed Description

Command line arguments for the class UDPReceiver.

Member Function Documentation

◆ setUnicast()

void ts::UDPReceiverArgs::setUnicast ( const IPv4SocketAddress local_address,
bool  reuse_port = true,
size_t  buffer_size = 0 
)

Set application-specified parameters to receive unicast traffic.

This method is used when command line parameters are not used.

Parameters
[in]local_addressOptional local address and required UDP port.
[in]reuse_portOptional reuse-port option.
[in]buffer_sizeOptional socket receive buffer size.

◆ defineArgs()

void ts::UDPReceiverArgs::defineArgs ( Args args,
bool  with_short_options,
bool  destination_is_parameter 
)
inline

Add command line option definitions in an Args.

Parameters
[in,out]argsCommand line arguments to update.
[in]with_short_optionsWhen true, define one-letter short options.
[in]destination_is_parameterWhen true, the destination [address:]port is defined as a mandatory parameter. When false, it is defined as option –ip–udp (optional, can be omitted)

◆ loadArgs()

bool ts::UDPReceiverArgs::loadArgs ( DuckContext duck,
Args args,
cn::milliseconds  default_receive_timeout = cn::milliseconds(-1) 
)
inline

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 from which to load the parameters.
[in]default_receive_timeoutDefault receive timeout in milliseconds. No timeout if zero or negative.
Returns
True on success, false on error in argument line.

Member Data Documentation

◆ destination

IPv4SocketAddress ts::UDPReceiverArgs::destination {}

Destination of packets to read ([address:]port).

The UDP port is mandatory. The IP address is optional. When present, it must be a multicast address. When the IP address is not present, receive unicast packets on the specified UDP port.

◆ source

IPv4SocketAddress ts::UDPReceiverArgs::source {}

Optional source (--source address[:port]).

The packets are accepted only is they come from the corresponding source. If the source IP address or source UDP port is unspecified, any address or port is accepted. If use_ssm is true, the source is used in source-specific multicast.


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