Context of a plugin event.
More...
#include <tsPluginEventContext.h>
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.
◆ PluginEventContext()
ts::PluginEventContext::PluginEventContext |
( |
uint32_t |
event_code, |
|
|
const UString & |
plugin_name, |
|
|
size_t |
plugin_index, |
|
|
size_t |
plugin_count, |
|
|
Plugin * |
plugin, |
|
|
Object * |
plugin_data = nullptr , |
|
|
const BitRate & |
bitrate = 0 , |
|
|
PacketCounter |
plugin_packets = 0 , |
|
|
PacketCounter |
total_packets = 0 |
|
) |
| |
Constructor.
- Parameters
-
[in] | event_code | A 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';
|
[in] | plugin_name | Plugin name as found in the plugin registry. |
[in] | plugin_index | 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. |
[in] | plugin_count | Total number N of plugins in the chain. |
[in] | plugin | Address of the plugin instance which signalled the event. If this is an application-defined plugin which exposes more services, the event handler may try a dynamic_cast on this pointer. |
[in] | plugin_data | Address of the plugin-specific data. It can be a null pointer. In the case of an application-defined plugin the application may try a dynamic_cast on this pointer to an expected type |
[in] | bitrate | Known bitrate in the context of the plugin at the time of the event. |
[in] | plugin_packets | Number of packets which passed through the plugin at the time of the event. |
[in] | total_packets | Total number of packets which passed through the plugin thread at the time of the event. It can be more than plugin_packets if some packets were not submitted to the plugin (deleted or excluded packets). |
◆ eventCode()
uint32_t ts::PluginEventContext::eventCode |
( |
| ) |
const |
|
inline |
Get the event code.
- Returns
- A plugin-defined 32-bit code describing the event type.
◆ pluginName()
UString ts::PluginEventContext::pluginName |
( |
| ) |
const |
|
inline |
Get the plugin name.
- Returns
- Plugin name as found in the plugin registry.
◆ pluginIndex()
size_t ts::PluginEventContext::pluginIndex |
( |
| ) |
const |
|
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()
size_t ts::PluginEventContext::pluginCount |
( |
| ) |
const |
|
inline |
Get the total number of plugins in the processing chain.
- Returns
- Total number of plugins in the chain.
◆ plugin()
Plugin * ts::PluginEventContext::plugin |
( |
| ) |
const |
|
inline |
Get the plugin which signalled the event.
- Returns
- Address of the plugin instance which signalled the event. If this is an application-defined plugin which exposes more services, the event handler may try a dynamic_cast on this pointer.
◆ pluginData()
Object * ts::PluginEventContext::pluginData |
( |
| ) |
const |
|
inline |
Get the plugin-specific data for this event.
- Returns
- Address of the plugin-specific data. It can be a null pointer. In the case of an application-defined plugin the application may try a dynamic_cast on this pointer to an expected type
◆ bitrate()
BitRate ts::PluginEventContext::bitrate |
( |
| ) |
const |
|
inline |
Get the plugin bitrate.
- Returns
- Known bitrate in the context of the plugin at the time of the event.
◆ pluginPackets()
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()
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 plugin_packets if some packets were not submitted to the plugin (deleted or excluded packets).
The documentation for this class was generated from the following file: