diff --git a/java/libraries/video/src/processing/video/Capture.java b/java/libraries/video/src/processing/video/Capture.java index 87046429b..7356585a7 100644 --- a/java/libraries/video/src/processing/video/Capture.java +++ b/java/libraries/video/src/processing/video/Capture.java @@ -3,8 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2011 Andres Colubri - Copyright (c) 2004-09 Ben Fry and Casey Reas + Copyright (c) 2004-12 Ben Fry and Casey Reas The previous version of this code was developed by Hernando Barragan This library is free software; you can redistribute it and/or @@ -589,6 +588,11 @@ public class Capture extends PImage implements PConstants { HashMap properties, String frameRate) { this.parent = parent; + String[] cameras = list(sourceName); + if (cameras.length == 0) { + throw new RuntimeException("There are no cameras available for capture."); + } + Video.init(); // register methods @@ -688,8 +692,7 @@ public class Capture extends PImage implements PConstants { boolean suppRes = false; for (int i = 0; i < resolutions.size(); i++) { Resolution res = resolutions.get(i); - if (reqWidth == res.width && reqHeight == res.height && - fps.equals("") || fps.equals(res.fpsString)) { + if (reqWidth == res.width && reqHeight == res.height && (fps.equals("") || fps.equals(res.fpsString))) { suppRes = true; break; } diff --git a/java/libraries/video/src/processing/video/LibraryLoader.java b/java/libraries/video/src/processing/video/LibraryLoader.java index f432116ac..eea12cfbe 100644 --- a/java/libraries/video/src/processing/video/LibraryLoader.java +++ b/java/libraries/video/src/processing/video/LibraryLoader.java @@ -3,8 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2011 Andres Colubri - Based on code by Tal Shalif + Copyright (c) 2011-12 Ben Fry and Casey Reas This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -31,6 +30,12 @@ import com.sun.jna.Library; import com.sun.jna.Native; import com.sun.jna.Platform; +/** + * This class loads the gstreamer native libraries. + * By Andres Colubri + * Based on code by Tal Shalif + * + */ public class LibraryLoader { public interface DummyLibrary extends Library { diff --git a/java/libraries/video/src/processing/video/LibraryPath.java b/java/libraries/video/src/processing/video/LibraryPath.java index f166904de..d8f16d876 100644 --- a/java/libraries/video/src/processing/video/LibraryPath.java +++ b/java/libraries/video/src/processing/video/LibraryPath.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2011 Andres Colubri + Copyright (c) 2011-12 Ben Fry and Casey Reas This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -29,7 +29,7 @@ import com.sun.jna.Platform; class LibraryPath { // This method returns the folder inside which the gstreamer library folder - // should be located. + // is located. String get() { URL url = this.getClass().getResource("LibraryPath.class"); if (url != null) { diff --git a/java/libraries/video/src/processing/video/Movie.java b/java/libraries/video/src/processing/video/Movie.java index d332fd4af..364fa9ed0 100644 --- a/java/libraries/video/src/processing/video/Movie.java +++ b/java/libraries/video/src/processing/video/Movie.java @@ -3,8 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2011 Andres Colubri - Copyright (c) 2004-07 Ben Fry and Casey Reas + Copyright (c) 2004-12 Ben Fry and Casey Reas The previous version of this code was developed by Hernando Barragan This library is free software; you can redistribute it and/or diff --git a/java/libraries/video/src/processing/video/Resolution.java b/java/libraries/video/src/processing/video/Resolution.java index b98e5733d..4711d533f 100644 --- a/java/libraries/video/src/processing/video/Resolution.java +++ b/java/libraries/video/src/processing/video/Resolution.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2011 Andres Colubri + Copyright (c) 2011-12 Ben Fry and Casey Reas This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/java/libraries/video/src/processing/video/Video.java b/java/libraries/video/src/processing/video/Video.java index c4f365dd6..a7a7aaebb 100644 --- a/java/libraries/video/src/processing/video/Video.java +++ b/java/libraries/video/src/processing/video/Video.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2011 Andres Colubri + Copyright (c) 2011-12 Ben Fry and Casey Reas This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public