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


Public Member Functions | |
| InputSwitcher (const InputSwitcherArgs &args, Report &report) | |
| InputSwitcher (Report &report) | |
| ~InputSwitcher () | |
| size_t | currentInput () |
| delete (self) | |
| Explicitly free the underlying C++ object. | |
| bool | isStarted () const |
| void | nextInput () |
| void | previousInput () |
| registerEventHandler (self, handler, event_code) | |
| Register an event handler by event code. | |
| registerInputEventHandler (self, handler) | |
| Register an event handler for all events from the input plugin. | |
| registerOutputEventHandler (self, handler) | |
| Register an event handler for all events from the output plugin. | |
| Report & | report () const |
| void | setInput (size_t pluginIndex) |
| bool | start (const InputSwitcherArgs &args) |
| void | stop () |
| bool | success () const |
| void | waitForTermination () |
Protected Member Functions | |
| _getNative (self) | |
| Get the native object. | |
| _setNative (self, obj) | |
| Set the native object. | |
Implementation of the input plugin switcher. This class is used by the tsswitch utility. It can also be used in other applications to switch between input plugins.
| ts::InputSwitcher::InputSwitcher | ( | Report & | report | ) |
Constructor. This constructor does not start the session.
| [in,out] | report | Where to report errors, logs, etc. This object will be used concurrently by all plugin execution threads. Consequently, it must be thread-safe. For performance reasons, it should be asynchronous (see for instance class AsyncReport). |
| ts::InputSwitcher::~InputSwitcher | ( | ) |
Destructor. It waits for termination of the session if it is running.
| ts::InputSwitcher::InputSwitcher | ( | const InputSwitcherArgs & | args, |
| Report & | report ) |
Full session constructor. The complete input switching session is performed in this constructor. The constructor returns only when the input switcher session terminates or fails tp start.
| [in] | args | Arguments and options. |
| [in,out] | report | Where to report errors, logs, etc. This object will be used concurrently by all plugin execution threads. Consequently, it must be thread-safe. For performance reasons, it should be asynchronous (see for instance class AsyncReport). |
|
inline |
Get a reference to the report object for the input switcher.
| bool ts::InputSwitcher::start | ( | const InputSwitcherArgs & | args | ) |
Start the input switcher session.
| [in] | args | Arguments and options. |
|
inline |
Check if the input switcher is started.
| void ts::InputSwitcher::setInput | ( | size_t | pluginIndex | ) |
Switch to another input plugin.
| [in] | pluginIndex | Index of the new input plugin. |
| void ts::InputSwitcher::nextInput | ( | ) |
Switch to the next input plugin.
| void ts::InputSwitcher::previousInput | ( | ) |
Switch to the previous input plugin.
| size_t ts::InputSwitcher::currentInput | ( | ) |
Get the index of the current input plugin.
| void ts::InputSwitcher::stop | ( | ) |
Stop the input switcher.
| void ts::InputSwitcher::waitForTermination | ( | ) |
Suspend the calling thread until input switcher is completed.
|
inline |
Check if the session, when completely run in the constructor, was successful.
|
inherited |
Register an event handler by event code.
| handler | An instance of AbstractPluginEventHandler. |
| event_code | The code of the events to handle. |
|
inherited |
Register an event handler for all events from the input plugin.
| handler | An instance of AbstractPluginEventHandler. |
|
inherited |
Register an event handler for all events from the output plugin.
| handler | An instance of AbstractPluginEventHandler. |
|
inherited |
Explicitly free the underlying C++ object.
After this call, the object becomes unusable. Most usages are unpredictable but most likely will do nothing.
Reimplemented in tsduck.AbstractPluginEventHandler, tsduck.AsyncReport, tsduck.DuckContext, tsduck.InputSwitcher, tsduck.SectionFile, tsduck.SystemMonitor, and tsduck.TSProcessor.
|
protectedinherited |
Set the native object.
This is typically done by subclass constructors.
| obj | Address of the C++ native object to store. |
|
protectedinherited |
Get the native object.
This is typically used by subclasses.