Class NativeDiscovery

java.lang.Object
uk.co.caprica.vlcj.factory.discovery.NativeDiscovery

public class NativeDiscovery extends Object
Native library discovery component.

This component attempts to automatically locate the LibVLC native library so that it may be reliably loaded by JNA.

The intent is that native discovery "just works". To that end, a number of default NativeDiscoveryStrategy implementations are provided.

It is possible to provide your own replacement native discovery strategy implementations when creating an instance of this component, or alternatively to provide none at all to sidestep automatic native discovery.

The first discovery strategy implementation that reports that it has found the native libraries "wins" - this means that even if turns out subsequently that the native library can not be loaded via this strategy, any other remaining discovery strategies are not tried.

It is possible that even if native discovery fails, i.e. discover() returns false, that the native library can be loaded successfully. This could happen in an environment that is already well-configured, with libraries installed in places that the Operating System and JVM already know about.

In MediaPlayerFactory, where this native discovery component is primarily used, an attempt to load the native library will always be made, whether explicit discovery works or not.

This behaviour is by design, as is always trying the discovery first whether or not this "default" library loading would work - since it is possible that a client application does not actually want to prioritise the default library load (e.g. different version of VLC if multiple are installed).