Class CameraDeviceConfigurator

java.lang.Object
com.banuba.sdk.input.CameraDeviceConfigurator

public abstract class CameraDeviceConfigurator extends Object
The class helps to reconfigure the camera.
See Also:
  • Field Details

    • SD_CAPTURE_SIZE

      public static final android.util.Size SD_CAPTURE_SIZE
      Available video and photo capture resolutions. In addition to these video resolutions, you can use your own.
    • HD_CAPTURE_SIZE

      public static final android.util.Size HD_CAPTURE_SIZE
    • FHD_CAPTURE_SIZE

      public static final android.util.Size FHD_CAPTURE_SIZE
    • QHD_CAPTURE_SIZE

      public static final android.util.Size QHD_CAPTURE_SIZE
    • DEFAULT_VIDEO_CAPTURE_SIZE

      public static final android.util.Size DEFAULT_VIDEO_CAPTURE_SIZE
      Default settings.
    • DEFAULT_IMAGE_CAPTURE_SIZE

      public static final android.util.Size DEFAULT_IMAGE_CAPTURE_SIZE
    • DEFAULT_LENS

      public static final CameraDeviceConfigurator.LensSelector DEFAULT_LENS
    • DEFAULT_FLASH_MODE

      public static final CameraDeviceConfigurator.FlashMode DEFAULT_FLASH_MODE
    • DEFAULT_LINEAR_ZOOM

      public static final float DEFAULT_LINEAR_ZOOM
      See Also:
    • DEFAULT_ZOOM_RATIO

      public static final float DEFAULT_ZOOM_RATIO
      See Also:
    • DEAULT_TORCH_ENABLED

      public static final boolean DEAULT_TORCH_ENABLED
      See Also:
    • mVideoCaptureSize

      protected android.util.Size mVideoCaptureSize
      Current settings
    • mImageCaptureSize

      protected android.util.Size mImageCaptureSize
    • mLens

    • mFrameRotationProviderCallback

      protected CameraDeviceConfigurator.IFrameRotationProviderCallback mFrameRotationProviderCallback
    • mIsMirroringEnabled

      protected boolean mIsMirroringEnabled
    • mTorchEnabled

      protected boolean mTorchEnabled
    • mLinearZoom

      protected float mLinearZoom
    • mZoomRatio

      protected float mZoomRatio
    • mFlashMode

      protected CameraDeviceConfigurator.FlashMode mFlashMode
  • Constructor Details

    • CameraDeviceConfigurator

      public CameraDeviceConfigurator()
  • Method Details

    • setVideoCaptureSize

      public CameraDeviceConfigurator setVideoCaptureSize(android.util.Size videoCaptureSize)
      Set the video capture resolution
      Parameters:
      videoCaptureSize - resolution
    • setImageCaptureSize

      public CameraDeviceConfigurator setImageCaptureSize(android.util.Size imageCaptureSize)
      Set the image capture resolution
      Parameters:
      imageCaptureSize - resolution
    • setLens

      Select current camera (front/back)
      Parameters:
      lens - front or back camera
    • setLens

      public CameraDeviceConfigurator setLens(CameraDeviceConfigurator.LensSelector lens, boolean isMirroringEnabled)
      Select current camera (front/back) and mirroring
      Parameters:
      lens - front or back camera
      isMirroringEnabled - enable mirroring. By default, front camera has mirroring enabled and the back camera has mirroring disabled
    • setTorchEnabled

      public CameraDeviceConfigurator setTorchEnabled(boolean enabled)
      Set the torch enabled
      Parameters:
      enabled - switches torch
    • setFlashMode

      Set flash mode when taking photos
      Parameters:
      flashMode - one of three: OFF, AUTO or ON
    • setLinearZoom

      public CameraDeviceConfigurator setLinearZoom(float zoom)
      Set the camera linear zoom
      Parameters:
      zoom - value in range [0.0f; 1.0f]
    • setZoomRatio

      public CameraDeviceConfigurator setZoomRatio(float zoom)
      Set the camera zoom ratio
      Parameters:
      zoom - ratio value. Min and max The min and max zoom value can be obtained from CameraDevice.getMinZoomRatio() and CameraDevice.getMaxZoomRatio()
    • setFrameRotationProviderCallback

      public CameraDeviceConfigurator setFrameRotationProviderCallback(CameraDeviceConfigurator.IFrameRotationProviderCallback callback)
      Set frame rotation provider callback
      Parameters:
      callback - rotation provider
    • commit

      public abstract void commit()
      The method commits all changes and reconfigures the camera.