Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 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 | #ifndef ANDROID_SERVERS_CAMERA_CAMERA2CLIENT_H |
| 18 | #define ANDROID_SERVERS_CAMERA_CAMERA2CLIENT_H |
| 19 | |
| 20 | #include "Camera2Device.h" |
| 21 | #include "CameraService.h" |
Eino-Ville Talvala | f69c70d | 2012-05-20 15:59:14 -0700 | [diff] [blame] | 22 | #include "camera/CameraParameters.h" |
Eino-Ville Talvala | d4bcfde | 2012-06-07 17:12:38 -0700 | [diff] [blame] | 23 | #include <binder/MemoryBase.h> |
| 24 | #include <binder/MemoryHeapBase.h> |
| 25 | #include <gui/CpuConsumer.h> |
Eino-Ville Talvala | 78822d7 | 2012-07-18 17:52:18 -0700 | [diff] [blame] | 26 | #include "MediaConsumer.h" |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 27 | |
| 28 | namespace android { |
| 29 | |
| 30 | /** |
| 31 | * Implements the android.hardware.camera API on top of |
| 32 | * camera device HAL version 2. |
| 33 | */ |
| 34 | class Camera2Client : public CameraService::Client |
| 35 | { |
| 36 | public: |
| 37 | // ICamera interface (see ICamera for details) |
| 38 | virtual void disconnect(); |
| 39 | virtual status_t connect(const sp<ICameraClient>& client); |
| 40 | virtual status_t lock(); |
| 41 | virtual status_t unlock(); |
| 42 | virtual status_t setPreviewDisplay(const sp<Surface>& surface); |
Eino-Ville Talvala | 6db981c | 2012-05-21 18:54:30 -0700 | [diff] [blame] | 43 | virtual status_t setPreviewTexture( |
| 44 | const sp<ISurfaceTexture>& surfaceTexture); |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 45 | virtual void setPreviewCallbackFlag(int flag); |
| 46 | virtual status_t startPreview(); |
| 47 | virtual void stopPreview(); |
| 48 | virtual bool previewEnabled(); |
| 49 | virtual status_t storeMetaDataInBuffers(bool enabled); |
| 50 | virtual status_t startRecording(); |
| 51 | virtual void stopRecording(); |
| 52 | virtual bool recordingEnabled(); |
| 53 | virtual void releaseRecordingFrame(const sp<IMemory>& mem); |
| 54 | virtual status_t autoFocus(); |
| 55 | virtual status_t cancelAutoFocus(); |
| 56 | virtual status_t takePicture(int msgType); |
| 57 | virtual status_t setParameters(const String8& params); |
| 58 | virtual String8 getParameters() const; |
| 59 | virtual status_t sendCommand(int32_t cmd, int32_t arg1, int32_t arg2); |
| 60 | |
| 61 | // Interface used by CameraService |
| 62 | Camera2Client(const sp<CameraService>& cameraService, |
| 63 | const sp<ICameraClient>& cameraClient, |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 64 | int cameraId, |
| 65 | int cameraFacing, |
| 66 | int clientPid); |
| 67 | ~Camera2Client(); |
| 68 | |
Eino-Ville Talvala | f69c70d | 2012-05-20 15:59:14 -0700 | [diff] [blame] | 69 | status_t initialize(camera_module_t *module); |
| 70 | |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 71 | virtual status_t dump(int fd, const Vector<String16>& args); |
| 72 | |
| 73 | private: |
Eino-Ville Talvala | 4ecfec3 | 2012-06-12 17:13:48 -0700 | [diff] [blame] | 74 | enum State { |
Eino-Ville Talvala | 3a60914 | 2012-07-31 14:36:26 -0700 | [diff] [blame] | 75 | DISCONNECTED, |
Eino-Ville Talvala | 6db981c | 2012-05-21 18:54:30 -0700 | [diff] [blame] | 76 | STOPPED, |
| 77 | WAITING_FOR_PREVIEW_WINDOW, |
Eino-Ville Talvala | 7f61084 | 2012-06-07 10:20:51 -0700 | [diff] [blame] | 78 | PREVIEW, |
| 79 | RECORD, |
Eino-Ville Talvala | d4bcfde | 2012-06-07 17:12:38 -0700 | [diff] [blame] | 80 | STILL_CAPTURE, |
| 81 | VIDEO_SNAPSHOT |
Eino-Ville Talvala | 6db981c | 2012-05-21 18:54:30 -0700 | [diff] [blame] | 82 | } mState; |
| 83 | |
Eino-Ville Talvala | 4ecfec3 | 2012-06-12 17:13:48 -0700 | [diff] [blame] | 84 | static const char *getStateName(State state); |
| 85 | |
Eino-Ville Talvala | 3cca136 | 2012-06-07 10:07:18 -0700 | [diff] [blame] | 86 | /** ICamera interface-related private members */ |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 87 | |
Eino-Ville Talvala | ac45eb3 | 2012-06-07 10:24:51 -0700 | [diff] [blame] | 88 | // Mutex that must be locked by methods implementing the ICamera interface. |
| 89 | // Ensures serialization between incoming ICamera calls |
| 90 | mutable Mutex mICameraLock; |
| 91 | |
Eino-Ville Talvala | 836b81f | 2012-07-27 11:35:21 -0700 | [diff] [blame] | 92 | // The following must be called with mICameraLock already locked |
Eino-Ville Talvala | ac45eb3 | 2012-06-07 10:24:51 -0700 | [diff] [blame] | 93 | |
Eino-Ville Talvala | d4bcfde | 2012-06-07 17:12:38 -0700 | [diff] [blame] | 94 | status_t setPreviewWindowLocked(const sp<IBinder>& binder, |
Eino-Ville Talvala | be0573b | 2012-06-15 12:42:30 -0700 | [diff] [blame] | 95 | sp<ANativeWindow> window); |
Eino-Ville Talvala | d4bcfde | 2012-06-07 17:12:38 -0700 | [diff] [blame] | 96 | |
| 97 | void stopPreviewLocked(); |
| 98 | status_t startPreviewLocked(); |
| 99 | |
Eino-Ville Talvala | 3cca136 | 2012-06-07 10:07:18 -0700 | [diff] [blame] | 100 | // Current camera state; this is the contents of the CameraParameters object |
| 101 | // in a more-efficient format. The enum values are mostly based off the |
| 102 | // corresponding camera2 enums, not the camera1 strings. A few are defined |
| 103 | // here if they don't cleanly map to camera2 values. |
| 104 | struct Parameters { |
| 105 | int previewWidth, previewHeight; |
Eino-Ville Talvala | 11b7cde | 2012-06-15 12:37:35 -0700 | [diff] [blame] | 106 | int32_t previewFpsRange[2]; |
Eino-Ville Talvala | 3cca136 | 2012-06-07 10:07:18 -0700 | [diff] [blame] | 107 | int previewFps; // deprecated, here only for tracking changes |
| 108 | int previewFormat; |
| 109 | |
Eino-Ville Talvala | 11b7cde | 2012-06-15 12:37:35 -0700 | [diff] [blame] | 110 | int previewTransform; // set by CAMERA_CMD_SET_DISPLAY_ORIENTATION |
| 111 | |
Eino-Ville Talvala | 3cca136 | 2012-06-07 10:07:18 -0700 | [diff] [blame] | 112 | int pictureWidth, pictureHeight; |
| 113 | |
Eino-Ville Talvala | 11b7cde | 2012-06-15 12:37:35 -0700 | [diff] [blame] | 114 | int32_t jpegThumbSize[2]; |
| 115 | int32_t jpegQuality, jpegThumbQuality; |
| 116 | int32_t jpegRotation; |
Eino-Ville Talvala | 3cca136 | 2012-06-07 10:07:18 -0700 | [diff] [blame] | 117 | |
| 118 | bool gpsEnabled; |
Eino-Ville Talvala | 11b7cde | 2012-06-15 12:37:35 -0700 | [diff] [blame] | 119 | double gpsCoordinates[3]; |
Eino-Ville Talvala | 3cca136 | 2012-06-07 10:07:18 -0700 | [diff] [blame] | 120 | int64_t gpsTimestamp; |
| 121 | String8 gpsProcessingMethod; |
| 122 | |
| 123 | int wbMode; |
| 124 | int effectMode; |
| 125 | int antibandingMode; |
| 126 | int sceneMode; |
| 127 | |
| 128 | enum flashMode_t { |
| 129 | FLASH_MODE_OFF = 0, |
| 130 | FLASH_MODE_AUTO, |
| 131 | FLASH_MODE_ON, |
| 132 | FLASH_MODE_TORCH, |
| 133 | FLASH_MODE_RED_EYE = ANDROID_CONTROL_AE_ON_AUTO_FLASH_REDEYE, |
| 134 | FLASH_MODE_INVALID = -1 |
| 135 | } flashMode; |
| 136 | |
| 137 | enum focusMode_t { |
| 138 | FOCUS_MODE_AUTO = ANDROID_CONTROL_AF_AUTO, |
| 139 | FOCUS_MODE_MACRO = ANDROID_CONTROL_AF_MACRO, |
| 140 | FOCUS_MODE_CONTINUOUS_VIDEO = ANDROID_CONTROL_AF_CONTINUOUS_VIDEO, |
| 141 | FOCUS_MODE_CONTINUOUS_PICTURE = |
| 142 | ANDROID_CONTROL_AF_CONTINUOUS_PICTURE, |
| 143 | FOCUS_MODE_EDOF = ANDROID_CONTROL_AF_EDOF, |
| 144 | FOCUS_MODE_INFINITY, |
| 145 | FOCUS_MODE_FIXED, |
| 146 | FOCUS_MODE_INVALID = -1 |
| 147 | } focusMode; |
| 148 | |
| 149 | struct Area { |
| 150 | int left, top, right, bottom; |
| 151 | int weight; |
| 152 | Area() {} |
| 153 | Area(int left, int top, int right, int bottom, int weight): |
| 154 | left(left), top(top), right(right), bottom(bottom), |
| 155 | weight(weight) {} |
| 156 | }; |
| 157 | Vector<Area> focusingAreas; |
| 158 | |
Eino-Ville Talvala | 11b7cde | 2012-06-15 12:37:35 -0700 | [diff] [blame] | 159 | int32_t exposureCompensation; |
Eino-Ville Talvala | 3cca136 | 2012-06-07 10:07:18 -0700 | [diff] [blame] | 160 | bool autoExposureLock; |
| 161 | bool autoWhiteBalanceLock; |
| 162 | |
| 163 | Vector<Area> meteringAreas; |
| 164 | |
| 165 | int zoom; |
| 166 | |
| 167 | int videoWidth, videoHeight; |
| 168 | |
| 169 | bool recordingHint; |
| 170 | bool videoStabilization; |
Eino-Ville Talvala | 78822d7 | 2012-07-18 17:52:18 -0700 | [diff] [blame] | 171 | |
| 172 | bool storeMetadataInBuffers; |
Eino-Ville Talvala | 836b81f | 2012-07-27 11:35:21 -0700 | [diff] [blame] | 173 | |
| 174 | String8 paramsFlattened; |
| 175 | }; |
| 176 | |
| 177 | class LockedParameters { |
| 178 | public: |
| 179 | class Key { |
| 180 | public: |
| 181 | Key(LockedParameters &p): |
| 182 | mParameters(p.mParameters), |
| 183 | mLockedParameters(p) { |
| 184 | mLockedParameters.mLock.lock(); |
| 185 | } |
| 186 | |
| 187 | ~Key() { |
| 188 | mLockedParameters.mLock.unlock(); |
| 189 | } |
| 190 | Parameters &mParameters; |
| 191 | private: |
| 192 | // Disallow copying, default construction |
| 193 | Key(); |
| 194 | Key(const Key &); |
| 195 | Key &operator=(const Key &); |
| 196 | LockedParameters &mLockedParameters; |
| 197 | }; |
| 198 | class ReadKey { |
| 199 | public: |
| 200 | ReadKey(const LockedParameters &p): |
| 201 | mParameters(p.mParameters), |
| 202 | mLockedParameters(p) { |
| 203 | mLockedParameters.mLock.lock(); |
| 204 | } |
| 205 | |
| 206 | ~ReadKey() { |
| 207 | mLockedParameters.mLock.unlock(); |
| 208 | } |
| 209 | const Parameters &mParameters; |
| 210 | private: |
| 211 | // Disallow copying, default construction |
| 212 | ReadKey(); |
| 213 | ReadKey(const ReadKey &); |
| 214 | ReadKey &operator=(const ReadKey &); |
| 215 | const LockedParameters &mLockedParameters; |
| 216 | }; |
| 217 | |
| 218 | // Only use for dumping or other debugging |
| 219 | const Parameters &unsafeUnlock() { |
| 220 | return mParameters; |
| 221 | } |
| 222 | private: |
| 223 | Parameters mParameters; |
| 224 | mutable Mutex mLock; |
| 225 | |
Eino-Ville Talvala | 3cca136 | 2012-06-07 10:07:18 -0700 | [diff] [blame] | 226 | } mParameters; |
| 227 | |
| 228 | /** Camera device-related private members */ |
| 229 | |
Eino-Ville Talvala | 9cca4c6 | 2012-06-15 15:41:44 -0700 | [diff] [blame] | 230 | class Camera2Heap; |
| 231 | |
| 232 | // Number of zoom steps to simulate |
| 233 | static const unsigned int NUM_ZOOM_STEPS = 10; |
| 234 | // Used with stream IDs |
| 235 | static const int NO_STREAM = -1; |
| 236 | |
| 237 | /* Preview related members */ |
| 238 | |
| 239 | int mPreviewStreamId; |
| 240 | camera_metadata_t *mPreviewRequest; |
| 241 | sp<IBinder> mPreviewSurface; |
| 242 | sp<ANativeWindow> mPreviewWindow; |
Eino-Ville Talvala | 836b81f | 2012-07-27 11:35:21 -0700 | [diff] [blame] | 243 | |
| 244 | status_t updatePreviewRequest(const Parameters ¶ms); |
| 245 | status_t updatePreviewStream(const Parameters ¶ms); |
Eino-Ville Talvala | 9cca4c6 | 2012-06-15 15:41:44 -0700 | [diff] [blame] | 246 | |
| 247 | /* Still image capture related members */ |
| 248 | |
| 249 | int mCaptureStreamId; |
| 250 | sp<CpuConsumer> mCaptureConsumer; |
| 251 | sp<ANativeWindow> mCaptureWindow; |
Eino-Ville Talvala | d4bcfde | 2012-06-07 17:12:38 -0700 | [diff] [blame] | 252 | // Simple listener that forwards frame available notifications from |
| 253 | // a CPU consumer to the capture notification |
| 254 | class CaptureWaiter: public CpuConsumer::FrameAvailableListener { |
| 255 | public: |
| 256 | CaptureWaiter(Camera2Client *parent) : mParent(parent) {} |
| 257 | void onFrameAvailable() { mParent->onCaptureAvailable(); } |
| 258 | private: |
| 259 | Camera2Client *mParent; |
| 260 | }; |
Eino-Ville Talvala | d4bcfde | 2012-06-07 17:12:38 -0700 | [diff] [blame] | 261 | sp<CaptureWaiter> mCaptureWaiter; |
Eino-Ville Talvala | 3cca136 | 2012-06-07 10:07:18 -0700 | [diff] [blame] | 262 | camera_metadata_t *mCaptureRequest; |
Eino-Ville Talvala | 9cca4c6 | 2012-06-15 15:41:44 -0700 | [diff] [blame] | 263 | sp<Camera2Heap> mCaptureHeap; |
| 264 | // Handle captured image buffers |
| 265 | void onCaptureAvailable(); |
Eino-Ville Talvala | 836b81f | 2012-07-27 11:35:21 -0700 | [diff] [blame] | 266 | |
| 267 | status_t updateCaptureRequest(const Parameters ¶ms); |
| 268 | status_t updateCaptureStream(const Parameters ¶ms); |
Eino-Ville Talvala | 9cca4c6 | 2012-06-15 15:41:44 -0700 | [diff] [blame] | 269 | |
| 270 | /* Recording related members */ |
| 271 | |
| 272 | int mRecordingStreamId; |
Eino-Ville Talvala | 78822d7 | 2012-07-18 17:52:18 -0700 | [diff] [blame] | 273 | sp<MediaConsumer> mRecordingConsumer; |
Eino-Ville Talvala | 9cca4c6 | 2012-06-15 15:41:44 -0700 | [diff] [blame] | 274 | sp<ANativeWindow> mRecordingWindow; |
| 275 | // Simple listener that forwards frame available notifications from |
| 276 | // a CPU consumer to the recording notification |
Eino-Ville Talvala | 78822d7 | 2012-07-18 17:52:18 -0700 | [diff] [blame] | 277 | class RecordingWaiter: public MediaConsumer::FrameAvailableListener { |
Eino-Ville Talvala | 9cca4c6 | 2012-06-15 15:41:44 -0700 | [diff] [blame] | 278 | public: |
| 279 | RecordingWaiter(Camera2Client *parent) : mParent(parent) {} |
| 280 | void onFrameAvailable() { mParent->onRecordingFrameAvailable(); } |
| 281 | private: |
| 282 | Camera2Client *mParent; |
| 283 | }; |
| 284 | sp<RecordingWaiter> mRecordingWaiter; |
| 285 | camera_metadata_t *mRecordingRequest; |
| 286 | sp<Camera2Heap> mRecordingHeap; |
| 287 | |
| 288 | // TODO: This needs to be queried from somewhere, or the BufferQueue needs |
Eino-Ville Talvala | 803cbf6 | 2012-07-25 15:23:36 -0700 | [diff] [blame] | 289 | // to be passed all the way to stagefright. Right now, set to a large number |
| 290 | // to avoid starvation of the video encoders. |
James Dong | 983cf23 | 2012-08-01 16:39:55 -0700 | [diff] [blame^] | 291 | static const size_t kDefaultRecordingHeapCount = 8; |
| 292 | size_t mRecordingHeapCount; |
Eino-Ville Talvala | 9cca4c6 | 2012-06-15 15:41:44 -0700 | [diff] [blame] | 293 | size_t mRecordingHeapHead, mRecordingHeapFree; |
| 294 | // Handle new recording image buffers |
| 295 | void onRecordingFrameAvailable(); |
Eino-Ville Talvala | 836b81f | 2012-07-27 11:35:21 -0700 | [diff] [blame] | 296 | |
| 297 | status_t updateRecordingRequest(const Parameters ¶ms); |
| 298 | status_t updateRecordingStream(const Parameters ¶ms); |
Eino-Ville Talvala | 9cca4c6 | 2012-06-15 15:41:44 -0700 | [diff] [blame] | 299 | |
| 300 | /** Camera2Device instance wrapping HAL2 entry */ |
Eino-Ville Talvala | 3cca136 | 2012-06-07 10:07:18 -0700 | [diff] [blame] | 301 | |
| 302 | sp<Camera2Device> mDevice; |
| 303 | |
Eino-Ville Talvala | 9cca4c6 | 2012-06-15 15:41:44 -0700 | [diff] [blame] | 304 | /** Utility members */ |
| 305 | |
Eino-Ville Talvala | 3a60914 | 2012-07-31 14:36:26 -0700 | [diff] [blame] | 306 | // Verify that caller is the owner of the camera |
| 307 | status_t checkPid(const char *checkLocation) const; |
| 308 | |
Eino-Ville Talvala | 9cca4c6 | 2012-06-15 15:41:44 -0700 | [diff] [blame] | 309 | // Utility class for managing a set of IMemory blocks |
| 310 | class Camera2Heap : public RefBase { |
| 311 | public: |
| 312 | Camera2Heap(size_t buf_size, uint_t num_buffers = 1, |
| 313 | const char *name = NULL) : |
| 314 | mBufSize(buf_size), |
| 315 | mNumBufs(num_buffers) { |
| 316 | mHeap = new MemoryHeapBase(buf_size * num_buffers, 0, name); |
| 317 | mBuffers = new sp<MemoryBase>[mNumBufs]; |
| 318 | for (uint_t i = 0; i < mNumBufs; i++) |
| 319 | mBuffers[i] = new MemoryBase(mHeap, |
| 320 | i * mBufSize, |
| 321 | mBufSize); |
| 322 | } |
| 323 | |
| 324 | virtual ~Camera2Heap() |
| 325 | { |
| 326 | delete [] mBuffers; |
| 327 | } |
| 328 | |
| 329 | size_t mBufSize; |
| 330 | uint_t mNumBufs; |
| 331 | sp<MemoryHeapBase> mHeap; |
| 332 | sp<MemoryBase> *mBuffers; |
| 333 | }; |
Eino-Ville Talvala | 3cca136 | 2012-06-07 10:07:18 -0700 | [diff] [blame] | 334 | |
| 335 | // Get values for static camera info entry. min/maxCount are used for error |
| 336 | // checking the number of values in the entry. 0 for max/minCount means to |
| 337 | // do no bounds check in that direction. In case of error, the entry data |
| 338 | // pointer is null and the count is 0. |
| 339 | camera_metadata_entry_t staticInfo(uint32_t tag, |
| 340 | size_t minCount=0, size_t maxCount=0); |
| 341 | |
Eino-Ville Talvala | f69c70d | 2012-05-20 15:59:14 -0700 | [diff] [blame] | 342 | // Convert static camera info from a camera2 device to the |
| 343 | // old API parameter map. |
| 344 | status_t buildDefaultParameters(); |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 345 | |
Eino-Ville Talvala | be0573b | 2012-06-15 12:42:30 -0700 | [diff] [blame] | 346 | // Update parameters all requests use, based on mParameters |
Eino-Ville Talvala | 836b81f | 2012-07-27 11:35:21 -0700 | [diff] [blame] | 347 | status_t updateRequestCommon(camera_metadata_t *request, const Parameters ¶ms); |
Eino-Ville Talvala | be0573b | 2012-06-15 12:42:30 -0700 | [diff] [blame] | 348 | |
| 349 | // Update specific metadata entry with new values. Adds entry if it does not |
| 350 | // exist, which will invalidate sorting |
| 351 | static status_t updateEntry(camera_metadata_t *buffer, |
| 352 | uint32_t tag, const void *data, size_t data_count); |
| 353 | |
| 354 | // Remove metadata entry. Will invalidate sorting. If entry does not exist, |
| 355 | // does nothing. |
| 356 | static status_t deleteEntry(camera_metadata_t *buffer, |
| 357 | uint32_t tag); |
| 358 | |
Eino-Ville Talvala | 6861a4e | 2012-06-07 10:32:12 -0700 | [diff] [blame] | 359 | // Convert camera1 preview format string to camera2 enum |
| 360 | static int formatStringToEnum(const char *format); |
Eino-Ville Talvala | 3cca136 | 2012-06-07 10:07:18 -0700 | [diff] [blame] | 361 | static const char *formatEnumToString(int format); |
Eino-Ville Talvala | 6861a4e | 2012-06-07 10:32:12 -0700 | [diff] [blame] | 362 | |
| 363 | static int wbModeStringToEnum(const char *wbMode); |
| 364 | static int effectModeStringToEnum(const char *effectMode); |
| 365 | static int abModeStringToEnum(const char *abMode); |
| 366 | static int sceneModeStringToEnum(const char *sceneMode); |
| 367 | static Parameters::flashMode_t flashModeStringToEnum(const char *flashMode); |
| 368 | static Parameters::focusMode_t focusModeStringToEnum(const char *focusMode); |
| 369 | static status_t parseAreas(const char *areasCStr, |
| 370 | Vector<Parameters::Area> *areas); |
| 371 | static status_t validateAreas(const Vector<Parameters::Area> &areas, |
| 372 | size_t maxRegions); |
| 373 | static bool boolFromString(const char *boolStr); |
Eino-Ville Talvala | c94cd19 | 2012-06-15 12:47:42 -0700 | [diff] [blame] | 374 | |
| 375 | // Map from camera orientation + facing to gralloc transform enum |
| 376 | static int degToTransform(int degrees, bool mirror); |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 377 | }; |
| 378 | |
| 379 | }; // namespace android |
| 380 | |
| 381 | #endif |