Skip to content

Commit

Permalink
Pre-ponder of VLCJ module
Browse files Browse the repository at this point in the history
  • Loading branch information
SrRapero720 committed Jun 6, 2024
1 parent ccdd87d commit 65418ee
Show file tree
Hide file tree
Showing 37 changed files with 73 additions and 85 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package uk.co.caprica.vlcj.factory.discovery;
package uk.co.caprica.vlcj.discovery;

import com.sun.jna.NativeLibrary;
import com.sun.jna.StringArray;
Expand All @@ -9,11 +9,11 @@
import uk.co.caprica.vlcj.VideoLan4J;
import uk.co.caprica.vlcj.binding.internal.libvlc_instance_t;
import uk.co.caprica.vlcj.binding.lib.LibVlc;
import uk.co.caprica.vlcj.discovery.strategy.LinuxNativeDiscoveryStrategy;
import uk.co.caprica.vlcj.discovery.strategy.NativeDiscoveryStrategy;
import uk.co.caprica.vlcj.discovery.strategy.OsxNativeDiscoveryStrategy;
import uk.co.caprica.vlcj.discovery.strategy.WindowsNativeDiscoveryStrategy;
import uk.co.caprica.vlcj.factory.MediaPlayerFactory;
import uk.co.caprica.vlcj.factory.discovery.strategy.LinuxNativeDiscoveryStrategy;
import uk.co.caprica.vlcj.factory.discovery.strategy.NativeDiscoveryStrategy;
import uk.co.caprica.vlcj.factory.discovery.strategy.OsxNativeDiscoveryStrategy;
import uk.co.caprica.vlcj.factory.discovery.strategy.WindowsNativeDiscoveryStrategy;
import uk.co.caprica.vlcj.support.version.LibVlcVersion;

import java.lang.ref.Reference;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/**
* Provides components that can be used to automatically discover the location of the LibVLC native libraries in the
* absence of proper run-time environment configuration.
* @deprecated This is going to be rewrited to videolan-natives
*/
package uk.co.caprica.vlcj.factory.discovery;
@Deprecated
package uk.co.caprica.vlcj.discovery;
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Copyright 2009-2020 Caprica Software Limited.
*/

package uk.co.caprica.vlcj.factory.discovery.provider;
package uk.co.caprica.vlcj.discovery.provider;

import java.io.File;
import java.io.FileNotFoundException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
* Copyright 2009-2019 Caprica Software Limited.
*/

package uk.co.caprica.vlcj.factory.discovery.provider;
package uk.co.caprica.vlcj.discovery.provider;

import uk.co.caprica.vlcj.factory.discovery.strategy.BaseNativeDiscoveryStrategy;
import uk.co.caprica.vlcj.factory.discovery.NativeDiscovery;
import uk.co.caprica.vlcj.discovery.NativeDiscovery;
import uk.co.caprica.vlcj.discovery.strategy.BaseNativeDiscoveryStrategy;

import java.util.ArrayList;
import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Copyright 2009-2019 Caprica Software Limited.
*/

package uk.co.caprica.vlcj.factory.discovery.provider;
package uk.co.caprica.vlcj.discovery.provider;

/**
* Specification for a component that provides a list of directories for the {@link DirectoryProviderDiscoveryStrategy}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Copyright 2009-2019 Caprica Software Limited.
*/

package uk.co.caprica.vlcj.factory.discovery.provider;
package uk.co.caprica.vlcj.discovery.provider;

/**
* Priority values used by the standard {@link DiscoveryDirectoryProvider} implementations.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Copyright 2009-2019 Caprica Software Limited.
*/

package uk.co.caprica.vlcj.factory.discovery.provider;
package uk.co.caprica.vlcj.discovery.provider;

import java.io.File;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Copyright 2009-2019 Caprica Software Limited.
*/

package uk.co.caprica.vlcj.factory.discovery.provider;
package uk.co.caprica.vlcj.discovery.provider;

import com.sun.jna.Platform;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Copyright 2009-2019 Caprica Software Limited.
*/

package uk.co.caprica.vlcj.factory.discovery.provider;
package uk.co.caprica.vlcj.discovery.provider;

import com.sun.jna.Platform;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Copyright 2009-2019 Caprica Software Limited.
*/

package uk.co.caprica.vlcj.factory.discovery.provider;
package uk.co.caprica.vlcj.discovery.provider;

import java.io.File;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Copyright 2009-2019 Caprica Software Limited.
*/

package uk.co.caprica.vlcj.factory.discovery.provider;
package uk.co.caprica.vlcj.discovery.provider;

/**
* Implementation of a directory provider that returns the current user home directory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Copyright 2009-2019 Caprica Software Limited.
*/

package uk.co.caprica.vlcj.factory.discovery.provider;
package uk.co.caprica.vlcj.discovery.provider;

/**
* Base implementation for directory provider that searches well-known directories.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
* Copyright 2009-2019 Caprica Software Limited.
*/

package uk.co.caprica.vlcj.factory.discovery.provider;
package uk.co.caprica.vlcj.discovery.provider;

import com.sun.jna.Platform;
import com.sun.jna.platform.win32.Advapi32Util;
import com.sun.jna.platform.win32.WinReg;
import uk.co.caprica.vlcj.factory.discovery.NativeDiscovery;
import uk.co.caprica.vlcj.discovery.NativeDiscovery;

import java.io.File;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* Components that provide the directories to search are loaded at run-time by the {@link java.util.ServiceLoader}
* mechanism.
* <p>
* Applications can easily provide their own {@link uk.co.caprica.vlcj.factory.discovery.provider.DiscoveryDirectoryProvider}
* Applications can easily provide their own {@link uk.co.caprica.vlcj.discovery.provider.DiscoveryDirectoryProvider}
* implementations and register the fully-qualified classnames of those implementations in the services descriptor file
* located at <code>META-INF/services/uk.co.caprica.vlcj.factory.discovery.provider.DiscoveryDirectoryProvider</code> (in their
* own application classpath).
*/
package uk.co.caprica.vlcj.factory.discovery.provider;
package uk.co.caprica.vlcj.discovery.provider;
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Copyright 2009-2019 Caprica Software Limited.
*/

package uk.co.caprica.vlcj.factory.discovery.strategy;
package uk.co.caprica.vlcj.discovery.strategy;

import java.io.File;
import java.nio.file.Files;
Expand All @@ -28,8 +28,8 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import static uk.co.caprica.vlcj.factory.discovery.NativeDiscovery.IT;
import static uk.co.caprica.vlcj.factory.discovery.NativeDiscovery.LOGGER;
import static uk.co.caprica.vlcj.discovery.NativeDiscovery.IT;
import static uk.co.caprica.vlcj.discovery.NativeDiscovery.LOGGER;

/**
* Base implementation of a native discovery strategy that searches a list of directories for a list of files.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
* Copyright 2009-2019 Caprica Software Limited.
*/

package uk.co.caprica.vlcj.factory.discovery.strategy;
package uk.co.caprica.vlcj.discovery.strategy;

import com.sun.jna.Platform;
import uk.co.caprica.vlcj.binding.lib.LibC;
import uk.co.caprica.vlcj.factory.discovery.provider.DirectoryProviderDiscoveryStrategy;
import uk.co.caprica.vlcj.discovery.provider.DirectoryProviderDiscoveryStrategy;

/**
* Default implementation of a native discovery strategy that searches directories on the Linux operating system.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Copyright 2009-2019 Caprica Software Limited.
*/

package uk.co.caprica.vlcj.factory.discovery.strategy;
package uk.co.caprica.vlcj.discovery.strategy;

/**
* Specification for a component that can locate the LibVLC native libraries at run-time.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
* Copyright 2009-2019 Caprica Software Limited.
*/

package uk.co.caprica.vlcj.factory.discovery.strategy;
package uk.co.caprica.vlcj.discovery.strategy;

import com.sun.jna.NativeLibrary;
import com.sun.jna.Platform;
import uk.co.caprica.vlcj.VideoLan4J;
import uk.co.caprica.vlcj.binding.lib.LibC;
import uk.co.caprica.vlcj.factory.discovery.provider.DirectoryProviderDiscoveryStrategy;
import uk.co.caprica.vlcj.discovery.provider.DirectoryProviderDiscoveryStrategy;

/**
* Default implementation of a native discovery strategy that searches directories on the OSX operating system.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
* Copyright 2009-2019 Caprica Software Limited.
*/

package uk.co.caprica.vlcj.factory.discovery.strategy;
package uk.co.caprica.vlcj.discovery.strategy;

import com.sun.jna.Platform;
import uk.co.caprica.vlcj.binding.lib.LibC;
import uk.co.caprica.vlcj.factory.discovery.provider.DirectoryProviderDiscoveryStrategy;
import uk.co.caprica.vlcj.discovery.provider.DirectoryProviderDiscoveryStrategy;

/**
* Default implementation of a native discovery strategy that searches directories on the Windows operating system.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
* Provides default implementations of components that can be used to automatically discover the location of the LibVLC
* native libraries for each supported operating system.
*/
package uk.co.caprica.vlcj.factory.discovery.strategy;
package uk.co.caprica.vlcj.discovery.strategy;
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
package uk.co.caprica.vlcj.factory;

import com.sun.jna.StringArray;
import uk.co.caprica.vlcj.binding.lib.LibVlc;
import uk.co.caprica.vlcj.binding.internal.libvlc_instance_t;
import uk.co.caprica.vlcj.factory.discovery.NativeDiscovery;
import uk.co.caprica.vlcj.factory.discovery.strategy.NativeDiscoveryStrategy;
import uk.co.caprica.vlcj.binding.lib.LibVlc;
import uk.co.caprica.vlcj.discovery.NativeDiscovery;
import uk.co.caprica.vlcj.discovery.strategy.NativeDiscoveryStrategy;
import uk.co.caprica.vlcj.support.eventmanager.TaskExecutor;
import uk.co.caprica.vlcj.support.version.LibVlcVersion;

Expand Down Expand Up @@ -166,7 +166,9 @@ public MediaPlayerFactory() {
*
* @param discovery native discovery used to find the native library, may be <code>null</code>
* @throws NativeLibraryMappingException if one or more of the declared method bindings in {@link LibVlc} could not be found in the native library that was loaded
* @deprecated Discovery is provided by WATERMeDIA
*/
@Deprecated
private void discoverNativeLibrary(NativeDiscovery discovery) {
if (discovery != null) {
// The discover method return value is not currently used, since we try and load the native library whether
Expand Down
3 changes: 3 additions & 0 deletions lib-vlcj/src/main/java/uk/co/caprica/vlcj/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
* Java framework for the VLC media player.
* <p>
* Most applications should start with the {@link uk.co.caprica.vlcj.factory.MediaPlayerFactory}.
* @deprecated Handle VLC stuff under Waiters or Callbacks isn't a good idea on a tick-based game that requires
* do all the handling in 1 thread
*/
@Deprecated
package uk.co.caprica.vlcj;
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*/
public final class ListApi extends BaseApi {

private final List<RendererItem> rendererItems = new CopyOnWriteArrayList<RendererItem>();
private final List<RendererItem> rendererItems = new CopyOnWriteArrayList<>();

ListApi(RendererDiscoverer rendererDiscoverer) {
super(rendererDiscoverer);
Expand All @@ -40,7 +40,7 @@ public final class ListApi extends BaseApi {
* @return
*/
public List<RendererItem> rendererItems() {
return new ArrayList<RendererItem>(rendererItems);
return new ArrayList<>(rendererItems);
}

/**
Expand All @@ -52,7 +52,7 @@ public List<RendererItem> rendererItems() {
* @return
*/
public boolean contains(RendererItem containsItem) {
for (RendererItem rendererItem : rendererItems) {
for (RendererItem rendererItem: rendererItems) {
if (rendererItem.rendererItemInstance().equals(containsItem.rendererItemInstance())) {
return true;
}
Expand All @@ -65,7 +65,7 @@ void itemAdded(RendererItem itemAdded) {
}

void itemDeleted(RendererItem itemDeleted) {
for (RendererItem rendererItem : rendererItems) {
for (RendererItem rendererItem: rendererItems) {
if (rendererItem.rendererItemInstance().equals(itemDeleted.rendererItemInstance())) {
rendererItems.remove(rendererItem);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

package uk.co.caprica.vlcj.player.renderer;

import uk.co.caprica.vlcj.binding.lib.LibVlc;
import uk.co.caprica.vlcj.binding.internal.libvlc_renderer_discoverer_t;
import uk.co.caprica.vlcj.binding.lib.LibVlc;

/**
* Encapsulation of a native renderer discoverer instance.
Expand All @@ -30,7 +30,7 @@ public final class RendererDiscoverer {
/**
* Native renderer discoverer instance.
*/
protected final libvlc_renderer_discoverer_t discovererInstance;
final libvlc_renderer_discoverer_t discovererInstance;

private final EventApi eventApi;
private final ListApi listApi;
Expand Down
26 changes: 12 additions & 14 deletions lib-vlcj/src/main/java/uk/co/caprica/vlcj/support/Info.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,20 +208,18 @@ private Version getVlcjVersion() {

@Override
public String toString() {
return new StringBuilder(200)
.append(getClass().getSimpleName()).append('[')
.append("vlcjVersion=").append(vlcjVersion).append(',')
.append("os=").append(os).append(',')
.append("javaVersion=").append(javaVersion).append(',')
.append("javaHome=").append(javaHome).append(',')
.append("jnaLibraryPath=").append(jnaLibraryPath).append(',')
.append("javaLibraryPath=").append(javaLibraryPath).append(',')
.append("path=").append(path).append(',')
.append("pluginPath=").append(pluginPath).append(',')
.append("ldLibraryPath=").append(ldLibraryPath).append(',')
.append("dyldLibraryPath=").append(dyldLibraryPath).append(',')
.append("dyldFallbackLibraryPath=").append(dyldFallbackLibraryPath).append(']')
.toString();
return getClass().getSimpleName() + '[' +
"vlcjVersion=" + vlcjVersion + ',' +
"os=" + os + ',' +
"javaVersion=" + javaVersion + ',' +
"javaHome=" + javaHome + ',' +
"jnaLibraryPath=" + jnaLibraryPath + ',' +
"javaLibraryPath=" + javaLibraryPath + ',' +
"path=" + path + ',' +
"pluginPath=" + pluginPath + ',' +
"ldLibraryPath=" + ldLibraryPath + ',' +
"dyldLibraryPath=" + dyldLibraryPath + ',' +
"dyldFallbackLibraryPath=" + dyldFallbackLibraryPath + ']';
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ private void shutdownExecutor(long timeout) {
executor.shutdownNow();
executor.awaitTermination(timeout, TimeUnit.MILLISECONDS);
}
}
catch (InterruptedException e) {
} catch (InterruptedException e) {
executor.shutdownNow();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,7 @@ public int compareTo(Version o) {

@Override
public String toString() {
StringBuilder sb = new StringBuilder(20);
sb.append(version);
return sb.toString();
return version;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
/**
* Exception thrown when a media player condition instance triggers aborts by returning <code>false</code> in an
*/
@SuppressWarnings("serial")
public final class BeforeWaiterAbortedException extends RuntimeException {

BeforeWaiterAbortedException() {
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
/**
* Exception thrown when a media player condition instance triggers in response to an error.
*/
@SuppressWarnings("serial")
public final class UnexpectedWaiterErrorException extends RuntimeException {

UnexpectedWaiterErrorException() {
Expand Down
Loading

0 comments on commit 65418ee

Please sign in to comment.