Camera3: Clean up ALOGE calls in non-error conditions

Use ALOGI/ALOGD instead.

Bug: 12489802
Change-Id: Id7fc9147395af3a9a0fe135d1017a155aad174fb
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
This commit is contained in:
Shuzhen Wang 2014-01-13 17:29:48 -08:00 committed by Artem Borisov
parent e73f66ef6b
commit d00b95ed3c
10 changed files with 36 additions and 38 deletions

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2013, The Linux Foundataion. All rights reserved. /* Copyright (c) 2012-2014, The Linux Foundataion. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
@ -873,12 +873,12 @@ void QCamera3PicChannel::jpegEvtHandle(jpeg_job_status_t status,
if(obj->mJpegSettings->max_jpeg_size <= 0 || if(obj->mJpegSettings->max_jpeg_size <= 0 ||
obj->mJpegSettings->max_jpeg_size > obj->mMemory->getSize(obj->mCurrentBufIndex)){ obj->mJpegSettings->max_jpeg_size > obj->mMemory->getSize(obj->mCurrentBufIndex)){
ALOGE("%s:Max Jpeg size :%d is out of valid range setting to size of buffer", ALOGW("%s:Max Jpeg size :%d is out of valid range setting to size of buffer",
__func__, obj->mJpegSettings->max_jpeg_size); __func__, obj->mJpegSettings->max_jpeg_size);
maxJpegSize = obj->mMemory->getSize(obj->mCurrentBufIndex); maxJpegSize = obj->mMemory->getSize(obj->mCurrentBufIndex);
} else { } else {
maxJpegSize = obj->mJpegSettings->max_jpeg_size; maxJpegSize = obj->mJpegSettings->max_jpeg_size;
ALOGE("%s: Setting max jpeg size to %d",__func__, maxJpegSize); ALOGI("%s: Setting max jpeg size to %d",__func__, maxJpegSize);
} }
jpeg_eof = &jpeg_buf[maxJpegSize-sizeof(jpegHeader)]; jpeg_eof = &jpeg_buf[maxJpegSize-sizeof(jpegHeader)];
memcpy(jpeg_eof, &jpegHeader, sizeof(jpegHeader)); memcpy(jpeg_eof, &jpegHeader, sizeof(jpegHeader));

View File

@ -2917,10 +2917,8 @@ camera_metadata_t* QCamera3HardwareInterface::translateCapabilityToMetadata(int
static uint8_t focusMode; static uint8_t focusMode;
if (gCamCapability[mCameraId]->supported_focus_modes_cnt > 1) { if (gCamCapability[mCameraId]->supported_focus_modes_cnt > 1) {
ALOGE("%s: Setting focus mode to auto", __func__);
focusMode = ANDROID_CONTROL_AF_MODE_AUTO; focusMode = ANDROID_CONTROL_AF_MODE_AUTO;
} else { } else {
ALOGE("%s: Setting focus mode to off", __func__);
focusMode = ANDROID_CONTROL_AF_MODE_OFF; focusMode = ANDROID_CONTROL_AF_MODE_OFF;
} }
settings.update(ANDROID_CONTROL_AF_MODE, &focusMode, 1); settings.update(ANDROID_CONTROL_AF_MODE, &focusMode, 1);

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2013, The Linux Foundataion. All rights reserved. /* Copyright (c) 2012-2014, The Linux Foundataion. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
@ -385,10 +385,10 @@ int32_t QCamera3PostProcessor::processAuxiliaryData(mm_camera_buf_def_t *frame,
// enqueu to post proc input queue // enqueu to post proc input queue
m_inputPPQ.enqueue((void *)aux_frame); m_inputPPQ.enqueue((void *)aux_frame);
if (!(m_inputMetaQ.isEmpty())) { if (!(m_inputMetaQ.isEmpty())) {
ALOGE("%s: meta queue is not empty, do next job", __func__); ALOGI("%s: meta queue is not empty, do next job", __func__);
m_dataProcTh.sendCmd(CAMERA_CMD_TYPE_DO_NEXT_JOB, FALSE, FALSE); m_dataProcTh.sendCmd(CAMERA_CMD_TYPE_DO_NEXT_JOB, FALSE, FALSE);
} else { } else {
ALOGE("%s: meta queue is empty, not calling do next job", __func__); ALOGI("%s: meta queue is empty, not calling do next job", __func__);
} }
pthread_mutex_unlock(&mReprocJobLock); pthread_mutex_unlock(&mReprocJobLock);
} else { } else {
@ -479,10 +479,10 @@ int32_t QCamera3PostProcessor::processPPMetadata(mm_camera_super_buf_t *frame)
// enqueue to metadata input queue // enqueue to metadata input queue
m_inputMetaQ.enqueue((void *)frame); m_inputMetaQ.enqueue((void *)frame);
if (!(m_inputPPQ.isEmpty())) { if (!(m_inputPPQ.isEmpty())) {
ALOGE("%s: pp queue is not empty, do next job", __func__); ALOGI("%s: pp queue is not empty, do next job", __func__);
m_dataProcTh.sendCmd(CAMERA_CMD_TYPE_DO_NEXT_JOB, FALSE, FALSE); m_dataProcTh.sendCmd(CAMERA_CMD_TYPE_DO_NEXT_JOB, FALSE, FALSE);
} else { } else {
ALOGE("%s: pp queue is empty, not calling do next job", __func__); ALOGI("%s: pp queue is empty, not calling do next job", __func__);
} }
pthread_mutex_unlock(&mReprocJobLock); pthread_mutex_unlock(&mReprocJobLock);
return NO_ERROR; return NO_ERROR;
@ -1090,7 +1090,7 @@ void *QCamera3PostProcessor::dataProcessRoutine(void *data)
if (is_active == TRUE) { if (is_active == TRUE) {
// check if there is any ongoing jpeg jobs // check if there is any ongoing jpeg jobs
if (pme->m_ongoingJpegQ.isEmpty()) { if (pme->m_ongoingJpegQ.isEmpty()) {
ALOGE("%s: ongoing jpeg queue is empty so doing the jpeg job", __func__); ALOGI("%s: ongoing jpeg queue is empty so doing the jpeg job", __func__);
// no ongoing jpeg job, we are fine to send jpeg encoding job // no ongoing jpeg job, we are fine to send jpeg encoding job
qcamera_jpeg_data_t *jpeg_job = qcamera_jpeg_data_t *jpeg_job =
(qcamera_jpeg_data_t *)pme->m_inputJpegQ.dequeue(); (qcamera_jpeg_data_t *)pme->m_inputJpegQ.dequeue();
@ -1111,7 +1111,7 @@ void *QCamera3PostProcessor::dataProcessRoutine(void *data)
} }
} }
} }
ALOGE("%s: dequeuing pp frame", __func__); ALOGD("%s: dequeuing pp frame", __func__);
mm_camera_super_buf_t *pp_frame = mm_camera_super_buf_t *pp_frame =
(mm_camera_super_buf_t *)pme->m_inputPPQ.dequeue(); (mm_camera_super_buf_t *)pme->m_inputPPQ.dequeue();
if (NULL != pp_frame) { if (NULL != pp_frame) {

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2013, The Linux Foundataion. All rights reserved. /* Copyright (c) 2012-2014, The Linux Foundataion. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
@ -274,7 +274,7 @@ int32_t QCamera3Stream::init(cam_stream_type_t streamType,
mStreamInfo->streaming_mode = CAM_STREAMING_MODE_BURST; mStreamInfo->streaming_mode = CAM_STREAMING_MODE_BURST;
//mStreamInfo->num_of_burst = reprocess_config->offline.num_of_bufs; //mStreamInfo->num_of_burst = reprocess_config->offline.num_of_bufs;
mStreamInfo->num_of_burst = 1; mStreamInfo->num_of_burst = 1;
ALOGE("%s: num_of_burst is %d", __func__, mStreamInfo->num_of_burst); ALOGI("%s: num_of_burst is %d", __func__, mStreamInfo->num_of_burst);
} else { } else {
mStreamInfo->streaming_mode = CAM_STREAMING_MODE_CONTINUOUS; mStreamInfo->streaming_mode = CAM_STREAMING_MODE_CONTINUOUS;
} }

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
@ -248,14 +248,14 @@ int32_t mm_camera_open(mm_camera_obj_t *my_obj)
snprintf(dev_name, sizeof(dev_name), "/dev/%s", snprintf(dev_name, sizeof(dev_name), "/dev/%s",
mm_camera_util_get_dev_name(my_obj->my_hdl)); mm_camera_util_get_dev_name(my_obj->my_hdl));
sscanf(dev_name, "/dev/video%u", &cam_idx); sscanf(dev_name, "/dev/video%u", &cam_idx);
CDBG_ERROR("%s: dev name = %s, cam_idx = %d", __func__, dev_name, cam_idx); CDBG_HIGH("%s: dev name = %s, cam_idx = %d", __func__, dev_name, cam_idx);
do{ do{
n_try--; n_try--;
my_obj->ctrl_fd = open(dev_name, O_RDWR | O_NONBLOCK); my_obj->ctrl_fd = open(dev_name, O_RDWR | O_NONBLOCK);
CDBG("%s: ctrl_fd = %d, errno == %d", __func__, my_obj->ctrl_fd, errno); CDBG("%s: ctrl_fd = %d, errno == %d", __func__, my_obj->ctrl_fd, errno);
if((my_obj->ctrl_fd > 0) || (errno != EIO) || (n_try <= 0 )) { if((my_obj->ctrl_fd > 0) || (errno != EIO) || (n_try <= 0 )) {
CDBG_ERROR("%s: opened, break out while loop", __func__); CDBG_HIGH("%s: opened, break out while loop", __func__);
break; break;
} }
CDBG_HIGH("%s:failed with I/O error retrying after %d milli-seconds", CDBG_HIGH("%s:failed with I/O error retrying after %d milli-seconds",

View File

@ -1181,7 +1181,7 @@ int32_t mm_stream_qbuf(mm_stream_t *my_obj, mm_camera_buf_def_t *buf)
mm_camera_async_call); mm_camera_async_call);
CDBG_HIGH("%s: Started poll on stream %p type :%d", __func__, my_obj,my_obj->stream_info->stream_type); CDBG_HIGH("%s: Started poll on stream %p type :%d", __func__, my_obj,my_obj->stream_info->stream_type);
if (rc < 0) { if (rc < 0) {
ALOGE("%s: add poll fd error", __func__); CDBG_ERROR("%s: add poll fd error", __func__);
return rc; return rc;
} }
} }

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
@ -59,7 +59,7 @@
#endif #endif
#ifdef _ANDROID_ #ifdef _ANDROID_
#define CDBG_HIGH(fmt, args...) ALOGE(fmt, ##args) #define CDBG_HIGH(fmt, args...) ALOGI(fmt, ##args)
#define CDBG_ERROR(fmt, args...) ALOGE(fmt, ##args) #define CDBG_ERROR(fmt, args...) ALOGE(fmt, ##args)
#else #else
#define CDBG_HIGH(fmt, args...) fprintf(stderr, fmt, ##args) #define CDBG_HIGH(fmt, args...) fprintf(stderr, fmt, ##args)

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
@ -60,7 +60,7 @@
FILE *fp = fopen(filename, "w+"); \ FILE *fp = fopen(filename, "w+"); \
if (fp) { \ if (fp) { \
rc = fwrite(p_addr, 1, len, fp); \ rc = fwrite(p_addr, 1, len, fp); \
CDBG_ERROR("%s:%d] written size %d", __func__, __LINE__, len); \ CDBG_HIGH("%s:%d] written size %d", __func__, __LINE__, len); \
fclose(fp); \ fclose(fp); \
} else { \ } else { \
CDBG_ERROR("%s:%d] open %s failed", __func__, __LINE__, filename); \ CDBG_ERROR("%s:%d] open %s failed", __func__, __LINE__, filename); \
@ -80,7 +80,7 @@
if (fp) { \ if (fp) { \
rc = fwrite(p_addr1, 1, len1, fp); \ rc = fwrite(p_addr1, 1, len1, fp); \
rc = fwrite(p_addr2, 1, len2, fp); \ rc = fwrite(p_addr2, 1, len2, fp); \
CDBG_ERROR("%s:%d] written %d %d", __func__, __LINE__, len1, len2); \ CDBG_HIGH("%s:%d] written %d %d", __func__, __LINE__, len1, len2); \
fclose(fp); \ fclose(fp); \
} else { \ } else { \
CDBG_ERROR("%s:%d] open %s failed", __func__, __LINE__, filename); \ CDBG_ERROR("%s:%d] open %s failed", __func__, __LINE__, filename); \
@ -2245,12 +2245,12 @@ mm_jpeg_job_q_node_t* mm_jpeg_queue_remove_job_by_client_id(
data = (mm_jpeg_job_q_node_t *)node->data; data = (mm_jpeg_job_q_node_t *)node->data;
if (data && (data->enc_info.client_handle == client_hdl)) { if (data && (data->enc_info.client_handle == client_hdl)) {
CDBG_ERROR("%s:%d] found matching client handle", __func__, __LINE__); CDBG_HIGH("%s:%d] found matching client handle", __func__, __LINE__);
job_node = data; job_node = data;
cam_list_del_node(&node->list); cam_list_del_node(&node->list);
queue->size--; queue->size--;
free(node); free(node);
CDBG_ERROR("%s: queue size = %d", __func__, queue->size); CDBG_HIGH("%s: queue size = %d", __func__, queue->size);
break; break;
} }
pos = pos->next; pos = pos->next;
@ -2279,12 +2279,12 @@ mm_jpeg_job_q_node_t* mm_jpeg_queue_remove_job_by_session_id(
data = (mm_jpeg_job_q_node_t *)node->data; data = (mm_jpeg_job_q_node_t *)node->data;
if (data && (data->enc_info.encode_job.session_id == session_id)) { if (data && (data->enc_info.encode_job.session_id == session_id)) {
CDBG_ERROR("%s:%d] found matching session id", __func__, __LINE__); CDBG_HIGH("%s:%d] found matching session id", __func__, __LINE__);
job_node = data; job_node = data;
cam_list_del_node(&node->list); cam_list_del_node(&node->list);
queue->size--; queue->size--;
free(node); free(node);
CDBG_ERROR("%s: queue size = %d", __func__, queue->size); CDBG_HIGH("%s: queue size = %d", __func__, queue->size);
break; break;
} }
pos = pos->next; pos = pos->next;
@ -2313,7 +2313,7 @@ mm_jpeg_job_q_node_t* mm_jpeg_queue_remove_job_by_job_id(
data = (mm_jpeg_job_q_node_t *)node->data; data = (mm_jpeg_job_q_node_t *)node->data;
if (data && (data->enc_info.job_id == job_id)) { if (data && (data->enc_info.job_id == job_id)) {
CDBG_ERROR("%s:%d] found matching job id", __func__, __LINE__); CDBG_HIGH("%s:%d] found matching job id", __func__, __LINE__);
job_node = data; job_node = data;
cam_list_del_node(&node->list); cam_list_del_node(&node->list);
queue->size--; queue->size--;

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are

View File

@ -1,4 +1,4 @@
/*Copyright (c) 2012, The Linux Foundation. All rights reserved. /*Copyright (c) 2012, 2014, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are modification, are permitted provided that the following conditions are
@ -79,7 +79,7 @@ OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Init()
} else { } else {
rc = OMX_ErrorInsufficientResources; rc = OMX_ErrorInsufficientResources;
} }
ALOGE("%s:%d] Complete %d", __func__, __LINE__, comp_cnt); ALOGI("%s:%d] Complete %d", __func__, __LINE__, comp_cnt);
return rc; return rc;
} }
@ -96,7 +96,7 @@ OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Deinit()
free(g_omxcore); free(g_omxcore);
g_omxcore = NULL; g_omxcore = NULL;
} }
ALOGE("%s:%d] Complete", __func__, __LINE__); ALOGI("%s:%d] Complete", __func__, __LINE__);
return OMX_ErrorNone; return OMX_ErrorNone;
} }
@ -210,7 +210,7 @@ OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_GetHandle(
/* Call the function from the address to create the obj */ /* Call the function from the address to create the obj */
p_obj = (*p_core_comp->get_instance)(); p_obj = (*p_core_comp->get_instance)();
ALOGE("%s:%d] get instance pts is %p", __func__, __LINE__, p_obj); ALOGI("%s:%d] get instance pts is %p", __func__, __LINE__, p_obj);
if (NULL == p_obj) { if (NULL == p_obj) {
ALOGE("%s:%d] Error cannot create object", __func__, __LINE__); ALOGE("%s:%d] Error cannot create object", __func__, __LINE__);
rc = OMX_ErrorInvalidComponent; rc = OMX_ErrorInvalidComponent;
@ -234,7 +234,7 @@ OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_GetHandle(
p_comp->SetCallbacks(p_comp, callBacks, appData); p_comp->SetCallbacks(p_comp, callBacks, appData);
pthread_mutex_unlock(&g_omxcore->core_lock); pthread_mutex_unlock(&g_omxcore->core_lock);
ALOGE("%s:%d] Success", __func__, __LINE__); ALOGI("%s:%d] Success", __func__, __LINE__);
return OMX_ErrorNone; return OMX_ErrorNone;
error: error:
@ -264,7 +264,7 @@ static int get_idx_from_handle(OMX_IN OMX_HANDLETYPE *ahComp, int *aCompIdx,
for (j = 0; j < OMX_COMP_MAX_INSTANCES; j++) { for (j = 0; j < OMX_COMP_MAX_INSTANCES; j++) {
if ((OMX_COMPONENTTYPE *)g_omxcore->component[i].handle[j] == if ((OMX_COMPONENTTYPE *)g_omxcore->component[i].handle[j] ==
(OMX_COMPONENTTYPE *)ahComp) { (OMX_COMPONENTTYPE *)ahComp) {
ALOGE("%s:%d] comp_idx %d inst_idx %d", __func__, __LINE__, i, j); ALOGD("%s:%d] comp_idx %d inst_idx %d", __func__, __LINE__, i, j);
*aCompIdx = i; *aCompIdx = i;
*aInstIdx = j; *aInstIdx = j;
return TRUE; return TRUE;
@ -305,7 +305,7 @@ OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_FreeHandle(
OMX_COMPONENTTYPE *p_comp = NULL; OMX_COMPONENTTYPE *p_comp = NULL;
omx_core_component_t *p_core_comp = NULL; omx_core_component_t *p_core_comp = NULL;
ALOGE("%s:%d] ", __func__, __LINE__); ALOGV("%s:%d] ", __func__, __LINE__);
if (hComp == NULL) { if (hComp == NULL) {
return OMX_ErrorBadParameter; return OMX_ErrorBadParameter;
} }
@ -334,9 +334,9 @@ OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_FreeHandle(
p_core_comp->create_comp_func = NULL; p_core_comp->create_comp_func = NULL;
p_core_comp->open = FALSE; p_core_comp->open = FALSE;
} else { } else {
ALOGE("%s:%d] Error Component is still Active", __func__, __LINE__); ALOGI("%s:%d] Error Component is still Active", __func__, __LINE__);
} }
pthread_mutex_unlock(&g_omxcore->core_lock); pthread_mutex_unlock(&g_omxcore->core_lock);
ALOGE("%s:%d] Success", __func__, __LINE__); ALOGV("%s:%d] Success", __func__, __LINE__);
return rc; return rc;
} }