Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 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 | #ifndef _ACAMERA_DEVICE_H |
| 17 | #define _ACAMERA_DEVICE_H |
| 18 | |
| 19 | #include <memory> |
Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame] | 20 | #include <map> |
| 21 | #include <set> |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 22 | #include <atomic> |
Yin-Chia Yeh | e081c59 | 2016-03-29 18:26:44 -0700 | [diff] [blame] | 23 | #include <utility> |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 24 | #include <utils/StrongPointer.h> |
| 25 | #include <utils/Mutex.h> |
| 26 | #include <utils/String8.h> |
Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame] | 27 | #include <utils/List.h> |
| 28 | #include <utils/Vector.h> |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 29 | |
Eino-Ville Talvala | d56db1d | 2015-12-17 16:50:35 -0800 | [diff] [blame] | 30 | #include <android/hardware/camera2/BnCameraDeviceCallbacks.h> |
| 31 | #include <android/hardware/camera2/ICameraDeviceUser.h> |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 32 | #include <media/stagefright/foundation/ALooper.h> |
| 33 | #include <media/stagefright/foundation/AHandler.h> |
| 34 | #include <media/stagefright/foundation/AMessage.h> |
Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame] | 35 | #include <camera/CaptureResult.h> |
Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame] | 36 | #include <camera/camera2/OutputConfiguration.h> |
| 37 | #include <camera/camera2/CaptureRequest.h> |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 38 | |
Colin Cross | 7e8d4ba | 2017-05-04 16:17:42 -0700 | [diff] [blame] | 39 | #include <camera/NdkCameraDevice.h> |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 40 | #include "ACameraMetadata.h" |
| 41 | |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 42 | namespace android { |
| 43 | |
Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame] | 44 | // Wrap ACameraCaptureFailure so it can be ref-counter |
| 45 | struct CameraCaptureFailure : public RefBase, public ACameraCaptureFailure {}; |
| 46 | |
| 47 | class CameraDevice final : public RefBase { |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 48 | public: |
| 49 | CameraDevice(const char* id, ACameraDevice_StateCallbacks* cb, |
| 50 | std::unique_ptr<ACameraMetadata> chars, |
| 51 | ACameraDevice* wrapper); |
| 52 | ~CameraDevice(); |
| 53 | |
| 54 | inline const char* getId() const { return mCameraId.string(); } |
| 55 | |
| 56 | camera_status_t createCaptureRequest( |
| 57 | ACameraDevice_request_template templateId, |
| 58 | ACaptureRequest** request) const; |
| 59 | |
Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame] | 60 | camera_status_t createCaptureSession( |
| 61 | const ACaptureSessionOutputContainer* outputs, |
| 62 | const ACameraCaptureSession_stateCallbacks* callbacks, |
| 63 | /*out*/ACameraCaptureSession** session); |
| 64 | |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 65 | // Callbacks from camera service |
Eino-Ville Talvala | d56db1d | 2015-12-17 16:50:35 -0800 | [diff] [blame] | 66 | class ServiceCallback : public hardware::camera2::BnCameraDeviceCallbacks { |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 67 | public: |
Chih-Hung Hsieh | d19d994 | 2016-08-29 14:21:14 -0700 | [diff] [blame] | 68 | explicit ServiceCallback(CameraDevice* device) : mDevice(device) {} |
Eino-Ville Talvala | d56db1d | 2015-12-17 16:50:35 -0800 | [diff] [blame] | 69 | binder::Status onDeviceError(int32_t errorCode, |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 70 | const CaptureResultExtras& resultExtras) override; |
Eino-Ville Talvala | d56db1d | 2015-12-17 16:50:35 -0800 | [diff] [blame] | 71 | binder::Status onDeviceIdle() override; |
| 72 | binder::Status onCaptureStarted(const CaptureResultExtras& resultExtras, |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 73 | int64_t timestamp) override; |
Eino-Ville Talvala | d56db1d | 2015-12-17 16:50:35 -0800 | [diff] [blame] | 74 | binder::Status onResultReceived(const CameraMetadata& metadata, |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 75 | const CaptureResultExtras& resultExtras) override; |
Eino-Ville Talvala | d56db1d | 2015-12-17 16:50:35 -0800 | [diff] [blame] | 76 | binder::Status onPrepared(int streamId) override; |
Shuzhen Wang | 9d06601 | 2016-09-30 11:30:20 -0700 | [diff] [blame] | 77 | binder::Status onRequestQueueEmpty() override; |
Yin-Chia Yeh | 8ca23dc | 2017-09-05 18:15:56 -0700 | [diff] [blame] | 78 | binder::Status onRepeatingRequestError(int64_t lastFrameNumber, |
| 79 | int32_t stoppedSequenceId) override; |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 80 | private: |
| 81 | const wp<CameraDevice> mDevice; |
| 82 | }; |
Eino-Ville Talvala | d56db1d | 2015-12-17 16:50:35 -0800 | [diff] [blame] | 83 | inline sp<hardware::camera2::ICameraDeviceCallbacks> getServiceCallback() { |
| 84 | return mServiceCallback; |
| 85 | }; |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 86 | |
| 87 | // Camera device is only functional after remote being set |
Eino-Ville Talvala | d56db1d | 2015-12-17 16:50:35 -0800 | [diff] [blame] | 88 | void setRemoteDevice(sp<hardware::camera2::ICameraDeviceUser> remote); |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 89 | |
Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame] | 90 | inline ACameraDevice* getWrapper() const { return mWrapper; }; |
| 91 | |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 92 | private: |
Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame] | 93 | friend ACameraCaptureSession; |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 94 | camera_status_t checkCameraClosedOrErrorLocked() const; |
| 95 | |
Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame] | 96 | // device goes into fatal error state after this |
| 97 | void setCameraDeviceErrorLocked(camera_status_t error); |
| 98 | |
| 99 | void disconnectLocked(); // disconnect from camera service |
| 100 | |
| 101 | camera_status_t stopRepeatingLocked(); |
| 102 | |
Yin-Chia Yeh | 309d05d | 2016-03-28 10:15:31 -0700 | [diff] [blame] | 103 | camera_status_t flushLocked(ACameraCaptureSession*); |
| 104 | |
Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame] | 105 | camera_status_t waitUntilIdleLocked(); |
| 106 | |
| 107 | |
| 108 | camera_status_t captureLocked(sp<ACameraCaptureSession> session, |
| 109 | /*optional*/ACameraCaptureSession_captureCallbacks* cbs, |
| 110 | int numRequests, ACaptureRequest** requests, |
| 111 | /*optional*/int* captureSequenceId); |
| 112 | |
| 113 | camera_status_t setRepeatingRequestsLocked(sp<ACameraCaptureSession> session, |
| 114 | /*optional*/ACameraCaptureSession_captureCallbacks* cbs, |
| 115 | int numRequests, ACaptureRequest** requests, |
| 116 | /*optional*/int* captureSequenceId); |
| 117 | |
| 118 | camera_status_t submitRequestsLocked( |
| 119 | sp<ACameraCaptureSession> session, |
| 120 | /*optional*/ACameraCaptureSession_captureCallbacks* cbs, |
| 121 | int numRequests, ACaptureRequest** requests, |
| 122 | /*out*/int* captureSequenceId, |
| 123 | bool isRepeating); |
| 124 | |
| 125 | static camera_status_t allocateCaptureRequest( |
| 126 | const ACaptureRequest* request, sp<CaptureRequest>& outReq); |
| 127 | |
| 128 | static ACaptureRequest* allocateACaptureRequest(sp<CaptureRequest>& req); |
| 129 | static void freeACaptureRequest(ACaptureRequest*); |
| 130 | |
| 131 | // only For session to hold device lock |
| 132 | // Always grab device lock before grabbing session lock |
| 133 | void lockDeviceForSessionOps() const { mDeviceLock.lock(); }; |
| 134 | void unlockDevice() const { mDeviceLock.unlock(); }; |
| 135 | |
| 136 | // For capture session to notify its end of life |
| 137 | void notifySessionEndOfLifeLocked(ACameraCaptureSession* session); |
| 138 | |
| 139 | camera_status_t configureStreamsLocked(const ACaptureSessionOutputContainer* outputs); |
| 140 | |
Yin-Chia Yeh | e081c59 | 2016-03-29 18:26:44 -0700 | [diff] [blame] | 141 | static camera_status_t getIGBPfromAnw( |
| 142 | ANativeWindow* anw, sp<IGraphicBufferProducer>& out); |
Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame] | 143 | |
| 144 | static camera_status_t getSurfaceFromANativeWindow( |
| 145 | ANativeWindow* anw, sp<Surface>& out); |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 146 | |
| 147 | mutable Mutex mDeviceLock; |
| 148 | const String8 mCameraId; // Camera ID |
| 149 | const ACameraDevice_StateCallbacks mAppCallbacks; // Callback to app |
| 150 | const std::unique_ptr<ACameraMetadata> mChars; // Camera characteristics |
| 151 | const sp<ServiceCallback> mServiceCallback; |
| 152 | ACameraDevice* mWrapper; |
| 153 | |
Yin-Chia Yeh | e081c59 | 2016-03-29 18:26:44 -0700 | [diff] [blame] | 154 | // stream id -> pair of (ANW* from application, OutputConfiguration used for camera service) |
| 155 | std::map<int, std::pair<ANativeWindow*, OutputConfiguration>> mConfiguredOutputs; |
Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame] | 156 | |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 157 | // TODO: maybe a bool will suffice for synchronous implementation? |
| 158 | std::atomic_bool mClosing; |
| 159 | inline bool isClosed() { return mClosing; } |
| 160 | |
Yin-Chia Yeh | 309d05d | 2016-03-28 10:15:31 -0700 | [diff] [blame] | 161 | bool mInError = false; |
| 162 | camera_status_t mError = ACAMERA_OK; |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 163 | void onCaptureErrorLocked( |
Eino-Ville Talvala | d56db1d | 2015-12-17 16:50:35 -0800 | [diff] [blame] | 164 | int32_t errorCode, |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 165 | const CaptureResultExtras& resultExtras); |
| 166 | |
Yin-Chia Yeh | 309d05d | 2016-03-28 10:15:31 -0700 | [diff] [blame] | 167 | bool mIdle = true; |
Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame] | 168 | // This will avoid a busy session being deleted before it's back to idle state |
| 169 | sp<ACameraCaptureSession> mBusySession; |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 170 | |
Eino-Ville Talvala | d56db1d | 2015-12-17 16:50:35 -0800 | [diff] [blame] | 171 | sp<hardware::camera2::ICameraDeviceUser> mRemote; |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 172 | |
| 173 | // Looper thread to handle callback to app |
| 174 | sp<ALooper> mCbLooper; |
| 175 | // definition of handler and message |
| 176 | enum { |
Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame] | 177 | // Device state callbacks |
Yin-Chia Yeh | e081c59 | 2016-03-29 18:26:44 -0700 | [diff] [blame] | 178 | kWhatOnDisconnected, // onDisconnected |
| 179 | kWhatOnError, // onError |
Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame] | 180 | // Session state callbacks |
Yin-Chia Yeh | e081c59 | 2016-03-29 18:26:44 -0700 | [diff] [blame] | 181 | kWhatSessionStateCb, // onReady, onActive |
Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame] | 182 | // Capture callbacks |
Yin-Chia Yeh | e081c59 | 2016-03-29 18:26:44 -0700 | [diff] [blame] | 183 | kWhatCaptureStart, // onCaptureStarted |
| 184 | kWhatCaptureResult, // onCaptureProgressed, onCaptureCompleted |
| 185 | kWhatCaptureFail, // onCaptureFailed |
| 186 | kWhatCaptureSeqEnd, // onCaptureSequenceCompleted |
| 187 | kWhatCaptureSeqAbort, // onCaptureSequenceAborted |
| 188 | kWhatCaptureBufferLost // onCaptureBufferLost |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 189 | }; |
| 190 | static const char* kContextKey; |
| 191 | static const char* kDeviceKey; |
| 192 | static const char* kErrorCodeKey; |
Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame] | 193 | static const char* kCallbackFpKey; |
| 194 | static const char* kSessionSpKey; |
| 195 | static const char* kCaptureRequestKey; |
| 196 | static const char* kTimeStampKey; |
| 197 | static const char* kCaptureResultKey; |
| 198 | static const char* kCaptureFailureKey; |
| 199 | static const char* kSequenceIdKey; |
| 200 | static const char* kFrameNumberKey; |
Yin-Chia Yeh | e081c59 | 2016-03-29 18:26:44 -0700 | [diff] [blame] | 201 | static const char* kAnwKey; |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 202 | class CallbackHandler : public AHandler { |
| 203 | public: |
| 204 | CallbackHandler() {} |
| 205 | void onMessageReceived(const sp<AMessage> &msg) override; |
| 206 | }; |
| 207 | sp<CallbackHandler> mHandler; |
| 208 | |
Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame] | 209 | /*********************************** |
| 210 | * Capture session related members * |
| 211 | ***********************************/ |
| 212 | // The current active session |
| 213 | ACameraCaptureSession* mCurrentSession = nullptr; |
Yin-Chia Yeh | 309d05d | 2016-03-28 10:15:31 -0700 | [diff] [blame] | 214 | bool mFlushing = false; |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 215 | |
Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame] | 216 | int mNextSessionId = 0; |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 217 | // TODO: might need another looper/handler to handle callbacks from service |
| 218 | |
Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame] | 219 | static const int REQUEST_ID_NONE = -1; |
| 220 | int mRepeatingSequenceId = REQUEST_ID_NONE; |
| 221 | |
| 222 | // sequence id -> last frame number map |
| 223 | std::map<int, int64_t> mSequenceLastFrameNumberMap; |
| 224 | |
| 225 | struct CallbackHolder { |
| 226 | CallbackHolder(sp<ACameraCaptureSession> session, |
| 227 | const Vector<sp<CaptureRequest> >& requests, |
| 228 | bool isRepeating, |
| 229 | ACameraCaptureSession_captureCallbacks* cbs); |
| 230 | |
| 231 | static ACameraCaptureSession_captureCallbacks fillCb( |
| 232 | ACameraCaptureSession_captureCallbacks* cbs) { |
| 233 | if (cbs != nullptr) { |
| 234 | return *cbs; |
| 235 | } |
Yin-Chia Yeh | e081c59 | 2016-03-29 18:26:44 -0700 | [diff] [blame] | 236 | return { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }; |
Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame] | 237 | } |
| 238 | |
| 239 | sp<ACameraCaptureSession> mSession; |
| 240 | Vector<sp<CaptureRequest> > mRequests; |
| 241 | const bool mIsRepeating; |
| 242 | ACameraCaptureSession_captureCallbacks mCallbacks; |
| 243 | }; |
| 244 | // sequence id -> callbacks map |
| 245 | std::map<int, CallbackHolder> mSequenceCallbackMap; |
| 246 | |
| 247 | static const int64_t NO_FRAMES_CAPTURED = -1; |
| 248 | class FrameNumberTracker { |
| 249 | public: |
| 250 | // TODO: Called in onResultReceived and onCaptureErrorLocked |
| 251 | void updateTracker(int64_t frameNumber, bool isError); |
| 252 | inline int64_t getCompletedFrameNumber() { return mCompletedFrameNumber; } |
| 253 | private: |
| 254 | void update(); |
| 255 | void updateCompletedFrameNumber(int64_t frameNumber); |
| 256 | |
| 257 | int64_t mCompletedFrameNumber = NO_FRAMES_CAPTURED; |
| 258 | List<int64_t> mSkippedFrameNumbers; |
| 259 | std::set<int64_t> mFutureErrorSet; |
| 260 | }; |
| 261 | FrameNumberTracker mFrameNumberTracker; |
| 262 | |
| 263 | void checkRepeatingSequenceCompleteLocked(const int sequenceId, const int64_t lastFrameNumber); |
| 264 | void checkAndFireSequenceCompleteLocked(); |
| 265 | |
| 266 | // Misc variables |
| 267 | int32_t mShadingMapSize[2]; // const after constructor |
| 268 | int32_t mPartialResultCount; // const after constructor |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 269 | |
| 270 | }; |
| 271 | |
| 272 | } // namespace android; |
| 273 | |
| 274 | /** |
| 275 | * ACameraDevice opaque struct definition |
| 276 | * Leave outside of android namespace because it's NDK struct |
| 277 | */ |
| 278 | struct ACameraDevice { |
| 279 | ACameraDevice(const char* id, ACameraDevice_StateCallbacks* cb, |
| 280 | std::unique_ptr<ACameraMetadata> chars) : |
| 281 | mDevice(new CameraDevice(id, cb, std::move(chars), this)) {} |
| 282 | |
| 283 | ~ACameraDevice() {}; |
| 284 | |
Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame] | 285 | /******************* |
| 286 | * NDK public APIs * |
| 287 | *******************/ |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 288 | inline const char* getId() const { return mDevice->getId(); } |
| 289 | |
| 290 | camera_status_t createCaptureRequest( |
| 291 | ACameraDevice_request_template templateId, |
| 292 | ACaptureRequest** request) const { |
| 293 | return mDevice->createCaptureRequest(templateId, request); |
| 294 | } |
| 295 | |
Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame] | 296 | camera_status_t createCaptureSession( |
| 297 | const ACaptureSessionOutputContainer* outputs, |
| 298 | const ACameraCaptureSession_stateCallbacks* callbacks, |
| 299 | /*out*/ACameraCaptureSession** session) { |
| 300 | return mDevice->createCaptureSession(outputs, callbacks, session); |
| 301 | } |
| 302 | |
| 303 | /*********************** |
| 304 | * Device interal APIs * |
| 305 | ***********************/ |
Eino-Ville Talvala | d56db1d | 2015-12-17 16:50:35 -0800 | [diff] [blame] | 306 | inline android::sp<android::hardware::camera2::ICameraDeviceCallbacks> getServiceCallback() { |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 307 | return mDevice->getServiceCallback(); |
| 308 | }; |
| 309 | |
| 310 | // Camera device is only functional after remote being set |
Eino-Ville Talvala | d56db1d | 2015-12-17 16:50:35 -0800 | [diff] [blame] | 311 | inline void setRemoteDevice(android::sp<android::hardware::camera2::ICameraDeviceUser> remote) { |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 312 | mDevice->setRemoteDevice(remote); |
| 313 | } |
| 314 | |
| 315 | private: |
Eino-Ville Talvala | d56db1d | 2015-12-17 16:50:35 -0800 | [diff] [blame] | 316 | android::sp<android::CameraDevice> mDevice; |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 317 | }; |
| 318 | |
| 319 | #endif // _ACAMERA_DEVICE_H |