mirror of
https://github.com/processing/processing4.git
synced 2026-01-29 19:31:16 +01:00
cleaning things up with new gsvideo code
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="lib" path="lib/gstreamer-java.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jna.jar"/>
|
||||
<classpathentry kind="lib" path="/home/andres/Coding/Processing/libs/1.5/core.jar"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/processing-core"/>
|
||||
<classpathentry kind="lib" path="library/gstreamer-java.jar"/>
|
||||
<classpathentry kind="lib" path="library/jna.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
* Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
package codeanticode.gsvideo;
|
||||
package processing.video;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
* Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
package codeanticode.gsvideo;
|
||||
package processing.video;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
* Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
package codeanticode.gsvideo;
|
||||
package processing.video;
|
||||
|
||||
import processing.core.*;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
* Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
package codeanticode.gsvideo;
|
||||
package processing.video;
|
||||
|
||||
import processing.core.*;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
* Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
package codeanticode.gsvideo;
|
||||
package processing.video;
|
||||
|
||||
import org.gstreamer.*;
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user