Class DroidCamDevice
- java.lang.Object
-
- com.github.sarxos.webcam.ds.ipcam.IpCamDevice
-
- de.frankmuenster.jameica.qrscanner.ipcam.DroidCamDevice
-
- All Implemented Interfaces:
com.github.sarxos.webcam.WebcamDevice,com.github.sarxos.webcam.WebcamDevice.BufferAccess,com.github.sarxos.webcam.WebcamDevice.FPSSource
public class DroidCamDevice extends com.github.sarxos.webcam.ds.ipcam.IpCamDeviceSpezielle IpCamDevice Implementierung für DroidCam App. Überschreibt isOnline und getImage.- Author:
- Frank Münster
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCAM_NAMEKameraname
-
Constructor Summary
Constructors Constructor Description DroidCamDevice(java.lang.String host, int port)Erstellt ein DroidCam Instance durch Angabe der IP und des Ports.DroidCamDevice(java.net.URL url)Erstellt ein DroidCam Instance durch Angabe der URL.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.image.BufferedImagegetImage()Liest ein Bild von der DroidCam.booleanisOnline()Pings the DroidCam URL.
-
-
-
Field Detail
-
CAM_NAME
public static final java.lang.String CAM_NAME
Kameraname- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DroidCamDevice
public DroidCamDevice(java.lang.String host, int port) throws java.net.MalformedURLExceptionErstellt ein DroidCam Instance durch Angabe der IP und des Ports.- Parameters:
host- Der Host des Streams. Kann auch IP-Adresse sein.port- Der Port des Streams.- Throws:
java.net.MalformedURLException
-
DroidCamDevice
public DroidCamDevice(java.net.URL url)
Erstellt ein DroidCam Instance durch Angabe der URL.- Parameters:
url- Die URL zu dem mjpegfeed Stream der DroidCam App. Das Suffix mjpegfeed muss mit angegeben werden.
-
-
Method Detail
-
getImage
public java.awt.image.BufferedImage getImage()
Liest ein Bild von der DroidCam. Sendet alle 2 Sekunden eine Auto-Fokus Anfrage.- Specified by:
getImagein interfacecom.github.sarxos.webcam.WebcamDevice- Overrides:
getImagein classcom.github.sarxos.webcam.ds.ipcam.IpCamDevice
-
isOnline
public boolean isOnline()
Pings the DroidCam URL. This effectively sends a GET request and returnstrueif the response code is in the 200-399 range.- Overrides:
isOnlinein classcom.github.sarxos.webcam.ds.ipcam.IpCamDevice- Returns:
trueif the given HTTP URL has returned response code 200-399 on a HEAD request within the given TIMEOUT_PING, otherwisefalse.
-
-