TSDuck Version 3.29-2562 (TSDuck - The MPEG Transport Stream Toolkit)
io.tsduck.InputSwitcher Class Reference

A wrapper class for C++ InputSwitcher. More...

Inheritance diagram for io.tsduck.InputSwitcher:
Collaboration diagram for io.tsduck.InputSwitcher:

Public Member Functions

 InputSwitcher (Report report)
 Constructor. More...
 
native int currentInput ()
 Get the index of the current input plugin. More...
 
native void delete ()
 Delete the encapsulated C++ object.
 
native void nextInput ()
 Switch to the next input plugin.
 
native void previousInput ()
 Switch to the previous input plugin.
 
native void registerEventHandler (AbstractPluginEventHandler handler, int eventCode)
 Register an event handler by event code. More...
 
native void registerInputEventHandler (AbstractPluginEventHandler handler)
 Register an event handler for all events from the input plugin. More...
 
native void registerOutputEventHandler (AbstractPluginEventHandler handler)
 Register an event handler for all events from the output plugin. More...
 
native void setInput (int pluginIndex)
 Switch to another input plugin. More...
 
native boolean start ()
 Start the input switcher session. More...
 
native void stop ()
 Terminate the processing.
 
native void waitForTermination ()
 Suspend the calling thread until input switcher session is completed.
 

Public Attributes

String appName = ""
 Application name, for help messages.
 
int bufferedPackets = 0
 Input buffer size in packets (0=default).
 
int cycleCount = 1
 Number of input cycles to execute (0 = infinite).
 
boolean delayedSwitch = false
 Delayed switch between input plugins.
 
String eventCommand = ""
 External shell command to run on a switching event.
 
String eventLocalAddress = ""
 Outgoing local interface for UDP event description.
 
int eventTTL = 0
 Time-to-live socket option for UDP event description.
 
String eventUDPAddress = ""
 Remote IPv4 address or host name to receive switching event JSON description.
 
int eventUDPPort = 0
 Remote UDP port to receive switching event JSON description.
 
boolean fastSwitch = false
 Fast switch between input plugins.
 
int firstInput = 0
 Index of first input plugin.
 
String[][] inputs = null
 Input plugins name and arguments (array of arrays of strings)
 
int maxInputPackets = 0
 Maximum input packets to read at a time (0=default).
 
int maxOutputPackets = 0
 Maximum input packets to send at a time (0=default).
 
String[] output = null
 Output plugin name and arguments (array of strings)
 
int primaryInput = -1
 Index of primary input plugin, negative if there is none.
 
int receiveTimeout = 0
 Receive timeout before switch (0=none).
 
int remoteServerPort = 0
 UDP server port for remote control (0=none).
 
boolean reusePort = false
 Reuse-port socket option.
 
int sockBuffer = 0
 Socket buffer size (0=default).
 
boolean terminate = false
 Terminate when one input plugin completes.
 

Protected Attributes

long nativeObject = 0
 The address of the underlying C++ object. More...
 

Detailed Description

A wrapper class for C++ InputSwitcher.

Constructor & Destructor Documentation

◆ InputSwitcher()

io.tsduck.InputSwitcher.InputSwitcher ( Report  report)
inline

Constructor.

Parameters
reportThe report object to use. If null, the logs are dropped. Be sure to specify a thread-safe report such has AsyncReport or a subclass of AbstractAsyncReport.

Member Function Documentation

◆ start()

native boolean io.tsduck.InputSwitcher.start ( )

Start the input switcher session.

All properties shall have been set before calling this method.

Returns
True on success, false on error.

◆ setInput()

native void io.tsduck.InputSwitcher.setInput ( int  pluginIndex)

Switch to another input plugin.

Parameters
pluginIndexIndex of the new input plugin.

◆ currentInput()

native int io.tsduck.InputSwitcher.currentInput ( )

Get the index of the current input plugin.

Returns
The index of the current input plugin.

◆ registerEventHandler()

native void io.tsduck.PluginEventHandlerRegistry.registerEventHandler ( AbstractPluginEventHandler  handler,
int  eventCode 
)
inherited

Register an event handler by event code.

Parameters
handlerAn instance of AbstractPluginEventHandler.
eventCodeThe code of the events to handle.

◆ registerInputEventHandler()

native void io.tsduck.PluginEventHandlerRegistry.registerInputEventHandler ( AbstractPluginEventHandler  handler)
inherited

Register an event handler for all events from the input plugin.

Parameters
handlerAn instance of AbstractPluginEventHandler.

◆ registerOutputEventHandler()

native void io.tsduck.PluginEventHandlerRegistry.registerOutputEventHandler ( AbstractPluginEventHandler  handler)
inherited

Register an event handler for all events from the output plugin.

Parameters
handlerAn instance of AbstractPluginEventHandler.

Member Data Documentation

◆ nativeObject

long io.tsduck.NativeObject.nativeObject = 0
protectedinherited

The address of the underlying C++ object.

It is normally accessed by native methods only.


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