Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 1 | /* |
| 2 | ** |
| 3 | ** Copyright (C) 2008, The Android Open Source Project |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 4 | ** |
| 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | ** you may not use this file except in compliance with the License. |
| 7 | ** You may obtain a copy of the License at |
| 8 | ** |
| 9 | ** http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | ** |
| 11 | ** Unless required by applicable law or agreed to in writing, software |
| 12 | ** distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | ** See the License for the specific language governing permissions and |
| 15 | ** limitations under the License. |
| 16 | */ |
| 17 | |
| 18 | //#define LOG_NDEBUG 0 |
| 19 | #define LOG_TAG "Camera" |
| 20 | #include <utils/Log.h> |
| 21 | #include <utils/threads.h> |
Eino-Ville Talvala | ceb388d | 2013-02-19 10:40:14 -0800 | [diff] [blame] | 22 | #include <utils/String16.h> |
Wu-cheng Li | 4ca2c7c | 2011-06-01 17:22:24 +0800 | [diff] [blame] | 23 | #include <binder/IPCThreadState.h> |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 24 | #include <binder/IServiceManager.h> |
| 25 | #include <binder/IMemory.h> |
| 26 | |
| 27 | #include <camera/Camera.h> |
Wu-cheng Li | 4ca2c7c | 2011-06-01 17:22:24 +0800 | [diff] [blame] | 28 | #include <camera/ICameraRecordingProxyListener.h> |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 29 | #include <camera/ICameraService.h> |
Igor Murashkin | c073ba5 | 2013-02-26 14:32:34 -0800 | [diff] [blame] | 30 | #include <camera/ICamera.h> |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 31 | |
Andy McFadden | 8ba0102 | 2012-12-18 09:46:54 -0800 | [diff] [blame] | 32 | #include <gui/IGraphicBufferProducer.h> |
Mathias Agopian | df712ea | 2012-02-25 18:48:35 -0800 | [diff] [blame] | 33 | #include <gui/Surface.h> |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 34 | |
| 35 | namespace android { |
| 36 | |
Igor Murashkin | c073ba5 | 2013-02-26 14:32:34 -0800 | [diff] [blame] | 37 | Camera::Camera(int cameraId) |
| 38 | : CameraBase(cameraId) |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 39 | { |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 40 | } |
| 41 | |
| 42 | // construct a camera client from an existing camera remote |
| 43 | sp<Camera> Camera::create(const sp<ICamera>& camera) |
| 44 | { |
Steve Block | 3856b09 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 45 | ALOGV("create"); |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 46 | if (camera == 0) { |
Steve Block | 29357bc | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 47 | ALOGE("camera remote is a NULL pointer"); |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 48 | return 0; |
| 49 | } |
| 50 | |
Igor Murashkin | c073ba5 | 2013-02-26 14:32:34 -0800 | [diff] [blame] | 51 | sp<Camera> c = new Camera(-1); |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 52 | if (camera->connect(c) == NO_ERROR) { |
| 53 | c->mStatus = NO_ERROR; |
| 54 | c->mCamera = camera; |
| 55 | camera->asBinder()->linkToDeath(c); |
Wu-cheng Li | 627baac | 2011-01-04 20:00:55 +0800 | [diff] [blame] | 56 | return c; |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 57 | } |
Wu-cheng Li | 627baac | 2011-01-04 20:00:55 +0800 | [diff] [blame] | 58 | return 0; |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 59 | } |
| 60 | |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 61 | Camera::~Camera() |
| 62 | { |
Chih-Chung Chang | d06618e | 2010-05-13 15:14:24 +0800 | [diff] [blame] | 63 | // We don't need to call disconnect() here because if the CameraService |
| 64 | // thinks we are the owner of the hardware, it will hold a (strong) |
| 65 | // reference to us, and we can't possibly be here. We also don't want to |
| 66 | // call disconnect() here if we are in the same process as mediaserver, |
| 67 | // because we may be invoked by CameraService::Client::connect() and will |
| 68 | // deadlock if we call any method of ICamera here. |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 69 | } |
| 70 | |
Eino-Ville Talvala | ceb388d | 2013-02-19 10:40:14 -0800 | [diff] [blame] | 71 | sp<Camera> Camera::connect(int cameraId, const String16& clientPackageName, |
| 72 | int clientUid) |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 73 | { |
Igor Murashkin | c073ba5 | 2013-02-26 14:32:34 -0800 | [diff] [blame] | 74 | return CameraBaseT::connect(cameraId, clientPackageName, clientUid); |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 75 | } |
| 76 | |
| 77 | status_t Camera::reconnect() |
| 78 | { |
Steve Block | 3856b09 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 79 | ALOGV("reconnect"); |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 80 | sp <ICamera> c = mCamera; |
| 81 | if (c == 0) return NO_INIT; |
| 82 | return c->connect(this); |
| 83 | } |
| 84 | |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 85 | status_t Camera::lock() |
| 86 | { |
| 87 | sp <ICamera> c = mCamera; |
| 88 | if (c == 0) return NO_INIT; |
| 89 | return c->lock(); |
| 90 | } |
| 91 | |
| 92 | status_t Camera::unlock() |
| 93 | { |
| 94 | sp <ICamera> c = mCamera; |
| 95 | if (c == 0) return NO_INIT; |
| 96 | return c->unlock(); |
| 97 | } |
| 98 | |
Jamie Gennis | 4b79168 | 2010-08-10 16:37:53 -0700 | [diff] [blame] | 99 | // pass the buffered Surface to the camera service |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 100 | status_t Camera::setPreviewDisplay(const sp<Surface>& surface) |
| 101 | { |
Steve Block | 3856b09 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 102 | ALOGV("setPreviewDisplay(%p)", surface.get()); |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 103 | sp <ICamera> c = mCamera; |
| 104 | if (c == 0) return NO_INIT; |
| 105 | if (surface != 0) { |
Jamie Gennis | 4b79168 | 2010-08-10 16:37:53 -0700 | [diff] [blame] | 106 | return c->setPreviewDisplay(surface); |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 107 | } else { |
Steve Block | b8a8052 | 2011-12-20 16:23:08 +0000 | [diff] [blame] | 108 | ALOGD("app passed NULL surface"); |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 109 | return c->setPreviewDisplay(0); |
| 110 | } |
| 111 | } |
| 112 | |
Andy McFadden | 8ba0102 | 2012-12-18 09:46:54 -0800 | [diff] [blame] | 113 | // pass the buffered IGraphicBufferProducer to the camera service |
| 114 | status_t Camera::setPreviewTexture(const sp<IGraphicBufferProducer>& bufferProducer) |
Jamie Gennis | bfa33aa | 2010-12-20 11:51:31 -0800 | [diff] [blame] | 115 | { |
Andy McFadden | 8ba0102 | 2012-12-18 09:46:54 -0800 | [diff] [blame] | 116 | ALOGV("setPreviewTexture(%p)", bufferProducer.get()); |
Jamie Gennis | bfa33aa | 2010-12-20 11:51:31 -0800 | [diff] [blame] | 117 | sp <ICamera> c = mCamera; |
| 118 | if (c == 0) return NO_INIT; |
Andy McFadden | 8ba0102 | 2012-12-18 09:46:54 -0800 | [diff] [blame] | 119 | if (bufferProducer != 0) { |
| 120 | return c->setPreviewTexture(bufferProducer); |
Jamie Gennis | bfa33aa | 2010-12-20 11:51:31 -0800 | [diff] [blame] | 121 | } else { |
Steve Block | b8a8052 | 2011-12-20 16:23:08 +0000 | [diff] [blame] | 122 | ALOGD("app passed NULL surface"); |
Jamie Gennis | bfa33aa | 2010-12-20 11:51:31 -0800 | [diff] [blame] | 123 | return c->setPreviewTexture(0); |
| 124 | } |
| 125 | } |
| 126 | |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 127 | // start preview mode |
| 128 | status_t Camera::startPreview() |
| 129 | { |
Steve Block | 3856b09 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 130 | ALOGV("startPreview"); |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 131 | sp <ICamera> c = mCamera; |
| 132 | if (c == 0) return NO_INIT; |
| 133 | return c->startPreview(); |
| 134 | } |
| 135 | |
James Dong | e2ad673 | 2010-10-18 20:42:51 -0700 | [diff] [blame] | 136 | status_t Camera::storeMetaDataInBuffers(bool enabled) |
| 137 | { |
Steve Block | 3856b09 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 138 | ALOGV("storeMetaDataInBuffers: %s", |
James Dong | e2ad673 | 2010-10-18 20:42:51 -0700 | [diff] [blame] | 139 | enabled? "true": "false"); |
| 140 | sp <ICamera> c = mCamera; |
| 141 | if (c == 0) return NO_INIT; |
| 142 | return c->storeMetaDataInBuffers(enabled); |
| 143 | } |
| 144 | |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 145 | // start recording mode, must call setPreviewDisplay first |
| 146 | status_t Camera::startRecording() |
| 147 | { |
Steve Block | 3856b09 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 148 | ALOGV("startRecording"); |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 149 | sp <ICamera> c = mCamera; |
| 150 | if (c == 0) return NO_INIT; |
| 151 | return c->startRecording(); |
| 152 | } |
| 153 | |
| 154 | // stop preview mode |
| 155 | void Camera::stopPreview() |
| 156 | { |
Steve Block | 3856b09 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 157 | ALOGV("stopPreview"); |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 158 | sp <ICamera> c = mCamera; |
| 159 | if (c == 0) return; |
| 160 | c->stopPreview(); |
| 161 | } |
| 162 | |
| 163 | // stop recording mode |
| 164 | void Camera::stopRecording() |
| 165 | { |
Steve Block | 3856b09 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 166 | ALOGV("stopRecording"); |
Wu-cheng Li | 4ca2c7c | 2011-06-01 17:22:24 +0800 | [diff] [blame] | 167 | { |
| 168 | Mutex::Autolock _l(mLock); |
| 169 | mRecordingProxyListener.clear(); |
| 170 | } |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 171 | sp <ICamera> c = mCamera; |
| 172 | if (c == 0) return; |
| 173 | c->stopRecording(); |
| 174 | } |
| 175 | |
| 176 | // release a recording frame |
| 177 | void Camera::releaseRecordingFrame(const sp<IMemory>& mem) |
| 178 | { |
Steve Block | 3856b09 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 179 | ALOGV("releaseRecordingFrame"); |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 180 | sp <ICamera> c = mCamera; |
| 181 | if (c == 0) return; |
| 182 | c->releaseRecordingFrame(mem); |
| 183 | } |
| 184 | |
| 185 | // get preview state |
| 186 | bool Camera::previewEnabled() |
| 187 | { |
Steve Block | 3856b09 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 188 | ALOGV("previewEnabled"); |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 189 | sp <ICamera> c = mCamera; |
| 190 | if (c == 0) return false; |
| 191 | return c->previewEnabled(); |
| 192 | } |
| 193 | |
| 194 | // get recording state |
| 195 | bool Camera::recordingEnabled() |
| 196 | { |
Steve Block | 3856b09 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 197 | ALOGV("recordingEnabled"); |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 198 | sp <ICamera> c = mCamera; |
| 199 | if (c == 0) return false; |
| 200 | return c->recordingEnabled(); |
| 201 | } |
| 202 | |
| 203 | status_t Camera::autoFocus() |
| 204 | { |
Steve Block | 3856b09 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 205 | ALOGV("autoFocus"); |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 206 | sp <ICamera> c = mCamera; |
| 207 | if (c == 0) return NO_INIT; |
| 208 | return c->autoFocus(); |
| 209 | } |
| 210 | |
| 211 | status_t Camera::cancelAutoFocus() |
| 212 | { |
Steve Block | 3856b09 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 213 | ALOGV("cancelAutoFocus"); |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 214 | sp <ICamera> c = mCamera; |
| 215 | if (c == 0) return NO_INIT; |
| 216 | return c->cancelAutoFocus(); |
| 217 | } |
| 218 | |
| 219 | // take a picture |
James Dong | e468ac5 | 2011-02-17 16:38:06 -0800 | [diff] [blame] | 220 | status_t Camera::takePicture(int msgType) |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 221 | { |
Steve Block | 3856b09 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 222 | ALOGV("takePicture: 0x%x", msgType); |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 223 | sp <ICamera> c = mCamera; |
| 224 | if (c == 0) return NO_INIT; |
James Dong | e468ac5 | 2011-02-17 16:38:06 -0800 | [diff] [blame] | 225 | return c->takePicture(msgType); |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 226 | } |
| 227 | |
| 228 | // set preview/capture parameters - key/value pairs |
| 229 | status_t Camera::setParameters(const String8& params) |
| 230 | { |
Steve Block | 3856b09 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 231 | ALOGV("setParameters"); |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 232 | sp <ICamera> c = mCamera; |
| 233 | if (c == 0) return NO_INIT; |
| 234 | return c->setParameters(params); |
| 235 | } |
| 236 | |
| 237 | // get preview/capture parameters - key/value pairs |
| 238 | String8 Camera::getParameters() const |
| 239 | { |
Steve Block | 3856b09 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 240 | ALOGV("getParameters"); |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 241 | String8 params; |
| 242 | sp <ICamera> c = mCamera; |
| 243 | if (c != 0) params = mCamera->getParameters(); |
| 244 | return params; |
| 245 | } |
| 246 | |
| 247 | // send command to camera driver |
| 248 | status_t Camera::sendCommand(int32_t cmd, int32_t arg1, int32_t arg2) |
| 249 | { |
Steve Block | 3856b09 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 250 | ALOGV("sendCommand"); |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 251 | sp <ICamera> c = mCamera; |
| 252 | if (c == 0) return NO_INIT; |
| 253 | return c->sendCommand(cmd, arg1, arg2); |
| 254 | } |
| 255 | |
| 256 | void Camera::setListener(const sp<CameraListener>& listener) |
| 257 | { |
| 258 | Mutex::Autolock _l(mLock); |
| 259 | mListener = listener; |
| 260 | } |
| 261 | |
Wu-cheng Li | 4ca2c7c | 2011-06-01 17:22:24 +0800 | [diff] [blame] | 262 | void Camera::setRecordingProxyListener(const sp<ICameraRecordingProxyListener>& listener) |
| 263 | { |
| 264 | Mutex::Autolock _l(mLock); |
| 265 | mRecordingProxyListener = listener; |
| 266 | } |
| 267 | |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 268 | void Camera::setPreviewCallbackFlags(int flag) |
| 269 | { |
Steve Block | 3856b09 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 270 | ALOGV("setPreviewCallbackFlags"); |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 271 | sp <ICamera> c = mCamera; |
| 272 | if (c == 0) return; |
| 273 | mCamera->setPreviewCallbackFlag(flag); |
| 274 | } |
| 275 | |
| 276 | // callback from camera service |
| 277 | void Camera::notifyCallback(int32_t msgType, int32_t ext1, int32_t ext2) |
| 278 | { |
Igor Murashkin | c073ba5 | 2013-02-26 14:32:34 -0800 | [diff] [blame] | 279 | return CameraBaseT::notifyCallback(msgType, ext1, ext2); |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 280 | } |
| 281 | |
| 282 | // callback from camera service when frame or image is ready |
Wu-cheng Li | 57c8618 | 2011-07-30 05:00:37 +0800 | [diff] [blame] | 283 | void Camera::dataCallback(int32_t msgType, const sp<IMemory>& dataPtr, |
| 284 | camera_frame_metadata_t *metadata) |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 285 | { |
Igor Murashkin | c073ba5 | 2013-02-26 14:32:34 -0800 | [diff] [blame] | 286 | return CameraBaseT::dataCallback(msgType, dataPtr, metadata); |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 287 | } |
| 288 | |
| 289 | // callback from camera service when timestamped frame is ready |
| 290 | void Camera::dataCallbackTimestamp(nsecs_t timestamp, int32_t msgType, const sp<IMemory>& dataPtr) |
| 291 | { |
Wu-cheng Li | 4ca2c7c | 2011-06-01 17:22:24 +0800 | [diff] [blame] | 292 | // If recording proxy listener is registered, forward the frame and return. |
| 293 | // The other listener (mListener) is ignored because the receiver needs to |
| 294 | // call releaseRecordingFrame. |
| 295 | sp<ICameraRecordingProxyListener> proxylistener; |
| 296 | { |
| 297 | Mutex::Autolock _l(mLock); |
| 298 | proxylistener = mRecordingProxyListener; |
| 299 | } |
| 300 | if (proxylistener != NULL) { |
| 301 | proxylistener->dataCallbackTimestamp(timestamp, msgType, dataPtr); |
| 302 | return; |
| 303 | } |
| 304 | |
Igor Murashkin | c073ba5 | 2013-02-26 14:32:34 -0800 | [diff] [blame] | 305 | if (!CameraBaseT::dataCallbackTimestamp(timestamp, msgType, dataPtr)) { |
Steve Block | 5ff1dd5 | 2012-01-05 23:22:43 +0000 | [diff] [blame] | 306 | ALOGW("No listener was set. Drop a recording frame."); |
James Dong | c42478e | 2010-11-15 10:38:37 -0800 | [diff] [blame] | 307 | releaseRecordingFrame(dataPtr); |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 308 | } |
| 309 | } |
| 310 | |
Wu-cheng Li | 4ca2c7c | 2011-06-01 17:22:24 +0800 | [diff] [blame] | 311 | sp<ICameraRecordingProxy> Camera::getRecordingProxy() { |
Steve Block | 3856b09 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 312 | ALOGV("getProxy"); |
Wu-cheng Li | 4ca2c7c | 2011-06-01 17:22:24 +0800 | [diff] [blame] | 313 | return new RecordingProxy(this); |
| 314 | } |
| 315 | |
| 316 | status_t Camera::RecordingProxy::startRecording(const sp<ICameraRecordingProxyListener>& listener) |
| 317 | { |
Steve Block | 3856b09 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 318 | ALOGV("RecordingProxy::startRecording"); |
Wu-cheng Li | 4ca2c7c | 2011-06-01 17:22:24 +0800 | [diff] [blame] | 319 | mCamera->setRecordingProxyListener(listener); |
| 320 | mCamera->reconnect(); |
| 321 | return mCamera->startRecording(); |
| 322 | } |
| 323 | |
| 324 | void Camera::RecordingProxy::stopRecording() |
| 325 | { |
Steve Block | 3856b09 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 326 | ALOGV("RecordingProxy::stopRecording"); |
Wu-cheng Li | 4ca2c7c | 2011-06-01 17:22:24 +0800 | [diff] [blame] | 327 | mCamera->stopRecording(); |
| 328 | } |
| 329 | |
| 330 | void Camera::RecordingProxy::releaseRecordingFrame(const sp<IMemory>& mem) |
| 331 | { |
Steve Block | 3856b09 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 332 | ALOGV("RecordingProxy::releaseRecordingFrame"); |
Wu-cheng Li | 4ca2c7c | 2011-06-01 17:22:24 +0800 | [diff] [blame] | 333 | mCamera->releaseRecordingFrame(mem); |
| 334 | } |
| 335 | |
| 336 | Camera::RecordingProxy::RecordingProxy(const sp<Camera>& camera) |
| 337 | { |
| 338 | mCamera = camera; |
| 339 | } |
| 340 | |
Mathias Agopian | 3cf6135 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 341 | }; // namespace android |