diff options
author | Daniel Levin <dendy@ti.com> | 2011-11-17 12:27:02 -0600 |
---|---|---|
committer | Daniel Levin <dendy@ti.com> | 2012-07-25 08:55:37 -0500 |
commit | de2c98bac5c44d049fa7d38ac0173e873eeba298 (patch) | |
tree | 466fce0928905ef599af1df8a83d39f7ee75e117 /camera | |
parent | 011e176967b3275582b8d8f0170aadb3c42334c8 (diff) | |
download | hardware_ti_omap4-de2c98bac5c44d049fa7d38ac0173e873eeba298.zip hardware_ti_omap4-de2c98bac5c44d049fa7d38ac0173e873eeba298.tar.gz hardware_ti_omap4-de2c98bac5c44d049fa7d38ac0173e873eeba298.tar.bz2 |
CameraHAL: Improved debug logging
0. Renamed DEBUG_LOG macro to CAMERAHAL_DEBUG and moved it
from CameraHal.h into Android.mk.
To enable debug logging next variable should be put into
$AFS/buildspec.mk:
TI_CAMERAHAL_DEBUG_ENABLED := 1
To enable verbose debug logging next variable should be put
into $AFS/buildspec.mk:
TI_CAMERAHAL_VERBOSE_DEBUG_ENABLED := 1
1. CAMHAL_LOG*A and CAMHAL_LOG*B macros have been united
into single CAMHAL_LOG* macro that accepts both variants.
2. Rewritten LOG_FUNCTION_NAME/LOG_FUNCTION_NAME_EXIT macros.
Now they do operate on internal FunctionLogger class instance
that does function enter/exit logging in constructor/destructor.
If LOG_FUNCTION_NAME is used then LOG_FUNCTION_NAME_EXIT
can be skipped in source code, in this case destructor
will correctly print function exit entry.
3. Added optional printing message timestamps.
To enable timestamp printing next variable should be put into
$AFS/buildspec.mk:
TI_CAMERAHAL_DEBUG_TIMESTAMPS := 1
4. Moved LOG_TAG macro definition from all CameraHAL sources to
Android.mk.
5. Added printing message thread ids.
6. Added printing per thread call stack indentation to visualize
call hierarchy.
7. Added CAMHAL_ASSERT(condition) and
CAMHAL_ASSERT_X(condition,description) macros to assert
conditions at runtime and abort process on failure.
8. Added CAMHAL_UNUSED(x) to mark unused variables which are
not mistakes.
9. Added next variables to enable debug logging for MessageQueue,
that should be put into $AFS/buildspec.mk:
TI_UTILS_MESSAGE_QUEUE_DEBUG_ENABLED := 1
TI_UTILS_MESSAGE_QUEUE_DEBUG_FUNCTION_NAMES := 1
Signed-off-by: Daniel Levin <dendy@ti.com>
Change-Id: I8ebea607199de621860ada6dfcab9164ba85674a
Diffstat (limited to 'camera')
25 files changed, 97 insertions, 146 deletions
diff --git a/camera/ANativeWindowDisplayAdapter.cpp b/camera/ANativeWindowDisplayAdapter.cpp index fa4e1d1..a2e7329 100644 --- a/camera/ANativeWindowDisplayAdapter.cpp +++ b/camera/ANativeWindowDisplayAdapter.cpp @@ -14,11 +14,6 @@ * limitations under the License. */ - - - -#define LOG_TAG "CameraHAL" - #include "ANativeWindowDisplayAdapter.h" #include <OMX_IVCommon.h> #include <ui/GraphicBuffer.h> diff --git a/camera/Android.mk b/camera/Android.mk index 4a76cd1..649d528 100644 --- a/camera/Android.mk +++ b/camera/Android.mk @@ -5,6 +5,28 @@ LOCAL_PATH:= $(call my-dir) OMAP4_CAMERA_HAL_USES:= OMX # OMAP4_CAMERA_HAL_USES:= USB +ifdef TI_CAMERAHAL_DEBUG_ENABLED + # Enable CameraHAL debug logs + CAMERAHAL_CFLAGS += -DCAMERAHAL_DEBUG +endif + +ifdef TI_CAMERAHAL_VERBOSE_DEBUG_ENABLED + # Enable CameraHAL verbose debug logs + CAMERAHAL_CFLAGS += -DCAMERAHAL_DEBUG_VERBOSE +endif + +ifdef TI_CAMERAHAL_DEBUG_FUNCTION_NAMES + # Enable CameraHAL function enter/exit logging + CAMERAHAL_CFLAGS += -DTI_UTILS_FUNCTION_LOGGER_ENABLE +endif + +ifdef TI_CAMERAHAL_DEBUG_TIMESTAMPS + # Enable timestamp logging + CAMERAHAL_CFLAGS += -DTI_UTILS_DEBUG_USE_TIMESTAMPS +endif + +CAMERAHAL_CFLAGS += -DLOG_TAG=\"CameraHal\" + OMAP4_CAMERA_HAL_SRC := \ CameraHal_Module.cpp \ CameraHal.cpp \ @@ -84,7 +106,7 @@ LOCAL_SHARED_LIBRARIES:= \ libjpeg \ libexif -LOCAL_CFLAGS := -fno-short-enums -DCOPY_IMAGE_BUFFER +LOCAL_CFLAGS := -fno-short-enums -DCOPY_IMAGE_BUFFER $(CAMERAHAL_CFLAGS) LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw LOCAL_MODULE:= camera.$(TARGET_BOARD_PLATFORM) @@ -127,7 +149,7 @@ LOCAL_SHARED_LIBRARIES:= \ libcamera_client \ libion \ -LOCAL_CFLAGS := -fno-short-enums -DCOPY_IMAGE_BUFFER +LOCAL_CFLAGS := -fno-short-enums -DCOPY_IMAGE_BUFFER $(CAMERAHAL_CFLAGS) LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw LOCAL_MODULE:= camera.$(TARGET_BOARD_PLATFORM) diff --git a/camera/AppCallbackNotifier.cpp b/camera/AppCallbackNotifier.cpp index df8a8de..bec2e68 100644 --- a/camera/AppCallbackNotifier.cpp +++ b/camera/AppCallbackNotifier.cpp @@ -14,12 +14,6 @@ * limitations under the License. */ - - - -#define LOG_TAG "CameraHAL" - - #include "CameraHal.h" #include "VideoMetadata.h" #include "Encoder_libjpeg.h" @@ -1128,6 +1122,8 @@ void AppCallbackNotifier::frameCallback(CameraFrame* caFrame) void AppCallbackNotifier::flushAndReturnFrames() { + LOG_FUNCTION_NAME; + TIUTILS::Message msg; CameraFrame *frame; @@ -1443,7 +1439,7 @@ status_t AppCallbackNotifier::startPreviewCallbacks(CameraParameters ¶ms, vo mPreviewing = true; - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return NO_ERROR; } diff --git a/camera/BaseCameraAdapter.cpp b/camera/BaseCameraAdapter.cpp index df287c5..b844a30 100644 --- a/camera/BaseCameraAdapter.cpp +++ b/camera/BaseCameraAdapter.cpp @@ -14,10 +14,6 @@ * limitations under the License. */ - - -#define LOG_TAG "CameraHAL" - #include "BaseCameraAdapter.h" namespace android { @@ -311,7 +307,7 @@ void BaseCameraAdapter::returnFrame(void* frameBuf, CameraFrame::FrameType frame //check if someone is holding this buffer if ( 0 == refCount ) { -#ifdef DEBUG_LOG +#ifdef CAMERAHAL_DEBUG if(mBuffersWithDucati.indexOfKey((int)frameBuf)>=0) { LOGE("Buffer already with Ducati!! 0x%x", frameBuf); @@ -1080,7 +1076,7 @@ status_t BaseCameraAdapter::notifyShutterSubscribers() shutterEvent.mEventData.clear(); - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } diff --git a/camera/CameraHal.cpp b/camera/CameraHal.cpp index 2170b15..2ce7499 100644 --- a/camera/CameraHal.cpp +++ b/camera/CameraHal.cpp @@ -21,8 +21,6 @@ * */ -#define LOG_TAG "CameraHAL" - #include "CameraHal.h" #include "ANativeWindowDisplayAdapter.h" #include "TICameraParameters.h" @@ -1163,7 +1161,7 @@ status_t CameraHal::allocPreviewDataBufs(size_t size, size_t bufferCount) mPreviewDataOffsets = NULL; } - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } @@ -1236,7 +1234,7 @@ status_t CameraHal::allocImageBufs(unsigned int width, unsigned int height, size mImageOffsets = NULL; } - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } @@ -1284,7 +1282,7 @@ status_t CameraHal::allocVideoBufs(uint32_t width, uint32_t height, uint32_t buf } exit: - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } @@ -1324,7 +1322,7 @@ status_t CameraHal::allocRawBufs(int width, int height, const char* previewForma mVideoOffsets = NULL; } - LOG_FUNCTION_NAME + LOG_FUNCTION_NAME_EXIT; return ret; } diff --git a/camera/CameraHalUtilClasses.cpp b/camera/CameraHalUtilClasses.cpp index 073c2b8..0cb5c35 100644 --- a/camera/CameraHalUtilClasses.cpp +++ b/camera/CameraHalUtilClasses.cpp @@ -21,9 +21,6 @@ * */ -#define LOG_TAG "CameraHAL" - - #include "CameraHal.h" namespace android { diff --git a/camera/CameraHal_Module.cpp b/camera/CameraHal_Module.cpp index 511cbc2..9f94bb8 100644 --- a/camera/CameraHal_Module.cpp +++ b/camera/CameraHal_Module.cpp @@ -21,8 +21,6 @@ * */ -#define LOG_TAG "CameraHAL" - #include <utils/threads.h> #include "CameraHal.h" diff --git a/camera/Encoder_libjpeg.cpp b/camera/Encoder_libjpeg.cpp index 7a6054f..deed61a 100644 --- a/camera/Encoder_libjpeg.cpp +++ b/camera/Encoder_libjpeg.cpp @@ -23,8 +23,6 @@ * */ -#define LOG_TAG "CameraHAL" - #include "CameraHal.h" #include "Encoder_libjpeg.h" #include "NV12_resize.h" diff --git a/camera/MemoryManager.cpp b/camera/MemoryManager.cpp index a817518..b6a1390 100644 --- a/camera/MemoryManager.cpp +++ b/camera/MemoryManager.cpp @@ -14,11 +14,6 @@ * limitations under the License. */ - - -#define LOG_TAG "CameraHAL" - - #include "CameraHal.h" #include "TICameraParameters.h" diff --git a/camera/NV12_resize.c b/camera/NV12_resize.c index 03c049e..9191d16 100644 --- a/camera/NV12_resize.c +++ b/camera/NV12_resize.c @@ -4,7 +4,11 @@ #define LOG_NIDEBUG 0 #define LOG_NDDEBUG 0 +#ifdef LOG_TAG +#undef LOG_TAG +#endif #define LOG_TAG "NV12_resize" + #define STRIDE 4096 #include <utils/Log.h> diff --git a/camera/OMXCameraAdapter/OMX3A.cpp b/camera/OMXCameraAdapter/OMX3A.cpp index 06571d2..8ccacf4 100644 --- a/camera/OMXCameraAdapter/OMX3A.cpp +++ b/camera/OMXCameraAdapter/OMX3A.cpp @@ -21,10 +21,6 @@ * */ -#undef LOG_TAG - -#define LOG_TAG "CameraHAL" - #include "CameraHal.h" #include "OMXCameraAdapter.h" #include "ErrorUtils.h" diff --git a/camera/OMXCameraAdapter/OMXAlgo.cpp b/camera/OMXCameraAdapter/OMXAlgo.cpp index b3fad0f..71274d8 100644 --- a/camera/OMXCameraAdapter/OMXAlgo.cpp +++ b/camera/OMXCameraAdapter/OMXAlgo.cpp @@ -21,10 +21,6 @@ * */ -#undef LOG_TAG - -#define LOG_TAG "CameraHAL" - #include "CameraHal.h" #include "OMXCameraAdapter.h" #include "ErrorUtils.h" diff --git a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp index e207803..ea896bb 100644 --- a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp +++ b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp @@ -38,10 +38,6 @@ static int mDebugFcs = 0; namespace android { -#undef LOG_TAG -///Maintain a separate tag for OMXCameraAdapter logs to isolate issues OMX specific -#define LOG_TAG "CameraHAL" - //frames skipped before recalculating the framerate #define FPS_PERIOD 30 @@ -346,6 +342,8 @@ OMXCameraAdapter::OMXCameraPortParameters *OMXCameraAdapter::getPortParams(Camer status_t OMXCameraAdapter::fillThisBuffer(void* frameBuf, CameraFrame::FrameType frameType) { + LOG_FUNCTION_NAME; + status_t ret = NO_ERROR; OMXCameraPortParameters *port = NULL; OMX_ERRORTYPE eError = OMX_ErrorNone; @@ -914,6 +912,8 @@ status_t OMXCameraAdapter::setFormat(OMX_U32 port, OMXCameraPortParameters &port status_t OMXCameraAdapter::flushBuffers() { + LOG_FUNCTION_NAME; + status_t ret = NO_ERROR; OMX_ERRORTYPE eError = OMX_ErrorNone; @@ -924,8 +924,6 @@ status_t OMXCameraAdapter::flushBuffers() return NO_INIT; } - LOG_FUNCTION_NAME; - OMXCameraPortParameters * mPreviewData = NULL; mPreviewData = &mCameraAdapterParameters.mCameraPortParams[mCameraAdapterParameters.mPrevPortIndex]; @@ -1160,7 +1158,7 @@ status_t OMXCameraAdapter::switchToExecuting() msg.arg1 = mErrorNotifier; ret = mCommandHandler->put(&msg); - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } @@ -2273,7 +2271,7 @@ status_t OMXCameraAdapter::autoFocus() EXIT: - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } @@ -3005,7 +3003,7 @@ OMX_ERRORTYPE OMXCameraAdapter::OMXCameraAdapterFillBufferDone(OMX_IN OMX_HANDLE mFramesWithDucati--; -#ifdef DEBUG_LOG +#ifdef CAMERAHAL_DEBUG if(mBuffersWithDucati.indexOfKey((int)pBuffHeader->pBuffer)<0) { LOGE("Buffer was never with Ducati!! 0x%x", pBuffHeader->pBuffer); diff --git a/camera/OMXCameraAdapter/OMXCapabilities.cpp b/camera/OMXCameraAdapter/OMXCapabilities.cpp index 30977ec..ada6491 100644 --- a/camera/OMXCameraAdapter/OMXCapabilities.cpp +++ b/camera/OMXCameraAdapter/OMXCapabilities.cpp @@ -28,11 +28,6 @@ namespace android { -#undef LOG_TAG - -// Maintain a separate tag for OMXCameraAdapter logs to isolate issues OMX specific -#define LOG_TAG "CameraHAL" - /************************************ * global constants and variables *************************************/ @@ -485,7 +480,7 @@ status_t OMXCameraAdapter::insertImageSizes(CameraProperties::Properties* params params->set(CameraProperties::SUPPORTED_PICTURE_SIZES, supported); } - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } @@ -523,7 +518,7 @@ status_t OMXCameraAdapter::insertPreviewSizes(CameraProperties::Properties* para params->set(CameraProperties::SUPPORTED_PREVIEW_SIZES, supported); } - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } @@ -549,7 +544,7 @@ status_t OMXCameraAdapter::insertVideoSizes(CameraProperties::Properties* params params->set(CameraProperties::SUPPORTED_VIDEO_SIZES, supported); } - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } @@ -576,7 +571,7 @@ status_t OMXCameraAdapter::insertThumbSizes(CameraProperties::Properties* params params->set(CameraProperties::SUPPORTED_THUMBNAIL_SIZES, supported); } - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } @@ -608,7 +603,7 @@ status_t OMXCameraAdapter::insertZoomStages(CameraProperties::Properties* params params->set(CameraProperties::SMOOTH_ZOOM_SUPPORTED, TICameraParameters::ZOOM_SUPPORTED); } - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } @@ -641,7 +636,7 @@ status_t OMXCameraAdapter::insertImageFormats(CameraProperties::Properties* para params->set(CameraProperties::SUPPORTED_PICTURE_FORMATS, supported); } - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } @@ -673,7 +668,7 @@ status_t OMXCameraAdapter::insertPreviewFormats(CameraProperties::Properties* pa params->set(CameraProperties::SUPPORTED_PREVIEW_FORMATS, supported); } - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } @@ -699,7 +694,7 @@ status_t OMXCameraAdapter::insertFramerates(CameraProperties::Properties* params params->set(CameraProperties::SUPPORTED_PREVIEW_FRAME_RATES, supported); } - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } @@ -731,7 +726,7 @@ status_t OMXCameraAdapter::insertVFramerates(CameraProperties::Properties* param CAMHAL_LOGDB("Default framerate range: [%s]", DEFAULT_FRAMERATE_RANGE_IMAGE); } - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } @@ -750,7 +745,7 @@ status_t OMXCameraAdapter::insertEVs(CameraProperties::Properties* params, OMX_T snprintf(supported, MAX_PROP_VALUE_LENGTH, "%d", ( int ) ( caps.xEVCompensationMax * 10 )); params->set(CameraProperties::SUPPORTED_EV_MAX, supported); - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } @@ -774,7 +769,7 @@ status_t OMXCameraAdapter::insertISOModes(CameraProperties::Properties* params, params->set(CameraProperties::SUPPORTED_ISO_VALUES, supported); } - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } @@ -809,7 +804,7 @@ status_t OMXCameraAdapter::insertIPPModes(CameraProperties::Properties* params, remove_last_sep(supported); params->set(CameraProperties::SUPPORTED_IPP_MODES, supported); - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } @@ -833,7 +828,7 @@ status_t OMXCameraAdapter::insertWBModes(CameraProperties::Properties* params, O params->set(CameraProperties::SUPPORTED_WHITE_BALANCE, supported); - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } @@ -857,7 +852,7 @@ status_t OMXCameraAdapter::insertEffects(CameraProperties::Properties* params, O remove_last_sep(supported); params->set(CameraProperties::SUPPORTED_EFFECTS, supported); - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } @@ -881,7 +876,7 @@ status_t OMXCameraAdapter::insertExpModes(CameraProperties::Properties* params, params->set(CameraProperties::SUPPORTED_EXPOSURE_MODES, supported); - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } @@ -911,7 +906,7 @@ status_t OMXCameraAdapter::insertFlashModes(CameraProperties::Properties* params remove_last_sep(supported); params->set(CameraProperties::SUPPORTED_FLASH_MODES, supported); - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } @@ -936,7 +931,7 @@ status_t OMXCameraAdapter::insertSceneModes(CameraProperties::Properties* params remove_last_sep(supported); params->set(CameraProperties::SUPPORTED_SCENE_MODES, supported); - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } @@ -972,7 +967,7 @@ status_t OMXCameraAdapter::insertFocusModes(CameraProperties::Properties* params params->set(CameraProperties::SUPPORTED_FOCUS_MODES, supported); - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } @@ -996,7 +991,7 @@ status_t OMXCameraAdapter::insertFlickerModes(CameraProperties::Properties* para remove_last_sep(supported); params->set(CameraProperties::SUPPORTED_ANTIBANDING, supported); - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } @@ -1019,7 +1014,7 @@ status_t OMXCameraAdapter::insertAreas(CameraProperties::Properties* params, OMX params->set(CameraProperties::MAX_NUM_METERING_AREAS, supported); CAMHAL_LOGDB("Maximum supported exposure areas %s", supported); - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } @@ -1032,7 +1027,7 @@ status_t OMXCameraAdapter::insertLocks(CameraProperties::Properties* params, OMX params->set(CameraProperties::AUTO_EXPOSURE_LOCK_SUPPORTED, DEFAULT_LOCK_SUPPORTED); params->set(CameraProperties::AUTO_WHITEBALANCE_LOCK_SUPPORTED, DEFAULT_LOCK_SUPPORTED); - LOG_FUNCTION_NAME + LOG_FUNCTION_NAME_EXIT return ret; } @@ -1097,7 +1092,7 @@ status_t OMXCameraAdapter::insertDefaults(CameraProperties::Properties* params, params->set(CameraProperties::PREFERRED_PREVIEW_SIZE_FOR_VIDEO, DEFAULT_PREFERRED_PREVIEW_SIZE_FOR_VIDEO); params->set(CameraProperties::SENSOR_ORIENTATION, DEFAULT_SENSOR_ORIENTATION); - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } @@ -1130,7 +1125,7 @@ status_t OMXCameraAdapter::insertSenMount(CameraProperties::Properties* params, // 2) Assign mounting rotation params->set(CameraProperties::ORIENTATION_INDEX, caps.tSenMounting.nRotation); - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } diff --git a/camera/OMXCameraAdapter/OMXCapture.cpp b/camera/OMXCameraAdapter/OMXCapture.cpp index 5e102c5..32c0666 100644 --- a/camera/OMXCameraAdapter/OMXCapture.cpp +++ b/camera/OMXCameraAdapter/OMXCapture.cpp @@ -21,10 +21,6 @@ * */ -#undef LOG_TAG - -#define LOG_TAG "CameraHAL" - #include "CameraHal.h" #include "OMXCameraAdapter.h" #include "ErrorUtils.h" diff --git a/camera/OMXCameraAdapter/OMXDefaults.cpp b/camera/OMXCameraAdapter/OMXDefaults.cpp index 9099bb5..891e595 100644 --- a/camera/OMXCameraAdapter/OMXDefaults.cpp +++ b/camera/OMXCameraAdapter/OMXDefaults.cpp @@ -26,9 +26,6 @@ namespace android { -#undef LOG_TAG -#define LOG_TAG "CameraHAL" - #define __STRINGIFY(s) __STRING(s) // OMX Camera defaults diff --git a/camera/OMXCameraAdapter/OMXExif.cpp b/camera/OMXCameraAdapter/OMXExif.cpp index 4c5e555..f931510 100644 --- a/camera/OMXCameraAdapter/OMXExif.cpp +++ b/camera/OMXCameraAdapter/OMXExif.cpp @@ -21,10 +21,6 @@ * */ -#undef LOG_TAG - -#define LOG_TAG "CameraHAL" - #include "CameraHal.h" #include "OMXCameraAdapter.h" #include <math.h> diff --git a/camera/OMXCameraAdapter/OMXFD.cpp b/camera/OMXCameraAdapter/OMXFD.cpp index 73d07ae..49d202b 100644 --- a/camera/OMXCameraAdapter/OMXFD.cpp +++ b/camera/OMXCameraAdapter/OMXFD.cpp @@ -21,10 +21,6 @@ * */ -#undef LOG_TAG - -#define LOG_TAG "CameraHAL" - #include "CameraHal.h" #include "OMXCameraAdapter.h" @@ -331,8 +327,6 @@ status_t OMXCameraAdapter::encodeFaceCoordinates(const OMX_FACEDETECTIONTYPE *fa return EINVAL; } - LOG_FUNCTION_NAME - hRange = CameraFDResult::RIGHT - CameraFDResult::LEFT; vRange = CameraFDResult::BOTTOM - CameraFDResult::TOP; diff --git a/camera/OMXCameraAdapter/OMXFocus.cpp b/camera/OMXCameraAdapter/OMXFocus.cpp index 3a882f4..014e8f5 100644 --- a/camera/OMXCameraAdapter/OMXFocus.cpp +++ b/camera/OMXCameraAdapter/OMXFocus.cpp @@ -22,10 +22,6 @@ * */ -#undef LOG_TAG - -#define LOG_TAG "CameraHAL" - #include "CameraHal.h" #include "OMXCameraAdapter.h" #include "ErrorUtils.h" @@ -72,7 +68,7 @@ status_t OMXCameraAdapter::setParametersFocus(const CameraParameters ¶ms, } } - LOG_FUNCTION_NAME; + LOG_FUNCTION_NAME_EXIT; return ret; } diff --git a/camera/OMXCameraAdapter/OMXZoom.cpp b/camera/OMXCameraAdapter/OMXZoom.cpp index eec7691..478fd81 100644 --- a/camera/OMXCameraAdapter/OMXZoom.cpp +++ b/camera/OMXCameraAdapter/OMXZoom.cpp @@ -21,10 +21,6 @@ * */ -#undef LOG_TAG - -#define LOG_TAG "CameraHAL" - #include "CameraHal.h" #include "OMXCameraAdapter.h" diff --git a/camera/SensorListener.cpp b/camera/SensorListener.cpp index bb6f577..00835b3 100644 --- a/camera/SensorListener.cpp +++ b/camera/SensorListener.cpp @@ -21,8 +21,6 @@ * */ -#define LOG_TAG "CameraHAL" - #include "SensorListener.h" #include "CameraHal.h" diff --git a/camera/TICameraParameters.cpp b/camera/TICameraParameters.cpp index e3f2645..a2c9f26 100644 --- a/camera/TICameraParameters.cpp +++ b/camera/TICameraParameters.cpp @@ -14,10 +14,6 @@ * limitations under the License. */ - - - -#define LOG_TAG "CameraHAL" #include <utils/Log.h> #include <string.h> diff --git a/camera/V4LCameraAdapter/V4LCameraAdapter.cpp b/camera/V4LCameraAdapter/V4LCameraAdapter.cpp index 3fb3380..44904f3 100644 --- a/camera/V4LCameraAdapter/V4LCameraAdapter.cpp +++ b/camera/V4LCameraAdapter/V4LCameraAdapter.cpp @@ -48,10 +48,6 @@ static int mDebugFps = 0; namespace android { -#undef LOG_TAG -///Maintain a separate tag for V4LCameraAdapter logs to isolate issues OMX specific -#define LOG_TAG "CameraHAL" - //frames skipped before recalculating the framerate #define FPS_PERIOD 30 diff --git a/camera/inc/BaseCameraAdapter.h b/camera/inc/BaseCameraAdapter.h index d778491..b358427 100644 --- a/camera/inc/BaseCameraAdapter.h +++ b/camera/inc/BaseCameraAdapter.h @@ -258,7 +258,7 @@ protected: uint32_t mFramesWithDisplay; uint32_t mFramesWithEncoder; -#ifdef DEBUG_LOG +#ifdef CAMERAHAL_DEBUG KeyedVector<int, bool> mBuffersWithDucati; #endif diff --git a/camera/inc/CameraHal.h b/camera/inc/CameraHal.h index 9f3230b..fd3080e 100644 --- a/camera/inc/CameraHal.h +++ b/camera/inc/CameraHal.h @@ -79,43 +79,45 @@ #define CAMHAL_LOGI LOGI -//Uncomment to enable more verbose/debug logs -//#define DEBUG_LOG - -///Camera HAL Logging Functions -#ifndef DEBUG_LOG - -#define CAMHAL_LOGDA(str) -#define CAMHAL_LOGDB(str, ...) -#define CAMHAL_LOGVA(str) -#define CAMHAL_LOGVB(str, ...) - -#define CAMHAL_LOGEA LOGE -#define CAMHAL_LOGEB LOGE - -#undef LOG_FUNCTION_NAME -#undef LOG_FUNCTION_NAME_EXIT -#define LOG_FUNCTION_NAME -#define LOG_FUNCTION_NAME_EXIT - +// logging functions +#ifdef CAMERAHAL_DEBUG +# define CAMHAL_LOGD DBGUTILS_LOGD +# define CAMHAL_LOGDA DBGUTILS_LOGDA +# define CAMHAL_LOGDB DBGUTILS_LOGDB +# ifdef CAMERAHAL_DEBUG_VERBOSE +# define CAMHAL_LOGV DBGUTILS_LOGV +# define CAMHAL_LOGVA DBGUTILS_LOGVA +# define CAMHAL_LOGVB DBGUTILS_LOGVB +# else +# define CAMHAL_LOGV(...) +# define CAMHAL_LOGVA(str) +# define CAMHAL_LOGVB(str, ...) +# endif #else +# define CAMHAL_LOGD(...) +# define CAMHAL_LOGDA(str) +# define CAMHAL_LOGDB(str, ...) +# define CAMHAL_LOGV(...) +# define CAMHAL_LOGVA(str) +# define CAMHAL_LOGVB(str, ...) +#endif -#define CAMHAL_LOGDA DBGUTILS_LOGDA -#define CAMHAL_LOGDB DBGUTILS_LOGDB -#define CAMHAL_LOGVA DBGUTILS_LOGVA -#define CAMHAL_LOGVB DBGUTILS_LOGVB - +#define CAMHAL_LOGE DBGUTILS_LOGE #define CAMHAL_LOGEA DBGUTILS_LOGEA #define CAMHAL_LOGEB DBGUTILS_LOGEB +#define CAMHAL_LOGF DBGUTILS_LOGF -#endif - +#define CAMHAL_ASSERT DBGUTILS_ASSERT +#define CAMHAL_ASSERT_X DBGUTILS_ASSERT_X +#define CAMHAL_UNUSED(x) (void)x #define NONNEG_ASSIGN(x,y) \ if(x > -1) \ y = x +#define CAMHAL_SIZE_OF_ARRAY(x) static_cast<int>(sizeof(x)/sizeof(x[0])) + namespace android { #define PARAM_BUFFER 6000 |