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.IpCamDevice
Spezielle 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.String
CAM_NAME
Kameraname
-
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.BufferedImage
getImage()
Liest ein Bild von der DroidCam.boolean
isOnline()
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.MalformedURLException
Erstellt 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:
getImage
in interfacecom.github.sarxos.webcam.WebcamDevice
- Overrides:
getImage
in classcom.github.sarxos.webcam.ds.ipcam.IpCamDevice
-
isOnline
public boolean isOnline()
Pings the DroidCam URL. This effectively sends a GET request and returnstrue
if the response code is in the 200-399 range.- Overrides:
isOnline
in classcom.github.sarxos.webcam.ds.ipcam.IpCamDevice
- Returns:
true
if the given HTTP URL has returned response code 200-399 on a HEAD request within the given TIMEOUT_PING, otherwisefalse
.
-
-