Camera1ApiManager

Created by pedro on 20/01/17. This class need use same resolution, fps and imageFormat that VideoEncoder Tested with YV12 and NV21.

Advantage = you can control fps of the stream. Disadvantages = you cant use all resolutions, only resolution that your camera support.

If you want use all resolutions. You can use libYuv for resize images in OnPreviewFrame: https://chromium.googlesource.com/libyuv/libyuv/

Constructors

Link copied to clipboard
constructor(surfaceView: SurfaceView, getCameraData: GetCameraData)
constructor(textureView: TextureView, getCameraData: GetCameraData)
constructor(surfaceTexture: SurfaceTexture, context: Context)

Properties

Link copied to clipboard
open val height: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open val width: Int

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun disableLantern()
@required:
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun enableFaceDetection(faceDetectorCallback: FaceDetectorCallback): Boolean
Link copied to clipboard
open fun enableLantern()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
See: ImageFormat to know name of constant values Example: 842094169 -> YV12, 17 -> NV21
Link copied to clipboard
open fun getCameraSize(width: Int, height: Int): Camera.Size
Link copied to clipboard
open fun getExposure(): Int
Link copied to clipboard
open fun getMaxExposure(): Int
Link copied to clipboard
open fun getMaxZoom(): Int
Link copied to clipboard
open fun getMinExposure(): Int
Link copied to clipboard
open fun getMinZoom(): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getZoom(): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun isRunning(): Boolean
Link copied to clipboard
Link copied to clipboard
open fun onFaceDetection(faces: Array<Camera.Face>, camera: Camera)
Link copied to clipboard
open fun onPreviewFrame(data: Array<Byte>, camera: Camera)
Link copied to clipboard
open fun setCameraCallbacks(cameraCallbacks: CameraCallbacks)
Link copied to clipboard
open fun setCameraFacing(cameraFacing: CameraHelper.Facing)
Link copied to clipboard
open fun setCameraSelect(cameraFacing: Int)
Link copied to clipboard
open fun setExposure(value: Int)
Link copied to clipboard
open fun setPreviewOrientation(orientation: Int)
Link copied to clipboard
open fun setRotation(rotation: Int)
Link copied to clipboard
open fun setSurfaceTexture(surfaceTexture: SurfaceTexture)
Link copied to clipboard
open fun setZoom(event: MotionEvent)
open fun setZoom(level: Int)
open fun setZoom(event: MotionEvent, delta: Int)
Link copied to clipboard
open fun start(width: Int, height: Int, fps: Int)
open fun start(cameraFacing: CameraHelper.Facing, width: Int, height: Int, fps: Int)
open fun start(facing: Int, width: Int, height: Int, fps: Int)
Link copied to clipboard
open fun stop()
Link copied to clipboard
open fun switchCamera()
open fun switchCamera(cameraId: Int)
Link copied to clipboard
open fun tapToFocus(view: View, event: MotionEvent): Boolean