TSDuck Version 3.16-1064 (TSDuck - The MPEG Transport Stream Toolkit)
ts::tsp::PluginExecutor Class Referenceabstract

Execution context of a tsp plugin. More...

Inheritance diagram for ts::tsp::PluginExecutor:
Collaboration diagram for ts::tsp::PluginExecutor:

Public Types

typedef ResidentBuffer< TSPacketPacketBuffer
 TS packet are accessed in a memory-resident buffer.
 

Public Member Functions

 PluginExecutor (Options *options, const PluginOptions *pl_options, const ThreadAttributes &attributes, Mutex &global_mutex)
 Constructor. More...
 
virtual bool aborting () const override
 Check for aborting application. More...
 
BitRate bitrate () const
 Get the current input bitrate in bits/seconds. More...
 
bool debug () const
 Check if debugging is active. More...
 
void debug (const UString &msg)
 Report a debug message. More...
 
void debug (const UChar *fmt, const std::initializer_list< ArgMixIn > &args)
 Report a debug message with a printf-like interface. More...
 
void debug (const UString &fmt, const std::initializer_list< ArgMixIn > &args)
 Report a debug message with a printf-like interface. More...
 
void error (const UString &msg)
 Report an error message. More...
 
void error (const UChar *fmt, const std::initializer_list< ArgMixIn > &args)
 Report an error message with a printf-like interface. More...
 
void error (const UString &fmt, const std::initializer_list< ArgMixIn > &args)
 Report an error message with a printf-like interface. More...
 
void fatal (const UString &msg)
 Report a fatal error message. More...
 
void fatal (const UChar *fmt, const std::initializer_list< ArgMixIn > &args)
 Report a fatal error message with a printf-like interface. More...
 
void fatal (const UString &fmt, const std::initializer_list< ArgMixIn > &args)
 Report a fatal error message with a printf-like interface. More...
 
void getAttributes (ThreadAttributes &attributes)
 Get a copy of the attributes of the thread. More...
 
void info (const UString &msg)
 Report an informational message. More...
 
void info (const UChar *fmt, const std::initializer_list< ArgMixIn > &args)
 Report an informational message with a printf-like interface. More...
 
void info (const UString &fmt, const std::initializer_list< ArgMixIn > &args)
 Report an informational message with a printf-like interface. More...
 
void initBuffer (PacketBuffer *buffer, size_t pkt_first, size_t pkt_cnt, bool input_end, bool aborted, BitRate bitrate)
 Set the initial state of the buffer for this plugin. More...
 
bool isCurrentThread () const
 Check if the caller is running in the context of this thread. More...
 
bool isRealTime () const
 Check if the plugin a real time one. More...
 
virtual void jointTerminate () override
 Signaling "joint termination". More...
 
virtual void log (int severity, const UString &msg)
 Report a message with an explicit severity. More...
 
virtual void log (int severity, const UChar *fmt, const std::initializer_list< ArgMixIn > &args)
 Report a message with an explicit severity and a printf-like interface. More...
 
virtual void log (int severity, const UString &fmt, const std::initializer_list< ArgMixIn > &args)
 Report a message with an explicit severity and a printf-like interface. More...
 
virtual void main ()=0
 This hook is invoked in the context of the thread. More...
 
int maxSeverity () const
 Get maximum severity level. More...
 
Pluginplugin () const
 Access the shared library API. More...
 
UString pluginName () const
 Get the plugin name. More...
 
virtual void raiseMaxSeverity (int level)
 Raise maximum severity level. More...
 
bool realtime () const
 Check if the current plugin environment should use defaults for real-time. More...
 
bool ringAlone () const
 Check if the node is alone in its own ring. More...
 
void ringInsertAfter (RingNode *o)
 Insert this object in a ring after the specified node. More...
 
void ringInsertBefore (RingNode *o)
 Insert this object in a ring before the specified node. More...
 
template<typename T >
T * ringNext ()
 Get the next node in the ring. More...
 
template<typename T >
const T * ringNext () const
 Get the next node in the ring. More...
 
template<typename T >
T * ringPrevious ()
 Get the previous node in the ring. More...
 
template<typename T >
const T * ringPrevious () const
 Get the previous node in the ring. More...
 
void ringRemove ()
 Remove the node from the ring it belongs to and creates its own ring.
 
size_t ringSize () const
 Count the number of element in the ring. More...
 
void ringSwap (RingNode *o)
 Swap this object and another one in their rings. More...
 
void setAbort ()
 This method sets the current packet processor in an abort state.
 
bool setAttributes (const ThreadAttributes &attributes)
 Set new attributes to the thread. More...
 
void setLogName (const UString &name)
 Set the plugin name as displayed in log messages. More...
 
virtual void setMaxSeverity (int level)
 Set maximum severity level. More...
 
void setRealTimeForAll (bool on)
 Inform if all plugins should use defaults for real-time. More...
 
void setReport (Report *rep)
 Change the report object. More...
 
void severe (const UString &msg)
 Report a severe error message. More...
 
void severe (const UChar *fmt, const std::initializer_list< ArgMixIn > &args)
 Report a severe error message with a printf-like interface. More...
 
void severe (const UString &fmt, const std::initializer_list< ArgMixIn > &args)
 Report a severe error message with a printf-like interface. More...
 
bool start ()
 Start the thread. More...
 
virtual bool thisJointTerminated () const override
 Check if the calling plugin has already declared "joint termination". More...
 
virtual void useJointTermination (bool on) override
 Activates or deactivates "joint termination". More...
 
virtual bool useJointTermination () const override
 Check if the calling plugin uses "joint termination". More...
 
bool verbose () const
 Check if verbose reporting is active. More...
 
void verbose (const UString &msg)
 Report a verbose message. More...
 
void verbose (const UChar *fmt, const std::initializer_list< ArgMixIn > &args)
 Report a verbose message with a printf-like interface. More...
 
void verbose (const UString &fmt, const std::initializer_list< ArgMixIn > &args)
 Report a verbose message with a printf-like interface. More...
 
bool waitForTermination ()
 Wait for thread termination. More...
 
void warning (const UString &msg)
 Report a warning message. More...
 
void warning (const UChar *fmt, const std::initializer_list< ArgMixIn > &args)
 Report a warning message with a printf-like interface. More...
 
void warning (const UString &fmt, const std::initializer_list< ArgMixIn > &args)
 Report a warning message with a printf-like interface. More...
 

Static Public Member Functions

static void Yield ()
 Yield execution of the current thread. More...
 

Static Public Attributes

static const int API_VERSION = 8
 Plugin API Version Number. More...
 
static const size_t STACK_SIZE_OVERHEAD = 32 * 1024
 Plugin stack size overhead. More...
 

Protected Member Functions

PacketCounter addTotalPackets (size_t incr)
 Account for more processed packets in this plugin. More...
 
bool passPackets (size_t count, BitRate bitrate, bool input_end, bool aborted)
 Pass processed packets to the next packet processor. More...
 
PacketCounter totalPackets () const
 Get total number of processed packets. More...
 
PacketCounter totalPacketsBeforeJointTermination () const
 Get the packet number after which the "joint termination" must be applied. More...
 
void waitWork (size_t &pkt_first, size_t &pkt_cnt, BitRate &bitrate, bool &input_end, bool &aborted)
 Wait for something to do. More...
 
virtual void writeLog (int severity, const UString &msg) override
 Actual message reporting method. More...
 

Protected Attributes

PacketBuffer_buffer
 Description of shared packet buffer.
 
Mutex_global_mutex
 Reference to the TSP global mutex.
 
volatile int _max_severity
 Debug level is accessible to subclasses.
 
const Options_options
 TSP options.
 
volatile bool _tsp_aborting
 TSP is currently aborting.
 
BitRate _tsp_bitrate
 TSP input bitrate.
 
bool _use_realtime
 The plugin should use realtime defaults.
 

Detailed Description

Execution context of a tsp plugin.

Data model

There is a global buffer for TS packets. The input thread writes incoming packets here. All packet processors update them and the output thread picks them for the same place.

The buffer is an array of ts::TSPacket. It is managed in a circular way. It is divided into logical areas, one per processor (including input and output). These logical areas are sliding windows which move when packets are processed.

Each sliding window is defined by the index of its first packet (_pkt_first) and its size in packets (_pkt_cnt).

Flat (non-circular) view of the buffer:

output->_pkt_first proc_1->_pkt_first
| |
| proc_N->_pkt_first | input->_pkt_first
| | | |
V V V V
+----------+----------+-------+----------+---------+
+-> | output | proc N | ... | proc 1 | input | ->-+
| +----------+----------+-------+----------+---------+ |
| |
+-------------------------------------------------------------+

When a thread terminates the processing of a bunch of packets, it moves up its first index and, consequently, decreases the sizes of its area and accordingly increases the size of the area of the next processor.

The modification of the starting index and size of any area must be performed under the protection of the global mutex. There is one global mutex for simplicity. The resulting bottleneck is not so important since updating a few pointers is fast.

When the sliding window of a processor is empty, the processor thread sleeps on its "_to_do" condition variable. Consequently, when a thread passes packets to the next processor (ie. increases the size of the sliding window of the next processor), it must notify the _to_do condition variable of the next thread.

When a packet processor decides to drop a packet, the synchronization byte (first byte of the packet, normally 0x47) is reset to zero. When a packet processor or the output processor encounters a packet starting with a zero byte, it ignores it.

All PluginExecutors are chained in a ring. The first one is input and the last one is output. The output points back to the input so that the output processor can easily pass free packets to be reused by the input processor.

The "_input_end" indicates that there is no more packet to process after those in the processor's area. This condition is signaled by the previous processor in the chain. All processors, except the output processor, may signal this condition to their successor.

The "_aborted" indicates that the current processor has encountered an error and has ceased to accept packets. This condition is checked by the previous processor in the chain (which, in turn, will declare itself as aborted). All processors, except the input processor may signal this condition. In case of error, all processors should also declare an "_input_end" to their successor.

Constructor & Destructor Documentation

◆ PluginExecutor()

ts::tsp::PluginExecutor::PluginExecutor ( Options options,
const PluginOptions pl_options,
const ThreadAttributes attributes,
Mutex global_mutex 
)

Constructor.

Parameters
[in,out]optionsCommand line options for tsp.
[in]pl_optionsCommand line options for this plugin.
[in]attributesCreation attributes for the thread executing this plugin.
[in,out]global_mutexGlobal mutex to synchronize access to the packet buffer.

Member Function Documentation

◆ initBuffer()

void ts::tsp::PluginExecutor::initBuffer ( PacketBuffer buffer,
size_t  pkt_first,
size_t  pkt_cnt,
bool  input_end,
bool  aborted,
BitRate  bitrate 
)

Set the initial state of the buffer for this plugin.

Must be executed in synchronous environment, before starting all executor threads.

Parameters
[in]bufferAddress of the packet buffer.
[in]pkt_firstStarting index of packets area for this plugin.
[in]pkt_cntSize of packets area for this plugin.
[in]input_endIf true, there is no more packet after current ones.
[in]abortedIf true, there was a packet processor error, aborted.
[in]bitrateInput bitrate (set by previous packet processor).

◆ setRealTimeForAll()

void ts::tsp::PluginExecutor::setRealTimeForAll ( bool  on)
inline

Inform if all plugins should use defaults for real-time.

Parameters
[in]onTrue if all plugins should use defaults for real-time.

◆ isRealTime()

bool ts::tsp::PluginExecutor::isRealTime ( ) const

Check if the plugin a real time one.

Returns
True if the plugin usually requires real-time responsiveness.

◆ passPackets()

bool ts::tsp::PluginExecutor::passPackets ( size_t  count,
BitRate  bitrate,
bool  input_end,
bool  aborted 
)
protected

Pass processed packets to the next packet processor.

This method is invoked by a subclass to indicate that some packets have been processed by this packet process and shall be passed to the next processor.

Parameters
[in]countNumber of packets to pass to next processor.
[in]bitrateBitrate, as computed by this processor or passed from the previous processor. To be passed to next processor.
[in]input_endIf true, this processor will no longer produce packets.
[in]abortedif true, this processor has encountered an error and will cease to accept packets.
Returns
True when the processor shall continue, false when it shall stop.

◆ waitWork()

void ts::tsp::PluginExecutor::waitWork ( size_t &  pkt_first,
size_t &  pkt_cnt,
BitRate bitrate,
bool &  input_end,
bool &  aborted 
)
protected

Wait for something to do.

This method is invoked by a subclass when it has nothing to do. This method makes the calling processor thread waiting for packets to process or some error condition. Always return a contiguous array of packets. If the circular buffer wrap-over occurs in the middle of the caller's area, only return the first part, up the buffer's highest address. The next call to wait_work will return the second part.

Parameters
[out]pkt_firstIndex of first packet to process in the buffer.
[out]pkt_cntNumber of packets to process in the buffer.
[out]bitrateCurrent bitrate, as computed from previous processors.
[out]input_endThe previous processor indicates that no more packets will be produced.
[out]abortedThe next processor indicates that it aborts and will no longer accept packets.

◆ useJointTermination() [1/2]

virtual void ts::tsp::JointTermination::useJointTermination ( bool  on)
overridevirtualinherited

Activates or deactivates "joint termination".

This method activates or deactivates "joint termination" for the calling plugin. It should be invoked during the plugin's start().

Parameters
[in]onTrue to activate or false to deactivate joint termination.

Implements ts::TSP.

◆ useJointTermination() [2/2]

virtual bool ts::tsp::JointTermination::useJointTermination ( ) const
inlineoverridevirtualinherited

Check if the calling plugin uses "joint termination".

Returns
True if the calling plugin uses "joint termination".

Implements ts::TSP.

◆ jointTerminate()

virtual void ts::tsp::JointTermination::jointTerminate ( )
overridevirtualinherited

Signaling "joint termination".

This method is used by the plugin to declare that its execution is potentially terminated in the context of "joint termination". After invoking this method, any packet which is processed by the plugin may be ignored by tsp.

Implements ts::TSP.

◆ thisJointTerminated()

virtual bool ts::tsp::JointTermination::thisJointTerminated ( ) const
inlineoverridevirtualinherited

Check if the calling plugin has already declared "joint termination".

Returns
True if the calling plugin has already declared "joint termination".

Implements ts::TSP.

◆ addTotalPackets()

PacketCounter ts::tsp::JointTermination::addTotalPackets ( size_t  incr)
inlineprotectedinherited

Account for more processed packets in this plugin.

Parameters
[in]incrAdd this number of processed packets.
Returns
New total number of processed packets.

◆ totalPackets()

PacketCounter ts::tsp::JointTermination::totalPackets ( ) const
inlineprotectedinherited

Get total number of processed packets.

Returns
The total number of processed packets in this plugin.

◆ totalPacketsBeforeJointTermination()

PacketCounter ts::tsp::JointTermination::totalPacketsBeforeJointTermination ( ) const
protectedinherited

Get the packet number after which the "joint termination" must be applied.

Returns
The packet number after which the "joint termination" must be applied. If no "joint termination" applies, return the maximum int value.

◆ setReport()

void ts::PluginThread::setReport ( Report rep)
inlineinherited

Change the report object.

Parameters
[in]repAddress of new report instance.

◆ plugin()

Plugin* ts::PluginThread::plugin ( ) const
inlineinherited

Access the shared library API.

Returns
Address of the plugin interface.

◆ pluginName()

UString ts::PluginThread::pluginName ( ) const
inlineinherited

Get the plugin name.

Returns
The plugin name.

◆ setLogName()

void ts::PluginThread::setLogName ( const UString name)
inlineinherited

Set the plugin name as displayed in log messages.

By default, used the real plugin name.

Parameters
[in]nameThe name to use in log messages. When empty, revert to the real plugin name.

◆ writeLog()

virtual void ts::PluginThread::writeLog ( int  severity,
const UString msg 
)
overrideprotectedvirtualinherited

Actual message reporting method.

Must be implemented in actual classes. The method is called only when a message passed the severity filter. It is not necessary to recheck severity inside the method.

Parameters
[in]severityMessage severity.
[in]msgMessage text.

Implements ts::Report.

◆ setAttributes()

bool ts::Thread::setAttributes ( const ThreadAttributes attributes)
inherited

Set new attributes to the thread.

New attributes can be set as long as the thread is not started, i.e. as long as start() is not invoked.

Parameters
[in]attributesNew attributes to set.
Returns
True on success, false on error (if the thread is already started).

◆ getAttributes()

void ts::Thread::getAttributes ( ThreadAttributes attributes)
inherited

Get a copy of the attributes of the thread.

Parameters
[out]attributesAttributes of the thread.

◆ start()

bool ts::Thread::start ( )
inherited

Start the thread.

The operating system thread is created and started. The code which is executed in the context of this thread is in the method main().

Returns
True on success, false on error (operating system error or the thread is already started).

◆ waitForTermination()

bool ts::Thread::waitForTermination ( )
inherited

Wait for thread termination.

The thread which invokes this method is blocked until the execution of this thread object completes.

Only one waiter thread is allowed. If several threads concurrently invoke waitForTermination() on the same Thread object, only the first one will wait. The method waitForTermination() returns an error to all other threads.

This method is automatically invoked in the destructor. Thus, when a Thread object is declared in a control block and the thread has been started, the end of the control block hangs as long as the thread is not terminated. If the thread has not been started, however, the destructor does not wait (otherwise it would hang for ever).

Important: When a subclass of Thread has non-static members, its destructor shall invoke waitForTermination(). Thus, it prevents its members from being destructed until the thread terminates. If the destructor of the subclass does not invoke waitForTermination() and the Thread object goes out of scope before the termination of the thread, the subclass part of the object is destroyed. Any attempt to access non-static members from the main() method in the context of the thread will give unexpected results. Most of the time, this will result in an error similar to "pure virtual method called". To avoid this:

class MyThread: public ts::Thread
{
public:
virtual ~MyThread()
{
}
...
};

Do not use this method if the thread was created with the delete when terminated flag (ts::ThreadAttributes::setDeleteWhenTerminated).

Returns
True on success, false on error. Errors include operating system errors, the thread is not yet started, the caller thread is this thread (waiting for ourself would result in a dead-lock).

◆ isCurrentThread()

bool ts::Thread::isCurrentThread ( ) const
inherited

Check if the caller is running in the context of this thread.

Returns
True if the caller of isCurrentThread() is running in the context of this thread.

◆ main()

virtual void ts::Thread::main ( )
pure virtualinherited

This hook is invoked in the context of the thread.

Concrete thread classes shall implement this pure virtual method. This method is invoked in the context of the created thread when it is started.

◆ Yield()

static void ts::Thread::Yield ( )
staticinherited

Yield execution of the current thread.

Execution is passed to another thread, if any is waiting for execution. This should not change the behaviour of correctly-written applications.

◆ bitrate()

BitRate ts::TSP::bitrate ( ) const
inlineinherited

Get the current input bitrate in bits/seconds.

Returns
The current input bitrate in bits/seconds or zero if unknown.

◆ realtime()

bool ts::TSP::realtime ( ) const
inlineinherited

Check if the current plugin environment should use defaults for real-time.

Returns
True if the current plugin environment should use defaults for real-time.

◆ aborting()

virtual bool ts::TSP::aborting ( ) const
inlineoverridevirtualinherited

Check for aborting application.

The plugin may invoke this method to check if the application is aborting for some reason (user interrupt for instance).

Returns
True if the tsp application is currently aborting.

Implements ts::AbortInterface.

◆ setMaxSeverity()

virtual void ts::Report::setMaxSeverity ( int  level)
virtualinherited

Set maximum severity level.

Messages with higher severities are not reported.

Parameters
[in]levelSet report to that level.

◆ raiseMaxSeverity()

virtual void ts::Report::raiseMaxSeverity ( int  level)
virtualinherited

Raise maximum severity level.

Parameters
[in]levelSet report at least to that level.

Reimplemented in ts::Args.

◆ maxSeverity()

int ts::Report::maxSeverity ( ) const
inlineinherited

Get maximum severity level.

Returns
Current maximum debug level.

◆ debug() [1/4]

bool ts::Report::debug ( ) const
inlineinherited

Check if debugging is active.

Returns
True if current reporting level is Debug or higher.

◆ debug() [2/4]

void ts::Report::debug ( const UString msg)
inlineinherited

Report a debug message.

Parameters
[in]msgMessage text.

◆ debug() [3/4]

void ts::Report::debug ( const UChar fmt,
const std::initializer_list< ArgMixIn > &  args 
)
inlineinherited

Report a debug message with a printf-like interface.

Parameters
[in]fmtFormat string with embedded '%' sequences.
[in]argsList of arguments to substitute in the format string.
See also
UString::format()

◆ debug() [4/4]

void ts::Report::debug ( const UString fmt,
const std::initializer_list< ArgMixIn > &  args 
)
inlineinherited

Report a debug message with a printf-like interface.

Parameters
[in]fmtFormat string with embedded '%' sequences.
[in]argsList of arguments to substitute in the format string.
See also
UString::format()

◆ verbose() [1/4]

bool ts::Report::verbose ( ) const
inlineinherited

Check if verbose reporting is active.

Returns
True if current reporting level is Verbose or higher.

◆ verbose() [2/4]

void ts::Report::verbose ( const UString msg)
inlineinherited

Report a verbose message.

Parameters
[in]msgMessage text.

◆ verbose() [3/4]

void ts::Report::verbose ( const UChar fmt,
const std::initializer_list< ArgMixIn > &  args 
)
inlineinherited

Report a verbose message with a printf-like interface.

Parameters
[in]fmtFormat string with embedded '%' sequences.
[in]argsList of arguments to substitute in the format string.
See also
UString::format()

◆ verbose() [4/4]

void ts::Report::verbose ( const UString fmt,
const std::initializer_list< ArgMixIn > &  args 
)
inlineinherited

Report a verbose message with a printf-like interface.

Parameters
[in]fmtFormat string with embedded '%' sequences.
[in]argsList of arguments to substitute in the format string.
See also
UString::format()

◆ log() [1/3]

virtual void ts::Report::log ( int  severity,
const UString msg 
)
virtualinherited

Report a message with an explicit severity.

This method is the central reporting point. If filters the severity and drops the message if severity is higher than maxSeverity().

Subclasses should override writeLog() to implement a specific reporting device. It is not necessary to override log() unless the subclass needs to implement a different severity filtering policy.

Parameters
[in]severityMessage severity.
[in]msgMessage text.

◆ log() [2/3]

virtual void ts::Report::log ( int  severity,
const UChar fmt,
const std::initializer_list< ArgMixIn > &  args 
)
virtualinherited

Report a message with an explicit severity and a printf-like interface.

Parameters
[in]severityMessage severity.
[in]fmtFormat string with embedded '%' sequences.
[in]argsList of arguments to substitute in the format string.
See also
UString::format()

◆ log() [3/3]

virtual void ts::Report::log ( int  severity,
const UString fmt,
const std::initializer_list< ArgMixIn > &  args 
)
virtualinherited

Report a message with an explicit severity and a printf-like interface.

Parameters
[in]severityMessage severity.
[in]fmtFormat string with embedded '%' sequences.
[in]argsList of arguments to substitute in the format string.
See also
UString::format()

◆ fatal() [1/3]

void ts::Report::fatal ( const UString msg)
inlineinherited

Report a fatal error message.

Parameters
[in]msgMessage text.

◆ fatal() [2/3]

void ts::Report::fatal ( const UChar fmt,
const std::initializer_list< ArgMixIn > &  args 
)
inlineinherited

Report a fatal error message with a printf-like interface.

Parameters
[in]fmtFormat string with embedded '%' sequences.
[in]argsList of arguments to substitute in the format string.
See also
UString::format()

◆ fatal() [3/3]

void ts::Report::fatal ( const UString fmt,
const std::initializer_list< ArgMixIn > &  args 
)
inlineinherited

Report a fatal error message with a printf-like interface.

Parameters
[in]fmtFormat string with embedded '%' sequences.
[in]argsList of arguments to substitute in the format string.
See also
UString::format()

◆ severe() [1/3]

void ts::Report::severe ( const UString msg)
inlineinherited

Report a severe error message.

Parameters
[in]msgMessage text.

◆ severe() [2/3]

void ts::Report::severe ( const UChar fmt,
const std::initializer_list< ArgMixIn > &  args 
)
inlineinherited

Report a severe error message with a printf-like interface.

Parameters
[in]fmtFormat string with embedded '%' sequences.
[in]argsList of arguments to substitute in the format string.
See also
UString::format()

◆ severe() [3/3]

void ts::Report::severe ( const UString fmt,
const std::initializer_list< ArgMixIn > &  args 
)
inlineinherited

Report a severe error message with a printf-like interface.

Parameters
[in]fmtFormat string with embedded '%' sequences.
[in]argsList of arguments to substitute in the format string.
See also
UString::format()

◆ error() [1/3]

void ts::Report::error ( const UString msg)
inlineinherited

Report an error message.

Parameters
[in]msgMessage text.

◆ error() [2/3]

void ts::Report::error ( const UChar fmt,
const std::initializer_list< ArgMixIn > &  args 
)
inlineinherited

Report an error message with a printf-like interface.

Parameters
[in]fmtFormat string with embedded '%' sequences.
[in]argsList of arguments to substitute in the format string.
See also
UString::format()

◆ error() [3/3]

void ts::Report::error ( const UString fmt,
const std::initializer_list< ArgMixIn > &  args 
)
inlineinherited

Report an error message with a printf-like interface.

Parameters
[in]fmtFormat string with embedded '%' sequences.
[in]argsList of arguments to substitute in the format string.
See also
UString::format()

◆ warning() [1/3]

void ts::Report::warning ( const UString msg)
inlineinherited

Report a warning message.

Parameters
[in]msgMessage text.

◆ warning() [2/3]

void ts::Report::warning ( const UChar fmt,
const std::initializer_list< ArgMixIn > &  args 
)
inlineinherited

Report a warning message with a printf-like interface.

Parameters
[in]fmtFormat string with embedded '%' sequences.
[in]argsList of arguments to substitute in the format string.
See also
UString::format()

◆ warning() [3/3]

void ts::Report::warning ( const UString fmt,
const std::initializer_list< ArgMixIn > &  args 
)
inlineinherited

Report a warning message with a printf-like interface.

Parameters
[in]fmtFormat string with embedded '%' sequences.
[in]argsList of arguments to substitute in the format string.
See also
UString::format()

◆ info() [1/3]

void ts::Report::info ( const UString msg)
inlineinherited

Report an informational message.

Parameters
[in]msgMessage text.

◆ info() [2/3]

void ts::Report::info ( const UChar fmt,
const std::initializer_list< ArgMixIn > &  args 
)
inlineinherited

Report an informational message with a printf-like interface.

Parameters
[in]fmtFormat string with embedded '%' sequences.
[in]argsList of arguments to substitute in the format string.
See also
UString::format()

◆ info() [3/3]

void ts::Report::info ( const UString fmt,
const std::initializer_list< ArgMixIn > &  args 
)
inlineinherited

Report an informational message with a printf-like interface.

Parameters
[in]fmtFormat string with embedded '%' sequences.
[in]argsList of arguments to substitute in the format string.
See also
UString::format()

◆ ringAlone()

bool ts::RingNode::ringAlone ( ) const
inlineinherited

Check if the node is alone in its own ring.

Returns
True if the node is alone in its own ring.

◆ ringInsertAfter()

void ts::RingNode::ringInsertAfter ( RingNode o)
inherited

Insert this object in a ring after the specified node.

Parameters
[in]oA node of a ring. This object is inserted after o in the ring.

◆ ringInsertBefore()

void ts::RingNode::ringInsertBefore ( RingNode o)
inherited

Insert this object in a ring before the specified node.

Parameters
[in]oA node of a ring. This object is inserted before o in the ring.

◆ ringSwap()

void ts::RingNode::ringSwap ( RingNode o)
inherited

Swap this object and another one in their rings.

If the two objects belong to the same ring, their positions are swapped. If they belong to distinct rings, they also move to each other's ring.

Parameters
[in]oThe node to swap with.

◆ ringNext() [1/2]

template<typename T >
T* ts::RingNode::ringNext ( )
inlineinherited

Get the next node in the ring.

Template Parameters
TA superclass of RingNode, the expected type of the next object in the ring.
Returns
Address of the next node in the ring or zero if the next node is not a subclass of T.

◆ ringNext() [2/2]

template<typename T >
const T* ts::RingNode::ringNext ( ) const
inlineinherited

Get the next node in the ring.

Template Parameters
TA superclass of RingNode, the expected type of the next object in the ring.
Returns
Address of the next node in the ring or zero if the next node is not a subclass of T.

◆ ringPrevious() [1/2]

template<typename T >
T* ts::RingNode::ringPrevious ( )
inlineinherited

Get the previous node in the ring.

Template Parameters
TA superclass of RingNode, the expected type of the previous object in the ring.
Returns
Address of the previous node in the ring or zero if the previous node is not a subclass of T.

◆ ringPrevious() [2/2]

template<typename T >
const T* ts::RingNode::ringPrevious ( ) const
inlineinherited

Get the previous node in the ring.

Template Parameters
TA superclass of RingNode, the expected type of the previous object in the ring.
Returns
Address of the previous node in the ring or zero if the previous node is not a subclass of T.

◆ ringSize()

size_t ts::RingNode::ringSize ( ) const
inherited

Count the number of element in the ring.

Warning: This method has a linear response time, avoid using it when possible.

Returns
The number of nodes in the ring.

Member Data Documentation

◆ STACK_SIZE_OVERHEAD

const size_t ts::PluginThread::STACK_SIZE_OVERHEAD = 32 * 1024
staticinherited

Plugin stack size overhead.

Each plugin defines its own usage of the stack. The PluginThread class and its subclasses have their own additional stack usage.

◆ API_VERSION

const int ts::TSP::API_VERSION = 8
staticinherited

Plugin API Version Number.

Important: Must be incremented each time the tsp plugin abstract interfaces are modified. All shared libraries shall export a global int data named tspInterfaceVersion which contains the current interface version at the time the library is built.


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