# CameraXSource

class CameraXSource(context: Context) : VideoSource, LifecycleOwner

Created by pedro on 16/2/24.

## Constructors

CameraXSource
Link copied to clipboard
constructor(context: Context)

## Properties

created
Link copied to clipboard
var created: Boolean
fps
Link copied to clipboard
var fps: Int
height
Link copied to clipboard
var height: Int
lifecycle
Link copied to clipboard
open override val lifecycle: Lifecycle
rotation
Link copied to clipboard
var rotation: Int
surfaceTexture
Link copied to clipboard
var surfaceTexture: SurfaceTexture?
width
Link copied to clipboard
var width: Int

## Functions

addImageListener
Link copied to clipboard
fun addImageListener(width: Int, height: Int, format: Int, autoClose: Boolean, listener: Camera2ApiManager.ImageCallback)
disableAutoExposure
Link copied to clipboard
fun disableAutoExposure()
disableAutoFocus
Link copied to clipboard
fun disableAutoFocus(): Boolean
disableAutoWhiteBalance
Link copied to clipboard
fun disableAutoWhiteBalance()
disableLantern
Link copied to clipboard
fun disableLantern()
enableAutoExposure
Link copied to clipboard
fun enableAutoExposure(): Boolean
enableAutoFocus
Link copied to clipboard
fun enableAutoFocus(): Boolean
enableAutoWhiteBalance
Link copied to clipboard
fun enableAutoWhiteBalance(): Boolean
enableLantern
Link copied to clipboard
fun enableLantern()
getCameraFacing
Link copied to clipboard
fun getCameraFacing(): Int
getCameraResolutions
Link copied to clipboard
fun getCameraResolutions(facing: CameraHelper.Facing): List<Size>
getExposure
Link copied to clipboard
fun getExposure(): Int
getOrientationConfig
Link copied to clipboard
open fun getOrientationConfig(): OrientationConfig
getZoom
Link copied to clipboard
fun getZoom(): Float
getZoomRange
Link copied to clipboard
fun getZoomRange(): Range<Float>
init
Link copied to clipboard
fun init(width: Int, height: Int, fps: Int, rotation: Int): Boolean
isAutoExposureEnabled
Link copied to clipboard
fun isAutoExposureEnabled(): Boolean
isAutoFocusEnabled
Link copied to clipboard
fun isAutoFocusEnabled(): Boolean
isAutoWhiteBalanceEnabled
Link copied to clipboard
fun isAutoWhiteBalanceEnabled(): Boolean
isLanternEnabled
Link copied to clipboard
fun isLanternEnabled(): Boolean
isRunning
Link copied to clipboard
open override fun isRunning(): Boolean
openCamera
Link copied to clipboard
fun openCamera(info: CameraInfo)
release
Link copied to clipboard
open override fun release()
removeImageListener
Link copied to clipboard
fun removeImageListener()
setExposure
Link copied to clipboard
fun setExposure(level: Int)
setRequiredResolution
Link copied to clipboard
fun setRequiredResolution(size: Size?)

Set the required resolution for the camera. Must be called before prepareVideo or changeVideoSource. Otherwise it will be ignored.

setZoom
Link copied to clipboard
fun setZoom(level: Float)
@JvmOverloads
fun setZoom(event: MotionEvent, delta: Float = 0.1f)
start
Link copied to clipboard
open override fun start(surfaceTexture: SurfaceTexture)
stop
Link copied to clipboard
open override fun stop()
switchCamera
Link copied to clipboard
fun switchCamera()
tapToFocus
Link copied to clipboard
fun tapToFocus(view: View, event: MotionEvent): Boolean