amazon-chime-sdk / com.amazonaws.services.chime.sdk.meetings.audiovideo.video.capture / DefaultCameraCaptureSource

DefaultCameraCaptureSource

class DefaultCameraCaptureSource : CameraCaptureSource, VideoSink

DefaultCameraCaptureSource will configure a reasonably standard capture stream which will use the Surface provided by the capture source provided by a SurfaceTextureCaptureSourceFactory

Constructors

<init>

DefaultCameraCaptureSource will configure a reasonably standard capture stream which will use the Surface provided by the capture source provided by a SurfaceTextureCaptureSourceFactory

DefaultCameraCaptureSource(context: Context, logger: Logger, surfaceTextureCaptureSourceFactory: SurfaceTextureCaptureSourceFactory, cameraManager: CameraManager = context.getSystemService( Context.CAMERA_SERVICE ) as CameraManager)

Properties

contentHint

Content hint for downstream processing

val contentHint: VideoContentHint

device

Current camera device. This is only null if the phone/device doesn't have any cameras May be called regardless of whether start or stop has been called.

var device: MediaDevice?

eventAnalyticsController

var eventAnalyticsController: EventAnalyticsController?

format

Current camera capture format. Actual format may be adjusted to use supported camera formats. May be called regardless of whether start or stop has been called.

var format: VideoCaptureFormat

torchEnabled

Toggle for torch on the current device. Will succeed if current device has access to flashlight, otherwise will stay false. May be called regardless of whether start or stop has been called.

var torchEnabled: Boolean

Functions

addCaptureSourceObserver

Add a capture source observer to receive callbacks from the source on lifecycle events which can be used to trigger UI. This observer is entirely optional.

fun addCaptureSourceObserver(observer: CaptureSourceObserver): Unit

addVideoSink

Add a video sink which will immediately begin to receive new frames.

fun addVideoSink(sink: VideoSink): Unit

onVideoFrameReceived

Receive a video frame from some upstream source. The VideoSink may render, store, process, and forward the frame, among other applications.

fun onVideoFrameReceived(frame: VideoFrame): Unit

release

fun release(): Unit

removeCaptureSourceObserver

Remove a capture source observer

fun removeCaptureSourceObserver(observer: CaptureSourceObserver): Unit

removeVideoSink

Remove a video sink which will no longer receive new frames on return

fun removeVideoSink(sink: VideoSink): Unit

setMaxResolution

Set max resolution for video capture source DefaultCameraCaptureSource and DefaultScreenCaptureSource call this function to set max resolution for camera and screen capture

fun setMaxResolution(maxResolution: VideoResolution): Unit

start

Start capturing on this source and emitting video frames

fun start(): Unit

stop

Stop capturing on this source and cease emitting video frames

fun stop(): Unit

switchCamera

Helper function to switch from front to back cameras or reverse. This also switches from any external cameras to the front camera.

fun switchCamera(): Unit