TSDuck Version 3.15-964 (TSDuck - The MPEG Transport Stream Toolkit)
ts::PluginSharedLibrary Class Reference

Representation of a TSP plugin shared library. More...

Inheritance diagram for ts::PluginSharedLibrary:
Collaboration diagram for ts::PluginSharedLibrary:

Public Member Functions

 PluginSharedLibrary (const UString &filename, Report &report=(*ts::CerrReport::Instance()))
 Constructor. More...
 
const UStringerrorMessage () const
 Return a message describing the constructor error. More...
 
const UStringfileName () const
 Return actual file name of shared library. More...
 
void * getSymbol (const std::string &name) const
 Get the value of an exported symbol inside the shared library. More...
 
bool isLoaded () const
 Check if the library was successfully loaded. More...
 
UString moduleName () const
 The module name is derived from the file name without the prefix. More...
 
UString prefix () const
 Get the prefix. More...
 

Static Public Member Functions

static void GetPluginList (UStringVector &files, const UString &prefix, const UString &library_path=UString())
 Get a list of plugins. More...
 

Public Attributes

NewInputProfile new_input
 Input plugin allocation function. More...
 
NewOutputProfile new_output
 Output plugin allocation function. More...
 
NewProcessorProfile new_processor
 Packet processing plugin allocation function. More...
 

Protected Member Functions

void load (const UString &filename)
 Try to load an alternate file if the shared library is not yet loaded. More...
 
void unload ()
 Force unload, even if permanent.
 

Detailed Description

Representation of a TSP plugin shared library.

Constructor & Destructor Documentation

◆ PluginSharedLibrary()

ts::PluginSharedLibrary::PluginSharedLibrary ( const UString filename,
Report report = (*ts::CerrReport::Instance()) 
)
explicit

Constructor.

When the load is successful, the API version has been successfully checked and the tsp plugin API has been located.

Parameters
[in]filenameShare library file name. Directory, "tsplugin_" prefix and suffix are optional.
[in,out]reportWhere to report errors.

Member Function Documentation

◆ moduleName()

UString ts::ApplicationSharedLibrary::moduleName ( ) const
inherited

The module name is derived from the file name without the prefix.

Returns
The module name.

◆ prefix()

UString ts::ApplicationSharedLibrary::prefix ( ) const
inlineinherited

Get the prefix.

Returns
The file name prefix.

◆ GetPluginList()

static void ts::ApplicationSharedLibrary::GetPluginList ( UStringVector files,
const UString prefix,
const UString library_path = UString() 
)
staticinherited

Get a list of plugins.

Parameters
[out]filesList of shared library files.
[in]prefixPrefix for plugin names.
[in]library_pathName of an environment variable, an optional list of directories to search, similar to LD_LIBARY_PATH.

◆ isLoaded()

bool ts::SharedLibrary::isLoaded ( ) const
inlineinherited

Check if the library was successfully loaded.

Returns
True if the library was successfully loaded.

◆ errorMessage()

const UString& ts::SharedLibrary::errorMessage ( ) const
inlineinherited

Return a message describing the constructor error.

Useful when isLoaded() == false.

Returns
An error message.

◆ fileName()

const UString& ts::SharedLibrary::fileName ( ) const
inlineinherited

Return actual file name of shared library.

Returns
The actual file name of shared library.

◆ getSymbol()

void* ts::SharedLibrary::getSymbol ( const std::string &  name) const
inherited

Get the value of an exported symbol inside the shared library.

Parameters
[in]nameSymbol name, using 8-bit characters, not Unicode.
Returns
The symbol value or 0 on error. When the symbol is an address, the returned value is a virtual memory address inside the current process.

◆ load()

void ts::SharedLibrary::load ( const UString filename)
protectedinherited

Try to load an alternate file if the shared library is not yet loaded.

Parameters
[in]filenameShared library file name.

Member Data Documentation

◆ new_input

NewInputProfile ts::PluginSharedLibrary::new_input

Input plugin allocation function.

If null, the plugin either does not provide input capability or is not a valid TSP plugin.

◆ new_output

NewOutputProfile ts::PluginSharedLibrary::new_output

Output plugin allocation function.

If null, the plugin either does not provide output capability or is not a valid TSP plugin.

◆ new_processor

NewProcessorProfile ts::PluginSharedLibrary::new_processor

Packet processing plugin allocation function.

If null, the plugin either does not provide packet processing capability or is not a valid TSP plugin.


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