blob: 2ed4e3a986c0f01302a75f5a71e008480f5b5af0 [file] [log] [blame]
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001/*
2 * Copyright (C) 2013 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
17package android.hardware.photography;
18
19import android.graphics.Rect;
20
21import java.util.List;
22
23/**
24 * <p>The properties describing a
25 * {@link CameraDevice CameraDevice}.</p>
26 *
27 * <p>These properties are fixed for a given CameraDevice, and can be queried
28 * through the {@link CameraManager CameraManager}
29 * interface in addition to through the CameraDevice interface.</p>
30 *
31 * @see CameraDevice
32 * @see CameraManager
33 */
34public final class CameraProperties extends CameraMetadata {
35 /**
36 * The model name of the camera. For fixed (non-removable) cameras, this is
37 * the manufacturer's name. For removable cameras, this is a string that
38 * uniquely identifies the camera model and manufacturer. The
39 * {@link #INFO_IDENTIFIER} can be used to distinguish between multiple
40 * removable cameras of the same model.
41 */
Igor Murashkin70725502013-06-25 20:27:06 +000042 public static final Key<String> INFO_MODEL =
Igor Murashkinb519cc52013-07-02 11:23:44 -070043 new Key<String>("android.info.model", String.class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080044
45 /**
46 * A unique identifier for this camera. For removable cameras, every
47 * camera will have a unique identifier, including two cameras of the
48 * same model and manufacturer. For non-removable cameras, the
49 * identifier is equal to the the device's id.
50 */
Igor Murashkin70725502013-06-25 20:27:06 +000051 public static final Key<String> INFO_IDENTIFIER =
Igor Murashkinb519cc52013-07-02 11:23:44 -070052 new Key<String>("android.info.identifier", String.class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080053
54 /**
55 * <p>Whether this camera is removable or not.</p>
56 *
57 * <p>Applications using a removable camera must be prepared for the camera
58 * to be disconnected during use. Use the {@link #INFO_IDENTIFIER} field to
59 * determine if this camera is a match for a camera device seen earlier.</p>
60 */
Igor Murashkin70725502013-06-25 20:27:06 +000061 public static final Key<Boolean> INFO_REMOVABLE =
Igor Murashkinb519cc52013-07-02 11:23:44 -070062 new Key<Boolean>("android.info.isRemovable", Boolean.TYPE);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080063
64 /**
65 * <p>The hardware operational model of this device. One of the
66 * INFO_SUPPORTED_HARDWARE_LEVEL_* constants.</p>
67 *
68 * <p>Limited-capability devices have a number of limitations relative to
69 * full-capability cameras. Roughly, they have capabilities comparable to
70 * those provided by the deprecated {@link android.hardware.Camera}
71 * class.</p>
72 *
73 * <p>Specifically, limited-mode devices:</p>
74 *
75 * <ol>
76 *
77 * <li>Do not provide per-frame result metadata for repeating
78 * captures. This means that a CaptureListener will not be called for
79 * captures done through {@link CameraDevice#setRepeatingRequest
80 * setRepeatingRequest} or {@link CameraDevice#setRepeatingBurst
81 * setRepeatingBurst}.</li>
82 *
83 * <li>Do not support complete result metadata. Only a few fields are
84 * provided, such as the timestamp (TODO).</li>
85 *
86 * <li>Do not support manual capture controls. Only the (TODO)
87 * ANDROID_CONTROL_* fields and TODO controls are used, and the various
88 * AE/AF/AWB_OFF control values cannot be used.</li>
89 *
90 * <li>Do not support high frame rate captures. To obtain high frame rate,
91 * the {@link CameraDevice#setRepeatingRequest setRepeatingRequest} method
92 * must be used. The {@link CameraDevice#capture capture},
93 * {@link CameraDevice#captureBurst captureBurst}, and
94 * {@link CameraDevice#setRepeatingBurst setRepeatingBurst} methods will
95 * result in slow frame captures.</li>
96 *
97 * </ol>
98 *
99 * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED
100 * @see #INFO_SUPPORTED_HARDWARE_LEVEL_FULL
101 */
Igor Murashkin70725502013-06-25 20:27:06 +0000102 public static final Key<Integer> INFO_SUPPORTED_HARDWARE_LEVEL =
Igor Murashkinb519cc52013-07-02 11:23:44 -0700103 new Key<Integer>("android.info.supportedHardwareLevel", Integer.TYPE);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800104
105 /**
106 * <p>The type reported by limited-capability camera devices.</p>
107 *
108 * <p>Limited-capability devices have a number of limitations relative to
109 * full-capability cameras. Roughly, they have capabilities comparable to
110 * those provided by the deprecated {@link android.hardware.Camera}
111 * class.</p>
112 *
113 * <p>Specifically, limited-mode devices:</p>
114 *
115 * <ol>
116 *
117 * <li>Do not provide per-frame result metadata for repeating
118 * captures. This means that a CaptureListener will not be called for
119 * captures done through {@link CameraDevice#setRepeatingRequest
120 * setRepeatingRequest} or {@link CameraDevice#setRepeatingBurst
121 * setRepeatingBurst}.</li>
122 *
123 * <li>Do not support complete result metadata. Only a few fields are
124 * provided, such as the timestamp (TODO).</li>
125 *
126 * <li>Do not support manual capture controls. Only the (TODO)
127 * ANDROID_CONTROL_* fields and TODO controls are used, and the various
128 * AE/AF/AWB_OFF control values cannot be used.</li>
129 *
130 * <li>Do not support high frame rate captures. To obtain high frame rate,
131 * the {@link CameraDevice#setRepeatingRequest setRepeatingRequest} method
132 * must be used. The {@link CameraDevice#capture capture},
133 * {@link CameraDevice#captureBurst captureBurst}, and
134 * {@link CameraDevice#setRepeatingBurst setRepeatingBurst} methods will
135 * result in slow frame captures.</li>
136 *
137 * </ol>
138 *
139 * @see #INFO_SUPPORTED_HARDWARE_LEVEL
140 */
141 public static final int INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED = 0;
142
143 /**
144 * <p>The type reported by full-capability camera devices</p>
145 *
146 * <p>Full-capability devices allow for per-frame control of capture
147 * hardware and post-processing parameters at high frame rates. They also
148 * provide output data at high resolution in uncompressed formats, in
149 * addition to compressed JPEG output.</p>
150 *
151 * @see #INFO_SUPPORTED_HARDWARE_LEVEL
152 */
153 public static final int INFO_SUPPORTED_HARDWARE_LEVEL_FULL = 1;
154
155 /**
156 * <p>The available output formats from this camera device. When using a
157 * {@link android.media.ImageReader} as an output target, the
158 * ImageReader must be configured to use one of these formats.</p>
159 *
160 * <p>The list is a subset of the formats defined in
161 * {@link android.graphics.ImageFormat}.</p>
162 *
163 * <p>The image formats {@link android.graphics.ImageFormat#JPEG},
164 * {@link android.graphics.ImageFormat#YUV_420_888} are guaranteed to be
165 * supported.</p>
166 */
Igor Murashkinb519cc52013-07-02 11:23:44 -0700167 public static final Key<int[]> SCALER_AVAILABLE_FORMATS =
168 new Key<int[]>("android.scaler.availableFormats", int[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800169
170 /**
171 * <p>The available output sizes for JPEG buffers from this camera
172 * device. When using a {@link android.media.ImageReader} as an output
173 * target, the ImageReader must be configured to use one of these sizes
174 * when using format {@link android.graphics.ImageFormat#JPEG}.</p>
175 */
Igor Murashkin70725502013-06-25 20:27:06 +0000176 public static final Key<Size[]> SCALER_AVAILABLE_JPEG_SIZES =
Igor Murashkinb519cc52013-07-02 11:23:44 -0700177 new Key<Size[]>("android.scaler.availableJpegSizes", Size[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800178
179 /**
180 * <p>The available sizes for output buffers from this camera device, when
181 * the buffers are neither of the {@link android.graphics.ImageFormat#JPEG}
182 * or of the {@link android.graphics.ImageFormat#RAW_SENSOR} type.</p>
183 *
184 * <p>When using a {@link android.view.SurfaceView},
185 * {@link android.graphics.SurfaceTexture},
186 * {@link android.media.MediaRecorder}, {@link android.media.MediaCodec}, or
187 * {@link android.renderscript.Allocation} as an output target, that target
188 * must be configured to one of these sizes. See
189 * {@link CameraDevice#configureOutputs} for details.
190 *
191 * <p>When using a {@link android.media.ImageReader} as an output
192 * target, the ImageReader must be configured to use one of these sizes
193 * when using format {@link android.graphics.ImageFormat#YUV_420_888}.</p>
194 *
195 */
Igor Murashkin70725502013-06-25 20:27:06 +0000196 public static final Key<Size[]> SCALER_AVAILABLE_PROCESSED_SIZES =
Igor Murashkinb519cc52013-07-02 11:23:44 -0700197 new Key<Size[]>("android.scaler.availableProcessedSizes", Size[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800198
199 /**
200 * <p>The available sizes for output buffers from this camera device, when
201 * the buffers are of the {@link android.graphics.ImageFormat#RAW_SENSOR} type. This type of output may not be
202 * supported by the device; check {@link #SCALER_AVAILABLE_FORMATS} to
203 * check. In that case, this list will not exist.</p>
204 *
205 * <p>When using a {@link android.media.ImageReader} as an output
206 * target, the ImageReader must be configured to use one of these sizes
207 * when using image format {@link android.graphics.ImageFormat#RAW_SENSOR}.</p>
208 */
Igor Murashkin70725502013-06-25 20:27:06 +0000209 public static final Key<Size[]> SCALER_AVAILABLE_RAW_SIZES =
Igor Murashkinb519cc52013-07-02 11:23:44 -0700210 new Key<Size[]>("android.scaler.availableRawSizes", Size[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800211
212 /**
213 * <p>The coordinates of the sensor's active pixel array, relative to its
214 * total pixel array. These are the pixels that are actually used for image
215 * capture. The active pixel region may be smaller than the total number of
216 * pixels, if some pixels are used for other tasks such as calibrating the
217 * sensor's black level. If all pixels available for readout are used for
218 * imaging, then this rectangle will be
219 * {@code (0,0) - (SENSOR_PIXEL_ARRAY_SIZE.width,
220 * SENSOR_PIXEL_ARRAY_SIZE.height)}.</p>
221 *
222 * <p>If raw sensor capture is supported by this device, the width and
223 * height of the active pixel array match up to one of the supported raw
224 * capture sizes, and using that size will capture just the active pixel
225 * array region.</p>
226 *
227 * <p>Most other coordinates used by the camera device (for example, for
228 * metering and crop region selection, or for reporting detected faces) use
229 * a coordinate system based on the active array dimensions, with (0,0)
230 * being the top-left corner of the active array.</p>
231 */
Igor Murashkin70725502013-06-25 20:27:06 +0000232 public static final Key<Rect> SENSOR_ACTIVE_ARRAY_SIZE =
Igor Murashkinb519cc52013-07-02 11:23:44 -0700233 new Key<Rect>("android.sensor.activeArraySize", Rect.class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800234
235 /**
236 * <p>The size of the sensor's total pixel array available for readout. Some
237 * of these pixels may not be used for image capture, in which case
238 * {@link #SENSOR_ACTIVE_ARRAY_SIZE} will describe a rectangle smaller than
239 * this. If raw sensor capture is supported by this device, this is one of
240 * the supported capture sizes.</p>
241 */
Igor Murashkin70725502013-06-25 20:27:06 +0000242 public static final Key<Size> SENSOR_PIXEL_ARRAY_SIZE =
Igor Murashkinb519cc52013-07-02 11:23:44 -0700243 new Key<Size>("android.sensor.activeArraySize", Size.class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800244
245 // TODO: Many more of these.
246
247}