CameraVideoCapturer

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
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
Camera switch handler - one of these functions are invoked with the result of switchCamera().
Link copied to clipboard
MediaRecorder add/remove handler - one of these functions are invoked with the result of addMediaRecorderToCamera() or removeMediaRecorderFromCamera calls.

Functions

Link copied to clipboard
Add MediaRecorder to camera pipeline.
Link copied to clipboard
Remove MediaRecorder from camera pipeline.
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.

Inherited functions

Link copied to clipboard
abstract fun changeCaptureFormat(width: Int, height: Int, framerate: Int)
Link copied to clipboard
abstract fun dispose()
Perform any final cleanup here.
Link copied to clipboard
abstract fun initialize(surfaceTextureHelper: SurfaceTextureHelper, applicationContext: Context, capturerObserver: CapturerObserver)
This function is used to initialize the camera thread, the android application context, and the capture observer.
Link copied to clipboard
abstract fun isScreencast(): Boolean
Link copied to clipboard
abstract fun startCapture(width: Int, height: Int, framerate: Int)
Start capturing frames in a format that is as close as possible to width x height and framerate.
Link copied to clipboard
abstract fun stopCapture()
Stop capturing.