aboutsummaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-09-30 19:53:40 +0200
committerSven Gothel <[email protected]>2012-09-30 19:53:40 +0200
commitef4990ed1d07e7910f0a7a8b0d9e2cb424672b48 (patch)
treeca38c25f8473560d254d9c66a6932583a9768704 /src/nativewindow/classes
parent2d35fc546097818aba5db51885f796cb0b442734 (diff)
parent20a2a4f27c9d7c029a86a96fa44c7e77d2d7db6b (diff)
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src/nativewindow/classes')
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
index af8008f0f..1962bcd09 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
@@ -33,6 +33,7 @@
package javax.media.nativewindow;
+import java.io.File;
import java.lang.reflect.Method;
import java.security.AccessController;
import java.security.PrivilegedAction;
@@ -66,6 +67,9 @@ public abstract class NativeWindowFactory {
/** X11 type, as retrieved with {@link #getNativeWindowType(boolean)}. String is canonical via {@link String#intern()}. */
public static final String TYPE_X11 = ".x11".intern();
+ /** Broadcom VC IV/EGL type, as retrieved with {@link #getNativeWindowType(boolean)}. String is canonical via {@link String#intern()}. */
+ public static final String TYPE_BCM_VC_IV = ".bcm.vc.iv".intern();
+
/** Android/EGL type, as retrieved with {@link #getNativeWindowType(boolean)}. String is canonical via {@link String#intern()}.*/
public static final String TYPE_ANDROID = ".android".intern();
@@ -107,6 +111,19 @@ public abstract class NativeWindowFactory {
protected NativeWindowFactory() {
}
+ private static final boolean guessBroadcomVCIV() {
+ return AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
+ private final File vcliblocation = new File(
+ "/opt/vc/lib/libbcm_host.so");
+ public Boolean run() {
+ if ( vcliblocation.isFile() ) {
+ return new Boolean(true);
+ }
+ return new Boolean(false);
+ }
+ } ).booleanValue();
+ }
+
private static String _getNativeWindowingType() {
switch(Platform.OS_TYPE) {
case ANDROID:
@@ -123,6 +140,9 @@ public abstract class NativeWindowFactory {
case SUNOS:
case HPUX:
default:
+ if( guessBroadcomVCIV() ) {
+ return TYPE_BCM_VC_IV;
+ }
return TYPE_X11;
}
}