Module uk.co.caprica.vlcj
Class BaseNativeDiscoveryStrategy
java.lang.Object
uk.co.caprica.vlcj.factory.discovery.strategy.BaseNativeDiscoveryStrategy
- All Implemented Interfaces:
NativeDiscoveryStrategy
- Direct Known Subclasses:
DirectoryProviderDiscoveryStrategy
Base implementation of a native discovery strategy that searches a list of directories for a list of files.
-
Constructor Summary
ConstructorsConstructorDescriptionBaseNativeDiscoveryStrategy
(String[] filenamePatterns, String[] pluginPathFormats) Create a new native discovery strategy. -
Method Summary
Modifier and TypeMethodDescriptionfinal String
discover()
Attempt to discover the location of the native shared libraries.boolean
Invoked when native shared libraries found.final boolean
onSetPluginPath
(String path) Invoked after discovery has completed and found the native shared libraries.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface uk.co.caprica.vlcj.factory.discovery.strategy.NativeDiscoveryStrategy
supported
-
Constructor Details
-
BaseNativeDiscoveryStrategy
Create a new native discovery strategy.- Parameters:
filenamePatterns
- filename patterns to search for, as regular expressionspluginPathFormats
- directory name templates used to find the VLC plugin directory, printf style.
-
-
Method Details
-
discover
Description copied from interface:NativeDiscoveryStrategy
Attempt to discover the location of the native shared libraries.- Specified by:
discover
in interfaceNativeDiscoveryStrategy
- Returns:
- path containing the shared libraries, or
null
if this strategy did not find them
-
onFound
Description copied from interface:NativeDiscoveryStrategy
Invoked when native shared libraries found.This serves two purposes: the first is to enable the strategy implementation to carry out bespoke work if needed; te second is to indicate whether or not the discovered path should be added to the JNA native library search path.
- Specified by:
onFound
in interfaceNativeDiscoveryStrategy
- Parameters:
path
- directory containing the shared libraries- Returns:
true
if the path should be added to the JNA native search path;false
if not
-
onSetPluginPath
Description copied from interface:NativeDiscoveryStrategy
Invoked after discovery has completed and found the native shared libraries.This method will not be invoked if there is already a VLC_PLUGIN_PATH environment variable set.
- Specified by:
onSetPluginPath
in interfaceNativeDiscoveryStrategy
- Parameters:
path
- directory containing the shared libraries- Returns:
true
if the plugin path was set successfully;false
on error
-