1 /*
2  * Copyright (C) 2015 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 /**
18  * @addtogroup Camera
19  * @{
20  */
21 
22 /**
23  * @file NdkCameraError.h
24  */
25 
26 /*
27  * This file defines an NDK API.
28  * Do not remove methods.
29  * Do not change method signatures.
30  * Do not change the value of constants.
31  * Do not change the size of any of the classes defined in here.
32  * Do not reference types that are not part of the NDK.
33  * Do not #include files that aren't part of the NDK.
34  */
35 
36 #ifndef _NDK_CAMERA_ERROR_H
37 #define _NDK_CAMERA_ERROR_H
38 
39 #include <sys/cdefs.h>
40 
41 __BEGIN_DECLS
42 
43 #if __ANDROID_API__ >= 24
44 
45 typedef enum {
46     ACAMERA_OK = 0,
47 
48     ACAMERA_ERROR_BASE                  = -10000,
49 
50     /**
51      * Camera operation has failed due to an unspecified cause.
52      */
53     ACAMERA_ERROR_UNKNOWN               = ACAMERA_ERROR_BASE,
54 
55     /**
56      * Camera operation has failed due to an invalid parameter being passed to the method.
57      */
58     ACAMERA_ERROR_INVALID_PARAMETER     = ACAMERA_ERROR_BASE - 1,
59 
60     /**
61      * Camera operation has failed because the camera device has been closed, possibly because a
62      * higher-priority client has taken ownership of the camera device.
63      */
64     ACAMERA_ERROR_CAMERA_DISCONNECTED   = ACAMERA_ERROR_BASE - 2,
65 
66     /**
67      * Camera operation has failed due to insufficient memory.
68      */
69     ACAMERA_ERROR_NOT_ENOUGH_MEMORY     = ACAMERA_ERROR_BASE - 3,
70 
71     /**
72      * Camera operation has failed due to the requested metadata tag cannot be found in input
73      * {@link ACameraMetadata} or {@link ACaptureRequest}.
74      */
75     ACAMERA_ERROR_METADATA_NOT_FOUND    = ACAMERA_ERROR_BASE - 4,
76 
77     /**
78      * Camera operation has failed and the camera device has encountered a fatal error and needs to
79      * be re-opened before it can be used again.
80      */
81     ACAMERA_ERROR_CAMERA_DEVICE         = ACAMERA_ERROR_BASE - 5,
82 
83     /**
84      * Camera operation has failed and the camera service has encountered a fatal error.
85      *
86      * <p>The Android device may need to be shut down and restarted to restore
87      * camera function, or there may be a persistent hardware problem.</p>
88      *
89      * <p>An attempt at recovery may be possible by closing the
90      * ACameraDevice and the ACameraManager, and trying to acquire all resources
91      * again from scratch.</p>
92      */
93     ACAMERA_ERROR_CAMERA_SERVICE        = ACAMERA_ERROR_BASE - 6,
94 
95     /**
96      * The {@link ACameraCaptureSession} has been closed and cannnot perform any operation other
97      * than {@link ACameraCaptureSession_close}.
98      */
99     ACAMERA_ERROR_SESSION_CLOSED        = ACAMERA_ERROR_BASE - 7,
100 
101     /**
102      * Camera operation has failed due to an invalid internal operation. Usually this is due to a
103      * low-level problem that may resolve itself on retry
104      */
105     ACAMERA_ERROR_INVALID_OPERATION     = ACAMERA_ERROR_BASE - 8,
106 
107     /**
108      * Camera device does not support the stream configuration provided by application in
109      * {@link ACameraDevice_createCaptureSession} or {@link
110      * ACameraDevice_isSessionConfigurationSupported}.
111      */
112     ACAMERA_ERROR_STREAM_CONFIGURE_FAIL = ACAMERA_ERROR_BASE - 9,
113 
114     /**
115      * Camera device is being used by another higher priority camera API client.
116      */
117     ACAMERA_ERROR_CAMERA_IN_USE         = ACAMERA_ERROR_BASE - 10,
118 
119     /**
120      * The system-wide limit for number of open cameras or camera resources has been reached, and
121      * more camera devices cannot be opened until previous instances are closed.
122      */
123     ACAMERA_ERROR_MAX_CAMERA_IN_USE     = ACAMERA_ERROR_BASE - 11,
124 
125     /**
126      * The camera is disabled due to a device policy, and cannot be opened.
127      */
128     ACAMERA_ERROR_CAMERA_DISABLED       = ACAMERA_ERROR_BASE - 12,
129 
130     /**
131      * The application does not have permission to open camera.
132      */
133     ACAMERA_ERROR_PERMISSION_DENIED     = ACAMERA_ERROR_BASE - 13,
134 
135     /**
136      * The operation is not supported by the camera device.
137      */
138     ACAMERA_ERROR_UNSUPPORTED_OPERATION = ACAMERA_ERROR_BASE - 14,
139 } camera_status_t;
140 
141 #endif /* __ANDROID_API__ >= 24 */
142 
143 __END_DECLS
144 
145 #endif /* _NDK_CAMERA_ERROR_H */
146 
147 /** @} */
148