summaryrefslogtreecommitdiffstats
path: root/camera/CameraHal.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'camera/CameraHal.cpp')
-rw-r--r--camera/CameraHal.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/camera/CameraHal.cpp b/camera/CameraHal.cpp
index c7ba87f..c64b7e2 100644
--- a/camera/CameraHal.cpp
+++ b/camera/CameraHal.cpp
@@ -1713,12 +1713,15 @@ status_t CameraHal::setPreviewWindow(struct preview_stream_ops *window)
// Start the preview since the window is now available
ret = startPreview();
}
- }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
- */
+ } else {
+ // Update the display adapter with the new window that is passed from CameraService
+ ret = mDisplayAdapter->setPreviewWindow(window);
+ if ( (NO_ERROR == ret) && previewEnabled() ) {
+ restartPreview();
+ } else if (ret == ALREADY_EXISTS) {
+ // ALREADY_EXISTS should be treated as a noop in this case
+ ret = NO_ERROR;
+ }
}
LOG_FUNCTION_NAME_EXIT;