VideoCaptureDsl

Added in 1.7.0-rc01

public final class VideoCaptureDsl


Summary

Public methods

static final @NonNull VideoCapture<@NonNull T>
<T extends VideoOutput> videoCapture(
    @NonNull T videoOutput,
    @NonNull Function1<@NonNull VideoCaptureScope<@NonNull T>, Unit> block
)

Creates a VideoCapture using a Kotlin DSL block.

Public methods

videoCapture

public static final @NonNull VideoCapture<@NonNull T> <T extends VideoOutput> videoCapture(
    @NonNull T videoOutput,
    @NonNull Function1<@NonNull VideoCaptureScope<@NonNull T>, Unit> block
)

Creates a VideoCapture using a Kotlin DSL block.

import androidx.camera.core.DynamicRange
import androidx.camera.core.MirrorMode
import androidx.camera.video.videoCapture

// Using the new Kotlin DSL to configure VideoCapture in a clean and idiomatic way
val videoCaptureUseCase =
    videoCapture(videoOutput) {
        targetName = "video_capture_dsl"
        targetRotation = Surface.ROTATION_90
        dynamicRange = DynamicRange.SDR
        mirrorMode = MirrorMode.MIRROR_MODE_ON
        isVideoStabilizationEnabled = true
        targetFrameRate = Range(30, 30)
    }
Parameters
@NonNull T videoOutput

The VideoOutput to associate with the VideoCapture.

@NonNull Function1<@NonNull VideoCaptureScope<@NonNull T>, Unit> block

A receiver lambda on VideoCaptureScope to configure the VideoCapture.