aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRajaram Gudivada <rajaramg@codeaurora.org>2015-05-22 15:51:43 +0530
committerdev-harsh1998 <harshitjain6751@gmail.com>2017-10-18 12:53:46 +0530
commit237456f047940f0aa855848f24872df65c425690 (patch)
tree40729813f366b7c3abc5517feb99692832b0a24b
parent3ff265620287e7f6f78da223569ca359c5e9b227 (diff)
QCamera2: HAL: Restart the preview channel
Issue: In some of the 3rd party Application's, Torch mode is set in preview stopped state with default dimensions and also recording hint is set to false. so, we add a preview channel thinking it.s a flash case and then App is setting the actual preview dimensions which we don't honor since the preview channel is already there and due to this mismatch in dimensions, garbled preview is seen. Fix: Delete the Preview Channel if it.s already there and add a new preview channel with updated dimensions & format. Change-Id: Ia1bd0d30a7939b8bdfd5d88fe100f696dfb4a7c6
-rwxr-xr-xcamera/QCamera2/HAL/QCamera2HWI.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/camera/QCamera2/HAL/QCamera2HWI.cpp b/camera/QCamera2/HAL/QCamera2HWI.cpp
index 653942b..2afc13b 100755
--- a/camera/QCamera2/HAL/QCamera2HWI.cpp
+++ b/camera/QCamera2/HAL/QCamera2HWI.cpp
@@ -4689,11 +4689,9 @@ int32_t QCamera2HardwareInterface::addPreviewChannel()
QCameraChannel *pChannel = NULL;
if (m_channels[QCAMERA_CH_TYPE_PREVIEW] != NULL) {
- // Using the no preview torch WA it is possible
- // to already have a preview channel present before
- // start preview gets called.
- CDBG_HIGH(" %s : Preview Channel already added!", __func__);
- return NO_ERROR;
+ CDBG_HIGH("%s : Preview Channel already added and so delete it", __func__);
+ delete m_channels[QCAMERA_CH_TYPE_PREVIEW];
+ m_channels[QCAMERA_CH_TYPE_PREVIEW] = NULL;
}
pChannel = new QCameraChannel(mCameraHandle->camera_handle,