Class 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
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.github.sarxos.webcam.WebcamDevice

        com.github.sarxos.webcam.WebcamDevice.BufferAccess, com.github.sarxos.webcam.WebcamDevice.Configurable, com.github.sarxos.webcam.WebcamDevice.FPSSource
    • 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.
      • Methods inherited from class com.github.sarxos.webcam.ds.ipcam.IpCamDevice

        close, dispose, getAuth, getClient, getFPS, getImageBytes, getImageBytes, getMode, getName, getResolution, getResolutions, getURL, isOpen, open, setResolution, setSizes, toURL
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 interface com.github.sarxos.webcam.WebcamDevice
        Overrides:
        getImage in class com.github.sarxos.webcam.ds.ipcam.IpCamDevice
      • isOnline

        public boolean isOnline()
        Pings the DroidCam URL. This effectively sends a GET request and returns true if the response code is in the 200-399 range.
        Overrides:
        isOnline in class com.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, otherwise false.