diff options
author | Tyler Luu <tluu@ti.com> | 2011-11-09 17:20:31 -0600 |
---|---|---|
committer | Iliyan Malchev <malchev@google.com> | 2011-12-05 10:40:20 -0800 |
commit | b2ae06294ad21d74df93ad0f5ca3e2f355f77436 (patch) | |
tree | 77e96c1b97983a5729ebceed5802637d9e814a18 /camera/ANativeWindowDisplayAdapter.cpp | |
parent | 77200d9a47a940d27b8614ad3682e3dabae6ed36 (diff) | |
download | hardware_ti_omap4-b2ae06294ad21d74df93ad0f5ca3e2f355f77436.zip hardware_ti_omap4-b2ae06294ad21d74df93ad0f5ca3e2f355f77436.tar.gz hardware_ti_omap4-b2ae06294ad21d74df93ad0f5ca3e2f355f77436.tar.bz2 |
CameraHal: Fix preview not starting after surface is abdandoned
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>
Diffstat (limited to 'camera/ANativeWindowDisplayAdapter.cpp')
-rw-r--r-- | camera/ANativeWindowDisplayAdapter.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/camera/ANativeWindowDisplayAdapter.cpp b/camera/ANativeWindowDisplayAdapter.cpp index a7b2e86..e6a4c87 100644 --- a/camera/ANativeWindowDisplayAdapter.cpp +++ b/camera/ANativeWindowDisplayAdapter.cpp @@ -269,6 +269,10 @@ int ANativeWindowDisplayAdapter::setPreviewWindow(preview_stream_ops_t* window) return BAD_VALUE; } + if ( window == mANativeWindow ) { + return ALREADY_EXISTS; + } + ///Destroy the existing window object, if it exists destroy(); |