TSDuck v3.38-3675
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
io.tsduck.PluginEventContext Class Reference

Context of a plugin event. More...

Public Member Functions

 PluginEventContext (int ecode, String pname, int pindex, int pcount, int brate, long ppackets, long tpackets, boolean rdonly, int maxdsize)
 Constructor.
 
int bitrate ()
 Get the plugin bitrate.
 
int eventCode ()
 Get the event code.
 
int maxDataSize ()
 Get the maximum returned data size in bytes (if they can be modified).
 
byte[] outputData ()
 Get the event returned data.
 
int pluginCount ()
 Get the total number of plugins in the processing chain.
 
int pluginIndex ()
 Get the plugin index in the processing chain.
 
String pluginName ()
 Get the plugin name.
 
long pluginPackets ()
 Get the number of packets which passed through the plugin.
 
boolean readOnlyData ()
 Indicate if the event data are read-only or if they can be updated.
 
void setOutputData (byte[] data)
 Set the event returned data.
 
long totalPackets ()
 Get the total number of packets which passed through the plugin thread.
 

Detailed Description

Context of a plugin event.

Each time a plugin signals an event for the application, a PluginEventContext instance is built and passed to all registered event handlers for that event.

Constructor & Destructor Documentation

◆ PluginEventContext()

io.tsduck.PluginEventContext.PluginEventContext ( int  ecode,
String  pname,
int  pindex,
int  pcount,
int  brate,
long  ppackets,
long  tpackets,
boolean  rdonly,
int  maxdsize 
)
inline

Constructor.

Parameters
ecodeA plugin-defined 32-bit code describing the event type. There is no predefined list of event codes. Plugin should define their own codes based on meaningful 4-char literals in order to avoid value clashes, for instance:
static constexpr uint32_t FAIL_EVENT = 'FAIL';
pnamePlugin name as found in the plugin registry.
pindexPlugin index in the chain. For tsp, plugins are numbered from 0 (the input plugin) to N-1 (the output plugin). For tsswitch, the input plugins are numbered from 0 to N-2 and the output plugin is N-1.
pcountTotal number N of plugins in the chain.
brateKnown bitrate in the context of the plugin at the time of the event.
ppacketsNumber of packet0s which passed through the plugin at the time of the event.
tpacketsTotal number of packets which passed through the plugin thread at the time of the event. It can be more than ppackets if some packets were not submitted to the plugin (deleted or excluded packets).
rdonlyTrue if the event data are read-only.
maxdsizeMaximum returned data size (if not read only).

Member Function Documentation

◆ eventCode()

int io.tsduck.PluginEventContext.eventCode ( )
inline

Get the event code.

Returns
A plugin-defined 32-bit code describing the event type.

◆ pluginName()

String io.tsduck.PluginEventContext.pluginName ( )
inline

Get the plugin name.

Returns
Plugin name as found in the plugin registry.

◆ pluginIndex()

int io.tsduck.PluginEventContext.pluginIndex ( )
inline

Get the plugin index in the processing chain.

Returns
Plugin index in the chain. For tsp, plugins are numbered from 0 (the input plugin) to N-1 (the output plugin). For tsswitch, the input plugins are numbered from 0 to N-2 and the output plugin is N-1.

◆ pluginCount()

int io.tsduck.PluginEventContext.pluginCount ( )
inline

Get the total number of plugins in the processing chain.

Returns
Total number of plugins in the chain.

◆ bitrate()

int io.tsduck.PluginEventContext.bitrate ( )
inline

Get the plugin bitrate.

Returns
Known bitrate in the context of the plugin at the time of the event.

◆ pluginPackets()

long io.tsduck.PluginEventContext.pluginPackets ( )
inline

Get the number of packets which passed through the plugin.

Returns
Number of packets which passed through the plugin at the time of the event.

◆ totalPackets()

long io.tsduck.PluginEventContext.totalPackets ( )
inline

Get the total number of packets which passed through the plugin thread.

Returns
Total number of packets which passed through the plugin thread at the time of the event. It can be more than pluginPackets() if some packets were not submitted to the plugin (deleted or excluded packets).

◆ readOnlyData()

boolean io.tsduck.PluginEventContext.readOnlyData ( )
inline

Indicate if the event data are read-only or if they can be updated.

Returns
True if the event data are read-only, false if they can be updated.

◆ maxDataSize()

int io.tsduck.PluginEventContext.maxDataSize ( )
inline

Get the maximum returned data size in bytes (if they can be modified).

Returns
Maximum returned data size in bytes.

◆ setOutputData()

void io.tsduck.PluginEventContext.setOutputData ( byte[]  data)
inline

Set the event returned data.

Parameters
dataEvent returned data. Ignored is returned data is read-only or larger than its max size.

◆ outputData()

byte[] io.tsduck.PluginEventContext.outputData ( )
inline

Get the event returned data.

Returns
Event returned data.

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