Interface Video


  • public interface Video
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Close the webcam, the device will not be available after this call
      byte[] createFrame()
      Create a byte array suitable for holding a single video frame
      int getHeight()
      return the frame height
      int getWidth()
      Return the frame width
      int grabFrame​(byte[] frame)
      Grab a single frame from the device and store the image into the supplied array
      void open​(int w, int h)
      Open the device and make it available for use, specify the desired frame size.
      void open​(int w, int h, int format, int field, int fps)
      Open the device and make it available for use, specify the desired frame size.
    • Field Detail

      • PIX_FMT_MJPEG

        static final int PIX_FMT_MJPEG
      • PIX_FMT_JPEG

        static final int PIX_FMT_JPEG
      • PIX_FMT_YUYV

        static final int PIX_FMT_YUYV
    • Method Detail

      • open

        void open​(int w,
                  int h,
                  int format,
                  int field,
                  int fps)
           throws java.io.IOException
        Open the device and make it available for use, specify the desired frame size. Note that the actual frame size may be adjusted to conform to the capabilities of the device.
        Parameters:
        w - the desired frame width
        h - the desired frame height
        format - desired pixel format
        field - desired field layout
        fps - the desired frame rate
        Throws:
        java.io.IOException
      • open

        void open​(int w,
                  int h)
           throws java.io.IOException
        Open the device and make it available for use, specify the desired frame size. Note that the actual frame size may be adjusted to conform to the capabilities of the device.
        Parameters:
        w - the desired frame width
        h - the desired frame height
        Throws:
        java.io.IOException
      • grabFrame

        int grabFrame​(byte[] frame)
               throws java.io.IOException
        Grab a single frame from the device and store the image into the supplied array
        Parameters:
        frame - array to store the frame
        Returns:
        the size of the frame grabbed (in bytes)
        Throws:
        java.io.IOException
      • close

        void close()
            throws java.io.IOException
        Close the webcam, the device will not be available after this call
        Throws:
        java.io.IOException
      • createFrame

        byte[] createFrame()
        Create a byte array suitable for holding a single video frame
        Returns:
        the frame array
      • getWidth

        int getWidth()
        Return the frame width
        Returns:
        width in pixels
      • getHeight

        int getHeight()
        return the frame height
        Returns:
        height in pixels