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
interface CameraEventsHandler
Camera events handler - can be used to be notifed about camera events.
Link copied to clipboard
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
Remove MediaRecorder from camera pipeline.
Link copied to clipboard
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
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
Link copied to clipboard
Start capturing frames in a format that is as close as possible to
width x height
and framerate
.Link copied to clipboard
Stop capturing.