From: Sungjoong Kang Date: Mon, 24 Sep 2012 08:48:33 +0000 (-0700) Subject: hardware: samsung_slsi: libcamera2: Change ISP streamoff sequence X-Git-Tag: cm-10.1-M1^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2~1^2~1^2^2^2^2^2~3^2^2^2^2~2^2^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=499c410a9c97d1e10fe1af41f62fae0ee3c5af4a;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung_slsi_exynos5.git hardware: samsung_slsi: libcamera2: Change ISP streamoff sequence To prevent memory-related crash, modified streamoff sequence. After applying this patch, ISP streamoff will be called before scaler streamoff. Change-Id: I2cf7120a0bebb2341d07b256c42c975649f473f3 Signed-off-by: Sungjoong Kang --- diff --git a/libcamera2/ExynosCameraHWInterface2.cpp b/libcamera2/ExynosCameraHWInterface2.cpp index 7177ad5..015832e 100644 --- a/libcamera2/ExynosCameraHWInterface2.cpp +++ b/libcamera2/ExynosCameraHWInterface2.cpp @@ -2180,6 +2180,17 @@ int ExynosCameraHWInterface2::releaseStream(uint32_t stream_id) return 1; } + if (m_sensorThread != NULL) { + m_sensorThread->release(); + ALOGD("(%s): START Waiting for (indirect) sensor thread termination", __FUNCTION__); + while (!m_sensorThread->IsTerminated()) + usleep(10000); + ALOGD("(%s): END Waiting for (indirect) sensor thread termination", __FUNCTION__); + } + else { + ALOGE("+++++++ sensor thread is NULL %d", __LINE__); + } + if (m_streamThreads[1]->m_numRegisteredStream == 0 && m_streamThreads[1]->m_activated) { ALOGV("(%s): deactivating stream thread 1 ", __FUNCTION__); targetStream = (StreamThread*)(m_streamThreads[1].get()); @@ -2212,18 +2223,6 @@ int ExynosCameraHWInterface2::releaseStream(uint32_t stream_id) ALOGD("(%s): END Waiting for (indirect) stream thread termination", __FUNCTION__); m_streamThreads[0] = NULL; } - - if (m_sensorThread != NULL) { - m_sensorThread->release(); - ALOGD("(%s): START Waiting for (indirect) sensor thread termination", __FUNCTION__); - while (!m_sensorThread->IsTerminated()) - usleep(10000); - ALOGD("(%s): END Waiting for (indirect) sensor thread termination", __FUNCTION__); - } - else { - ALOGE("+++++++ sensor thread is NULL %d", __LINE__); - } - if (m_camera_info.capture.status == true) { m_scpForceSuspended = true; }