Heres the code:
- package schalterraum;
- import processing.core.PApplet;
- import processing.video.*;
- public class PhotoStage
- {
- private Capture myCapture;
- private PApplet parent;
- public PhotoStage(PApplet p)
- {
- parent = p;
- init();
- }
- private void init()
- {
- myCapture = new Capture(parent, 620, 480, 30);
- }
- public void draw()
- {
- parent.image(myCapture, 0, 0);
- }
- public void captureEvent(Capture myCapture)
- {
- myCapture.read();
- }
- }
The error
- java.lang.NullPointerException
- at processing.core.PApplet.registerNoArgs(PApplet.java:954)
- at processing.core.PApplet.registerDispose(PApplet.java:945)
- at processing.video.Capture.init(Capture.java:220)
- at processing.video.Capture.<init>(Capture.java:154)
- at processing.video.Capture.<init>(Capture.java:115)
- at schalterraum.PhotoStage.init(PhotoStage.java:19)
- at schalterraum.PhotoStage.<init>(PhotoStage.java:14)
- at schalterraum.SchalterRaum.init(SchalterRaum.java:31)
- at processing.core.PApplet.runSketch(PApplet.java:7442)
- at processing.core.PApplet.main(PApplet.java:7580)
- at schalterraum.SchalterRaum.main(SchalterRaum.java:42)
- java.lang.RuntimeException: Could not register dispose + () for processing.video.Capture@6caf16
- at processing.core.PApplet.die(PApplet.java:2571)
- at processing.core.PApplet.die(PApplet.java:2580)
- at processing.core.PApplet.registerNoArgs(PApplet.java:961)
- at processing.core.PApplet.registerDispose(PApplet.java:945)
- at processing.video.Capture.init(Capture.java:220)
- at processing.video.Capture.<init>(Capture.java:154)
- at processing.video.Capture.<init>(Capture.java:115)
- at schalterraum.PhotoStage.init(PhotoStage.java:19)
- at schalterraum.PhotoStage.<init>(PhotoStage.java:14)
- at schalterraum.SchalterRaum.init(SchalterRaum.java:31)
- at processing.core.PApplet.runSketch(PApplet.java:7442)
- at processing.core.PApplet.main(PApplet.java:7580)
- at schalterraum.SchalterRaum.main(SchalterRaum.java:42)
- Exception in thread "main" java.lang.RuntimeException: Error while setting up Capture
- at processing.core.PApplet.die(PApplet.java:2571)
- at processing.core.PApplet.die(PApplet.java:2580)
- at processing.video.Capture.init(Capture.java:247)
- at processing.video.Capture.<init>(Capture.java:154)
- at processing.video.Capture.<init>(Capture.java:115)
- at schalterraum.PhotoStage.init(PhotoStage.java:19)
- at schalterraum.PhotoStage.<init>(PhotoStage.java:14)
- at schalterraum.SchalterRaum.init(SchalterRaum.java:31)
- at processing.core.PApplet.runSketch(PApplet.java:7442)
- at processing.core.PApplet.main(PApplet.java:7580)
- at schalterraum.SchalterRaum.main(SchalterRaum.java:42)
If I'm adressing a capture device directly (Capture.list()[0]) the error changes to this
- quicktime.std.StdQTException[QTJava:7.6.6g],-9408=deviceCantMeetRequest,QT.vers:7668000
- at quicktime.std.StdQTException.checkError(StdQTException.java:40)
- at quicktime.std.sg.SGChannel.setDevice(SGChannel.java:330)
- at processing.video.Capture.init(Capture.java:203)
- at processing.video.Capture.<init>(Capture.java:154)
- at schalterraum.PhotoStage.init(PhotoStage.java:20)
- at schalterraum.PhotoStage.<init>(PhotoStage.java:14)
- at schalterraum.SchalterRaum.init(SchalterRaum.java:31)
- at processing.core.PApplet.runSketch(PApplet.java:7442)
- at processing.core.PApplet.main(PApplet.java:7580)
- at schalterraum.SchalterRaum.main(SchalterRaum.java:42)
- Exception in thread "main" java.lang.RuntimeException: Error while setting up Capture
- at processing.core.PApplet.die(PApplet.java:2571)
- at processing.core.PApplet.die(PApplet.java:2580)
- at processing.video.Capture.init(Capture.java:244)
- at processing.video.Capture.<init>(Capture.java:154)
- at schalterraum.PhotoStage.init(PhotoStage.java:20)
- at schalterraum.PhotoStage.<init>(PhotoStage.java:14)
- at schalterraum.SchalterRaum.init(SchalterRaum.java:31)
- at processing.core.PApplet.runSketch(PApplet.java:7442)
- at processing.core.PApplet.main(PApplet.java:7580)
- at schalterraum.SchalterRaum.main(SchalterRaum.java:42)
Quicktime 7 is installed and in the System Libaray (QTJava.zip). Also tried adding QTJava from processing folder to build path, didnt change anything.
Also starting application in 32bit mode, java version "1.6.0_26".
Getting mad here ..
1