CameraVideoCapturer

interface CameraVideoCapturer : VideoCapturer

Base interface for camera1 and camera2 implementations. Extends VideoCapturer with a switchCamera() function. Also provides subinterfaces for handling camera events, and a helper class for detecting camera freezes.

Types

Link copied to clipboard
interface CameraEventsHandler
Camera events handler - can be used to be notifed about camera events.
Link copied to clipboard
open class CameraStatistics
Helper class to log framerate and detect if the camera freezes.
Link copied to clipboard
interface CameraSwitchHandler
Camera switch handler - one of these functions are invoked with the result of switchCamera().
Link copied to clipboard
interface MediaRecorderHandler
MediaRecorder add/remove handler - one of these functions are invoked with the result of addMediaRecorderToCamera() or removeMediaRecorderFromCamera calls.

Functions

Link copied to clipboard
open fun addMediaRecorderToCamera(mediaRecorder: MediaRecorder, resultHandler: CameraVideoCapturer.MediaRecorderHandler)
Add MediaRecorder to camera pipeline.
Link copied to clipboard
open fun removeMediaRecorderFromCamera(resultHandler: CameraVideoCapturer.MediaRecorderHandler)
Remove MediaRecorder from camera pipeline.
Link copied to clipboard
abstract fun setTorch(enabled: Boolean)
Link copied to clipboard
abstract fun setZoom(@Nullable zoom: Float)
Link copied to clipboard
abstract fun switchCamera(switchEventsHandler: CameraVideoCapturer.CameraSwitchHandler)
Switch camera to the next valid camera id.
abstract fun switchCamera(switchEventsHandler: CameraVideoCapturer.CameraSwitchHandler, cameraName: String)
Switch camera to the specified camera id.