AbstractPreviewableSource

Abstract class for previewable sources to manage requestRelease.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
abstract val infoProviderFlow: StateFlow<ISourceInfoProvider>

Orientation provider of the capture source. It is used to orientate the frame according to the source orientation.

Link copied to clipboard
abstract val isPreviewingFlow: StateFlow<Boolean>

Flow of the last previewing state.

Link copied to clipboard
abstract val isStreamingFlow: StateFlow<Boolean>

Flow of the last streaming state.

Link copied to clipboard

The offset between source capture time and MONOTONIC clock in nanoseconds. It is used to synchronize video with audio. It is only useful for camera source.

Functions

Link copied to clipboard
abstract suspend fun configure(config: VideoSourceConfig)

Configure the Configurable implementation.

Link copied to clipboard
abstract suspend fun getOutput(): Surface?

Gets the output surface for the video stream.

Link copied to clipboard
abstract fun <T> getPreviewSize(targetSize: Size, targetClass: Class<T>): Size

Gets the preview size from the target size.

Link copied to clipboard
abstract suspend fun hasPreview(): Boolean

Whether the video source has a preview.

Link copied to clipboard
abstract fun release()

Closes and releases resources

Link copied to clipboard
open suspend override fun requestRelease()

Requests release.

Link copied to clipboard
open suspend override fun resetOutput()

Resets output and releases if isReleasedRequested is true.

Link copied to clipboard
abstract suspend fun resetOutputImpl()

Resets output implementation.

Link copied to clipboard
open suspend override fun resetPreview()

Resets preview and releases if isReleasedRequested is true.

Link copied to clipboard
abstract suspend fun resetPreviewImpl()

Resets preview implementation.

Link copied to clipboard
abstract suspend fun setOutput(surface: Surface)

Sets the output surface for the video stream.

Link copied to clipboard
abstract suspend fun setPreview(surface: Surface)

Sets preview surface.

Link copied to clipboard
suspend fun IPreviewableSource.setPreview(surfaceHolder: SurfaceHolder)

Sets a preview surface holder.

suspend fun IPreviewableSource.setPreview(surfaceView: SurfaceView)
suspend fun IPreviewableSource.setPreview(textureView: TextureView)

Sets a preview surface.

Link copied to clipboard
abstract suspend fun startPreview()

Starts video preview.

abstract suspend fun startPreview(previewSurface: Surface)

Sets preview surface and start video preview.

Link copied to clipboard
suspend fun IPreviewableSource.startPreview(surfaceHolder: SurfaceHolder)
suspend fun IPreviewableSource.startPreview(surfaceView: SurfaceView)
suspend fun IPreviewableSource.startPreview(textureView: TextureView)

Starts audio and video capture. If you can prefer to call SingleStreamer.setAudioConfig before starting preview. It is a shortcut for setPreview and startPreview.

Link copied to clipboard
abstract suspend fun startStream()

Starts frames or data stream generation Throws an exception if not ready for live stream

Link copied to clipboard
abstract suspend fun stopPreview()

Stops video preview.

Link copied to clipboard
abstract suspend fun stopStream()

Stops frames or data stream generation