10dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh/*
20dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh * Copyright (C) 2015 The Android Open Source Project
30dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh *
40dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh * Licensed under the Apache License, Version 2.0 (the "License");
50dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh * you may not use this file except in compliance with the License.
60dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh * You may obtain a copy of the License at
70dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh *
80dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh *      http://www.apache.org/licenses/LICENSE-2.0
90dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh *
100dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh * Unless required by applicable law or agreed to in writing, software
110dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh * distributed under the License is distributed on an "AS IS" BASIS,
120dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
130dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh * See the License for the specific language governing permissions and
140dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh * limitations under the License.
150dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh */
160dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
173e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh/**
183e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @addtogroup Camera
193e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @{
203e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh */
213e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh
223e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh/**
233e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @file NdkCameraDevice.h
243e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh */
253e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh
260dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh/*
270dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh * This file defines an NDK API.
280dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh * Do not remove methods.
290dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh * Do not change method signatures.
300dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh * Do not change the value of constants.
310dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh * Do not change the size of any of the classes defined in here.
320dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh * Do not reference types that are not part of the NDK.
330dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh * Do not #include files that aren't part of the NDK.
340dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh */
35d7973ba37cea1a9638ded23041c69774ae8cebbcDan Albert#include <sys/cdefs.h>
360dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
370dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh#include <android/native_window.h>
380dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh#include "NdkCameraError.h"
390dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh#include "NdkCaptureRequest.h"
400dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh#include "NdkCameraCaptureSession.h"
410dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
420dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh#ifndef _NDK_CAMERA_DEVICE_H
430dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh#define _NDK_CAMERA_DEVICE_H
440dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
45d7973ba37cea1a9638ded23041c69774ae8cebbcDan Albert__BEGIN_DECLS
46d7973ba37cea1a9638ded23041c69774ae8cebbcDan Albert
47d7973ba37cea1a9638ded23041c69774ae8cebbcDan Albert#if __ANDROID_API__ >= 24
480dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
493e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh/**
503e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * ACameraDevice is opaque type that provides access to a camera device.
513e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
523e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * A pointer can be obtained using {@link ACameraManager_openCamera} method.
533e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh */
540dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yehtypedef struct ACameraDevice ACameraDevice;
550dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
563e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh/// Enum for ACameraDevice_ErrorStateCallback error code
573e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yehenum {
583e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh    /**
593e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * The camera device is in use already.
603e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     */
613e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh    ERROR_CAMERA_IN_USE = 1,
623e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh
633e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh    /**
643e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * The system-wide limit for number of open cameras or camera resources has
653e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * been reached, and more camera devices cannot be opened until previous
663e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * instances are closed.
673e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     */
683e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh    ERROR_MAX_CAMERAS_IN_USE = 2,
693e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh
703e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh    /**
713e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * The camera is disabled due to a device policy, and cannot be opened.
723e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     */
733e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh    ERROR_CAMERA_DISABLED = 3,
743e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh
753e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh    /**
763e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * The camera device has encountered a fatal error.
773e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * <p>The camera device needs to be re-opened to be used again.</p>
783e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     */
793e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh    ERROR_CAMERA_DEVICE = 4,
803e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh
813e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh    /**
823e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * The camera service has encountered a fatal error.
833e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * <p>The Android device may need to be shut down and restarted to restore
843e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * camera function, or there may be a persistent hardware problem.
853e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * An attempt at recovery may be possible by closing the
863e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * CameraDevice and the CameraManager, and trying to acquire all resources
873e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * again from scratch.</p>
883e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     */
893e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh    ERROR_CAMERA_SERVICE = 5
903e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh};
913e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh
923e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh/**
933e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * Camera device state callbacks to be used in {@link ACameraDevice_stateCallbacks}.
943e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
953e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @param context The optional context in {@link ACameraDevice_stateCallbacks} will be
963e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *                passed to this callback.
973e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @param device The {@link ACameraDevice} that is being disconnected.
983e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh */
990dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yehtypedef void (*ACameraDevice_StateCallback)(void* context, ACameraDevice* device);
1003e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh
1013e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh/**
1023e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * Camera device error state callbacks to be used in {@link ACameraDevice_stateCallbacks}.
1033e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
1043e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @param context The optional context in {@link ACameraDevice_stateCallbacks} will be
1053e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *                passed to this callback.
1063e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @param device The {@link ACameraDevice} that is being disconnected.
1073e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @param error The error code describes the cause of this error callback. See the folowing
1083e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *              links for more detail.
1093e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
1103e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @see ERROR_CAMERA_IN_USE
1113e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @see ERROR_MAX_CAMERAS_IN_USE
1123e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @see ERROR_CAMERA_DISABLED
1133e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @see ERROR_CAMERA_DEVICE
1143e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @see ERROR_CAMERA_SERVICE
1153e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh */
1160dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yehtypedef void (*ACameraDevice_ErrorStateCallback)(void* context, ACameraDevice* device, int error);
1170dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
1180dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yehtypedef struct ACameraDevice_StateCallbacks {
1193e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh    /// optional application context.
1200dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh    void*                             context;
1213e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh
1223e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh    /**
1233e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * The function is  called when a camera device is no longer available for use.
1243e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     *
1253e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * <p>Any attempt to call API methods on this ACameraDevice will return
1263e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * {@link ACAMERA_ERROR_CAMERA_DISCONNECTED}. The disconnection could be due to a
1273e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * change in security policy or permissions; the physical disconnection
1283e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * of a removable camera device; or the camera being needed for a
1293e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * higher-priority camera API client.</p>
1303e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     *
1313e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * <p>Application should clean up the camera with {@link ACameraDevice_close} after
1323e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * this happens, as it is not recoverable until the camera can be opened
1333e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * again.</p>
1343e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     *
1353e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     */
1363e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh    ACameraDevice_StateCallback       onDisconnected;
1373e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh
1383e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh    /**
1393e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * The function called when a camera device has encountered a serious error.
1403e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     *
1413e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * <p>This indicates a failure of the camera device or camera service in some way.
1423e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * Any attempt to call API methods on this ACameraDevice in the future will return
1433e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * {@link ACAMERA_ERROR_CAMERA_DISCONNECTED}.</p>
1443e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     *
1453e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * <p>There may still be capture completion or camera stream callbacks that will be called
1463e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * after this error is received.</p>
1473e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     *
1483e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * <p>Application should clean up the camera with {@link ACameraDevice_close} after this
1493e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * happens. Further attempts at recovery are error-code specific.</p>
1503e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     *
1513e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     */
1523e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh    ACameraDevice_ErrorStateCallback  onError;
1530dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh} ACameraDevice_stateCallbacks;
1540dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
1550dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh/**
1563e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * Close the connection and free this ACameraDevice synchronously. Access to the ACameraDevice
1573e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * after calling this method will cause a crash.
1583e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
1593e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <p>After this call, all calls to the active ACameraCaptureSession associated to this
1603e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * ACameraDevice will return {@link ACAMERA_ERROR_SESSION_CLOSED} except for calls to
1613e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * {@link ACameraCaptureSession_close}.</p>
1623e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
1633e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <p>This method will stop all repeating captures sent via
1643e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * {@link ACameraCaptureSession_setRepeatingRequest} and block until all capture requests sent via
1653e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * {@link ACameraCaptureSession_capture} is complete. Once the method returns, the camera device
1663e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * will be removed from memory and access to the closed camera device pointer will cause a crash.</p>
1673e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
1683e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @param device the camera device to be closed
1693e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
1703e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @return <ul>
1713e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *         <li>{@link ACAMERA_OK} if the method call succeeds.</li>
1723e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *         <li>{@link ACAMERA_ERROR_INVALID_PARAMETER} if device is NULL.</li></ul>
1730dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh */
1743e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yehcamera_status_t ACameraDevice_close(ACameraDevice* device);
1750dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
1760dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh/**
1773e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * Return the camera id associated with this camera device.
1783e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
1793e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @param device the camera device to be closed
1803e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
1813e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @return camera ID string. The returned string is managed by framework and should not be
1823e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * delete/free by the application. Also the returned string must not be used after the device
1833e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * has been closed.
1840dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh */
1853e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yehconst char* ACameraDevice_getId(const ACameraDevice* device);
1860dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
1870dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yehtypedef enum {
1883e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh    /**
1893e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * Create a request suitable for a camera preview window. Specifically, this
1903e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * means that high frame rate is given priority over the highest-quality
1913e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * post-processing. These requests would normally be used with the
1923e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * {@link ACameraCaptureSession_setRepeatingRequest} method.
1933e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * This template is guaranteed to be supported on all camera devices.
1943e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     *
1953e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * @see ACameraDevice_createCaptureRequest
1963e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     */
1970dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh    TEMPLATE_PREVIEW = 1,
1983e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh
1993e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh    /**
2003e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * Create a request suitable for still image capture. Specifically, this
2013e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * means prioritizing image quality over frame rate. These requests would
2023e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * commonly be used with the {@link ACameraCaptureSession_capture} method.
2033e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * This template is guaranteed to be supported on all camera devices.
2043e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     *
2053e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * @see ACameraDevice_createCaptureRequest
2063e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     */
2073e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh    TEMPLATE_STILL_CAPTURE = 2,
2083e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh
2093e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh    /**
2103e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * Create a request suitable for video recording. Specifically, this means
2113e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * that a stable frame rate is used, and post-processing is set for
2123e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * recording quality. These requests would commonly be used with the
2133e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * {@link ACameraCaptureSession_setRepeatingRequest} method.
2143e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * This template is guaranteed to be supported on all camera devices.
2153e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     *
2163e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * @see ACameraDevice_createCaptureRequest
2173e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     */
2183e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh    TEMPLATE_RECORD = 3,
2193e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh
2203e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh    /**
2213e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * Create a request suitable for still image capture while recording
2223e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * video. Specifically, this means maximizing image quality without
2233e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * disrupting the ongoing recording. These requests would commonly be used
2243e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * with the {@link ACameraCaptureSession_capture} method while a request based on
2253e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * {@link TEMPLATE_RECORD} is is in use with {@link ACameraCaptureSession_setRepeatingRequest}.
2263e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * This template is guaranteed to be supported on all camera devices.
2273e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     *
2283e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * @see ACameraDevice_createCaptureRequest
2293e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     */
2303e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh    TEMPLATE_VIDEO_SNAPSHOT = 4,
2313e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh
2323e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh    /**
2333e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * Create a request suitable for zero shutter lag still capture. This means
2343e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * means maximizing image quality without compromising preview frame rate.
2353e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * AE/AWB/AF should be on auto mode.
2363e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     *
2373e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * @see ACameraDevice_createCaptureRequest
2383e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     */
2393e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh    TEMPLATE_ZERO_SHUTTER_LAG = 5,
2403e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh
2413e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh    /**
2423e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * A basic template for direct application control of capture
2433e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * parameters. All automatic control is disabled (auto-exposure, auto-white
2443e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * balance, auto-focus), and post-processing parameters are set to preview
2453e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * quality. The manual capture parameters (exposure, sensitivity, and so on)
2463e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * are set to reasonable defaults, but should be overriden by the
2473e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * application depending on the intended use case.
2483e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * This template is guaranteed to be supported on camera devices that support the
2493e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * {@link ACAMERA_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR} capability.
2503e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     *
2513e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     * @see ACameraDevice_createCaptureRequest
2523e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh     */
2533e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh    TEMPLATE_MANUAL = 6,
2540dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh} ACameraDevice_request_template;
2550dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
2560dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh/**
2573e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * Create a ACaptureRequest for capturing images, initialized with template
2583e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * for a target use case.
2593e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
2603e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <p>The settings are chosen to be the best options for this camera device,
2613e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * so it is not recommended to reuse the same request for a different camera device.</p>
2623e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
2633e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @param device the camera device of interest
2643e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @param templateId the type of capture request to be created.
2653e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *        See {@link ACameraDevice_request_template}.
2663e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @param request the output request will be stored here if the method call succeeds.
2673e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
2683e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @return <ul>
2693e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *         <li>{@link ACAMERA_OK} if the method call succeeds. The created capture request will be
2703e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *                                filled in request argument.</li>
271a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh *         <li>{@link ACAMERA_ERROR_INVALID_PARAMETER} if device or request is NULL, templateId
272a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh *                                is undefined or camera device does not support requested template.
273a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh *                                </li>
2743e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *         <li>{@link ACAMERA_ERROR_CAMERA_DISCONNECTED} if the camera device is closed.</li>
2753e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *         <li>{@link ACAMERA_ERROR_CAMERA_DEVICE} if the camera device encounters fatal error.</li>
2763e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *         <li>{@link ACAMERA_ERROR_CAMERA_SERVICE} if the camera service encounters fatal error.</li>
2773e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *         <li>{@link ACAMERA_ERROR_UNKNOWN} if the method fails for some other reasons.</li></ul>
2783e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
2793e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @see TEMPLATE_PREVIEW
2803e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @see TEMPLATE_RECORD
2813e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @see TEMPLATE_STILL_CAPTURE
2823e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @see TEMPLATE_VIDEO_SNAPSHOT
2833e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @see TEMPLATE_MANUAL
2840dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh */
2850dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yehcamera_status_t ACameraDevice_createCaptureRequest(
2863e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh        const ACameraDevice* device, ACameraDevice_request_template templateId,
2873e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh        /*out*/ACaptureRequest** request);
2883e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh
2890dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
2900dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yehtypedef struct ACaptureSessionOutputContainer ACaptureSessionOutputContainer;
2910dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
2920dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yehtypedef struct ACaptureSessionOutput ACaptureSessionOutput;
2930dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
2943e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh/**
2953e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * Create a capture session output container.
2963e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
2973e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <p>The container is used in {@link ACameraDevice_createCaptureSession} method to create a capture
2983e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * session. Use {@link ACaptureSessionOutputContainer_free} to free the container and its memory
2993e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * after application no longer needs the ACaptureSessionOutputContainer.</p>
3003e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
3013e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @param container the output {@link ACaptureSessionOutputContainer} will be stored here if the
3023e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *                  method call succeeds.
3033e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
3043e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @return <ul>
3053e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *         <li>{@link ACAMERA_OK} if the method call succeeds. The created container will be
3063e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *                                filled in container argument.</li>
3073e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *         <li>{@link ACAMERA_ERROR_INVALID_PARAMETER} if container is NULL.</li></ul>
3083e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh */
3093e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yehcamera_status_t ACaptureSessionOutputContainer_create(
3103e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh        /*out*/ACaptureSessionOutputContainer** container);
3113e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh
3123e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh/**
3133e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * Free a capture session output container.
3143e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
3153e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @param container the {@link ACaptureSessionOutputContainer} to be freed.
3163e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
3173e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @see ACaptureSessionOutputContainer_create
3183e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh */
3193e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yehvoid            ACaptureSessionOutputContainer_free(ACaptureSessionOutputContainer* container);
3203e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh
3213e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh/**
3223e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * Create a ACaptureSessionOutput object.
3233e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
3243e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <p>The ACaptureSessionOutput is used in {@link ACaptureSessionOutputContainer_add} method to add
3253e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * an output {@link ANativeWindow} to ACaptureSessionOutputContainer. Use
3263e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * {@link ACaptureSessionOutput_free} to free the object and its memory after application no longer
3273e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * needs the {@link ACaptureSessionOutput}.</p>
3283e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
3293e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @param anw the {@link ANativeWindow} to be associated with the {@link ACaptureSessionOutput}
3303e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @param output the output {@link ACaptureSessionOutput} will be stored here if the
3313e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *                  method call succeeds.
3323e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
3333e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @return <ul>
3343e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *         <li>{@link ACAMERA_OK} if the method call succeeds. The created container will be
3353e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *                                filled in the output argument.</li>
3363e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *         <li>{@link ACAMERA_ERROR_INVALID_PARAMETER} if anw or output is NULL.</li></ul>
3373e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
3383e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @see ACaptureSessionOutputContainer_add
3393e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh */
3403e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yehcamera_status_t ACaptureSessionOutput_create(
3413e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh        ANativeWindow* anw, /*out*/ACaptureSessionOutput** output);
3420dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
3433e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh/**
3443e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * Free a ACaptureSessionOutput object.
3453e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
3463e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @param output the {@link ACaptureSessionOutput} to be freed.
3473e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
3483e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @see ACaptureSessionOutput_create
3493e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh */
3503e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yehvoid            ACaptureSessionOutput_free(ACaptureSessionOutput* output);
3510dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
3523e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh/**
3533e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * Add an {@link ACaptureSessionOutput} object to {@link ACaptureSessionOutputContainer}.
3543e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
3553e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @param container the {@link ACaptureSessionOutputContainer} of interest.
3563e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @param output the output {@link ACaptureSessionOutput} to be added to container.
3573e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
3583e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @return <ul>
3593e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *         <li>{@link ACAMERA_OK} if the method call succeeds.</li>
3603e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *         <li>{@link ACAMERA_ERROR_INVALID_PARAMETER} if container or output is NULL.</li></ul>
3613e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh */
3620dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yehcamera_status_t ACaptureSessionOutputContainer_add(
3633e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh        ACaptureSessionOutputContainer* container, const ACaptureSessionOutput* output);
3643e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh
3653e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh/**
3663e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * Remove an {@link ACaptureSessionOutput} object from {@link ACaptureSessionOutputContainer}.
3673e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
3683e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <p>This method has no effect if the ACaptureSessionOutput does not exist in
3693e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * ACaptureSessionOutputContainer.</p>
3703e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
3713e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @param container the {@link ACaptureSessionOutputContainer} of interest.
3723e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @param output the output {@link ACaptureSessionOutput} to be removed from container.
3733e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
3743e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @return <ul>
3753e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *         <li>{@link ACAMERA_OK} if the method call succeeds.</li>
3763e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *         <li>{@link ACAMERA_ERROR_INVALID_PARAMETER} if container or output is NULL.</li></ul>
3773e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh */
3780dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yehcamera_status_t ACaptureSessionOutputContainer_remove(
3793e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh        ACaptureSessionOutputContainer* container, const ACaptureSessionOutput* output);
3800dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
3813e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh/**
3823e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * Create a new camera capture session by providing the target output set of {@link ANativeWindow}
3833e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * to the camera device.
3843e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
3853e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <p>If there is a preexisting session, the previous session will be closed
3863e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * automatically. However, app still needs to call {@link ACameraCaptureSession_close} on previous
3873e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * session. Otherwise the resources held by previous session will NOT be freed.</p>
3883e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
3893e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <p>The active capture session determines the set of potential output {@link ANativeWindow}s for
3903e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * the camera device for each capture request. A given request may use all
3913e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * or only some of the outputs. Once the ACameraCaptureSession is created, requests can be
3923e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * submitted with {@link ACameraCaptureSession_capture} or
3933e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * {@link ACameraCaptureSession_setRepeatingRequest}.</p>
3943e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
3953e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <p>Often the {@link ANativeWindow} used with this method can be obtained from a <a href=
3963e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * "http://developer.android.com/reference/android/view/Surface.html">Surface</a> java object by
3973e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * {@link ANativeWindow_fromSurface} NDK method. Surfaces or ANativeWindow suitable for inclusion as a camera
3983e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * output can be created for various use cases and targets:</p>
3993e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
4003e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <ul>
4013e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
4023e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <li>For drawing to a
4033e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   <a href="http://developer.android.com/reference/android/view/SurfaceView.html">SurfaceView</a>:
4043e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   Once the SurfaceView's Surface is created, set the size
4053e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   of the Surface with
4063e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   <a href="http://developer.android.com/reference/android/view/SurfaceHolder.html#setFixedSize(int, int)">
4073e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *    android.view.SurfaceHolder\#setFixedSize</a> to be one of the PRIVATE output sizes
4083e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   returned by {@link ACAMERA_SCALER_AVAILABLE_STREAM_CONFIGURATIONS}
4093e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   and then obtain the Surface by calling <a href=
4103e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   "http://developer.android.com/reference/android/view/SurfaceHolder.html#getSurface()">
4113e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   android.view.SurfaceHolder\#getSurface</a>. If the size is not set by the application, it will
4123e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   be rounded to the nearest supported size less than 1080p, by the camera device.</li>
4133e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
4143e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <li>For accessing through an OpenGL texture via a <a href=
4153e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   "http://developer.android.com/reference/android/graphics/SurfaceTexture.html">SurfaceTexture</a>:
4163e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   Set the size of the SurfaceTexture with <a href=
4173e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   "http://developer.android.com/reference/android/graphics/SurfaceTexture.html#setDefaultBufferSize(int, int)">
4183e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   setDefaultBufferSize</a> to be one of the PRIVATE output sizes
4193e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   returned by {@link ACAMERA_SCALER_AVAILABLE_STREAM_CONFIGURATIONS}
4203e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   before creating a Surface from the SurfaceTexture with <a href=
4213e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   "http://developer.android.com/reference/android/view/Surface.html#Surface(android.graphics.SurfaceTexture)">
4223e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   Surface\#Surface(SurfaceTextrue)</a>. If the size is not set by the application, it will be set to be the
4233e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   smallest supported size less than 1080p, by the camera device.</li>
4243e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
4253e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <li>For recording with <a href=
4263e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *     "http://developer.android.com/reference/android/media/MediaCodec.html">
4273e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *     MediaCodec</a>: Call
4283e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   <a href=
4293e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *     "http://developer.android.com/reference/android/media/MediaCodec.html#createInputSurface()">
4303e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *     android.media.MediaCodec\#createInputSurface</a> after configuring
4313e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   the media codec to use one of the PRIVATE output sizes
4323e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   returned by {@link ACAMERA_SCALER_AVAILABLE_STREAM_CONFIGURATIONS}.
4333e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   </li>
4343e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
4353e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <li>For recording with <a href=
4363e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *    "http://developer.android.com/reference/android/media/MediaRecorder.html">
4373e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *    MediaRecorder</a>: Call
4383e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   <a href="http://developer.android.com/reference/android/media/MediaRecorder.html#getSurface()">
4393e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *    android.media.MediaRecorder\#getSurface</a> after configuring the media recorder to use
4403e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   one of the PRIVATE output sizes returned by
4413e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   {@link ACAMERA_SCALER_AVAILABLE_STREAM_CONFIGURATIONS}, or configuring it to use one of the supported
4423e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   <a href="http://developer.android.com/reference/android/media/CamcorderProfile.html">
4433e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *    CamcorderProfiles</a>.</li>
4443e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
4453e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <li>For efficient YUV processing with <a href=
4463e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   "http://developer.android.com/reference/android/renderscript/package-summary.html">
4473e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   RenderScript</a>:
4483e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   Create a RenderScript
4493e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   <a href="http://developer.android.com/reference/android/renderscript/Allocation.html">
4503e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   Allocation</a> with a supported YUV
4513e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   type, the IO_INPUT flag, and one of the YUV output sizes returned by
4523e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   {@link ACAMERA_SCALER_AVAILABLE_STREAM_CONFIGURATIONS},
4533e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   Then obtain the Surface with
4543e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   <a href="http://developer.android.com/reference/android/renderscript/Allocation.html#getSurface()">
4553e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   Allocation#getSurface}</a>.</li>
4563e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
4573e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <li>For access to RAW, uncompressed YUV, or compressed JPEG data in the application: Create an
4583e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   {@link AImageReader} object using the {@link AImageReader_new} method with one of the supported
4593e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   output formats given by {@link ACAMERA_SCALER_AVAILABLE_STREAM_CONFIGURATIONS}. Then obtain a
4603e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   ANativeWindow from it with {@link AImageReader_getWindow}.
4613e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   If the AImageReader size is not set to a supported size, it will be rounded to a supported
4623e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   size less than 1080p by the camera device.
4633e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *   </li>
4643e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
4653e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * </ul>
4663e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
4673e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <p>The camera device will query each ANativeWindow's size and formats upon this
4683e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * call, so they must be set to a valid setting at this time.</p>
4693e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
4703e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <p>It can take several hundred milliseconds for the session's configuration to complete,
4713e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * since camera hardware may need to be powered on or reconfigured.</p>
4723e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
4733e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <p>If a prior ACameraCaptureSession already exists when this method is called, the previous
4743e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * session will no longer be able to accept new capture requests and will be closed. Any
4753e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * in-progress capture requests made on the prior session will be completed before it's closed.
4763e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * To minimize the transition time,
4773e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * the ACameraCaptureSession_abortCaptures method can be used to discard the remaining
4783e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * requests for the prior capture session before a new one is created. Note that once the new
4793e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * session is created, the old one can no longer have its captures aborted.</p>
4803e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
4813e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <p>Using larger resolution outputs, or more outputs, can result in slower
4823e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * output rate from the device.</p>
4833e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
4843e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <p>Configuring a session with an empty list will close the current session, if
4853e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * any. This can be used to release the current session's target surfaces for another use.</p>
4863e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
4873e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <p>While any of the sizes from {@link ACAMERA_SCALER_AVAILABLE_STREAM_CONFIGURATIONS} can be used when
4883e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * a single output stream is configured, a given camera device may not be able to support all
4893e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * combination of sizes, formats, and targets when multiple outputs are configured at once.  The
4903e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * tables below list the maximum guaranteed resolutions for combinations of streams and targets,
4913e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * given the capabilities of the camera device.</p>
4923e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
4933e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <p>If an application tries to create a session using a set of targets that exceed the limits
4943e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * described in the below tables, one of three possibilities may occur. First, the session may
4953e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * be successfully created and work normally. Second, the session may be successfully created,
4963e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * but the camera device won't meet the frame rate guarantees as described in
4973e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * {@link ACAMERA_SCALER_AVAILABLE_MIN_FRAME_DURATIONS}. Or third, if the output set
4983e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * cannot be used at all, session creation will fail entirely, with
4993e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * {@link ACAMERA_ERROR_STREAM_CONFIGURE_FAIL} being returned.</p>
5003e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
5013e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <p>For the type column `PRIV` refers to output format {@link AIMAGE_FORMAT_PRIVATE},
5023e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * `YUV` refers to output format {@link AIMAGE_FORMAT_YUV_420_888},
5033e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * `JPEG` refers to output format {@link AIMAGE_FORMAT_JPEG},
5043e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * and `RAW` refers to output format {@link AIMAGE_FORMAT_RAW16}
5053e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
5063e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
5073e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <p>For the maximum size column, `PREVIEW` refers to the best size match to the
5083e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * device's screen resolution, or to 1080p `(1920x1080)`, whichever is
5093e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * smaller. `RECORD` refers to the camera device's maximum supported recording resolution,
5103e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * as determined by <a href="http://developer.android.com/reference/android/media/CamcorderProfile.html">
5113e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * android.media.CamcorderProfiles</a>. And `MAXIMUM` refers to the
5123e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * camera device's maximum output resolution for that format or target from
5133e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * {@link ACAMERA_SCALER_AVAILABLE_STREAM_CONFIGURATIONS}.</p>
5143e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
5153e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <p>To use these tables, determine the number and the formats/targets of outputs needed, and
5163e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * find the row(s) of the table with those targets. The sizes indicate the maximum set of sizes
5173e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * that can be used; it is guaranteed that for those targets, the listed sizes and anything
5183e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * smaller from the list given by {@link ACAMERA_SCALER_AVAILABLE_STREAM_CONFIGURATIONS} can be
5193e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * successfully used to create a session.  For example, if a row indicates that a 8 megapixel
5203e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * (MP) YUV_420_888 output can be used together with a 2 MP `PRIV` output, then a session
5213e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * can be created with targets `[8 MP YUV, 2 MP PRIV]` or targets `[2 MP YUV, 2 MP PRIV]`;
5223e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * but a session with targets `[8 MP YUV, 4 MP PRIV]`, targets `[4 MP YUV, 4 MP PRIV]`,
5233e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * or targets `[8 MP PRIV, 2 MP YUV]` would not be guaranteed to work, unless
5243e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * some other row of the table lists such a combination.</p>
5253e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
5263e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <p>Legacy devices ({@link ACAMERA_INFO_SUPPORTED_HARDWARE_LEVEL}
5273e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * `== `{@link ACAMERA_INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY LEGACY}) support at
5283e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * least the following stream combinations:
5293e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
5303e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <table>
5313e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr><th colspan="7">LEGACY-level guaranteed configurations</th></tr>
5323e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <th colspan="2" id="rb">Target 1</th> <th colspan="2" id="rb">Target 2</th>  <th colspan="2" id="rb">Target 3</th> <th rowspan="2">Sample use case(s)</th> </tr>
5333e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <th>Type</th><th id="rb">Max size</th> <th>Type</th><th id="rb">Max size</th> <th>Type</th><th id="rb">Max size</th></tr>
5343e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`PRIV`</td><td id="rb">`MAXIMUM`</td> <td colspan="2" id="rb"></td> <td colspan="2" id="rb"></td> <td>Simple preview, GPU video processing, or no-preview video recording.</td> </tr>
5353e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`JPEG`</td><td id="rb">`MAXIMUM`</td> <td colspan="2" id="rb"></td> <td colspan="2" id="rb"></td> <td>No-viewfinder still image capture.</td> </tr>
5363e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`YUV `</td><td id="rb">`MAXIMUM`</td> <td colspan="2" id="rb"></td> <td colspan="2" id="rb"></td> <td>In-application video/image processing.</td> </tr>
5373e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`PRIV`</td><td id="rb">`PREVIEW`</td> <td>`JPEG`</td><td id="rb">`MAXIMUM`</td> <td colspan="2" id="rb"></td> <td>Standard still imaging.</td> </tr>
5383e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`YUV `</td><td id="rb">`PREVIEW`</td> <td>`JPEG`</td><td id="rb">`MAXIMUM`</td> <td colspan="2" id="rb"></td> <td>In-app processing plus still capture.</td> </tr>
5393e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`PRIV`</td><td id="rb">`PREVIEW`</td> <td>`PRIV`</td><td id="rb">`PREVIEW`</td> <td colspan="2" id="rb"></td> <td>Standard recording.</td> </tr>
5403e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`PRIV`</td><td id="rb">`PREVIEW`</td> <td>`YUV `</td><td id="rb">`PREVIEW`</td> <td colspan="2" id="rb"></td> <td>Preview plus in-app processing.</td> </tr>
5413e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`PRIV`</td><td id="rb">`PREVIEW`</td> <td>`YUV `</td><td id="rb">`PREVIEW`</td> <td>`JPEG`</td><td id="rb">`MAXIMUM`</td> <td>Still capture plus in-app processing.</td> </tr>
5423e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * </table><br>
5433e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * </p>
5443e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
5453e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <p>Limited-level ({@link ACAMERA_INFO_SUPPORTED_HARDWARE_LEVEL}
5463e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * `== `{@link ACAMERA_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED}) devices
5473e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * support at least the following stream combinations in addition to those for
5483e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * {@link ACAMERA_INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY LEGACY} devices:
5493e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
5503e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <table>
5513e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr><th colspan="7">LIMITED-level additional guaranteed configurations</th></tr>
5523e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr><th colspan="2" id="rb">Target 1</th><th colspan="2" id="rb">Target 2</th><th colspan="2" id="rb">Target 3</th> <th rowspan="2">Sample use case(s)</th> </tr>
5533e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th></tr>
5543e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`PRIV`</td><td id="rb">`PREVIEW`</td> <td>`PRIV`</td><td id="rb">`RECORD `</td> <td colspan="2" id="rb"></td> <td>High-resolution video recording with preview.</td> </tr>
5553e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`PRIV`</td><td id="rb">`PREVIEW`</td> <td>`YUV `</td><td id="rb">`RECORD `</td> <td colspan="2" id="rb"></td> <td>High-resolution in-app video processing with preview.</td> </tr>
5563e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`YUV `</td><td id="rb">`PREVIEW`</td> <td>`YUV `</td><td id="rb">`RECORD `</td> <td colspan="2" id="rb"></td> <td>Two-input in-app video processing.</td> </tr>
5573e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`PRIV`</td><td id="rb">`PREVIEW`</td> <td>`PRIV`</td><td id="rb">`RECORD `</td> <td>`JPEG`</td><td id="rb">`RECORD `</td> <td>High-resolution recording with video snapshot.</td> </tr>
5583e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`PRIV`</td><td id="rb">`PREVIEW`</td> <td>`YUV `</td><td id="rb">`RECORD `</td> <td>`JPEG`</td><td id="rb">`RECORD `</td> <td>High-resolution in-app processing with video snapshot.</td> </tr>
5593e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`YUV `</td><td id="rb">`PREVIEW`</td> <td>`YUV `</td><td id="rb">`PREVIEW`</td> <td>`JPEG`</td><td id="rb">`MAXIMUM`</td> <td>Two-input in-app processing with still capture.</td> </tr>
5603e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * </table><br>
5613e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * </p>
5623e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
5633e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <p>FULL-level ({@link ACAMERA_INFO_SUPPORTED_HARDWARE_LEVEL}
5643e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * `== `{@link ACAMERA_INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL}) devices
5653e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * support at least the following stream combinations in addition to those for
5663e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * {@link ACAMERA_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED} devices:
5673e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
5683e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <table>
5693e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr><th colspan="7">FULL-level additional guaranteed configurations</th></tr>
5703e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr><th colspan="2" id="rb">Target 1</th><th colspan="2" id="rb">Target 2</th><th colspan="2" id="rb">Target 3</th> <th rowspan="2">Sample use case(s)</th> </tr>
5713e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th> </tr>
5723e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`PRIV`</td><td id="rb">`PREVIEW`</td> <td>`PRIV`</td><td id="rb">`MAXIMUM`</td> <td colspan="2" id="rb"></td> <td>Maximum-resolution GPU processing with preview.</td> </tr>
5733e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`PRIV`</td><td id="rb">`PREVIEW`</td> <td>`YUV `</td><td id="rb">`MAXIMUM`</td> <td colspan="2" id="rb"></td> <td>Maximum-resolution in-app processing with preview.</td> </tr>
5743e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`YUV `</td><td id="rb">`PREVIEW`</td> <td>`YUV `</td><td id="rb">`MAXIMUM`</td> <td colspan="2" id="rb"></td> <td>Maximum-resolution two-input in-app processsing.</td> </tr>
5753e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`PRIV`</td><td id="rb">`PREVIEW`</td> <td>`PRIV`</td><td id="rb">`PREVIEW`</td> <td>`JPEG`</td><td id="rb">`MAXIMUM`</td> <td>Video recording with maximum-size video snapshot</td> </tr>
5763e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`YUV `</td><td id="rb">`640x480`</td> <td>`PRIV`</td><td id="rb">`PREVIEW`</td> <td>`YUV `</td><td id="rb">`MAXIMUM`</td> <td>Standard video recording plus maximum-resolution in-app processing.</td> </tr>
5773e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`YUV `</td><td id="rb">`640x480`</td> <td>`YUV `</td><td id="rb">`PREVIEW`</td> <td>`YUV `</td><td id="rb">`MAXIMUM`</td> <td>Preview plus two-input maximum-resolution in-app processing.</td> </tr>
5783e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * </table><br>
5793e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * </p>
5803e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
5813e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <p>RAW-capability ({@link ACAMERA_REQUEST_AVAILABLE_CAPABILITIES} includes
5823e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * {@link ACAMERA_REQUEST_AVAILABLE_CAPABILITIES_RAW RAW}) devices additionally support
5833e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * at least the following stream combinations on both
5843e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * {@link ACAMERA_INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL} and
5853e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * {@link ACAMERA_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED} devices:
5863e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
5873e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <table>
5883e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr><th colspan="7">RAW-capability additional guaranteed configurations</th></tr>
5893e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr><th colspan="2" id="rb">Target 1</th><th colspan="2" id="rb">Target 2</th><th colspan="2" id="rb">Target 3</th> <th rowspan="2">Sample use case(s)</th> </tr>
5903e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th> </tr>
5913e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`RAW `</td><td id="rb">`MAXIMUM`</td> <td colspan="2" id="rb"></td> <td colspan="2" id="rb"></td> <td>No-preview DNG capture.</td> </tr>
5923e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`PRIV`</td><td id="rb">`PREVIEW`</td> <td>`RAW `</td><td id="rb">`MAXIMUM`</td> <td colspan="2" id="rb"></td> <td>Standard DNG capture.</td> </tr>
5933e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`YUV `</td><td id="rb">`PREVIEW`</td> <td>`RAW `</td><td id="rb">`MAXIMUM`</td> <td colspan="2" id="rb"></td> <td>In-app processing plus DNG capture.</td> </tr>
5943e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`PRIV`</td><td id="rb">`PREVIEW`</td> <td>`PRIV`</td><td id="rb">`PREVIEW`</td> <td>`RAW `</td><td id="rb">`MAXIMUM`</td> <td>Video recording with DNG capture.</td> </tr>
5953e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`PRIV`</td><td id="rb">`PREVIEW`</td> <td>`YUV `</td><td id="rb">`PREVIEW`</td> <td>`RAW `</td><td id="rb">`MAXIMUM`</td> <td>Preview with in-app processing and DNG capture.</td> </tr>
5963e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`YUV `</td><td id="rb">`PREVIEW`</td> <td>`YUV `</td><td id="rb">`PREVIEW`</td> <td>`RAW `</td><td id="rb">`MAXIMUM`</td> <td>Two-input in-app processing plus DNG capture.</td> </tr>
5973e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`PRIV`</td><td id="rb">`PREVIEW`</td> <td>`JPEG`</td><td id="rb">`MAXIMUM`</td> <td>`RAW `</td><td id="rb">`MAXIMUM`</td> <td>Still capture with simultaneous JPEG and DNG.</td> </tr>
5983e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`YUV `</td><td id="rb">`PREVIEW`</td> <td>`JPEG`</td><td id="rb">`MAXIMUM`</td> <td>`RAW `</td><td id="rb">`MAXIMUM`</td> <td>In-app processing with simultaneous JPEG and DNG.</td> </tr>
5993e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * </table><br>
6003e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * </p>
6013e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
6023e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <p>BURST-capability ({@link ACAMERA_REQUEST_AVAILABLE_CAPABILITIES} includes
6033e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * {@link ACAMERA_REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE BURST_CAPTURE}) devices
6043e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * support at least the below stream combinations in addition to those for
6053e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * {@link ACAMERA_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED} devices. Note that all
6063e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * FULL-level devices support the BURST capability, and the below list is a strict subset of the
6073e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * list for FULL-level devices, so this table is only relevant for LIMITED-level devices that
6083e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * support the BURST_CAPTURE capability.
6093e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
6103e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <table>
6113e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr><th colspan="5">BURST-capability additional guaranteed configurations</th></tr>
6123e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr><th colspan="2" id="rb">Target 1</th><th colspan="2" id="rb">Target 2</th><th rowspan="2">Sample use case(s)</th> </tr>
6133e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th> </tr>
6143e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`PRIV`</td><td id="rb">`PREVIEW`</td> <td>`PRIV`</td><td id="rb">`MAXIMUM`</td> <td>Maximum-resolution GPU processing with preview.</td> </tr>
6153e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`PRIV`</td><td id="rb">`PREVIEW`</td> <td>`YUV `</td><td id="rb">`MAXIMUM`</td> <td>Maximum-resolution in-app processing with preview.</td> </tr>
6163e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`YUV `</td><td id="rb">`PREVIEW`</td> <td>`YUV `</td><td id="rb">`MAXIMUM`</td> <td>Maximum-resolution two-input in-app processsing.</td> </tr>
6173e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * </table><br>
6183e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * </p>
6193e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
6203e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <p>LEVEL-3 ({@link ACAMERA_INFO_SUPPORTED_HARDWARE_LEVEL}
6213e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * `== `{@link ACAMERA_INFO_SUPPORTED_HARDWARE_LEVEL_3 LEVEL_3})
6223e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * support at least the following stream combinations in addition to the combinations for
6233e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * {@link ACAMERA_INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL} and for
6243e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * RAW capability ({@link ACAMERA_REQUEST_AVAILABLE_CAPABILITIES} includes
6253e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * {@link ACAMERA_REQUEST_AVAILABLE_CAPABILITIES_RAW RAW}):
6263e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
6273e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <table>
6283e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr><th colspan="11">LEVEL-3 additional guaranteed configurations</th></tr>
6293e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr><th colspan="2" id="rb">Target 1</th><th colspan="2" id="rb">Target 2</th><th colspan="2" id="rb">Target 3</th><th colspan="2" id="rb">Target 4</th><th rowspan="2">Sample use case(s)</th> </tr>
6303e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th> </tr>
6313e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`PRIV`</td><td id="rb">`PREVIEW`</td> <td>`PRIV`</td><td id="rb">`640x480`</td> <td>`YUV`</td><td id="rb">`MAXIMUM`</td> <td>`RAW`</td><td id="rb">`MAXIMUM`</td> <td>In-app viewfinder analysis with dynamic selection of output format.</td> </tr>
6323e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <tr> <td>`PRIV`</td><td id="rb">`PREVIEW`</td> <td>`PRIV`</td><td id="rb">`640x480`</td> <td>`JPEG`</td><td id="rb">`MAXIMUM`</td> <td>`RAW`</td><td id="rb">`MAXIMUM`</td> <td>In-app viewfinder analysis with dynamic selection of output format.</td> </tr>
6333e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * </table><br>
6343e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * </p>
6353e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
6363e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * <p>Since the capabilities of camera devices vary greatly, a given camera device may support
6373e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * target combinations with sizes outside of these guarantees, but this can only be tested for
6383e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * by attempting to create a session with such targets.</p>
6393e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
6403e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @param device the camera device of interest.
6413e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @param outputs the {@link ACaptureSessionOutputContainer} describes all output streams.
6423e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @param callbacks the {@link ACameraCaptureSession_stateCallbacks capture session state callbacks}.
6433e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @param session the created {@link ACameraCaptureSession} will be filled here if the method call
6443e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *        succeeds.
6453e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *
6463e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh * @return <ul>
6473e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *         <li>{@link ACAMERA_OK} if the method call succeeds. The created capture session will be
6483e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *                                filled in session argument.</li>
6493e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *         <li>{@link ACAMERA_ERROR_INVALID_PARAMETER} if any of device, outputs, callbacks or
6503e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *                                session is NULL.</li>
6513e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *         <li>{@link ACAMERA_ERROR_CAMERA_DISCONNECTED} if the camera device is closed.</li>
6523e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *         <li>{@link ACAMERA_ERROR_CAMERA_DEVICE} if the camera device encounters fatal error.</li>
6533e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *         <li>{@link ACAMERA_ERROR_CAMERA_SERVICE} if the camera service encounters fatal error.</li>
6543e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh *         <li>{@link ACAMERA_ERROR_UNKNOWN} if the method fails for some other reasons.</li></ul>
655ead9146f844ee194a4f4244ba8ae1a3aece12b63Yin-Chia Yeh */
6560dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yehcamera_status_t ACameraDevice_createCaptureSession(
6573e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh        ACameraDevice* device,
6580dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh        const ACaptureSessionOutputContainer*       outputs,
659ead9146f844ee194a4f4244ba8ae1a3aece12b63Yin-Chia Yeh        const ACameraCaptureSession_stateCallbacks* callbacks,
660ead9146f844ee194a4f4244ba8ae1a3aece12b63Yin-Chia Yeh        /*out*/ACameraCaptureSession** session);
6610dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
662d7973ba37cea1a9638ded23041c69774ae8cebbcDan Albert#endif /* __ANDROID_API__ >= 24 */
663d7973ba37cea1a9638ded23041c69774ae8cebbcDan Albert
664d7973ba37cea1a9638ded23041c69774ae8cebbcDan Albert__END_DECLS
6650dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
666d7973ba37cea1a9638ded23041c69774ae8cebbcDan Albert#endif /* _NDK_CAMERA_DEVICE_H */
6673e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh
6683e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh/** @} */
6693e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh
670