summaryrefslogtreecommitdiff
path: root/camera/device/3.2/default/CameraDeviceSession.cpp
diff options
context:
space:
mode:
authorYin-Chia Yeh <yinchiayeh@google.com>2017-01-09 14:29:06 -0800
committerYin-Chia Yeh <yinchiayeh@google.com>2017-01-09 14:29:06 -0800
commit7584624329a22663598e6fe70d150c0c32932014 (patch)
tree63b75dc743389cea9c664845b14b2770a5ebfebc /camera/device/3.2/default/CameraDeviceSession.cpp
parent35e47f5345fb9b98330b6940f19c0b8a70a4d046 (diff)
Camera: avoid double closing FD
Right now conventional HAL close the acquire_fence FD so wrapper should not close it again. However, we might need to change this behavior later to make camera service agnostic to passthrough or binderized mode. Bug: 34169301 Change-Id: I96b46521e4081b43e7a7e9c9efa98121739dda99
Diffstat (limited to 'camera/device/3.2/default/CameraDeviceSession.cpp')
-rw-r--r--camera/device/3.2/default/CameraDeviceSession.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/camera/device/3.2/default/CameraDeviceSession.cpp b/camera/device/3.2/default/CameraDeviceSession.cpp
index de61d83164..201a3b41c1 100644
--- a/camera/device/3.2/default/CameraDeviceSession.cpp
+++ b/camera/device/3.2/default/CameraDeviceSession.cpp
@@ -97,6 +97,9 @@ public:
//TODO(b/34110242): make this hidl transport agnostic
#ifdef BINDERIZED
fd = dup(handle->data[0]);
+ // TODO(b/34169301)
+ // Camera service expect FD be closed by HAL process (in passthrough mode)
+ // close(handle->data[0]);
#else
fd = handle->data[0];
#endif
@@ -695,14 +698,16 @@ void CameraDeviceSession::sProcessCaptureResult(
if (hasInputBuf) {
int streamId = static_cast<Camera3Stream*>(hal_result->input_buffer->stream)->mId;
auto key = std::make_pair(streamId, frameNumber);
- sHandleImporter.closeFence(d->mInflightBuffers[key].acquire_fence);
+ // TODO (b/34169301): currently HAL closed the fence
+ //sHandleImporter.closeFence(d->mInflightBuffers[key].acquire_fence);
d->mInflightBuffers.erase(key);
}
for (size_t i = 0; i < numOutputBufs; i++) {
int streamId = static_cast<Camera3Stream*>(hal_result->output_buffers[i].stream)->mId;
auto key = std::make_pair(streamId, frameNumber);
- sHandleImporter.closeFence(d->mInflightBuffers[key].acquire_fence);
+ // TODO (b/34169301): currently HAL closed the fence
+ //sHandleImporter.closeFence(d->mInflightBuffers[key].acquire_fence);
d->mInflightBuffers.erase(key);
}