summaryrefslogtreecommitdiff
path: root/camera
diff options
context:
space:
mode:
authorTyler Luu <tluu@ti.com>2011-11-09 17:20:31 -0600
committerIliyan Malchev <malchev@google.com>2011-11-10 13:49:18 -0800
commitcbaa66464ff86bddf40e3c8de8db44473ff27de9 (patch)
tree1a0319c7d75eb83ee7e8c13d004485f9343124a9 /camera
parentf9df3ee5cfb3c3177bcc630abf6d756e8a60254c (diff)
downloadomap4xxx-cbaa66464ff86bddf40e3c8de8db44473ff27de9.tar.gz
CameraHAL: Fix preview not starting after surface is abdandoned
Fix 3/3 for b/5593964. (I'm bundling this fix with b/5573610 because it is preview-related, though strictly speaking not part of b/b/5573610. It has been with us since the beginning.) If an application gets backgrounded (HOME key) without stopping preview and releasing camera, preview would previously not restart when application is resumed. ANativeWindowDisplayAdapter would detect that the preview surface was abandoned and stop sending buffers to CameraAdapter. We were previously not doing anything when CameraService called setPreviewWindow when a display adapter was already created. To fix this issue, we need to send the preview window and restart preview. Change-Id: I36089b0046f9861897d32c50b52128a41e2de2a5 Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
Diffstat (limited to 'camera')
-rw-r--r--camera/CameraHal.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/camera/CameraHal.cpp b/camera/CameraHal.cpp
index 7e18330..8e14fec 100644
--- a/camera/CameraHal.cpp
+++ b/camera/CameraHal.cpp
@@ -1715,10 +1715,11 @@ status_t CameraHal::setPreviewWindow(struct preview_stream_ops *window)
}
}else
{
- /* If mDisplayAdpater is already created. No need to do anything.
- * We get a surface handle directly now, so we can reconfigure surface
- * itself in DisplayAdapter if dimensions have changed
- */
+ // Update the display adapter with the new window that is passed from CameraService
+ ret = mDisplayAdapter->setPreviewWindow(window);
+ if (previewEnabled()) {
+ restartPreview();
+ }
}
LOG_FUNCTION_NAME_EXIT;