diff options
author | Zhijun He <zhijunhe@google.com> | 2013-07-23 08:02:53 -0700 |
---|---|---|
committer | Zhijun He <zhijunhe@google.com> | 2013-07-23 11:01:59 -0700 |
commit | 2ab500c632569e2f131a1a2288459933da70c4ee (patch) | |
tree | fe3d1ab19e24e225ea2b6eab9cf2735cda0b2336 /services | |
parent | 0429aa9322a1419eae0b932491b22f300cd58206 (diff) | |
download | frameworks_av-2ab500c632569e2f131a1a2288459933da70c4ee.zip frameworks_av-2ab500c632569e2f131a1a2288459933da70c4ee.tar.gz frameworks_av-2ab500c632569e2f131a1a2288459933da70c4ee.tar.bz2 |
camera2: Implement ICameraDeviceUser::waitUntilIdle
Also fixed some logging typo
Change-Id: Ib254bdb137dca10b12595c23aeb1c53097423425
Diffstat (limited to 'services')
3 files changed, 27 insertions, 1 deletions
diff --git a/services/camera/libcameraservice/camera3/Camera3OutputStream.cpp b/services/camera/libcameraservice/camera3/Camera3OutputStream.cpp index f085443..0ec2b05 100644 --- a/services/camera/libcameraservice/camera3/Camera3OutputStream.cpp +++ b/services/camera/libcameraservice/camera3/Camera3OutputStream.cpp @@ -304,7 +304,7 @@ status_t Camera3OutputStream::configureQueueLocked() { ALOGV("%s: Consumer wants %d buffers, HAL wants %d", __FUNCTION__, maxConsumerBuffers, camera3_stream::max_buffers); if (camera3_stream::max_buffers == 0) { - ALOGE("%s: Camera HAL requested no max_buffers, requires at least 1", + ALOGE("%s: Camera HAL requested max_buffer count: %d, requires at least 1", __FUNCTION__, camera3_stream::max_buffers); return INVALID_OPERATION; } diff --git a/services/camera/libcameraservice/photography/CameraDeviceClient.cpp b/services/camera/libcameraservice/photography/CameraDeviceClient.cpp index e1c7e79..dd845f6 100644 --- a/services/camera/libcameraservice/photography/CameraDeviceClient.cpp +++ b/services/camera/libcameraservice/photography/CameraDeviceClient.cpp @@ -412,6 +412,30 @@ status_t CameraDeviceClient::getCameraInfo(/*out*/CameraMetadata* info) return res; } +status_t CameraDeviceClient::waitUntilIdle() +{ + ATRACE_CALL(); + ALOGV("%s", __FUNCTION__); + + status_t res = OK; + if ( (res = checkPid(__FUNCTION__) ) != OK) return res; + + Mutex::Autolock icl(mBinderSerializationLock); + + if (!mDevice.get()) return DEAD_OBJECT; + + // FIXME: Also need check repeating burst. + if (!mStreamingRequestList.isEmpty()) { + ALOGE("%s: Camera %d: Try to waitUntilIdle when there are active streaming requests", + __FUNCTION__, mCameraId); + return INVALID_OPERATION; + } + res = mDevice->waitUntilDrained(); + ALOGV("%s Done", __FUNCTION__); + + return res; +} + status_t CameraDeviceClient::dump(int fd, const Vector<String16>& args) { String8 result; result.appendFormat("CameraDeviceClient[%d] (%p) PID: %d, dump:\n", diff --git a/services/camera/libcameraservice/photography/CameraDeviceClient.h b/services/camera/libcameraservice/photography/CameraDeviceClient.h index c6c241a..bb2949c 100644 --- a/services/camera/libcameraservice/photography/CameraDeviceClient.h +++ b/services/camera/libcameraservice/photography/CameraDeviceClient.h @@ -87,6 +87,8 @@ public: // -- Caller owns the newly allocated metadata virtual status_t getCameraInfo(/*out*/CameraMetadata* info); + // Wait until all the submitted requests have finished processing + virtual status_t waitUntilIdle(); /** * Interface used by CameraService */ |