org.vigia.server.driver.camera
Class CameraDriver

java.lang.Object
  extended by org.vigia.server.driver.camera.CameraDriver
All Implemented Interfaces:
Driver

public class CameraDriver
extends java.lang.Object
implements Driver

The camera driver class

Author:
jesus

Nested Class Summary
protected  class CameraDriver.FrameThread
          Thread to get the frames from the camera
 
Field Summary
private  JMFCapture camera
          JMFCapture object (webcam)
private  int currentXPos
          Current XPos of the camera
private  int currentYPos
          Current YPos of the camera
private static int DELAY
          Delay between frames
private  java.awt.image.BufferedImage frame
          current frame
protected  java.util.Set<FrameListener> frameListeners
          List of camera's frame listeners
protected  CameraDriver.FrameThread fThread
          The tread that grabs the frames
private  int imageCount
          count of images (frames)
protected  java.util.Set<LogListener> logListeners
          List of camera's log listeners
private  int m_Port
          Server's port
private  java.lang.String m_Server
          Server's IP address
private  boolean stop
          If true the camera's thread will stop
private  long totalTime
          total time of capturing period
 
Constructor Summary
CameraDriver()
          CameraDriver class constructor
CameraDriver(java.lang.String server, int port)
          CameraDriver class constructor
 
Method Summary
 void addFrameListener(FrameListener frameListener)
          Adds a listener to obtain the frames from the camera.
 void addLogListener(LogListener logListener)
          Adds a listener to obtain control messages from the camera.
 void goHome()
          Go to home position
 void move(int pan, int tilt, int zoom)
          Move to relative position (pan,tilt) and zoom
 void start()
          Start to capture frames from the camera
 void stop()
          Stop to capture frames from the camera
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

frameListeners

protected java.util.Set<FrameListener> frameListeners
List of camera's frame listeners


logListeners

protected java.util.Set<LogListener> logListeners
List of camera's log listeners


m_Server

private java.lang.String m_Server
Server's IP address


m_Port

private int m_Port
Server's port


currentXPos

private int currentXPos
Current XPos of the camera


currentYPos

private int currentYPos
Current YPos of the camera


DELAY

private static final int DELAY
Delay between frames

See Also:
Constant Field Values

stop

private boolean stop
If true the camera's thread will stop


camera

private JMFCapture camera
JMFCapture object (webcam)


imageCount

private int imageCount
count of images (frames)


totalTime

private long totalTime
total time of capturing period


frame

private java.awt.image.BufferedImage frame
current frame


fThread

protected CameraDriver.FrameThread fThread
The tread that grabs the frames

Constructor Detail

CameraDriver

public CameraDriver()
CameraDriver class constructor


CameraDriver

public CameraDriver(java.lang.String server,
                    int port)
             throws CameraDriverException
CameraDriver class constructor

Parameters:
server - server IP address
port - server HTTP port
Throws:
CameraDriverException - exception creating the camera driver
Method Detail

addFrameListener

public void addFrameListener(FrameListener frameListener)
Description copied from interface: Driver
Adds a listener to obtain the frames from the camera.

Specified by:
addFrameListener in interface Driver
Parameters:
frameListener - an implementation of the data listener.
See Also:
Driver.addFrameListener(org.vigia.shared.communications.FrameListener)

addLogListener

public void addLogListener(LogListener logListener)
Description copied from interface: Driver
Adds a listener to obtain control messages from the camera.

Specified by:
addLogListener in interface Driver
Parameters:
logListener - an implementation of the control listener.
See Also:
Driver.addLogListener(org.vigia.shared.communications.LogListener)

move

public void move(int pan,
                 int tilt,
                 int zoom)
Move to relative position (pan,tilt) and zoom

Specified by:
move in interface Driver
Parameters:
pan - pan movement
tilt - tilt movement
zoom - zoom movement

goHome

public void goHome()
Go to home position


start

public void start()
Start to capture frames from the camera

Specified by:
start in interface Driver
See Also:
Driver.start()

stop

public void stop()
Stop to capture frames from the camera

Specified by:
stop in interface Driver
See Also:
Driver.stop()