From 32cf94013c9ba94ffaab68f942c7926ed007956f Mon Sep 17 00:00:00 2001 From: Sungjoong Kang Date: Mon, 8 Oct 2012 16:15:15 -0700 Subject: [PATCH] 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 --- libcamera2/ExynosCameraHWInterface2.cpp | 10 ++++++++-- libcamera2/ExynosCameraHWInterface2.h | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) 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; -- 2.20.1