public abstract class

OutputOptions

extends java.lang.Object

 java.lang.Object

↳androidx.camera.video.OutputOptions

Subclasses:

FileOutputOptions, MediaStoreOutputOptions, FileDescriptorOutputOptions

Gradle dependencies

compile group: 'androidx.camera', name: 'camera-video', version: '1.2.0-alpha01'

  • groupId: androidx.camera
  • artifactId: camera-video
  • version: 1.2.0-alpha01

Artifact androidx.camera:camera-video:1.2.0-alpha01 it located at Google repository (https://maven.google.com/)

Overview

Options for configuring output destination for generating a recording.

A PendingRecording can be generated with Recorder.prepareRecording(Context, FileOutputOptions) for different types of output destination, such as FileOutputOptions, FileDescriptorOutputOptions and MediaStoreOutputOptions.

Summary

Fields
public static final intFILE_SIZE_UNLIMITED

Represents an unbound file size.

Methods
public abstract longgetFileSizeLimit()

Gets the limit for the file size in bytes.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Fields

public static final int FILE_SIZE_UNLIMITED

Represents an unbound file size.

Methods

public abstract long getFileSizeLimit()

Gets the limit for the file size in bytes.

Returns:

the file size limit in bytes.

Source

/*
 * Copyright 2021 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package androidx.camera.video;

import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;

/**
 * Options for configuring output destination for generating a recording.
 *
 * <p>A {@link PendingRecording} can be generated with {@link Recorder#prepareRecording} for
 * different types of output destination, such as {@link FileOutputOptions},
 * {@link FileDescriptorOutputOptions} and {@link MediaStoreOutputOptions}.
 *
 * @see FileOutputOptions
 * @see FileDescriptorOutputOptions
 * @see MediaStoreOutputOptions
 */
@RequiresApi(21) // TODO(b/200306659): Remove and replace with annotation on package-info.java
public abstract class OutputOptions {

    /** Represents an unbound file size. */
    public static final int FILE_SIZE_UNLIMITED = 0;

    OutputOptions() {
    }

    /**
     * Gets the limit for the file size in bytes.
     *
     * @return the file size limit in bytes.
     */
    public abstract long getFileSizeLimit();

    /**
     * The builder of the {@link OutputOptions}.
     */
    interface Builder<T extends OutputOptions, B> {

        /**
         * Sets the limit for the file length in bytes.
         *
         * <p>If not set, defaults to {@link #FILE_SIZE_UNLIMITED}.
         */
        @NonNull
        B setFileSizeLimit(long bytes);

        /**
         * Builds the {@link OutputOptions} instance.
         */
        @NonNull
        T build();
    }
}