summaryrefslogtreecommitdiff
authorjiyu.yang <jiyu.yang@amlogic.com>2014-01-13 07:19:13 (GMT)
committer Sandy lUo <sandy.luo@amlogic.com>2014-01-13 11:08:46 (GMT)
commit17e34d1d6cf5358efd9ae03205687c10bb14a278 (patch)
tree80583a51f6ed72bf08963209a57176b1b917f8b6
parent817df98a264ccbe2d37b63f67b2d1ed70d8a4ba2 (diff)
downloadcamera-17e34d1d6cf5358efd9ae03205687c10bb14a278.zip
camera-17e34d1d6cf5358efd9ae03205687c10bb14a278.tar.gz
camera-17e34d1d6cf5358efd9ae03205687c10bb14a278.tar.bz2
PD#85561 fix meiyancamera can't work
commit 4d7bccd76b8d162d2fdd30150444e7ad9cdaedbb Author: jiyu.yang <jiyu.yang@amlogic.com> Date: Mon Jan 13 12:34:07 2014 +0800 PD#85561 fix meiyancamera can't work commit e2f3b161b93d0263e5487bad837ce0bef480d4e9 Author: jiyu.yang <jiyu.yang@amlogic.com> Date: Thu Jan 9 15:06:20 2014 +0800 PD#85561 stopPreview without takePicture check
Diffstat
-rwxr-xr-xAppCallbackNotifier.cpp4
-rwxr-xr-xCameraHal.cpp9
-rwxr-xr-xinc/CameraHal.h1
-rwxr-xr-xutils/DebugUtils.h4
4 files changed, 12 insertions, 6 deletions
diff --git a/AppCallbackNotifier.cpp b/AppCallbackNotifier.cpp
index 9f7ffd3..197c604 100755
--- a/AppCallbackNotifier.cpp
+++ b/AppCallbackNotifier.cpp
@@ -479,8 +479,8 @@ static void copy2Dto1D(void *dst,
unsigned int *y_uv = (unsigned int *)src;
- CAMHAL_LOGDB("copy2Dto1D() y= 0x%x ; uv=0x%x.",y_uv[0], y_uv[1]);
- CAMHAL_LOGDB("pixelFormat= %s; offset=%d; length=%d;width=%d,%d;stride=%d;",
+ CAMHAL_LOGVB("copy2Dto1D() y= 0x%x ; uv=0x%x.",y_uv[0], y_uv[1]);
+ CAMHAL_LOGVB("pixelFormat= %s; offset=%d; length=%d;width=%d,%d;stride=%d;",
pixelFormat,offset,length,width,height,stride);
if (pixelFormat!=NULL) {
diff --git a/CameraHal.cpp b/CameraHal.cpp
index a46f94b..948afb1 100755
--- a/CameraHal.cpp
+++ b/CameraHal.cpp
@@ -1566,6 +1566,7 @@ status_t CameraHal::startPreview()
LOG_FUNCTION_NAME;
+ refCount ++;
if ( mPreviewEnabled ){
CAMHAL_LOGDA("Preview already running");
LOG_FUNCTION_NAME_EXIT;
@@ -1885,20 +1886,22 @@ void CameraHal::stopPreview()
{
LOG_FUNCTION_NAME;
+ refCount --;
if( (!previewEnabled() && !mDisplayPaused) || mRecordingEnabled)
{
- LOG_FUNCTION_NAME_EXIT;
+ CAMHAL_LOGDA("direct return1\n");
return;
}
bool imageCaptureRunning = (mCameraAdapter->getState() == CameraAdapter::CAPTURE_STATE) &&
(mCameraAdapter->getNextState() != CameraAdapter::PREVIEW_STATE);
- if(mDisplayPaused && !imageCaptureRunning)
+ if(mDisplayPaused && !imageCaptureRunning && (refCount>=0))
{
// Display is paused, which essentially means there is no preview active.
// Note: this is done so that when stopPreview is called by client after
// an image capture, we do not de-initialize the camera adapter and
// restart over again.
+ CAMHAL_LOGDA("direct return2\n");
return;
}
@@ -1909,6 +1912,7 @@ void CameraHal::stopPreview()
CAMHAL_LOGDA("Resetting Capture-Mode to default");
mParameters.set(ExCameraParameters::KEY_CAP_MODE, "");
+ refCount =0;
LOG_FUNCTION_NAME_EXIT;
}
@@ -2980,6 +2984,7 @@ CameraHal::CameraHal(int cameraId)
#else
SYS_close_video();
#endif
+ refCount = 0;
LOG_FUNCTION_NAME_EXIT;
}
diff --git a/inc/CameraHal.h b/inc/CameraHal.h
index 28320b4..8828d90 100755
--- a/inc/CameraHal.h
+++ b/inc/CameraHal.h
@@ -1255,6 +1255,7 @@ private:
int mVideoWidth;
int mVideoHeight;
+ int refCount;
};
diff --git a/utils/DebugUtils.h b/utils/DebugUtils.h
index 56afc00..05eed19 100755
--- a/utils/DebugUtils.h
+++ b/utils/DebugUtils.h
@@ -67,8 +67,8 @@ extern volatile int32_t gCamHal_LogLevel;
#define LOG_FUNCTION_NAME CAMHAL_LOGVA("ENTER");
#define LOG_FUNCTION_NAME_EXIT CAMHAL_LOGVA("EXIT");
-#define DBG_LOGA(str) ALOGI_IF(gCamHal_LogLevel >=4,"%5d %s - " str, __LINE__,__FUNCTION__);
-#define DBG_LOGB(str, ...) ALOGI_IF(gCamHal_LogLevel >=4,"%5d %s - " str, __LINE__,__FUNCTION__, __VA_ARGS__);
+#define DBG_LOGA(str) ALOGI_IF(gCamHal_LogLevel >=4,"%10s-%5d %s - " str, CAMHAL_BUILD_NAME, __LINE__,__FUNCTION__)
+#define DBG_LOGB(str, ...) ALOGI_IF(gCamHal_LogLevel >=4,"%10s-%5d %s - " str, CAMHAL_BUILD_NAME, __LINE__,__FUNCTION__, __VA_ARGS__);
#endif