From f0a637ea91857fd69cc0eb82cb72ef7ae7e2db71 Mon Sep 17 00:00:00 2001 From: benfry Date: Sat, 18 Jun 2011 16:39:50 +0000 Subject: [PATCH] cleaning things up with new gsvideo code --- java/libraries/video/.classpath | 6 +++--- .../video/src/processing/video/CLibrary.java | 2 +- .../video/src/processing/video/Capture.java | 20 +++++++++---------- .../src/processing/video/GSLibraryLoader.java | 2 +- .../src/processing/video/GSLibraryPath.java | 2 +- .../src/processing/video/GSPipeline.java | 2 +- .../video/src/processing/video/GSPlayer.java | 2 +- .../video/src/processing/video/GSVideo.java | 2 +- .../video/src/processing/video/Movie.java | 8 ++++---- .../src/processing/video/MovieMaker.java | 14 ++++++------- 10 files changed, 30 insertions(+), 30 deletions(-) diff --git a/java/libraries/video/.classpath b/java/libraries/video/.classpath index 41e779422..80820b4c9 100644 --- a/java/libraries/video/.classpath +++ b/java/libraries/video/.classpath @@ -2,8 +2,8 @@ - - - + + + diff --git a/java/libraries/video/src/processing/video/CLibrary.java b/java/libraries/video/src/processing/video/CLibrary.java index 069143a2e..1005ddc78 100644 --- a/java/libraries/video/src/processing/video/CLibrary.java +++ b/java/libraries/video/src/processing/video/CLibrary.java @@ -17,7 +17,7 @@ * Boston, MA 02111-1307 USA */ -package codeanticode.gsvideo; +package processing.video; import com.sun.jna.Library; import com.sun.jna.Native; diff --git a/java/libraries/video/src/processing/video/Capture.java b/java/libraries/video/src/processing/video/Capture.java index 01cea75b7..7efb28882 100644 --- a/java/libraries/video/src/processing/video/Capture.java +++ b/java/libraries/video/src/processing/video/Capture.java @@ -17,7 +17,7 @@ * Boston, MA 02111-1307 USA */ -package codeanticode.gsvideo; +package processing.video; import processing.core.*; @@ -35,7 +35,7 @@ import org.gstreamer.interfaces.Property; * Class for storing and manipulating video frames from an attached capture * device such as a camera. */ -public class GSCapture extends PImage implements PConstants { +public class Capture extends PImage implements PConstants { protected String source; protected boolean playing = false; @@ -77,7 +77,7 @@ public class GSCapture extends PImage implements PConstants { * Basic constructor: tries to auto-detect all the capture parameters, * with the exception of the resolution. */ - public GSCapture(PApplet parent, int requestWidth, int requestHeight) { + public Capture(PApplet parent, int requestWidth, int requestHeight) { super(requestWidth, requestHeight, RGB); initPlatform(parent, requestWidth, requestHeight, new String[] {}, new int[] {}, new String[] {}, new String[] {}, ""); @@ -86,7 +86,7 @@ public class GSCapture extends PImage implements PConstants { /** * Constructor that takes resolution and framerate indicated as a single number. */ - public GSCapture(PApplet parent, int requestWidth, int requestHeight, int frameRate) { + public Capture(PApplet parent, int requestWidth, int requestHeight, int frameRate) { super(requestWidth, requestHeight, RGB); initPlatform(parent, requestWidth, requestHeight, new String[] {}, new int[] {}, new String[] {}, new String[] {}, frameRate + "/1"); @@ -96,7 +96,7 @@ public class GSCapture extends PImage implements PConstants { * This constructor allows to specify the camera name. In Linux, for example, this * should be a string of the form /dev/video0, /dev/video1, etc. */ - public GSCapture(PApplet parent, int requestWidth, int requestHeight, String cameraName) { + public Capture(PApplet parent, int requestWidth, int requestHeight, String cameraName) { super(requestWidth, requestHeight, RGB); initPlatform(parent, requestWidth, requestHeight, new String[] {}, new int[] {}, new String[] { devicePropertyName() }, new String[] { cameraName }, ""); @@ -105,7 +105,7 @@ public class GSCapture extends PImage implements PConstants { /** * This constructor allows to specify the camera name and the desired framerate. */ - public GSCapture(PApplet parent, int requestWidth, int requestHeight, int frameRate, + public Capture(PApplet parent, int requestWidth, int requestHeight, int frameRate, String cameraName) { super(requestWidth, requestHeight, RGB); initPlatform(parent, requestWidth, requestHeight, new String[] {}, new int[] {}, @@ -117,7 +117,7 @@ public class GSCapture extends PImage implements PConstants { * This constructor lets to indicate which source element to use (i.e.: v4l2src, * osxvideosrc, dshowvideosrc, ksvideosrc, etc). */ - public GSCapture(PApplet parent, int requestWidth, int requestHeight, int frameRate, + public Capture(PApplet parent, int requestWidth, int requestHeight, int frameRate, String sourceName, String cameraName) { super(requestWidth, requestHeight, RGB); initGStreamer(parent, requestWidth, requestHeight, sourceName, new String[] {}, new int[] {}, @@ -130,7 +130,7 @@ public class GSCapture extends PImage implements PConstants { * The camera name could be one of these properties. The framerate must be specified * as a fraction string: 30/1, 15/2, etc. */ - public GSCapture(PApplet parent, int requestWidth, int requestHeight, String frameRate, + public Capture(PApplet parent, int requestWidth, int requestHeight, String frameRate, String sourceName, String[] strPropNames, String[] strPropValues) { super(requestWidth, requestHeight, RGB); initGStreamer(parent, requestWidth, requestHeight, sourceName, new String[] {}, new int[] {}, @@ -142,7 +142,7 @@ public class GSCapture extends PImage implements PConstants { * as well as a list of integer properties. This could be useful if a camera cannot by * specified by name but by index. Framerate must be a fraction string: 30/1, 15/2, etc. */ - public GSCapture(PApplet parent, int requestWidth, int requestHeight, String frameRate, + public Capture(PApplet parent, int requestWidth, int requestHeight, String frameRate, String sourceName, String[] strPropNames, String[] strPropValues, String[] intPropNames, int[] intPropValues) { super(requestWidth, requestHeight, RGB); @@ -232,7 +232,7 @@ public class GSCapture extends PImage implements PConstants { try { captureEventMethod = parent.getClass().getMethod("captureEvent", - new Class[] { GSCapture.class }); + new Class[] { Capture.class }); } catch (Exception e) { // no such method, or an error.. which is fine, just ignore } diff --git a/java/libraries/video/src/processing/video/GSLibraryLoader.java b/java/libraries/video/src/processing/video/GSLibraryLoader.java index 6736569ad..c966d2b27 100644 --- a/java/libraries/video/src/processing/video/GSLibraryLoader.java +++ b/java/libraries/video/src/processing/video/GSLibraryLoader.java @@ -17,7 +17,7 @@ * Boston, MA 02111-1307 USA */ -package codeanticode.gsvideo; +package processing.video; import java.util.HashMap; import java.util.Map; diff --git a/java/libraries/video/src/processing/video/GSLibraryPath.java b/java/libraries/video/src/processing/video/GSLibraryPath.java index ad7bc4ac4..0cf42ef62 100644 --- a/java/libraries/video/src/processing/video/GSLibraryPath.java +++ b/java/libraries/video/src/processing/video/GSLibraryPath.java @@ -17,7 +17,7 @@ * Boston, MA 02111-1307 USA */ -package codeanticode.gsvideo; +package processing.video; import java.net.URL; diff --git a/java/libraries/video/src/processing/video/GSPipeline.java b/java/libraries/video/src/processing/video/GSPipeline.java index 8dd426afc..c973ad1bb 100644 --- a/java/libraries/video/src/processing/video/GSPipeline.java +++ b/java/libraries/video/src/processing/video/GSPipeline.java @@ -17,7 +17,7 @@ * Boston, MA 02111-1307 USA */ -package codeanticode.gsvideo; +package processing.video; import processing.core.*; diff --git a/java/libraries/video/src/processing/video/GSPlayer.java b/java/libraries/video/src/processing/video/GSPlayer.java index 66775fb57..37c453969 100644 --- a/java/libraries/video/src/processing/video/GSPlayer.java +++ b/java/libraries/video/src/processing/video/GSPlayer.java @@ -17,7 +17,7 @@ * Boston, MA 02111-1307 USA */ -package codeanticode.gsvideo; +package processing.video; import processing.core.*; diff --git a/java/libraries/video/src/processing/video/GSVideo.java b/java/libraries/video/src/processing/video/GSVideo.java index c2a06679f..aa9d59d2e 100644 --- a/java/libraries/video/src/processing/video/GSVideo.java +++ b/java/libraries/video/src/processing/video/GSVideo.java @@ -17,7 +17,7 @@ * Boston, MA 02111-1307 USA */ -package codeanticode.gsvideo; +package processing.video; import org.gstreamer.*; diff --git a/java/libraries/video/src/processing/video/Movie.java b/java/libraries/video/src/processing/video/Movie.java index 6cf8b770f..60eb766f9 100644 --- a/java/libraries/video/src/processing/video/Movie.java +++ b/java/libraries/video/src/processing/video/Movie.java @@ -17,7 +17,7 @@ * Boston, MA 02111-1307 USA */ -package codeanticode.gsvideo; +package processing.video; import processing.core.*; @@ -35,7 +35,7 @@ import org.gstreamer.elements.*; * This class makes it possible to load movies and to play them back in many * ways including looping, pausing, and changing speed. */ -public class GSMovie extends PImage implements PConstants { +public class Movie extends PImage implements PConstants { protected String filename; protected boolean playing = false; @@ -74,7 +74,7 @@ public class GSMovie extends PImage implements PConstants { * @param parent PApplet * @param filename String */ - public GSMovie(PApplet parent, String filename) { + public Movie(PApplet parent, String filename) { super(0, 0, RGB); initGStreamer(parent, filename); } @@ -161,7 +161,7 @@ public class GSMovie extends PImage implements PConstants { try { movieEventMethod = eventHandler.getClass().getMethod("movieEvent", - new Class[] { GSMovie.class }); + new Class[] { Movie.class }); } catch (Exception e) { // no such method, or an error.. which is fine, just ignore } diff --git a/java/libraries/video/src/processing/video/MovieMaker.java b/java/libraries/video/src/processing/video/MovieMaker.java index e91d68d5f..4bd7211b5 100644 --- a/java/libraries/video/src/processing/video/MovieMaker.java +++ b/java/libraries/video/src/processing/video/MovieMaker.java @@ -17,7 +17,7 @@ * Boston, MA 02111-1307 USA */ -package codeanticode.gsvideo; +package processing.video; import processing.core.*; @@ -30,7 +30,7 @@ import org.gstreamer.elements.RGBDataFileSink; /** * This class makes movies from a running program. */ -public class GSMovieMaker { +public class MovieMaker { protected PApplet parent; protected boolean recording; protected RGBDataFileSink recorder; @@ -53,7 +53,7 @@ public class GSMovieMaker { * Constructor that sets the codec to THEORA, MEDIUM quality and 30 fps. * */ - public GSMovieMaker(PApplet parent, int requestWidth, int requestHeight, + public MovieMaker(PApplet parent, int requestWidth, int requestHeight, String filename) { init(parent, requestWidth, requestHeight, filename, THEORA, MEDIUM, 30); } @@ -62,7 +62,7 @@ public class GSMovieMaker { * Constructor that allows to set codec type and fps. * */ - public GSMovieMaker(PApplet parent, int requestWidth, int requestHeight, + public MovieMaker(PApplet parent, int requestWidth, int requestHeight, String filename, int codecType, int ifps) { init(parent, requestWidth, requestHeight, filename, codecType, MEDIUM, ifps); } @@ -71,7 +71,7 @@ public class GSMovieMaker { * Constructor that allows to set codec type, encoding quality and fps. * */ - public GSMovieMaker(PApplet parent, int requestWidth, int requestHeight, + public MovieMaker(PApplet parent, int requestWidth, int requestHeight, String filename, int codecType, int codecQuality, int ifps) { init(parent, requestWidth, requestHeight, filename, codecType, codecQuality, ifps); @@ -82,7 +82,7 @@ public class GSMovieMaker { * Properties for encoder and muxer are left to wherever the default values are. * */ - public GSMovieMaker(PApplet parent, int requestWidth, int requestHeight, + public MovieMaker(PApplet parent, int requestWidth, int requestHeight, String filename, String encoder, String muxer, int ifps) { init(parent, requestWidth, requestHeight, filename, encoder, muxer, null, null, ifps); } @@ -92,7 +92,7 @@ public class GSMovieMaker { * well as the properties. * */ - public GSMovieMaker(PApplet parent, int requestWidth, int requestHeight, + public MovieMaker(PApplet parent, int requestWidth, int requestHeight, String filename, String encoder, String muxer, String[] propNames, Object[] propValues, int ifps) { init(parent, requestWidth, requestHeight, filename, encoder, muxer, propNames, propValues, ifps); }