blob: 36251fce7aec8875558f9e621054db5b59092664 [file] [log] [blame]
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -08001/*
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
Yin-Chia Yeh3e49be12016-04-12 16:00:33 -070017/**
18 * @addtogroup Camera
19 * @{
20 */
21
22/**
23 * @file NdkCameraError.h
24 */
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -080025
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#ifdef __cplusplus
40extern "C" {
41#endif
42
43typedef enum {
44 ACAMERA_OK = 0,
45
46 ACAMERA_ERROR_BASE = -10000,
Yin-Chia Yeha22528a2016-05-12 14:03:11 -070047
48 /**
49 * Camera operation has failed due to an unspecified cause.
50 */
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -080051 ACAMERA_ERROR_UNKNOWN = ACAMERA_ERROR_BASE,
Yin-Chia Yeha22528a2016-05-12 14:03:11 -070052
53 /**
54 * Camera operation has failed due to an invalid parameter being passed to the method.
55 */
56 ACAMERA_ERROR_INVALID_PARAMETER = ACAMERA_ERROR_BASE - 1,
57
58 /**
59 * Camera operation has failed because the camera device has been closed, possibly because a
60 * higher-priority client has taken ownership of the camera device.
61 */
62 ACAMERA_ERROR_CAMERA_DISCONNECTED = ACAMERA_ERROR_BASE - 2,
63
64 /**
65 * Camera operation has failed due to insufficient memory.
66 */
67 ACAMERA_ERROR_NOT_ENOUGH_MEMORY = ACAMERA_ERROR_BASE - 3,
68
69 /**
70 * Camera operation has failed due to the requested metadata tag cannot be found in input
71 * {@link ACameraMetadata} or {@link ACaptureRequest}.
72 */
73 ACAMERA_ERROR_METADATA_NOT_FOUND = ACAMERA_ERROR_BASE - 4,
74
75 /**
76 * Camera operation has failed and the camera device has encountered a fatal error and needs to
77 * be re-opened before it can be used again.
78 */
79 ACAMERA_ERROR_CAMERA_DEVICE = ACAMERA_ERROR_BASE - 5,
80
81 /**
82 * Camera operation has failed and the camera service has encountered a fatal error.
83 *
84 * <p>The Android device may need to be shut down and restarted to restore
85 * camera function, or there may be a persistent hardware problem.</p>
86 *
87 * <p>An attempt at recovery may be possible by closing the
88 * ACameraDevice and the ACameraManager, and trying to acquire all resources
89 * again from scratch.</p>
90 */
91 ACAMERA_ERROR_CAMERA_SERVICE = ACAMERA_ERROR_BASE - 6,
92
93 /**
94 * The {@link ACameraCaptureSession} has been closed and cannnot perform any operation other
95 * than {@link ACameraCaptureSession_close}.
96 */
97 ACAMERA_ERROR_SESSION_CLOSED = ACAMERA_ERROR_BASE - 7,
98
99 /**
100 * Camera operation has failed due to an invalid internal operation. Usually this is due to a
101 * low-level problem that may resolve itself on retry
102 */
103 ACAMERA_ERROR_INVALID_OPERATION = ACAMERA_ERROR_BASE - 8,
104
105 /**
106 * Camera device does not support the stream configuration provided by application in
107 * {@link ACameraDevice_createCaptureSession}.
108 */
109 ACAMERA_ERROR_STREAM_CONFIGURE_FAIL = ACAMERA_ERROR_BASE - 9,
110
111 /**
112 * Camera device is being used by another higher priority camera API client.
113 */
114 ACAMERA_ERROR_CAMERA_IN_USE = ACAMERA_ERROR_BASE - 10,
115
116 /**
117 * The system-wide limit for number of open cameras or camera resources has been reached, and
118 * more camera devices cannot be opened until previous instances are closed.
119 */
120 ACAMERA_ERROR_MAX_CAMERA_IN_USE = ACAMERA_ERROR_BASE - 11,
121
122 /**
123 * The camera is disabled due to a device policy, and cannot be opened.
124 */
125 ACAMERA_ERROR_CAMERA_DISABLED = ACAMERA_ERROR_BASE - 12,
126
127 /**
128 * The application does not have permission to open camera.
129 */
130 ACAMERA_ERROR_PERMISSION_DENIED = ACAMERA_ERROR_BASE - 13,
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -0800131} camera_status_t;
132
133
134#ifdef __cplusplus
135} // extern "C"
136#endif
137
138#endif // _NDK_CAMERA_ERROR_H
Yin-Chia Yeh3e49be12016-04-12 16:00:33 -0700139
140/** @} */