![]() |
TSDuck v3.46-4964
MPEG Transport Stream Toolkit
|
#include <tsTSDatagramOutput.h>


Public Member Functions | |
| TSDatagramOutput (Report &report, TSDatagramOutputOptions flags, TSDatagramOutputHandlerInterface *output=nullptr) | |
| bool | close (const BitRate &bitrate, bool abort) |
| void | defineArgs (Args &args) |
| bool | loadArgs (DuckContext &duck, Args &args) |
| size_t | maxPayloadSize () const |
| bool | open () |
| bool | send (const TSPacket *packets, const TSPacketMetadata *metadata, size_t packet_count, const BitRate &bitrate) |
Static Public Attributes | |
| static constexpr size_t | DEFAULT_PACKET_BURST = 7 |
| static constexpr size_t | MAX_PACKET_BURST = 128 |
Send TS packets over datagrams (UDP, SRT, RIST, etc.)
| ts::TSDatagramOutput::TSDatagramOutput | ( | Report & | report, |
| TSDatagramOutputOptions | flags, | ||
| TSDatagramOutputHandlerInterface * | output = nullptr ) |
Constructor.
| [in,out] | report | Where to report errors. |
| [in] | flags | List of options. |
| [in] | output | Output handler for datagrams. If null, raw UDP output is used. |
| void ts::TSDatagramOutput::defineArgs | ( | Args & | args | ) |
Add command line option definitions in an Args.
| [in,out] | args | Command line arguments to update. |
| bool ts::TSDatagramOutput::loadArgs | ( | DuckContext & | duck, |
| Args & | args ) |
Load arguments from command line. Args error indicator is set in case of incorrect arguments.
| [in,out] | duck | TSDuck execution context. |
| [in,out] | args | Command line arguments. |
| bool ts::TSDatagramOutput::open | ( | ) |
Open and initialize the TS packet output.
| bool ts::TSDatagramOutput::close | ( | const BitRate & | bitrate, |
| bool | abort ) |
Close the TS packet output. Flush pending packets, if any.
| [in] | bitrate | Current of last bitrate to compute timestamps for buffered packets. Ignored if zero. |
| [in] | abort | If true, do not flush pending packets. |
| bool ts::TSDatagramOutput::send | ( | const TSPacket * | packets, |
| const TSPacketMetadata * | metadata, | ||
| size_t | packet_count, | ||
| const BitRate & | bitrate ) |
Send TS packets. Some of them can be buffered and sent later.
| [in] | packets | Address of first packet. |
| [in] | metadata | Address of first packet metadata (can be null). |
| [in] | packet_count | Number of packets to send. |
| [in] | bitrate | Current bitrate to compute timestamps. Ignored if zero. |
|
inline |
Get the maximum datagram payload size, according to options –packet-burst and –rs204.
|
staticconstexpr |
Default number of TS packets in a UDP datagram. This value is equivalent to 1316 bytes, the maximum number of TS packets which fit (with headers) in an Ethernet MTU (1500 bytes).
|
staticconstexpr |
Maximum number of TS packets in a UDP datagram. This value (approximately 24 kB) is not recommended since it will result in IP datagram fragmentation in most cases.