@Override public synchronized void apply(Pointer<freenect_device> dev, Pointer<?> video, int timestamp) { updated = true; nextTimeStamp = timestamp; setImage(); }
@Override public synchronized void run() { shutdownFreenect(); } });
/** * Stop the stream */ public void stop() { callback.stop(); }
/** * Close the device. Closing an already closed device has no effect. */ public synchronized void close() { if (device == null) return; videoStream.stop(); depthStream.stop(); libfreenectLibrary.freenect_close_device(device); device = null; ACTIVE_CONTROLLERS.remove(this); }
/** * Switch the main camera between InfraRed and RGB modes. * * @param irmode * if true, then switches to IR mode, otherwise switches to RGB * mode. */ public void setIRMode(boolean irmode) { if (device == null) return; if (irmode) { if (!(videoStream instanceof KinectIRVideoStream)) { videoStream.stop(); videoStream = new KinectIRVideoStream(this); } } else { if (!(videoStream instanceof KinectRGBVideoStream)) { videoStream.stop(); videoStream = new KinectRGBVideoStream(this); } } }
/** * Set whether depth should be registered * * @param rdepth * if true, then switches to depth registered mode, otherwise * depth is not registered */ public void setRegisteredDepth(boolean rdepth) { if (device == null) return; if (depthStream.registered != rdepth) { depthStream.stop(); depthStream = new KinectDepthStream(this, rdepth); } }
@Override public synchronized void apply(Pointer<freenect_device> dev, Pointer<?> depth, int timestamp) { updated = true; nextTimeStamp = timestamp; setImage(); }
@Override public void finalize() { close(); }
@Override public T getNextFrame() { currentFrame++; callback.swapFrames(); return frame; }
/** * Close the device. Closing an already closed device has no effect. */ public synchronized void close() { if (device == null) return; videoStream.stop(); depthStream.stop(); libfreenectLibrary.freenect_close_device(device); device = null; ACTIVE_CONTROLLERS.remove(this); }
/** * Switch the main camera between InfraRed and RGB modes. * * @param irmode * if true, then switches to IR mode, otherwise switches to RGB * mode. */ public void setIRMode(boolean irmode) { if (device == null) return; if (irmode) { if (!(videoStream instanceof KinectIRVideoStream)) { videoStream.stop(); videoStream = new KinectIRVideoStream(this); } } else { if (!(videoStream instanceof KinectRGBVideoStream)) { videoStream.stop(); videoStream = new KinectRGBVideoStream(this); } } }
/** * Set whether depth should be registered * * @param rdepth * if true, then switches to depth registered mode, otherwise * depth is not registered */ public void setRegisteredDepth(boolean rdepth) { if (device == null) return; if (depthStream.registered != rdepth) { depthStream.stop(); depthStream = new KinectDepthStream(this, rdepth); } }
@Override public synchronized void apply(Pointer<freenect_device> dev, Pointer<?> video, int timestamp) { updated = true; nextTimeStamp = timestamp; setImage(); }
@Override public synchronized void run() { shutdownFreenect(); } });
/** * Stop the stream */ public void stop() { callback.stop(); }
@Override public synchronized void apply(Pointer<freenect_device> dev, Pointer<?> depth, int timestamp) { updated = true; nextTimeStamp = timestamp; setImage(); }
@Override public void finalize() { close(); }
@Override public T getNextFrame() { currentFrame++; callback.swapFrames(); return frame; }