blob: 92dbd01a2708e5a0ee7229f1ed15e401fcaba8ac [file] [log] [blame]
Mathias Agopian3cf61352010-02-09 17:46:37 -08001/*
2**
3** Copyright (C) 2008, The Android Open Source Project
Mathias Agopian3cf61352010-02-09 17:46:37 -08004**
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 Talvalaceb388d2013-02-19 10:40:14 -080022#include <utils/String16.h>
Wu-cheng Li4ca2c7c2011-06-01 17:22:24 +080023#include <binder/IPCThreadState.h>
Mathias Agopian3cf61352010-02-09 17:46:37 -080024#include <binder/IServiceManager.h>
25#include <binder/IMemory.h>
26
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -080027#include <Camera.h>
28#include <ICameraRecordingProxyListener.h>
29#include <android/hardware/ICameraService.h>
30#include <android/hardware/ICamera.h>
Mathias Agopian3cf61352010-02-09 17:46:37 -080031
Andy McFadden8ba01022012-12-18 09:46:54 -080032#include <gui/IGraphicBufferProducer.h>
Mathias Agopiandf712ea2012-02-25 18:48:35 -080033#include <gui/Surface.h>
Mathias Agopian3cf61352010-02-09 17:46:37 -080034
35namespace android {
36
Igor Murashkinc073ba52013-02-26 14:32:34 -080037Camera::Camera(int cameraId)
38 : CameraBase(cameraId)
Mathias Agopian3cf61352010-02-09 17:46:37 -080039{
Mathias Agopian3cf61352010-02-09 17:46:37 -080040}
41
Ruben Brunk0f61d8f2013-08-08 13:07:18 -070042CameraTraits<Camera>::TCamConnectService CameraTraits<Camera>::fnConnectService =
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -080043 &::android::hardware::ICameraService::connect;
Ruben Brunk0f61d8f2013-08-08 13:07:18 -070044
Mathias Agopian3cf61352010-02-09 17:46:37 -080045// construct a camera client from an existing camera remote
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -080046sp<Camera> Camera::create(const sp<::android::hardware::ICamera>& camera)
Mathias Agopian3cf61352010-02-09 17:46:37 -080047{
Steve Block3856b092011-10-20 11:56:00 +010048 ALOGV("create");
Mathias Agopian3cf61352010-02-09 17:46:37 -080049 if (camera == 0) {
Steve Block29357bc2012-01-06 19:20:56 +000050 ALOGE("camera remote is a NULL pointer");
Mathias Agopian3cf61352010-02-09 17:46:37 -080051 return 0;
52 }
53
Igor Murashkinc073ba52013-02-26 14:32:34 -080054 sp<Camera> c = new Camera(-1);
Mathias Agopian3cf61352010-02-09 17:46:37 -080055 if (camera->connect(c) == NO_ERROR) {
56 c->mStatus = NO_ERROR;
57 c->mCamera = camera;
Marco Nelissen06b46062014-11-14 07:58:25 -080058 IInterface::asBinder(camera)->linkToDeath(c);
Wu-cheng Li627baac2011-01-04 20:00:55 +080059 return c;
Mathias Agopian3cf61352010-02-09 17:46:37 -080060 }
Wu-cheng Li627baac2011-01-04 20:00:55 +080061 return 0;
Mathias Agopian3cf61352010-02-09 17:46:37 -080062}
63
Mathias Agopian3cf61352010-02-09 17:46:37 -080064Camera::~Camera()
65{
Chih-Chung Changd06618e2010-05-13 15:14:24 +080066 // We don't need to call disconnect() here because if the CameraService
67 // thinks we are the owner of the hardware, it will hold a (strong)
68 // reference to us, and we can't possibly be here. We also don't want to
69 // call disconnect() here if we are in the same process as mediaserver,
70 // because we may be invoked by CameraService::Client::connect() and will
71 // deadlock if we call any method of ICamera here.
Mathias Agopian3cf61352010-02-09 17:46:37 -080072}
73
Svetoslav Ganov280405a2015-05-12 02:19:27 +000074sp<Camera> Camera::connect(int cameraId, const String16& clientPackageName,
Chien-Yu Chen98a668f2015-12-18 14:10:33 -080075 int clientUid, int clientPid)
Mathias Agopian3cf61352010-02-09 17:46:37 -080076{
Chien-Yu Chen98a668f2015-12-18 14:10:33 -080077 return CameraBaseT::connect(cameraId, clientPackageName, clientUid, clientPid);
Mathias Agopian3cf61352010-02-09 17:46:37 -080078}
79
80status_t Camera::reconnect()
81{
Steve Block3856b092011-10-20 11:56:00 +010082 ALOGV("reconnect");
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -080083 sp <::android::hardware::ICamera> c = mCamera;
Mathias Agopian3cf61352010-02-09 17:46:37 -080084 if (c == 0) return NO_INIT;
85 return c->connect(this);
86}
87
Mathias Agopian3cf61352010-02-09 17:46:37 -080088status_t Camera::lock()
89{
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -080090 sp <::android::hardware::ICamera> c = mCamera;
Mathias Agopian3cf61352010-02-09 17:46:37 -080091 if (c == 0) return NO_INIT;
92 return c->lock();
93}
94
95status_t Camera::unlock()
96{
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -080097 sp <::android::hardware::ICamera> c = mCamera;
Mathias Agopian3cf61352010-02-09 17:46:37 -080098 if (c == 0) return NO_INIT;
99 return c->unlock();
100}
101
Andy McFadden8ba01022012-12-18 09:46:54 -0800102// pass the buffered IGraphicBufferProducer to the camera service
Eino-Ville Talvala4b820b02013-08-21 14:39:05 -0700103status_t Camera::setPreviewTarget(const sp<IGraphicBufferProducer>& bufferProducer)
Jamie Gennisbfa33aa2010-12-20 11:51:31 -0800104{
Eino-Ville Talvala4b820b02013-08-21 14:39:05 -0700105 ALOGV("setPreviewTarget(%p)", bufferProducer.get());
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800106 sp <::android::hardware::ICamera> c = mCamera;
Jamie Gennisbfa33aa2010-12-20 11:51:31 -0800107 if (c == 0) return NO_INIT;
Mathias Agopian99617ad2013-03-12 18:42:23 -0700108 ALOGD_IF(bufferProducer == 0, "app passed NULL surface");
Eino-Ville Talvala1ce7c342013-08-21 13:57:21 -0700109 return c->setPreviewTarget(bufferProducer);
Jamie Gennisbfa33aa2010-12-20 11:51:31 -0800110}
111
Chien-Yu Chen8cca0752015-11-13 15:28:48 -0800112status_t Camera::setVideoTarget(const sp<IGraphicBufferProducer>& bufferProducer)
113{
114 ALOGV("setVideoTarget(%p)", bufferProducer.get());
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800115 sp <::android::hardware::ICamera> c = mCamera;
Chien-Yu Chen8cca0752015-11-13 15:28:48 -0800116 if (c == 0) return NO_INIT;
117 ALOGD_IF(bufferProducer == 0, "app passed NULL video surface");
118 return c->setVideoTarget(bufferProducer);
119}
120
Mathias Agopian3cf61352010-02-09 17:46:37 -0800121// start preview mode
122status_t Camera::startPreview()
123{
Steve Block3856b092011-10-20 11:56:00 +0100124 ALOGV("startPreview");
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800125 sp <::android::hardware::ICamera> c = mCamera;
Mathias Agopian3cf61352010-02-09 17:46:37 -0800126 if (c == 0) return NO_INIT;
127 return c->startPreview();
128}
129
Chien-Yu Chen8cca0752015-11-13 15:28:48 -0800130status_t Camera::setVideoBufferMode(int32_t videoBufferMode)
James Donge2ad6732010-10-18 20:42:51 -0700131{
Chien-Yu Chen8cca0752015-11-13 15:28:48 -0800132 ALOGV("setVideoBufferMode: %d", videoBufferMode);
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800133 sp <::android::hardware::ICamera> c = mCamera;
James Donge2ad6732010-10-18 20:42:51 -0700134 if (c == 0) return NO_INIT;
Chien-Yu Chen8cca0752015-11-13 15:28:48 -0800135 return c->setVideoBufferMode(videoBufferMode);
James Donge2ad6732010-10-18 20:42:51 -0700136}
137
Eino-Ville Talvala4b820b02013-08-21 14:39:05 -0700138// start recording mode, must call setPreviewTarget first
Mathias Agopian3cf61352010-02-09 17:46:37 -0800139status_t Camera::startRecording()
140{
Steve Block3856b092011-10-20 11:56:00 +0100141 ALOGV("startRecording");
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800142 sp <::android::hardware::ICamera> c = mCamera;
Mathias Agopian3cf61352010-02-09 17:46:37 -0800143 if (c == 0) return NO_INIT;
144 return c->startRecording();
145}
146
147// stop preview mode
148void Camera::stopPreview()
149{
Steve Block3856b092011-10-20 11:56:00 +0100150 ALOGV("stopPreview");
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800151 sp <::android::hardware::ICamera> c = mCamera;
Mathias Agopian3cf61352010-02-09 17:46:37 -0800152 if (c == 0) return;
153 c->stopPreview();
154}
155
156// stop recording mode
157void Camera::stopRecording()
158{
Steve Block3856b092011-10-20 11:56:00 +0100159 ALOGV("stopRecording");
Wu-cheng Li4ca2c7c2011-06-01 17:22:24 +0800160 {
161 Mutex::Autolock _l(mLock);
162 mRecordingProxyListener.clear();
163 }
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800164 sp <::android::hardware::ICamera> c = mCamera;
Mathias Agopian3cf61352010-02-09 17:46:37 -0800165 if (c == 0) return;
166 c->stopRecording();
167}
168
169// release a recording frame
170void Camera::releaseRecordingFrame(const sp<IMemory>& mem)
171{
Steve Block3856b092011-10-20 11:56:00 +0100172 ALOGV("releaseRecordingFrame");
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800173 sp <::android::hardware::ICamera> c = mCamera;
Mathias Agopian3cf61352010-02-09 17:46:37 -0800174 if (c == 0) return;
175 c->releaseRecordingFrame(mem);
176}
177
Chien-Yu Chen2d13b1d2016-04-28 12:11:20 -0700178void Camera::releaseRecordingFrameHandle(native_handle_t* handle)
179{
180 ALOGV("releaseRecordingFrameHandle");
181 sp <::android::hardware::ICamera> c = mCamera;
182 if (c == 0) return;
183 c->releaseRecordingFrameHandle(handle);
184}
185
Yin-Chia Yehb5df5472017-03-20 19:32:19 -0700186void Camera::releaseRecordingFrameHandleBatch(
187 const std::vector<native_handle_t*> handles) {
188 ALOGV("releaseRecordingFrameHandleBatch");
189 sp <::android::hardware::ICamera> c = mCamera;
190 if (c == 0) return;
191 c->releaseRecordingFrameHandleBatch(handles);
192}
193
Mathias Agopian3cf61352010-02-09 17:46:37 -0800194// get preview state
195bool Camera::previewEnabled()
196{
Steve Block3856b092011-10-20 11:56:00 +0100197 ALOGV("previewEnabled");
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800198 sp <::android::hardware::ICamera> c = mCamera;
Mathias Agopian3cf61352010-02-09 17:46:37 -0800199 if (c == 0) return false;
200 return c->previewEnabled();
201}
202
203// get recording state
204bool Camera::recordingEnabled()
205{
Steve Block3856b092011-10-20 11:56:00 +0100206 ALOGV("recordingEnabled");
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800207 sp <::android::hardware::ICamera> c = mCamera;
Mathias Agopian3cf61352010-02-09 17:46:37 -0800208 if (c == 0) return false;
209 return c->recordingEnabled();
210}
211
212status_t Camera::autoFocus()
213{
Steve Block3856b092011-10-20 11:56:00 +0100214 ALOGV("autoFocus");
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800215 sp <::android::hardware::ICamera> c = mCamera;
Mathias Agopian3cf61352010-02-09 17:46:37 -0800216 if (c == 0) return NO_INIT;
217 return c->autoFocus();
218}
219
220status_t Camera::cancelAutoFocus()
221{
Steve Block3856b092011-10-20 11:56:00 +0100222 ALOGV("cancelAutoFocus");
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800223 sp <::android::hardware::ICamera> c = mCamera;
Mathias Agopian3cf61352010-02-09 17:46:37 -0800224 if (c == 0) return NO_INIT;
225 return c->cancelAutoFocus();
226}
227
228// take a picture
James Donge468ac52011-02-17 16:38:06 -0800229status_t Camera::takePicture(int msgType)
Mathias Agopian3cf61352010-02-09 17:46:37 -0800230{
Steve Block3856b092011-10-20 11:56:00 +0100231 ALOGV("takePicture: 0x%x", msgType);
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800232 sp <::android::hardware::ICamera> c = mCamera;
Mathias Agopian3cf61352010-02-09 17:46:37 -0800233 if (c == 0) return NO_INIT;
James Donge468ac52011-02-17 16:38:06 -0800234 return c->takePicture(msgType);
Mathias Agopian3cf61352010-02-09 17:46:37 -0800235}
236
237// set preview/capture parameters - key/value pairs
238status_t Camera::setParameters(const String8& params)
239{
Steve Block3856b092011-10-20 11:56:00 +0100240 ALOGV("setParameters");
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800241 sp <::android::hardware::ICamera> c = mCamera;
Mathias Agopian3cf61352010-02-09 17:46:37 -0800242 if (c == 0) return NO_INIT;
243 return c->setParameters(params);
244}
245
246// get preview/capture parameters - key/value pairs
247String8 Camera::getParameters() const
248{
Steve Block3856b092011-10-20 11:56:00 +0100249 ALOGV("getParameters");
Mathias Agopian3cf61352010-02-09 17:46:37 -0800250 String8 params;
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800251 sp <::android::hardware::ICamera> c = mCamera;
Mathias Agopian3cf61352010-02-09 17:46:37 -0800252 if (c != 0) params = mCamera->getParameters();
253 return params;
254}
255
256// send command to camera driver
257status_t Camera::sendCommand(int32_t cmd, int32_t arg1, int32_t arg2)
258{
Steve Block3856b092011-10-20 11:56:00 +0100259 ALOGV("sendCommand");
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800260 sp <::android::hardware::ICamera> c = mCamera;
Mathias Agopian3cf61352010-02-09 17:46:37 -0800261 if (c == 0) return NO_INIT;
262 return c->sendCommand(cmd, arg1, arg2);
263}
264
265void Camera::setListener(const sp<CameraListener>& listener)
266{
267 Mutex::Autolock _l(mLock);
268 mListener = listener;
269}
270
Wu-cheng Li4ca2c7c2011-06-01 17:22:24 +0800271void Camera::setRecordingProxyListener(const sp<ICameraRecordingProxyListener>& listener)
272{
273 Mutex::Autolock _l(mLock);
274 mRecordingProxyListener = listener;
275}
276
Mathias Agopian3cf61352010-02-09 17:46:37 -0800277void Camera::setPreviewCallbackFlags(int flag)
278{
Steve Block3856b092011-10-20 11:56:00 +0100279 ALOGV("setPreviewCallbackFlags");
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800280 sp <::android::hardware::ICamera> c = mCamera;
Mathias Agopian3cf61352010-02-09 17:46:37 -0800281 if (c == 0) return;
282 mCamera->setPreviewCallbackFlag(flag);
283}
284
Eino-Ville Talvala3ee35502013-04-02 15:45:11 -0700285status_t Camera::setPreviewCallbackTarget(
286 const sp<IGraphicBufferProducer>& callbackProducer)
287{
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800288 sp <::android::hardware::ICamera> c = mCamera;
Eino-Ville Talvala3ee35502013-04-02 15:45:11 -0700289 if (c == 0) return NO_INIT;
290 return c->setPreviewCallbackTarget(callbackProducer);
291}
292
Yin-Chia Yehcfab4e12019-09-09 13:08:28 -0700293status_t Camera::setAudioRestriction(int32_t mode)
Yin-Chia Yehdba03232019-08-19 15:54:28 -0700294{
295 sp <::android::hardware::ICamera> c = mCamera;
296 if (c == 0) return NO_INIT;
297 return c->setAudioRestriction(mode);
298}
299
Yin-Chia Yehcfab4e12019-09-09 13:08:28 -0700300int32_t Camera::getGlobalAudioRestriction()
301{
302 sp <::android::hardware::ICamera> c = mCamera;
303 if (c == 0) return NO_INIT;
304 return c->getGlobalAudioRestriction();
305}
306
Mathias Agopian3cf61352010-02-09 17:46:37 -0800307// callback from camera service
308void Camera::notifyCallback(int32_t msgType, int32_t ext1, int32_t ext2)
309{
Igor Murashkinc073ba52013-02-26 14:32:34 -0800310 return CameraBaseT::notifyCallback(msgType, ext1, ext2);
Mathias Agopian3cf61352010-02-09 17:46:37 -0800311}
312
313// callback from camera service when frame or image is ready
Wu-cheng Li57c86182011-07-30 05:00:37 +0800314void Camera::dataCallback(int32_t msgType, const sp<IMemory>& dataPtr,
315 camera_frame_metadata_t *metadata)
Mathias Agopian3cf61352010-02-09 17:46:37 -0800316{
Igor Murashkinfa4cf9d2013-03-04 16:14:23 -0800317 sp<CameraListener> listener;
318 {
319 Mutex::Autolock _l(mLock);
320 listener = mListener;
321 }
322 if (listener != NULL) {
323 listener->postData(msgType, dataPtr, metadata);
324 }
Mathias Agopian3cf61352010-02-09 17:46:37 -0800325}
326
327// callback from camera service when timestamped frame is ready
328void Camera::dataCallbackTimestamp(nsecs_t timestamp, int32_t msgType, const sp<IMemory>& dataPtr)
329{
Wu-cheng Li4ca2c7c2011-06-01 17:22:24 +0800330 // If recording proxy listener is registered, forward the frame and return.
331 // The other listener (mListener) is ignored because the receiver needs to
332 // call releaseRecordingFrame.
333 sp<ICameraRecordingProxyListener> proxylistener;
334 {
335 Mutex::Autolock _l(mLock);
336 proxylistener = mRecordingProxyListener;
337 }
338 if (proxylistener != NULL) {
339 proxylistener->dataCallbackTimestamp(timestamp, msgType, dataPtr);
340 return;
341 }
342
Igor Murashkinfa4cf9d2013-03-04 16:14:23 -0800343 sp<CameraListener> listener;
344 {
345 Mutex::Autolock _l(mLock);
346 listener = mListener;
347 }
348
349 if (listener != NULL) {
350 listener->postDataTimestamp(timestamp, msgType, dataPtr);
351 } else {
Steve Block5ff1dd52012-01-05 23:22:43 +0000352 ALOGW("No listener was set. Drop a recording frame.");
James Dongc42478e2010-11-15 10:38:37 -0800353 releaseRecordingFrame(dataPtr);
Mathias Agopian3cf61352010-02-09 17:46:37 -0800354 }
355}
356
Chien-Yu Chen2d13b1d2016-04-28 12:11:20 -0700357void Camera::recordingFrameHandleCallbackTimestamp(nsecs_t timestamp, native_handle_t* handle)
358{
359 // If recording proxy listener is registered, forward the frame and return.
360 // The other listener (mListener) is ignored because the receiver needs to
361 // call releaseRecordingFrameHandle.
362 sp<ICameraRecordingProxyListener> proxylistener;
363 {
364 Mutex::Autolock _l(mLock);
365 proxylistener = mRecordingProxyListener;
366 }
367 if (proxylistener != NULL) {
368 proxylistener->recordingFrameHandleCallbackTimestamp(timestamp, handle);
369 return;
370 }
371
372 sp<CameraListener> listener;
373 {
374 Mutex::Autolock _l(mLock);
375 listener = mListener;
376 }
377
378 if (listener != NULL) {
379 listener->postRecordingFrameHandleTimestamp(timestamp, handle);
380 } else {
381 ALOGW("No listener was set. Drop a recording frame.");
382 releaseRecordingFrameHandle(handle);
383 }
384}
385
Yin-Chia Yehb5df5472017-03-20 19:32:19 -0700386void Camera::recordingFrameHandleCallbackTimestampBatch(
387 const std::vector<nsecs_t>& timestamps,
388 const std::vector<native_handle_t*>& handles)
389{
390 // If recording proxy listener is registered, forward the frame and return.
391 // The other listener (mListener) is ignored because the receiver needs to
392 // call releaseRecordingFrameHandle.
393 sp<ICameraRecordingProxyListener> proxylistener;
394 {
395 Mutex::Autolock _l(mLock);
396 proxylistener = mRecordingProxyListener;
397 }
398 if (proxylistener != NULL) {
399 proxylistener->recordingFrameHandleCallbackTimestampBatch(timestamps, handles);
400 return;
401 }
402
403 sp<CameraListener> listener;
404 {
405 Mutex::Autolock _l(mLock);
406 listener = mListener;
407 }
408
409 if (listener != NULL) {
410 listener->postRecordingFrameHandleTimestampBatch(timestamps, handles);
411 } else {
412 ALOGW("No listener was set. Drop a batch of recording frames.");
413 releaseRecordingFrameHandleBatch(handles);
414 }
415}
416
Wu-cheng Li4ca2c7c2011-06-01 17:22:24 +0800417sp<ICameraRecordingProxy> Camera::getRecordingProxy() {
Steve Block3856b092011-10-20 11:56:00 +0100418 ALOGV("getProxy");
Wu-cheng Li4ca2c7c2011-06-01 17:22:24 +0800419 return new RecordingProxy(this);
420}
421
422status_t Camera::RecordingProxy::startRecording(const sp<ICameraRecordingProxyListener>& listener)
423{
Steve Block3856b092011-10-20 11:56:00 +0100424 ALOGV("RecordingProxy::startRecording");
Wu-cheng Li4ca2c7c2011-06-01 17:22:24 +0800425 mCamera->setRecordingProxyListener(listener);
426 mCamera->reconnect();
427 return mCamera->startRecording();
428}
429
430void Camera::RecordingProxy::stopRecording()
431{
Steve Block3856b092011-10-20 11:56:00 +0100432 ALOGV("RecordingProxy::stopRecording");
Wu-cheng Li4ca2c7c2011-06-01 17:22:24 +0800433 mCamera->stopRecording();
434}
435
436void Camera::RecordingProxy::releaseRecordingFrame(const sp<IMemory>& mem)
437{
Steve Block3856b092011-10-20 11:56:00 +0100438 ALOGV("RecordingProxy::releaseRecordingFrame");
Wu-cheng Li4ca2c7c2011-06-01 17:22:24 +0800439 mCamera->releaseRecordingFrame(mem);
440}
441
Chien-Yu Chen2d13b1d2016-04-28 12:11:20 -0700442void Camera::RecordingProxy::releaseRecordingFrameHandle(native_handle_t* handle) {
443 ALOGV("RecordingProxy::releaseRecordingFrameHandle");
444 mCamera->releaseRecordingFrameHandle(handle);
445}
446
Yin-Chia Yehb5df5472017-03-20 19:32:19 -0700447void Camera::RecordingProxy::releaseRecordingFrameHandleBatch(
448 const std::vector<native_handle_t*>& handles) {
449 ALOGV("RecordingProxy::releaseRecordingFrameHandleBatch");
450 mCamera->releaseRecordingFrameHandleBatch(handles);
451}
452
Wu-cheng Li4ca2c7c2011-06-01 17:22:24 +0800453Camera::RecordingProxy::RecordingProxy(const sp<Camera>& camera)
454{
455 mCamera = camera;
456}
457
Mathias Agopian3cf61352010-02-09 17:46:37 -0800458}; // namespace android