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


Public Member Functions | |
| PluginEventData (const uint8_t *data, size_t size) | |
| PluginEventData (uint8_t *data, size_t size, size_t max_size) | |
| virtual | ~PluginEventData () override |
| bool | append (const void *data_addr, size_t data_size) |
| const uint8_t * | data () const |
| bool | hasError () const |
| size_t | maxSize () const |
| uint8_t * | outputData () const |
| bool | readOnly () const |
| size_t | remainingSize () const |
| void | setError (bool error=true) |
| size_t | size () const |
| bool | updateSize (size_t size) |
General-purpose plugin event data referencing binary data to exchange with applications.
This subclass of Object can be used as "plugin data" when a plugin triggers an event and wants to pass to the application a read-only binary area.
The plugin event handlers in the application are synchronously invoked in the context of the thread plugin. The referenced binary data can be local data inside the plugin. The event handler may not saved a reference to it.
| ts::PluginEventData::PluginEventData | ( | const uint8_t * | data, |
| size_t | size ) |
Constructor passing read-only event data.
| [in] | data | Address of the plugin event data to pass to applications. It can be a null pointer. |
| [in] | size | Size in bytes of the plugin data. |
| ts::PluginEventData::PluginEventData | ( | uint8_t * | data, |
| size_t | size, | ||
| size_t | max_size ) |
Constructor passing read-write event data.
| [in] | data | Address of the plugin event data to pass to applications. It can be a null pointer. |
| [in] | size | Initial size in bytes of the plugin event data. |
| [in] | max_size | Maximum size in bytes of the plugin event data buffer. It must not be less than size. If the application modifies the data, it shall not write more than max_size bytes. |
|
overridevirtual |
Destructor.
|
inline |
Check if the plugin event data area is read-only.
|
inline |
Get the address of the plugin read-only event data.
|
inline |
Get the current size in bytes of the plugin event data. If the event data is modifiable, this may change.
|
inline |
Get the maximum size in bytes of the plugin event data. If the event data is modifiable, this may be more than size().
|
inline |
Get the remaining modifiable size in bytes of the plugin event data. If the event data is modifiable, this is zero.
| bool ts::PluginEventData::append | ( | const void * | data_addr, |
| size_t | data_size ) |
Append new application data inside the plugin event data area. The plugin event data area must not
| [in] | data_addr | Address of the data to append at the end of the plugin event data. |
| [in] | data_size | Size in bytes of the data to append. |
|
inline |
Get the address of the plugin modifiable event data. When the event data are not read-only, the application may update them directly, within the limits of maxSize().
| bool ts::PluginEventData::updateSize | ( | size_t | size | ) |
Update the current size of the plugin modifiable event data. When the event data are not read-only, the application may update the event data directly, within the limits of maxSize(). This method shall be used if the current data size is changed.
| [in] | size | The new event data size in bytes. Must not be more than maxSize(). |
|
inline |
Set the error indicator in the event data.
| [in] | error | Error indicator (default is true). |
|
inline |
Check the error indicator in the event data.