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