try {
// Parse the byte array into a Buffered Image
- //InputStream in = new ByteArrayInputStream(_camera.getLatestFrame());
InputStream in = new ByteArrayInputStream(latestFrame);
img = ImageIO.read(in);
// Save the image and timestamp for use later
imageWriteLock.lock(); // lock the image and timestamp buffers since multithread
- latestImage = img; // image into image buffer
+ latestImage = img; // image into image buffer
// timestamp from camera into timestamo buffer
- //try {
- //long dateLong = _camera.getTimestamp();
- long dateLong = timeStamp;
- possibleDate = new Date(dateLong);
- //} catch (RemoteException e) {
- // e.printStackTrace();
- //}
+ long dateLong = timeStamp;
+ possibleDate = new Date(dateLong);
imageWriteLock.unlock(); // Never forget to unlock
// Motion was detected so issue callbacks to all objects that registered
// to receive callback from this class.
for (MotionDetectionCallback c : callbackList) {
- //try {
- c.motionDetected(this.getTimestampOfLastMotion());
- //} catch (RemoteException re) {
- //}
+ c.motionDetected(this.getTimestampOfLastMotion());
}
} else {