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 NdkCameraError.h
243e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh */
250dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-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 */
350dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
360dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh#ifndef _NDK_CAMERA_ERROR_H
370dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh#define _NDK_CAMERA_ERROR_H
380dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
39d7973ba37cea1a9638ded23041c69774ae8cebbcDan Albert#include <sys/cdefs.h>
40d7973ba37cea1a9638ded23041c69774ae8cebbcDan Albert
41d7973ba37cea1a9638ded23041c69774ae8cebbcDan Albert__BEGIN_DECLS
42d7973ba37cea1a9638ded23041c69774ae8cebbcDan Albert
43d7973ba37cea1a9638ded23041c69774ae8cebbcDan Albert#if __ANDROID_API__ >= 24
440dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
450dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yehtypedef enum {
460dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh    ACAMERA_OK = 0,
470dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
480dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh    ACAMERA_ERROR_BASE                  = -10000,
49a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh
50a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    /**
51a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     * Camera operation has failed due to an unspecified cause.
52a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     */
530dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh    ACAMERA_ERROR_UNKNOWN               = ACAMERA_ERROR_BASE,
54a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh
55a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    /**
56a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     * Camera operation has failed due to an invalid parameter being passed to the method.
57a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     */
58a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    ACAMERA_ERROR_INVALID_PARAMETER     = ACAMERA_ERROR_BASE - 1,
59a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh
60a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    /**
61a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     * Camera operation has failed because the camera device has been closed, possibly because a
62a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     * higher-priority client has taken ownership of the camera device.
63a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     */
64a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    ACAMERA_ERROR_CAMERA_DISCONNECTED   = ACAMERA_ERROR_BASE - 2,
65a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh
66a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    /**
67a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     * Camera operation has failed due to insufficient memory.
68a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     */
69a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    ACAMERA_ERROR_NOT_ENOUGH_MEMORY     = ACAMERA_ERROR_BASE - 3,
70a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh
71a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    /**
72a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     * Camera operation has failed due to the requested metadata tag cannot be found in input
73a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     * {@link ACameraMetadata} or {@link ACaptureRequest}.
74a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     */
75a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    ACAMERA_ERROR_METADATA_NOT_FOUND    = ACAMERA_ERROR_BASE - 4,
76a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh
77a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    /**
78a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     * Camera operation has failed and the camera device has encountered a fatal error and needs to
79a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     * be re-opened before it can be used again.
80a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     */
81a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    ACAMERA_ERROR_CAMERA_DEVICE         = ACAMERA_ERROR_BASE - 5,
82a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh
83a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    /**
84a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     * Camera operation has failed and the camera service has encountered a fatal error.
85a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     *
86a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     * <p>The Android device may need to be shut down and restarted to restore
87a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     * camera function, or there may be a persistent hardware problem.</p>
88a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     *
89a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     * <p>An attempt at recovery may be possible by closing the
90a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     * ACameraDevice and the ACameraManager, and trying to acquire all resources
91a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     * again from scratch.</p>
92a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     */
93a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    ACAMERA_ERROR_CAMERA_SERVICE        = ACAMERA_ERROR_BASE - 6,
94a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh
95a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    /**
96a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     * The {@link ACameraCaptureSession} has been closed and cannnot perform any operation other
97a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     * than {@link ACameraCaptureSession_close}.
98a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     */
99a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    ACAMERA_ERROR_SESSION_CLOSED        = ACAMERA_ERROR_BASE - 7,
100a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh
101a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    /**
102a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     * Camera operation has failed due to an invalid internal operation. Usually this is due to a
103a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     * low-level problem that may resolve itself on retry
104a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     */
105a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    ACAMERA_ERROR_INVALID_OPERATION     = ACAMERA_ERROR_BASE - 8,
106a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh
107a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    /**
108a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     * Camera device does not support the stream configuration provided by application in
109a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     * {@link ACameraDevice_createCaptureSession}.
110a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     */
111a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    ACAMERA_ERROR_STREAM_CONFIGURE_FAIL = ACAMERA_ERROR_BASE - 9,
112a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh
113a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    /**
114a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     * Camera device is being used by another higher priority camera API client.
115a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     */
116a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    ACAMERA_ERROR_CAMERA_IN_USE         = ACAMERA_ERROR_BASE - 10,
117a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh
118a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    /**
119a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     * The system-wide limit for number of open cameras or camera resources has been reached, and
120a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     * more camera devices cannot be opened until previous instances are closed.
121a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     */
122a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    ACAMERA_ERROR_MAX_CAMERA_IN_USE     = ACAMERA_ERROR_BASE - 11,
123a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh
124a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    /**
125a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     * The camera is disabled due to a device policy, and cannot be opened.
126a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     */
127a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    ACAMERA_ERROR_CAMERA_DISABLED       = ACAMERA_ERROR_BASE - 12,
128a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh
129a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    /**
130a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     * The application does not have permission to open camera.
131a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh     */
132a22528a9fac1763810d21b899e1b8c7977ea224cYin-Chia Yeh    ACAMERA_ERROR_PERMISSION_DENIED     = ACAMERA_ERROR_BASE - 13,
1330dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh} camera_status_t;
1340dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
135d7973ba37cea1a9638ded23041c69774ae8cebbcDan Albert#endif /* __ANDROID_API__ >= 24 */
1360dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
137d7973ba37cea1a9638ded23041c69774ae8cebbcDan Albert__END_DECLS
1380dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
139d7973ba37cea1a9638ded23041c69774ae8cebbcDan Albert#endif /* _NDK_CAMERA_ERROR_H */
1403e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh
1413e49be17d8c8c53f50bb0d39affbbc36f6a12488Yin-Chia Yeh/** @} */
142