• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 /**
44  * Camera status enum types.
45  */
46 typedef enum {
47     /**
48      * Camera operation has succeeded.
49      */
50     ACAMERA_OK = 0,
51 
52     ACAMERA_ERROR_BASE                  = -10000,
53 
54     /**
55      * Camera operation has failed due to an unspecified cause.
56      */
57     ACAMERA_ERROR_UNKNOWN               = ACAMERA_ERROR_BASE,
58 
59     /**
60      * Camera operation has failed due to an invalid parameter being passed to the method.
61      */
62     ACAMERA_ERROR_INVALID_PARAMETER     = ACAMERA_ERROR_BASE - 1,
63 
64     /**
65      * Camera operation has failed because the camera device has been closed, possibly because a
66      * higher-priority client has taken ownership of the camera device.
67      */
68     ACAMERA_ERROR_CAMERA_DISCONNECTED   = ACAMERA_ERROR_BASE - 2,
69 
70     /**
71      * Camera operation has failed due to insufficient memory.
72      */
73     ACAMERA_ERROR_NOT_ENOUGH_MEMORY     = ACAMERA_ERROR_BASE - 3,
74 
75     /**
76      * Camera operation has failed due to the requested metadata tag cannot be found in input
77      * {@link ACameraMetadata} or {@link ACaptureRequest}.
78      */
79     ACAMERA_ERROR_METADATA_NOT_FOUND    = ACAMERA_ERROR_BASE - 4,
80 
81     /**
82      * Camera operation has failed and the camera device has encountered a fatal error and needs to
83      * be re-opened before it can be used again.
84      */
85     ACAMERA_ERROR_CAMERA_DEVICE         = ACAMERA_ERROR_BASE - 5,
86 
87     /**
88      * Camera operation has failed and the camera service has encountered a fatal error.
89      *
90      * <p>The Android device may need to be shut down and restarted to restore
91      * camera function, or there may be a persistent hardware problem.</p>
92      *
93      * <p>An attempt at recovery may be possible by closing the
94      * ACameraDevice and the ACameraManager, and trying to acquire all resources
95      * again from scratch.</p>
96      */
97     ACAMERA_ERROR_CAMERA_SERVICE        = ACAMERA_ERROR_BASE - 6,
98 
99     /**
100      * The {@link ACameraCaptureSession} has been closed and cannot perform any operation other
101      * than {@link ACameraCaptureSession_close}.
102      */
103     ACAMERA_ERROR_SESSION_CLOSED        = ACAMERA_ERROR_BASE - 7,
104 
105     /**
106      * Camera operation has failed due to an invalid internal operation. Usually this is due to a
107      * low-level problem that may resolve itself on retry
108      */
109     ACAMERA_ERROR_INVALID_OPERATION     = ACAMERA_ERROR_BASE - 8,
110 
111     /**
112      * Camera device does not support the stream configuration provided by application in
113      * {@link ACameraDevice_createCaptureSession} or {@link
114      * ACameraDevice_isSessionConfigurationSupported}.
115      */
116     ACAMERA_ERROR_STREAM_CONFIGURE_FAIL = ACAMERA_ERROR_BASE - 9,
117 
118     /**
119      * Camera device is being used by another higher priority camera API client.
120      */
121     ACAMERA_ERROR_CAMERA_IN_USE         = ACAMERA_ERROR_BASE - 10,
122 
123     /**
124      * The system-wide limit for number of open cameras or camera resources has been reached, and
125      * more camera devices cannot be opened until previous instances are closed.
126      */
127     ACAMERA_ERROR_MAX_CAMERA_IN_USE     = ACAMERA_ERROR_BASE - 11,
128 
129     /**
130      * The camera is disabled due to a device policy, and cannot be opened.
131      */
132     ACAMERA_ERROR_CAMERA_DISABLED       = ACAMERA_ERROR_BASE - 12,
133 
134     /**
135      * The application does not have permission to open camera.
136      */
137     ACAMERA_ERROR_PERMISSION_DENIED     = ACAMERA_ERROR_BASE - 13,
138 
139     /**
140      * The operation is not supported by the camera device.
141      */
142     ACAMERA_ERROR_UNSUPPORTED_OPERATION = ACAMERA_ERROR_BASE - 14,
143 } camera_status_t;
144 
145 __END_DECLS
146 
147 #endif /* _NDK_CAMERA_ERROR_H */
148 
149 /** @} */
150