Skip to content

Camera1Base

Pedro Sánchez edited this page Apr 3, 2020 · 1 revision

Camera1Base

With Camera1Base (RtmpCamera1 and RtspCamera1) you can use the following methods:

Commons (with RtmpCamera1 and RtspCamera1):

setCustomAudioEffect

Set an audio effect modifying microphone's PCM buffer

Methods:

setFpsListener

Callback to get fps while record or stream. Set null to disable.

Methods:

enableFaceDetection

Experimental. Enable face detection returning faces detected in the callback.

Methods:

disableFaceDetection

Experimental. Disable face detection

Methods:

isFrontCamera

Check if you are using front camera. True if front camera, false if back camera.

Methods:

enableLantern

Enable lantern.

Methods:

disableLantern

Disable lantern

Methods:

isLanternEnabled

Check if you are using front camera. True if front camera, false if back camera.

Methods:

setAuthorization

Authentication with server. Call this methods before startStream. Methods: String user, String password

prepareVideo

Call this method before use startStream. Configure your video parameters. NOTE: Rotation with encoder is silence ignored in some devices.

Methods:

prepareAudio

Call this method before use startStream. Configure your audio parameters

Methods:

setForce

Force use audio and video software, hardware or first compatible found encoder

Methods:

startRecord

Start record a video. Should be called after prepareVideo and prepareAudio

Methods:

stopRecord

Stop record MP4 video started with startRecord. If you don't call it file will be unreadable

Methods:

replaceView

Replace glInterface used on fly. Ignored if you use SurfaceView or TextureView

Methods:

startPreview

Start camera preview. Ignored, if stream or preview is started.

Methods:

stopPreview

Stop camera preview. Ignored if streaming or already stopped. You need call it after stopStream to release camera properly if you will close activity.

Methods:

setPreviewOrientation

Change preview orientation can be called while stream. Could be 90, 180, 270 or 0.

Methods:

setZoom

Set zoomIn or zoomOut to camera. Expected to get event.getPointerCount() > 1

Methods:

startStream

Need be called after prepareVideo or/and prepareAudio. This method override resolution of startPreview to resolution seated in prepareVideo. If you never startPreview this method startPreview for you to resolution seated in prepareVideo

Methods:

stopStream

Stop stream started with startStream

Methods:

reTry

Try reconnect to server as many times as indicated in setReTries method.

Methods:

setReTries

Set number of reTry to do.

Methods:

getResolutionsBack

Return valid camera back resolutions.

Methods:

getResolutionsFront

Return valid camera back resolutions.

Methods:

disableAudio

Mute microphone, can be called before, while and after stream

Methods:

enableAudio

Enable a muted microphone, can be called before, while and after stream

Methods:

isAudioMuted

Get mute state of microphone

Methods:

getBitrate

Get video bitrate setted

Methods:

getResolutionValue

Get resolution value (width x height)

Methods:

getStreamWidth

Get stream width resolution

Methods:

getStreamHeight

Get stream height resolution

Methods:

switchCamera

Switch camera used. Can be called on preview or while stream, ignored with preview off. CameraOpenException If the other camera doesn't support same resolution.

Methods:

getGlInterface

Get GlInterface if you are using OpenGlVIew or LightOpenGlView

Methods:

setVideoBitrateOnFly

Set video bitrate in kb while stream

Methods:

setLimitFPSOnFly

Set limit FPS while stream. This will be override when you call to prepareVideo method. This could produce a change in iFrameInterval

Methods:

isStreaming

Check if streaming

Methods:

isOnPreview

Check if preview is enabled

Methods:

isRecording

Check if recording

Methods:

pauseRecord

Pause video record

Methods:

resumeRecord

Resume a paused video record

Methods:

getRecordStatus

Get record status. STARTED, STOPPED, RECORDING, PAUSED, RESUMED

Methods: