diff --git a/core/todo.txt b/core/todo.txt
index 0af074886..2f365871b 100644
--- a/core/todo.txt
+++ b/core/todo.txt
@@ -1,6 +1,13 @@
0208 core
+X remove/hide several video functions that weren't approved
+api to be fixed/removed
+_ remove PImage.delete() and friends from PImage, Movie, etc.
+_ delete()/dispose() being used in the movie
+_ buffer sink methods in movie
+_ 'newFrame' is 'available', and ready() is part of that
+
_ loadShape() mess
_ get things out of PGraphics
_ separate PShape2/3D from OpenGL
diff --git a/java/libraries/video/src/processing/video/Capture.java b/java/libraries/video/src/processing/video/Capture.java
index fc9af182a..d6d4232ce 100644
--- a/java/libraries/video/src/processing/video/Capture.java
+++ b/java/libraries/video/src/processing/video/Capture.java
@@ -242,7 +242,7 @@ public class Capture extends PImage implements PConstants {
*
* @return boolean
*/
- public boolean ready() {
+ protected boolean ready() {
return 0 < bufWidth && 0 < bufHeight && pipelineReady;
}
@@ -253,7 +253,7 @@ public class Capture extends PImage implements PConstants {
*
* @return boolean
*/
- public synchronized boolean newFrame() {
+ protected synchronized boolean newFrame() {
boolean res = newFrame;
newFrame = false;
return res;
@@ -264,7 +264,7 @@ public class Capture extends PImage implements PConstants {
*
* @return boolean
*/
- public boolean isCapturing() {
+ protected boolean isCapturing() {
return capturing;
}
@@ -282,6 +282,7 @@ public class Capture extends PImage implements PConstants {
return available;
}
+
/**
* Starts capturing frames from the selected device.
*/
@@ -303,6 +304,7 @@ public class Capture extends PImage implements PConstants {
}
}
+
/**
* ( begin auto-generated from Capture_stop.xml )
*
@@ -322,6 +324,7 @@ public class Capture extends PImage implements PConstants {
gpipeline.stop();
}
+
/**
* ( begin auto-generated from Capture_read.xml )
*
@@ -387,6 +390,7 @@ public class Capture extends PImage implements PConstants {
newFrame = true;
}
+
/**
*
Advanced
* Returns the name of the source element used for capture.
@@ -397,6 +401,7 @@ public class Capture extends PImage implements PConstants {
return source;
}
+
/**
* ( begin auto-generated from Capture_list.xml )
*
@@ -412,6 +417,7 @@ public class Capture extends PImage implements PConstants {
return list(capturePlugin);
}
+
/**
* Advanced
* Get a list of all available captures as a String array. i.e.
@@ -451,6 +457,7 @@ public class Capture extends PImage implements PConstants {
return res;
}
+
static protected String[] list(String sourceName, String propertyName) {
Video.init();
String[] valuesListing = new String[0];
@@ -471,6 +478,7 @@ public class Capture extends PImage implements PConstants {
return valuesListing;
}
+
/**
* Advanced
* Returns a list with the resolutions supported by the capture device,
@@ -478,7 +486,7 @@ public class Capture extends PImage implements PConstants {
*
* @return Resolution[]
*/
- public Resolution[] resolutions() {
+ protected Resolution[] resolutions() {
Resolution[] res;
if (resolutions == null) {
@@ -494,13 +502,14 @@ public class Capture extends PImage implements PConstants {
return res;
}
+
/**
* Advanced
* Prints all the gstreamer elements currently used in the
* current pipeline instance.
*
*/
- public void printElements() {
+ protected void printElements() {
List list = gpipeline.getElementsRecursive();
PApplet.println(list);
for (Element element : list) {
@@ -515,7 +524,7 @@ public class Capture extends PImage implements PConstants {
* be called upon a new frame read event.
*
*/
- public void setEventHandlerObject(Object obj) {
+ protected void setEventHandlerObject(Object obj) {
eventHandler = obj;
try {
diff --git a/java/libraries/video/src/processing/video/Movie.java b/java/libraries/video/src/processing/video/Movie.java
index 53bcfabef..6f7ef70ce 100644
--- a/java/libraries/video/src/processing/video/Movie.java
+++ b/java/libraries/video/src/processing/video/Movie.java
@@ -136,6 +136,7 @@ public class Movie extends PImage implements PConstants {
}
}
+
/**
* Same as delete.
*/
@@ -143,6 +144,7 @@ public class Movie extends PImage implements PConstants {
delete();
}
+
/**
* Finalizer of the class.
*/
@@ -154,13 +156,14 @@ public class Movie extends PImage implements PConstants {
}
}
+
/**
* Get the width of the source video. Note: calling this method repeatedly
* can slow down playback performance.
*
* @return int
*/
- public int getSourceWidth() {
+ protected int getSourceWidth() {
Dimension dim = gplayer.getVideoSize();
if (dim != null) {
return dim.width;
@@ -169,13 +172,14 @@ public class Movie extends PImage implements PConstants {
}
}
+
/**
* Get the height of the source video. Note: calling this method repeatedly
* can slow down playback performance.
*
* @return int
*/
- public int getSourceHeight() {
+ protected int getSourceHeight() {
Dimension dim = gplayer.getVideoSize();
if (dim != null) {
return dim.height;
@@ -184,16 +188,18 @@ public class Movie extends PImage implements PConstants {
}
}
+
/**
* Get the original framerate of the source video. Note: calling this method repeatedly
* can slow down playback performance.
*
* @return float
*/
- public float getSourceFrameRate() {
+ protected float getSourceFrameRate() {
return (float)gplayer.getVideoSinkFrameRate();
}
+
/**
* ( begin auto-generated from Movie_frameRate.xml )
*
@@ -242,6 +248,7 @@ public class Movie extends PImage implements PConstants {
fps = ifps;
}
+
/**
* ( begin auto-generated from Movie_speed.xml )
*
@@ -268,6 +275,7 @@ public class Movie extends PImage implements PConstants {
}
}
+
/**
* ( begin auto-generated from Movie_duration.xml )
*
@@ -285,6 +293,7 @@ public class Movie extends PImage implements PConstants {
return sec + Video.nanoSecToSecFrac(nanosec);
}
+
/**
* ( begin auto-generated from Movie_time.xml )
*
@@ -302,6 +311,7 @@ public class Movie extends PImage implements PConstants {
return sec + Video.nanoSecToSecFrac(nanosec);
}
+
/**
* ( begin auto-generated from Movie_jump.xml )
*
@@ -339,12 +349,13 @@ public class Movie extends PImage implements PConstants {
seeking = false;
}
+
/**
* Returns true if the stream is already producing frames.
*
* @return boolean
*/
- public boolean ready() {
+ protected boolean ready() {
return 0 < bufWidth && 0 < bufHeight && sinkReady && !seeking;
}
@@ -355,7 +366,7 @@ public class Movie extends PImage implements PConstants {
*
* @return boolean
*/
- public boolean newFrame() {
+ protected boolean newFrame() {
boolean res = newFrame;
newFrame = false;
return res;
@@ -380,7 +391,7 @@ public class Movie extends PImage implements PConstants {
*
* @return boolean
*/
- public boolean isPlaying() {
+ protected boolean isPlaying() {
return playing;
}
@@ -390,7 +401,7 @@ public class Movie extends PImage implements PConstants {
*
* @return boolean
*/
- public boolean isPaused() {
+ protected boolean isPaused() {
return paused;
}
@@ -399,7 +410,7 @@ public class Movie extends PImage implements PConstants {
*
* @return boolean
*/
- public boolean isLooping() {
+ protected boolean isLooping() {
return repeat;
}
@@ -505,7 +516,7 @@ public class Movie extends PImage implements PConstants {
}
if (playing) {
- goToBeginning();
+ jump(0);
playing = false;
}
paused = false;
@@ -577,20 +588,7 @@ public class Movie extends PImage implements PConstants {
newFrame = true;
}
- /**
- * Goes to the first frame of the movie.
- */
- public void goToBeginning() {
- jump(0.0f);
- }
- /**
- * Goes to the last frame of the movie.
- */
- public void goToEnd() {
- jump(duration());
- }
-
/**
* Change the volume. Values are from 0 to 1.
*
@@ -602,21 +600,13 @@ public class Movie extends PImage implements PConstants {
}
}
- /**
- * Returns the text string containing the filename of the video loaded.
- *
- * @return String
- */
- public String getFilename() {
- return filename;
- }
/**
* Prints all the gstreamer elements currently used in the
* current player instance.
*
*/
- public void printElements() {
+ protected void printElements() {
List list = gplayer.getElementsRecursive();
PApplet.println(list);
for (Element element : list) {
@@ -630,7 +620,7 @@ public class Movie extends PImage implements PConstants {
* be called upon a new frame read event.
*
*/
- public void setEventHandlerObject(Object obj) {
+ protected void setEventHandlerObject(Object obj) {
eventHandler = obj;
try {
@@ -829,10 +819,10 @@ public class Movie extends PImage implements PConstants {
if (repeat) {
if (0 < rate) {
// Playing forward, so we return to the beginning
- goToBeginning();
+ jump(0);
} else {
// Playing backwards, so we go to the end.
- goToEnd();
+ jump(duration());
}
// The rate is reset to 1 when restarting the stream, so
diff --git a/todo.txt b/todo.txt
index fb4787b01..ea3cba663 100644
--- a/todo.txt
+++ b/todo.txt
@@ -73,6 +73,7 @@ _ so that it re-loads in the proper environment
2.0 FINAL / casey stuff
+_ change "Standard" to "Java" mode
_ change syntax highlighting so it differentiates keyPressed and keyPressed()
_ syntax highlight with parens also helps "String line" vs "line()"
_ errors that cannot be placed (i.e. missing brace)