RtspDisplay

@RequiresApi(api = 21)
class RtspDisplay(context: Context, useOpengl: Boolean, connectChecker: ConnectChecker) : DisplayBase

More documentation see: com.pedro.library.base.DisplayBase

Created by pedro on 9/08/17.

Constructors

Link copied to clipboard
constructor(context: Context, useOpengl: Boolean, connectChecker: ConnectChecker)

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open fun disableAudio()

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

Link copied to clipboard
open fun enableAudio()

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

Link copied to clipboard
open fun forceCodecType(codecTypeVideo: CodecUtil.CodecType, codecTypeAudio: CodecUtil.CodecType)
Link copied to clipboard
open fun forceFpsLimit(enabled: Boolean)

Force stream to work with fps selected in prepareVideo method. Must be called before prepareVideo. This is not recommend because could produce fps problems.

Link copied to clipboard
open fun getBitrate(): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun getStreamClient(): RtspStreamClient
Link copied to clipboard
open fun getStreamHeight(): Int
Link copied to clipboard
open fun getStreamWidth(): Int
Link copied to clipboard
open fun isAudioMuted(): Boolean

Get mute state of microphone.

Link copied to clipboard
open fun isRecording(): Boolean

Get record state.

Link copied to clipboard
open fun pauseRecord()
Link copied to clipboard
open fun prepareAudio(): Boolean

Same to call: prepareAudio(64 * 1024, 32000, true, false, false);

open fun prepareAudio(bitrate: Int, sampleRate: Int, isStereo: Boolean): Boolean
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. If not you will do a stream without audio.

Link copied to clipboard
@RequiresApi(api = 29)
open fun prepareInternalAudio(bitrate: Int, sampleRate: Int, isStereo: Boolean): Boolean

@RequiresApi(api = 29)
open fun prepareInternalAudio(bitrate: Int, sampleRate: Int, isStereo: Boolean, echoCanceler: Boolean, noiseSuppressor: Boolean): Boolean

Call this method before use @startStream for streaming internal audio only.

Link copied to clipboard
open fun prepareVideo(): Boolean

Same to call: rotation = 0; if (Portrait) rotation = 90; prepareVideo(640, 480, 30, 1200 * 1024, true, 0);

open fun prepareVideo(width: Int, height: Int, bitrate: Int): Boolean
open fun prepareVideo(width: Int, height: Int, fps: Int, bitrate: Int, rotation: Int, dpi: Int): Boolean

open fun prepareVideo(width: Int, height: Int, fps: Int, bitrate: Int, rotation: Int, dpi: Int, profile: Int, level: Int, iFrameInterval: Int): Boolean

Call this method before use @startStream. If not you will do a stream without video.

Link copied to clipboard
open fun requestKeyFrame()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun resumeRecord()
Link copied to clipboard
open fun sendIntent(): Intent

Create Intent used to init screen capture with startActivityForResult.

Link copied to clipboard
open fun setAudioCodec(codec: AudioCodec)
Link copied to clipboard
open fun setCustomAudioEffect(customAudioEffect: CustomAudioEffect)

Set an audio effect modifying microphone's PCM buffer.

Link copied to clipboard
open fun setEncoderErrorCallback(encoderErrorCallback: EncoderErrorCallback)

Set a callback to know errors related with Video/Audio encoders

Link copied to clipboard
Link copied to clipboard
open fun setIntentResult(resultCode: Int, data: Intent)
Link copied to clipboard
open fun setMediaProjectionCallback(mediaProjectionCallback: MediaProjection.Callback)
Link copied to clipboard
open fun setMicrophoneMode(microphoneMode: MicrophoneMode)

Must be called before prepareAudio.

Link copied to clipboard
open fun setRecordController(recordController: BaseRecordController)
Link copied to clipboard
open fun setVideoBitrateOnFly(bitrate: Int)

Set video bitrate of H264 in bits per second while stream.

Link copied to clipboard
open fun setVideoCodec(codec: VideoCodec)
Link copied to clipboard
@RequiresApi(api = 26)
open fun startRecord(@NonNull fd: FileDescriptor)
open fun startRecord(@NonNull path: String)

Starts recording a MP4 video.

Link copied to clipboard
open fun startStream(url: String)

Need be called after @prepareVideo or/and @prepareAudio.

Link copied to clipboard
open fun stopRecord()

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

Link copied to clipboard
open fun stopStream()

Stop stream started with @startStream.