blob: 6b5815502b11df56637755d7d833c868898c9aee [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
Dan Albertd7973ba2016-09-14 12:35:50 -070039#include <sys/cdefs.h>
40
41__BEGIN_DECLS
42
43#if __ANDROID_API__ >= 24
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -080044
45typedef enum {
46 ACAMERA_OK = 0,
47
48 ACAMERA_ERROR_BASE = -10000,
Yin-Chia Yeha22528a2016-05-12 14:03:11 -070049
50 /**
51 * Camera operation has failed due to an unspecified cause.
52 */
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -080053 ACAMERA_ERROR_UNKNOWN = ACAMERA_ERROR_BASE,
Yin-Chia Yeha22528a2016-05-12 14:03:11 -070054
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}.
110 */
111 ACAMERA_ERROR_STREAM_CONFIGURE_FAIL = ACAMERA_ERROR_BASE - 9,
112
113 /**
114 * Camera device is being used by another higher priority camera API client.
115 */
116 ACAMERA_ERROR_CAMERA_IN_USE = ACAMERA_ERROR_BASE - 10,
117
118 /**
119 * The system-wide limit for number of open cameras or camera resources has been reached, and
120 * more camera devices cannot be opened until previous instances are closed.
121 */
122 ACAMERA_ERROR_MAX_CAMERA_IN_USE = ACAMERA_ERROR_BASE - 11,
123
124 /**
125 * The camera is disabled due to a device policy, and cannot be opened.
126 */
127 ACAMERA_ERROR_CAMERA_DISABLED = ACAMERA_ERROR_BASE - 12,
128
129 /**
130 * The application does not have permission to open camera.
131 */
132 ACAMERA_ERROR_PERMISSION_DENIED = ACAMERA_ERROR_BASE - 13,
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -0800133} camera_status_t;
134
Dan Albertd7973ba2016-09-14 12:35:50 -0700135#endif /* __ANDROID_API__ >= 24 */
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -0800136
Dan Albertd7973ba2016-09-14 12:35:50 -0700137__END_DECLS
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -0800138
Dan Albertd7973ba2016-09-14 12:35:50 -0700139#endif /* _NDK_CAMERA_ERROR_H */
Yin-Chia Yeh3e49be12016-04-12 16:00:33 -0700140
141/** @} */