Camera2Base
Wrapper to stream with camera2 api and microphone. Support stream with SurfaceView, TextureView, OpenGlView(Custom SurfaceView that use OpenGl) and Context(background mode). All views use Surface to buffer encoding mode for H264. API requirements: API 21+. Created by pedro on 7/07/17.
Inheritors
Functions
Link copied to clipboard
open fun addImageListener(width: Int, height: Int, format: Int, maxImages: Int, listener: Camera2ApiManager.ImageCallback)
open fun addImageListener(width: Int, height: Int, format: Int, maxImages: Int, autoClose: Boolean, listener: Camera2ApiManager.ImageCallback)
Link copied to clipboard
Mute microphone, can be called before, while and after stream.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Enable a muted microphone, can be called before, while and after stream.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Enable OIS video stabilization Warning: Turning both OIS and EIS modes on may produce undesirable interaction, so it is recommended not to enable both at the same time.
Link copied to clipboard
Enable EIS video stabilization Warning: Turning both OIS and EIS modes on may produce undesirable interaction, so it is recommended not to enable both at the same time.
Link copied to clipboard
Link copied to clipboard
Force stream to work with fps selected in prepareVideo method.
Link copied to clipboard
Link copied to clipboard
Get supported properties of the camera
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Get supported resolutions of cameraId in px.
Link copied to clipboard
Get supported resolutions of back camera in px.
Link copied to clipboard
Get supported resolutions of front camera in px.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Return zoom level range
Link copied to clipboard
Get mute state of microphone.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Use getCameraFacing instead
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Get preview state.
Link copied to clipboard
Link copied to clipboard
Get record state.
Link copied to clipboard
Get stream state.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Same to call: prepareAudio(64 * 1024, 32000, true, false, false);
open fun prepareAudio(bitrate: Int, sampleRate: Int, isStereo: Boolean, echoCanceler: Boolean, noiseSuppressor: Boolean): Boolean
open fun prepareAudio(audioSource: Int, bitrate: Int, sampleRate: Int, isStereo: Boolean, echoCanceler: Boolean, noiseSuppressor: Boolean): Boolean
Call this method before use @startStream.
Link copied to clipboard
Same to call: isHardwareRotation = true; if (openGlVIew) isHardwareRotation = false; prepareVideo(640, 480, 30, 1200 * 1024, isHardwareRotation, 90);
open fun prepareVideo(width: Int, height: Int, fps: Int, bitrate: Int, iFrameInterval: Int, rotation: Int): Boolean
backward compatibility reason
open fun prepareVideo(width: Int, height: Int, fps: Int, bitrate: Int, iFrameInterval: Int, rotation: Int, profile: Int, level: Int): Boolean
Call this method before use @startStream.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Set an audio effect modifying microphone's PCM buffer.
Link copied to clipboard
Set a callback to know errors related with Video/Audio encoders
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Set the mode to calculate timestamp.
Link copied to clipboard
Set video bitrate of H264 in bits per second while stream.
Link copied to clipboard
Link copied to clipboard
Set zoomIn or zoomOut to camera.
Link copied to clipboard
open fun startPreview(cameraFacing: CameraHelper.Facing, width: Int, height: Int, fps: Int, rotation: Int)
Start camera preview.
Link copied to clipboard
Starts recording a MP4 video.
Link copied to clipboard
Need be called after @prepareVideo or/and @prepareAudio.
Link copied to clipboard
Link copied to clipboard
Similar to stopPreview but you can do it while streaming or recording.
Link copied to clipboard
Stop camera preview.
Link copied to clipboard
Stop record MP4 video started with @startRecord.
Link copied to clipboard
Stop stream started with @startStream.
Link copied to clipboard
Switch camera used.
Choose a specific camera to use.
Link copied to clipboard