From: Sungjoong Kang Date: Mon, 8 Oct 2012 23:15:15 +0000 (-0700) Subject: hardware: samsung_slsi: libcamera2: Apply pending JPEG count to in_progress X-Git-Tag: cm-10.1-M1~30 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=32cf94013c9ba94ffaab68f942c7926ed007956f;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung_slsi_exynos5.git hardware: samsung_slsi: libcamera2: Apply pending JPEG count to in_progress Apply the count of pending JPEG output to the result of get_in_progress_count. BUG: 7276954 Change-Id: I89aa1311618423d089c9572c9a292d90eb5de92d Signed-off-by: Sungjoong Kang --- diff --git a/libcamera2/ExynosCameraHWInterface2.cpp b/libcamera2/ExynosCameraHWInterface2.cpp index ecfd430..0975d7c 100644 --- a/libcamera2/ExynosCameraHWInterface2.cpp +++ b/libcamera2/ExynosCameraHWInterface2.cpp @@ -954,6 +954,7 @@ ExynosCameraHWInterface2::ExynosCameraHWInterface2(int cameraId, camera2_device_ m_afTriggerId(0), m_afPendingTriggerId(0), m_afModeWaitingCnt(0), + m_jpegEncodingCount(0), m_scpForceSuspended(false), m_halDevice(dev), m_nightCaptureCnt(0), @@ -1609,8 +1610,9 @@ int ExynosCameraHWInterface2::setFrameQueueDstOps(const camera2_frame_queue_dst_ int ExynosCameraHWInterface2::getInProgressCount() { int inProgressCount = m_requestManager->GetNumEntries(); - ALOGV("DEBUG(%s): # of dequeued req (%d)", __FUNCTION__, inProgressCount); - return inProgressCount; + ALOGV("DEBUG(%s): # of dequeued req (%d) jpeg(%d) = (%d)", __FUNCTION__, + inProgressCount, m_jpegEncodingCount, (inProgressCount + m_jpegEncodingCount)); + return (inProgressCount + m_jpegEncodingCount); } int ExynosCameraHWInterface2::flushCapturesInProgress() @@ -4129,6 +4131,7 @@ void ExynosCameraHWInterface2::m_streamThreadFunc(SignalDrivenThread * self) } int ExynosCameraHWInterface2::m_jpegCreator(StreamThread *selfThread, ExynosBuffer *srcImageBuf, nsecs_t frameTimeStamp) { + Mutex::Autolock lock(m_jpegEncoderLock); stream_parameters_t *selfStreamParms = &(selfThread->m_parameters); substream_parameters_t *subParms = &m_subStreams[STREAM_ID_JPEG]; status_t res; @@ -4160,6 +4163,8 @@ int ExynosCameraHWInterface2::m_jpegCreator(StreamThread *selfThread, ExynosBuff return 1; } + m_jpegEncodingCount++; + m_getRatioSize(selfStreamParms->width, selfStreamParms->height, m_streamThreads[0]->m_parameters.width, m_streamThreads[0]->m_parameters.height, &srcCropX, &srcCropY, @@ -4322,6 +4327,7 @@ int ExynosCameraHWInterface2::m_jpegCreator(StreamThread *selfThread, ExynosBuff subParms->svcBufIndex, subParms->svcBufStatus[subParms->svcBufIndex]); } } + m_jpegEncodingCount--; return 0; } diff --git a/libcamera2/ExynosCameraHWInterface2.h b/libcamera2/ExynosCameraHWInterface2.h index d51cd25..59a808c 100644 --- a/libcamera2/ExynosCameraHWInterface2.h +++ b/libcamera2/ExynosCameraHWInterface2.h @@ -660,6 +660,8 @@ class MainThread : public SignalDrivenThread { int m_vdisDupFrame; mutable Mutex m_qbufLock; + mutable Mutex m_jpegEncoderLock; + int m_jpegEncodingCount; bool m_scpForceSuspended; int m_afState;