public class IpCamDevice extends java.lang.Object implements WebcamDevice, WebcamDevice.FPSSource, WebcamDevice.BufferAccess
WebcamDevice.BufferAccess, WebcamDevice.Configurable, WebcamDevice.FPSSource
Constructor and Description |
---|
IpCamDevice(java.lang.String name,
java.lang.String url,
IpCamMode mode) |
IpCamDevice(java.lang.String name,
java.lang.String url,
IpCamMode mode,
IpCamAuth auth) |
IpCamDevice(java.lang.String name,
java.net.URL url,
IpCamMode mode) |
IpCamDevice(java.lang.String name,
java.net.URL url,
IpCamMode mode,
IpCamAuth auth) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
dispose() |
IpCamAuth |
getAuth() |
org.apache.http.client.HttpClient |
getClient() |
double |
getFPS() |
java.awt.image.BufferedImage |
getImage() |
java.nio.ByteBuffer |
getImageBytes()
Return image RGB data in form of
ByteBuffer . |
void |
getImageBytes(java.nio.ByteBuffer buffer)
Put image RGB data into the
ByteBuffer . |
IpCamMode |
getMode() |
java.lang.String |
getName() |
java.awt.Dimension |
getResolution() |
java.awt.Dimension[] |
getResolutions() |
java.net.URL |
getURL() |
boolean |
isOnline()
This method will send HTTP HEAD request to the camera URL to check whether it's online or
offline.
|
boolean |
isOpen() |
void |
open() |
void |
setResolution(java.awt.Dimension size) |
protected void |
setSizes(java.awt.Dimension[] sizes) |
protected static java.net.URL |
toURL(java.lang.String url) |
public IpCamDevice(java.lang.String name, java.lang.String url, IpCamMode mode) throws java.net.MalformedURLException
java.net.MalformedURLException
public IpCamDevice(java.lang.String name, java.net.URL url, IpCamMode mode)
public IpCamDevice(java.lang.String name, java.lang.String url, IpCamMode mode, IpCamAuth auth) throws java.net.MalformedURLException
java.net.MalformedURLException
protected static final java.net.URL toURL(java.lang.String url)
public org.apache.http.client.HttpClient getClient()
public java.lang.String getName()
getName
in interface WebcamDevice
public java.awt.Dimension[] getResolutions()
getResolutions
in interface WebcamDevice
protected void setSizes(java.awt.Dimension[] sizes)
public java.awt.Dimension getResolution()
getResolution
in interface WebcamDevice
public void setResolution(java.awt.Dimension size)
setResolution
in interface WebcamDevice
public java.awt.image.BufferedImage getImage()
getImage
in interface WebcamDevice
public boolean isOnline()
public void open()
open
in interface WebcamDevice
public void close()
close
in interface WebcamDevice
public java.net.URL getURL()
public IpCamMode getMode()
public IpCamAuth getAuth()
public void dispose()
dispose
in interface WebcamDevice
public boolean isOpen()
isOpen
in interface WebcamDevice
public double getFPS()
getFPS
in interface WebcamDevice.FPSSource
public java.nio.ByteBuffer getImageBytes()
ByteBuffer
. Please note that ByteBuffer
returned by this method does not contain original JPEG data bytes, but bytes representing RGB
data of the image constructed from JPEG data.getImageBytes
in interface WebcamDevice.BufferAccess
public void getImageBytes(java.nio.ByteBuffer buffer)
ByteBuffer
. Please note that data from ByteBuffer
consumed by this method does not contain original JPEG data bytes, but bytes representing RGB
data of the image constructed from JPEG data.getImageBytes
in interface WebcamDevice.BufferAccess
Copyright © 2012-2018 Bartosz Firyn (SarXos). All Rights Reserved.