summaryrefslogtreecommitdiffstats
path: root/libcamera
diff options
context:
space:
mode:
Diffstat (limited to 'libcamera')
-rw-r--r--libcamera/Android.mk1
-rwxr-xr-xlibcamera/SecCamera.cpp544
-rwxr-xr-xlibcamera/SecCamera.h4
-rwxr-xr-xlibcamera/SecCameraHWInterface.cpp409
4 files changed, 472 insertions, 486 deletions
diff --git a/libcamera/Android.mk b/libcamera/Android.mk
index 4e9ac05..9abbf7e 100644
--- a/libcamera/Android.mk
+++ b/libcamera/Android.mk
@@ -9,6 +9,7 @@ LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../include
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../libs3cjpeg
+LOCAL_C_INCLUDES += frameworks/native/include/media/hardware
LOCAL_SRC_FILES:= \
SecCamera.cpp \
diff --git a/libcamera/SecCamera.cpp b/libcamera/SecCamera.cpp
index 2b09168..81bc3fb 100755
--- a/libcamera/SecCamera.cpp
+++ b/libcamera/SecCamera.cpp
@@ -39,7 +39,7 @@ using namespace android;
#define CHECK(return_value) \
if (return_value < 0) { \
- LOGE("%s::%d fail. errno: %s, m_camera_id = %d\n", \
+ ALOGE("%s::%d fail. errno: %s, m_camera_id = %d\n", \
__func__, __LINE__, strerror(errno), m_camera_id); \
return -1; \
}
@@ -47,7 +47,7 @@ using namespace android;
#define CHECK_PTR(return_value) \
if (return_value < 0) { \
- LOGE("%s::%d fail, errno: %s, m_camera_id = %d\n", \
+ ALOGE("%s::%d fail, errno: %s, m_camera_id = %d\n", \
__func__,__LINE__, strerror(errno), m_camera_id); \
return NULL; \
}
@@ -132,12 +132,12 @@ static int fimc_poll(struct pollfd *events)
*/
ret = poll(events, 1, 10000);
if (ret < 0) {
- LOGE("ERR(%s):poll error\n", __func__);
+ ALOGE("ERR(%s):poll error\n", __func__);
return ret;
}
if (ret == 0) {
- LOGE("ERR(%s):No data in 10 secs..\n", __func__);
+ ALOGE("ERR(%s):No data in 10 secs..\n", __func__);
return ret;
}
@@ -156,7 +156,7 @@ int SecCamera::previewPoll(bool preview)
status = getCameraSensorESDStatus();
m_esd_check_count = 0;
if (status) {
- LOGE("ERR(%s) ESD status(%d)", __func__, status);
+ ALOGE("ERR(%s) ESD status(%d)", __func__, status);
return status;
}
}
@@ -168,12 +168,12 @@ int SecCamera::previewPoll(bool preview)
}
if (ret < 0) {
- LOGE("ERR(%s):poll error\n", __func__);
+ ALOGE("ERR(%s):poll error\n", __func__);
return ret;
}
if (ret == 0) {
- LOGE("ERR(%s):No data in 1 secs.. Camera Device Reset \n", __func__);
+ ALOGE("ERR(%s):No data in 1 secs.. Camera Device Reset \n", __func__);
return ret;
}
@@ -188,12 +188,12 @@ static int fimc_v4l2_querycap(int fp)
ret = ioctl(fp, VIDIOC_QUERYCAP, &cap);
if (ret < 0) {
- LOGE("ERR(%s):VIDIOC_QUERYCAP failed\n", __func__);
+ ALOGE("ERR(%s):VIDIOC_QUERYCAP failed\n", __func__);
return -1;
}
if (!(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) {
- LOGE("ERR(%s):no capture devices\n", __func__);
+ ALOGE("ERR(%s):no capture devices\n", __func__);
return -1;
}
@@ -206,10 +206,10 @@ static const __u8* fimc_v4l2_enuminput(int fp, int index)
input.index = index;
if (ioctl(fp, VIDIOC_ENUMINPUT, &input) != 0) {
- LOGE("ERR(%s):No matching index found\n", __func__);
+ ALOGE("ERR(%s):No matching index found\n", __func__);
return NULL;
}
- LOGI("Name of input channel[%d] is %s\n", input.index, input.name);
+ ALOGI("Name of input channel[%d] is %s\n", input.index, input.name);
return input.name;
}
@@ -224,7 +224,7 @@ static int fimc_v4l2_s_input(int fp, int index)
ret = ioctl(fp, VIDIOC_S_INPUT, &input);
if (ret < 0) {
- LOGE("ERR(%s):VIDIOC_S_INPUT failed\n", __func__);
+ ALOGE("ERR(%s):VIDIOC_S_INPUT failed\n", __func__);
return ret;
}
@@ -254,7 +254,7 @@ static int fimc_v4l2_s_fmt(int fp, int width, int height, unsigned int fmt, int
/* Set up for capture */
ret = ioctl(fp, VIDIOC_S_FMT, &v4l2_fmt);
if (ret < 0) {
- LOGE("ERR(%s):VIDIOC_S_FMT failed\n", __func__);
+ ALOGE("ERR(%s):VIDIOC_S_FMT failed\n", __func__);
return -1;
}
@@ -282,12 +282,12 @@ static int fimc_v4l2_s_fmt_cap(int fp, int width, int height, unsigned int fmt)
v4l2_fmt.fmt.pix = pixfmt;
- //LOGE("ori_w %d, ori_h %d, w %d, h %d\n", width, height, v4l2_fmt.fmt.pix.width, v4l2_fmt.fmt.pix.height);
+ //ALOGE("ori_w %d, ori_h %d, w %d, h %d\n", width, height, v4l2_fmt.fmt.pix.width, v4l2_fmt.fmt.pix.height);
/* Set up for capture */
ret = ioctl(fp, VIDIOC_S_FMT, &v4l2_fmt);
if (ret < 0) {
- LOGE("ERR(%s):VIDIOC_S_FMT failed\n", __func__);
+ ALOGE("ERR(%s):VIDIOC_S_FMT failed\n", __func__);
return ret;
}
@@ -304,7 +304,7 @@ static int fimc_v4l2_enum_fmt(int fp, unsigned int fmt)
while (ioctl(fp, VIDIOC_ENUM_FMT, &fmtdesc) == 0) {
if (fmtdesc.pixelformat == fmt) {
- LOGV("passed fmt = %#x found pixel format[%d]: %s\n", fmt, fmtdesc.index, fmtdesc.description);
+ ALOGV("passed fmt = %#x found pixel format[%d]: %s\n", fmt, fmtdesc.index, fmtdesc.description);
found = 1;
break;
}
@@ -313,7 +313,7 @@ static int fimc_v4l2_enum_fmt(int fp, unsigned int fmt)
}
if (!found) {
- LOGE("unsupported pixel format\n");
+ ALOGE("unsupported pixel format\n");
return -1;
}
@@ -331,7 +331,7 @@ static int fimc_v4l2_reqbufs(int fp, enum v4l2_buf_type type, int nr_bufs)
ret = ioctl(fp, VIDIOC_REQBUFS, &req);
if (ret < 0) {
- LOGE("ERR(%s):VIDIOC_REQBUFS failed\n", __func__);
+ ALOGE("ERR(%s):VIDIOC_REQBUFS failed\n", __func__);
return -1;
}
@@ -343,7 +343,7 @@ static int fimc_v4l2_querybuf(int fp, struct fimc_buffer *buffer, enum v4l2_buf_
struct v4l2_buffer v4l2_buf;
int ret;
- LOGI("%s :", __func__);
+ ALOGI("%s :", __func__);
v4l2_buf.type = type;
v4l2_buf.memory = V4L2_MEMORY_MMAP;
@@ -351,7 +351,7 @@ static int fimc_v4l2_querybuf(int fp, struct fimc_buffer *buffer, enum v4l2_buf_
ret = ioctl(fp , VIDIOC_QUERYBUF, &v4l2_buf);
if (ret < 0) {
- LOGE("ERR(%s):VIDIOC_QUERYBUF failed\n", __func__);
+ ALOGE("ERR(%s):VIDIOC_QUERYBUF failed\n", __func__);
return -1;
}
@@ -359,11 +359,11 @@ static int fimc_v4l2_querybuf(int fp, struct fimc_buffer *buffer, enum v4l2_buf_
if ((buffer->start = (char *)mmap(0, v4l2_buf.length,
PROT_READ | PROT_WRITE, MAP_SHARED,
fp, v4l2_buf.m.offset)) < 0) {
- LOGE("%s %d] mmap() failed\n",__func__, __LINE__);
+ ALOGE("%s %d] mmap() failed\n",__func__, __LINE__);
return -1;
}
- LOGI("%s: buffer->start = %p v4l2_buf.length = %d",
+ ALOGI("%s: buffer->start = %p v4l2_buf.length = %d",
__func__, buffer->start, v4l2_buf.length);
return 0;
@@ -376,7 +376,7 @@ static int fimc_v4l2_streamon(int fp)
ret = ioctl(fp, VIDIOC_STREAMON, &type);
if (ret < 0) {
- LOGE("ERR(%s):VIDIOC_STREAMON failed\n", __func__);
+ ALOGE("ERR(%s):VIDIOC_STREAMON failed\n", __func__);
return ret;
}
@@ -388,10 +388,10 @@ static int fimc_v4l2_streamoff(int fp)
enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
int ret;
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
ret = ioctl(fp, VIDIOC_STREAMOFF, &type);
if (ret < 0) {
- LOGE("ERR(%s):VIDIOC_STREAMOFF failed\n", __func__);
+ ALOGE("ERR(%s):VIDIOC_STREAMOFF failed\n", __func__);
return ret;
}
@@ -409,7 +409,7 @@ static int fimc_v4l2_qbuf(int fp, int index)
ret = ioctl(fp, VIDIOC_QBUF, &v4l2_buf);
if (ret < 0) {
- LOGE("ERR(%s):VIDIOC_QBUF failed\n", __func__);
+ ALOGE("ERR(%s):VIDIOC_QBUF failed\n", __func__);
return ret;
}
@@ -426,7 +426,7 @@ static int fimc_v4l2_dqbuf(int fp)
ret = ioctl(fp, VIDIOC_DQBUF, &v4l2_buf);
if (ret < 0) {
- LOGE("ERR(%s):VIDIOC_DQBUF failed, dropped frame\n", __func__);
+ ALOGE("ERR(%s):VIDIOC_DQBUF failed, dropped frame\n", __func__);
return ret;
}
@@ -442,7 +442,7 @@ static int fimc_v4l2_g_ctrl(int fp, unsigned int id)
ret = ioctl(fp, VIDIOC_G_CTRL, &ctrl);
if (ret < 0) {
- LOGE("ERR(%s): VIDIOC_G_CTRL(id = 0x%x (%d)) failed, ret = %d\n",
+ ALOGE("ERR(%s): VIDIOC_G_CTRL(id = 0x%x (%d)) failed, ret = %d\n",
__func__, id, id-V4L2_CID_PRIVATE_BASE, ret);
return ret;
}
@@ -460,7 +460,7 @@ static int fimc_v4l2_s_ctrl(int fp, unsigned int id, unsigned int value)
ret = ioctl(fp, VIDIOC_S_CTRL, &ctrl);
if (ret < 0) {
- LOGE("ERR(%s):VIDIOC_S_CTRL(id = %#x (%d), value = %d) failed ret = %d\n",
+ ALOGE("ERR(%s):VIDIOC_S_CTRL(id = %#x (%d), value = %d) failed ret = %d\n",
__func__, id, id-V4L2_CID_PRIVATE_BASE, value, ret);
return ret;
@@ -469,26 +469,6 @@ static int fimc_v4l2_s_ctrl(int fp, unsigned int id, unsigned int value)
return ctrl.value;
}
-static int fimc_v4l2_s_ext_ctrl(int fp, unsigned int id, void *value)
-{
- struct v4l2_ext_controls ctrls;
- struct v4l2_ext_control ctrl;
- int ret;
-
- ctrl.id = id;
- ctrl.reserved = value;
-
- ctrls.ctrl_class = V4L2_CTRL_CLASS_CAMERA;
- ctrls.count = 1;
- ctrls.controls = &ctrl;
-
- ret = ioctl(fp, VIDIOC_S_EXT_CTRLS, &ctrls);
- if (ret < 0)
- LOGE("ERR(%s):VIDIOC_S_EXT_CTRLS failed\n", __func__);
-
- return ret;
-}
-
static int fimc_v4l2_g_parm(int fp, struct v4l2_streamparm *streamparm)
{
int ret;
@@ -497,11 +477,11 @@ static int fimc_v4l2_g_parm(int fp, struct v4l2_streamparm *streamparm)
ret = ioctl(fp, VIDIOC_G_PARM, streamparm);
if (ret < 0) {
- LOGE("ERR(%s):VIDIOC_G_PARM failed\n", __func__);
+ ALOGE("ERR(%s):VIDIOC_G_PARM failed\n", __func__);
return -1;
}
- LOGV("%s : timeperframe: numerator %d, denominator %d\n", __func__,
+ ALOGV("%s : timeperframe: numerator %d, denominator %d\n", __func__,
streamparm->parm.capture.timeperframe.numerator,
streamparm->parm.capture.timeperframe.denominator);
@@ -516,7 +496,7 @@ static int fimc_v4l2_s_parm(int fp, struct v4l2_streamparm *streamparm)
ret = ioctl(fp, VIDIOC_S_PARM, streamparm);
if (ret < 0) {
- LOGE("ERR(%s):VIDIOC_S_PARM failed\n", __func__);
+ ALOGE("ERR(%s):VIDIOC_S_PARM failed\n", __func__);
return ret;
}
@@ -592,17 +572,17 @@ SecCamera::SecCamera() :
memset(&m_capture_buf, 0, sizeof(m_capture_buf));
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
}
SecCamera::~SecCamera()
{
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
}
int SecCamera::initCamera(int index)
{
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
int ret = 0;
if (!m_flag_init) {
@@ -614,12 +594,12 @@ int SecCamera::initCamera(int index)
m_cam_fd = open(CAMERA_DEV_NAME, O_RDWR);
if (m_cam_fd < 0) {
- LOGE("ERR(%s):Cannot open %s (error : %s)\n", __func__, CAMERA_DEV_NAME, strerror(errno));
+ ALOGE("ERR(%s):Cannot open %s (error : %s)\n", __func__, CAMERA_DEV_NAME, strerror(errno));
return -1;
}
- LOGV("%s: open(%s) --> m_cam_fd %d", __FUNCTION__, CAMERA_DEV_NAME, m_cam_fd);
+ ALOGV("%s: open(%s) --> m_cam_fd %d", __FUNCTION__, CAMERA_DEV_NAME, m_cam_fd);
- LOGE("initCamera: m_cam_fd(%d), m_jpeg_fd(%d)", m_cam_fd, m_jpeg_fd);
+ ALOGE("initCamera: m_cam_fd(%d), m_jpeg_fd(%d)", m_cam_fd, m_jpeg_fd);
ret = fimc_v4l2_querycap(m_cam_fd);
CHECK(ret);
@@ -629,13 +609,13 @@ int SecCamera::initCamera(int index)
CHECK(ret);
m_cam_fd2 = open(CAMERA_DEV_NAME2, O_RDWR);
- LOGV("%s: open(%s) --> m_cam_fd2 = %d", __FUNCTION__, CAMERA_DEV_NAME2, m_cam_fd2);
+ ALOGV("%s: open(%s) --> m_cam_fd2 = %d", __FUNCTION__, CAMERA_DEV_NAME2, m_cam_fd2);
if (m_cam_fd2 < 0) {
- LOGE("ERR(%s):Cannot open %s (error : %s)\n", __func__, CAMERA_DEV_NAME2, strerror(errno));
+ ALOGE("ERR(%s):Cannot open %s (error : %s)\n", __func__, CAMERA_DEV_NAME2, strerror(errno));
return -1;
}
- LOGE("initCamera: m_cam_fd2(%d)", m_cam_fd2);
+ ALOGE("initCamera: m_cam_fd2(%d)", m_cam_fd2);
ret = fimc_v4l2_querycap(m_cam_fd2);
CHECK(ret);
@@ -665,21 +645,21 @@ int SecCamera::initCamera(int index)
setExifFixedAttribute();
m_flag_init = 1;
- LOGI("%s : initialized", __FUNCTION__);
+ ALOGI("%s : initialized", __FUNCTION__);
}
return 0;
}
void SecCamera::resetCamera()
{
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
DeinitCamera();
initCamera(m_camera_id);
}
void SecCamera::DeinitCamera()
{
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
if (m_flag_init) {
@@ -688,13 +668,13 @@ void SecCamera::DeinitCamera()
/* close m_cam_fd after stopRecord() because stopRecord()
* uses m_cam_fd to change frame rate
*/
- LOGI("DeinitCamera: m_cam_fd(%d)", m_cam_fd);
+ ALOGI("DeinitCamera: m_cam_fd(%d)", m_cam_fd);
if (m_cam_fd > -1) {
close(m_cam_fd);
m_cam_fd = -1;
}
- LOGI("DeinitCamera: m_cam_fd2(%d)", m_cam_fd2);
+ ALOGI("DeinitCamera: m_cam_fd2(%d)", m_cam_fd2);
if (m_cam_fd2 > -1) {
close(m_cam_fd2);
m_cam_fd2 = -1;
@@ -702,7 +682,7 @@ void SecCamera::DeinitCamera()
m_flag_init = 0;
}
- else LOGI("%s : already deinitialized", __FUNCTION__);
+ else ALOGI("%s : already deinitialized", __FUNCTION__);
}
@@ -719,16 +699,16 @@ int SecCamera::startPreview(void)
v4l2_streamparm streamparm;
struct sec_cam_parm *parms;
parms = (struct sec_cam_parm*)&streamparm.parm.raw_data;
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
// aleady started
if (m_flag_camera_start > 0) {
- LOGE("ERR(%s):Preview was already started\n", __func__);
+ ALOGE("ERR(%s):Preview was already started\n", __func__);
return 0;
}
if (m_cam_fd <= 0) {
- LOGE("ERR(%s):Camera was closed\n", __func__);
+ ALOGE("ERR(%s):Camera was closed\n", __func__);
return -1;
}
@@ -745,7 +725,7 @@ int SecCamera::startPreview(void)
ret = fimc_v4l2_reqbufs(m_cam_fd, V4L2_BUF_TYPE_VIDEO_CAPTURE, MAX_BUFFERS);
CHECK(ret);
- LOGV("%s : m_preview_width: %d m_preview_height: %d m_angle: %d\n",
+ ALOGV("%s : m_preview_width: %d m_preview_height: %d m_angle: %d\n",
__func__, m_preview_width, m_preview_height, m_angle);
ret = fimc_v4l2_s_ctrl(m_cam_fd,
@@ -774,7 +754,7 @@ int SecCamera::startPreview(void)
if (m_camera_id == CAMERA_ID_FRONT) {
/* Blur setting */
- LOGV("m_blur_level = %d", m_blur_level);
+ ALOGV("m_blur_level = %d", m_blur_level);
ret = fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_VGA_BLUR,
m_blur_level);
CHECK(ret);
@@ -786,7 +766,7 @@ int SecCamera::startPreview(void)
ret = fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_RETURN_FOCUS, 0);
CHECK(ret);
- LOGV("%s: got the first frame of the preview\n", __func__);
+ ALOGV("%s: got the first frame of the preview\n", __func__);
return 0;
}
@@ -795,10 +775,10 @@ int SecCamera::stopPreview(void)
{
int ret;
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
if (m_flag_camera_start == 0) {
- LOGW("%s: doing nothing because m_flag_camera_start is zero", __func__);
+ ALOGW("%s: doing nothing because m_flag_camera_start is zero", __func__);
return 0;
}
@@ -806,7 +786,7 @@ int SecCamera::stopPreview(void)
setFlashMode(FLASH_MODE_OFF);
if (m_cam_fd <= 0) {
- LOGE("ERR(%s):Camera was closed\n", __func__);
+ ALOGE("ERR(%s):Camera was closed\n", __func__);
return -1;
}
@@ -823,16 +803,16 @@ int SecCamera::startRecord(void)
{
int ret, i;
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
// aleady started
if (m_flag_record_start > 0) {
- LOGE("ERR(%s):Preview was already started\n", __func__);
+ ALOGE("ERR(%s):Preview was already started\n", __func__);
return 0;
}
if (m_cam_fd2 <= 0) {
- LOGE("ERR(%s):Camera was closed\n", __func__);
+ ALOGE("ERR(%s):Camera was closed\n", __func__);
return -1;
}
@@ -840,7 +820,7 @@ int SecCamera::startRecord(void)
ret = fimc_v4l2_enum_fmt(m_cam_fd2, V4L2_PIX_FMT_NV12T);
CHECK(ret);
- LOGI("%s: m_recording_width = %d, m_recording_height = %d\n",
+ ALOGI("%s: m_recording_width = %d, m_recording_height = %d\n",
__func__, m_recording_width, m_recording_height);
ret = fimc_v4l2_s_fmt(m_cam_fd2, m_recording_width,
@@ -879,15 +859,15 @@ int SecCamera::stopRecord(void)
{
int ret;
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
if (m_flag_record_start == 0) {
- LOGW("%s: doing nothing because m_flag_record_start is zero", __func__);
+ ALOGW("%s: doing nothing because m_flag_record_start is zero", __func__);
return 0;
}
if (m_cam_fd2 <= 0) {
- LOGE("ERR(%s):Camera was closed\n", __func__);
+ ALOGE("ERR(%s):Camera was closed\n", __func__);
return -1;
}
@@ -950,7 +930,7 @@ int SecCamera::getPreview()
int ret;
if (m_flag_camera_start == 0 || previewPoll(true) == 0) {
- LOGE("ERR(%s):Start Camera Device Reset \n", __func__);
+ ALOGE("ERR(%s):Start Camera Device Reset \n", __func__);
/* GAUDI Project([arun.c@samsung.com]) 2010.05.20. [Implemented ESD code] */
/*
* When there is no data for more than 1 second from the camera we inform
@@ -968,14 +948,14 @@ int SecCamera::getPreview()
CHECK(ret);
ret = startPreview();
if (ret < 0) {
- LOGE("ERR(%s): startPreview() return %d\n", __func__, ret);
+ ALOGE("ERR(%s): startPreview() return %d\n", __func__, ret);
return 0;
}
}
index = fimc_v4l2_dqbuf(m_cam_fd);
if (!(0 <= index && index < MAX_BUFFERS)) {
- LOGE("ERR(%s):wrong index = %d\n", __func__, index);
+ ALOGE("ERR(%s):wrong index = %d\n", __func__, index);
return -1;
}
@@ -988,7 +968,7 @@ int SecCamera::getPreview()
int SecCamera::getRecordFrame()
{
if (m_flag_record_start == 0) {
- LOGE("%s: m_flag_record_start is 0", __func__);
+ ALOGE("%s: m_flag_record_start is 0", __func__);
return -1;
}
@@ -1005,7 +985,7 @@ int SecCamera::releaseRecordFrame(int index)
* cases where fimc could crash if we called qbuf and it
* wasn't expecting it.
*/
- LOGI("%s: recording not in progress, ignoring", __func__);
+ ALOGI("%s: recording not in progress, ignoring", __func__);
return 0;
}
@@ -1014,27 +994,27 @@ int SecCamera::releaseRecordFrame(int index)
int SecCamera::setPreviewSize(int width, int height, int pixel_format)
{
- LOGV("%s(width(%d), height(%d), format(%d))", __func__, width, height, pixel_format);
+ ALOGV("%s(width(%d), height(%d), format(%d))", __func__, width, height, pixel_format);
int v4lpixelformat = pixel_format;
#if defined(LOG_NDEBUG) && LOG_NDEBUG == 0
if (v4lpixelformat == V4L2_PIX_FMT_YUV420)
- LOGV("PreviewFormat:V4L2_PIX_FMT_YUV420");
+ ALOGV("PreviewFormat:V4L2_PIX_FMT_YUV420");
else if (v4lpixelformat == V4L2_PIX_FMT_NV12)
- LOGV("PreviewFormat:V4L2_PIX_FMT_NV12");
+ ALOGV("PreviewFormat:V4L2_PIX_FMT_NV12");
else if (v4lpixelformat == V4L2_PIX_FMT_NV12T)
- LOGV("PreviewFormat:V4L2_PIX_FMT_NV12T");
+ ALOGV("PreviewFormat:V4L2_PIX_FMT_NV12T");
else if (v4lpixelformat == V4L2_PIX_FMT_NV21)
- LOGV("PreviewFormat:V4L2_PIX_FMT_NV21");
+ ALOGV("PreviewFormat:V4L2_PIX_FMT_NV21");
else if (v4lpixelformat == V4L2_PIX_FMT_YUV422P)
- LOGV("PreviewFormat:V4L2_PIX_FMT_YUV422P");
+ ALOGV("PreviewFormat:V4L2_PIX_FMT_YUV422P");
else if (v4lpixelformat == V4L2_PIX_FMT_YUYV)
- LOGV("PreviewFormat:V4L2_PIX_FMT_YUYV");
+ ALOGV("PreviewFormat:V4L2_PIX_FMT_YUYV");
else if (v4lpixelformat == V4L2_PIX_FMT_RGB565)
- LOGV("PreviewFormat:V4L2_PIX_FMT_RGB565");
+ ALOGV("PreviewFormat:V4L2_PIX_FMT_RGB565");
else
- LOGV("PreviewFormat:UnknownFormat");
+ ALOGV("PreviewFormat:UnknownFormat");
#endif
m_preview_width = width;
m_preview_height = height;
@@ -1074,7 +1054,7 @@ int SecCamera::getPreviewPixelFormat(void)
*/
int SecCamera::setSnapshotCmd(void)
{
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
int ret = 0;
@@ -1082,13 +1062,13 @@ int SecCamera::setSnapshotCmd(void)
LOG_TIME_DEFINE(1)
if (m_cam_fd <= 0) {
- LOGE("ERR(%s):Camera was closed\n", __func__);
+ ALOGE("ERR(%s):Camera was closed\n", __func__);
return 0;
}
if (m_flag_camera_start > 0) {
LOG_TIME_START(0)
- LOGW("WARN(%s):Camera was in preview, should have been stopped\n", __func__);
+ ALOGW("WARN(%s):Camera was in preview, should have been stopped\n", __func__);
stopPreview();
LOG_TIME_END(0)
}
@@ -1123,10 +1103,10 @@ int SecCamera::endSnapshot(void)
{
int ret;
- LOGI("%s :", __func__);
+ ALOGI("%s :", __func__);
if (m_capture_buf.start) {
munmap(m_capture_buf.start, m_capture_buf.length);
- LOGI("munmap():virt. addr %p size = %d\n",
+ ALOGI("munmap():virt. addr %p size = %d\n",
m_capture_buf.start, m_capture_buf.length);
m_capture_buf.start = NULL;
m_capture_buf.length = 0;
@@ -1139,7 +1119,7 @@ int SecCamera::endSnapshot(void)
*/
unsigned char* SecCamera::getJpeg(int *jpeg_size, unsigned int *phyaddr)
{
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
int index, ret = 0;
unsigned char *addr;
@@ -1151,7 +1131,7 @@ unsigned char* SecCamera::getJpeg(int *jpeg_size, unsigned int *phyaddr)
CHECK_PTR(ret);
index = fimc_v4l2_dqbuf(m_cam_fd);
if (index != 0) {
- LOGE("ERR(%s):wrong index = %d\n", __func__, index);
+ ALOGE("ERR(%s):wrong index = %d\n", __func__, index);
return NULL;
}
@@ -1165,7 +1145,7 @@ unsigned char* SecCamera::getJpeg(int *jpeg_size, unsigned int *phyaddr)
ret = fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_STREAM_PAUSE, 0);
CHECK_PTR(ret);
- LOGV("\nsnapshot dqueued buffer = %d snapshot_width = %d snapshot_height = %d, size = %d\n\n",
+ ALOGV("\nsnapshot dqueued buffer = %d snapshot_width = %d snapshot_height = %d, size = %d\n\n",
index, m_snapshot_width, m_snapshot_height, *jpeg_size);
addr = (unsigned char*)(m_capture_buf.start) + main_offset;
@@ -1183,7 +1163,7 @@ int SecCamera::getExif(unsigned char *pExifDst, unsigned char *pThumbSrc)
{
JpegEncoder jpgEnc;
- LOGV("%s : m_jpeg_thumbnail_width = %d, height = %d",
+ ALOGV("%s : m_jpeg_thumbnail_width = %d, height = %d",
__func__, m_jpeg_thumbnail_width, m_jpeg_thumbnail_height);
if ((m_jpeg_thumbnail_width > 0) && (m_jpeg_thumbnail_height > 0)) {
int inFormat = JPG_MODESEL_YCBCR;
@@ -1228,10 +1208,10 @@ int SecCamera::getExif(unsigned char *pExifDst, unsigned char *pThumbSrc)
jpgEnc.encode(&thumbSize, NULL);
- LOGV("%s : enableThumb set to true", __func__);
+ ALOGV("%s : enableThumb set to true", __func__);
mExifInfo.enableThumb = true;
} else {
- LOGV("%s : enableThumb set to false", __func__);
+ ALOGV("%s : enableThumb set to false", __func__);
mExifInfo.enableThumb = false;
}
@@ -1239,7 +1219,7 @@ int SecCamera::getExif(unsigned char *pExifDst, unsigned char *pThumbSrc)
setExifChangedAttribute();
- LOGV("%s: calling jpgEnc.makeExif, mExifInfo.width set to %d, height to %d\n",
+ ALOGV("%s: calling jpgEnc.makeExif, mExifInfo.width set to %d, height to %d\n",
__func__, mExifInfo.width, mExifInfo.height);
jpgEnc.makeExif(pExifDst, &mExifInfo, &exifSize, true);
@@ -1258,7 +1238,7 @@ void SecCamera::getPostViewConfig(int *width, int *height, int *size)
*height = BACK_CAMERA_POSTVIEW_HEIGHT;
*size = BACK_CAMERA_POSTVIEW_WIDTH * BACK_CAMERA_POSTVIEW_HEIGHT * BACK_CAMERA_POSTVIEW_BPP / 8;
}
- LOGV("[5B] m_preview_width : %d, mPostViewWidth = %d mPostViewHeight = %d mPostViewSize = %d",
+ ALOGV("[5B] m_preview_width : %d, mPostViewWidth = %d mPostViewHeight = %d mPostViewSize = %d",
m_preview_width, *width, *height, *size);
}
@@ -1285,7 +1265,7 @@ int SecCamera::getPostViewOffset(void)
int SecCamera::getSnapshotAndJpeg(unsigned char *yuv_buf, unsigned char *jpeg_buf,
unsigned int *output_size)
{
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
int index;
//unsigned int addr;
@@ -1302,13 +1282,13 @@ int SecCamera::getSnapshotAndJpeg(unsigned char *yuv_buf, unsigned char *jpeg_bu
//fimc_v4l2_streamoff(m_cam_fd); [zzangdol] remove - it is separate in HWInterface with camera_id
if (m_cam_fd <= 0) {
- LOGE("ERR(%s):Camera was closed\n", __func__);
+ ALOGE("ERR(%s):Camera was closed\n", __func__);
return -1;
}
if (m_flag_camera_start > 0) {
LOG_TIME_START(0)
- LOGW("WARN(%s):Camera was in preview, should have been stopped\n", __func__);
+ ALOGW("WARN(%s):Camera was in preview, should have been stopped\n", __func__);
stopPreview();
LOG_TIME_END(0)
}
@@ -1319,23 +1299,23 @@ int SecCamera::getSnapshotAndJpeg(unsigned char *yuv_buf, unsigned char *jpeg_bu
#if defined(LOG_NDEBUG) && LOG_NDEBUG == 0
if (m_snapshot_v4lformat == V4L2_PIX_FMT_YUV420)
- LOGV("SnapshotFormat:V4L2_PIX_FMT_YUV420");
+ ALOGV("SnapshotFormat:V4L2_PIX_FMT_YUV420");
else if (m_snapshot_v4lformat == V4L2_PIX_FMT_NV12)
- LOGV("SnapshotFormat:V4L2_PIX_FMT_NV12");
+ ALOGV("SnapshotFormat:V4L2_PIX_FMT_NV12");
else if (m_snapshot_v4lformat == V4L2_PIX_FMT_NV12T)
- LOGV("SnapshotFormat:V4L2_PIX_FMT_NV12T");
+ ALOGV("SnapshotFormat:V4L2_PIX_FMT_NV12T");
else if (m_snapshot_v4lformat == V4L2_PIX_FMT_NV21)
- LOGV("SnapshotFormat:V4L2_PIX_FMT_NV21");
+ ALOGV("SnapshotFormat:V4L2_PIX_FMT_NV21");
else if (m_snapshot_v4lformat == V4L2_PIX_FMT_YUV422P)
- LOGV("SnapshotFormat:V4L2_PIX_FMT_YUV422P");
+ ALOGV("SnapshotFormat:V4L2_PIX_FMT_YUV422P");
else if (m_snapshot_v4lformat == V4L2_PIX_FMT_YUYV)
- LOGV("SnapshotFormat:V4L2_PIX_FMT_YUYV");
+ ALOGV("SnapshotFormat:V4L2_PIX_FMT_YUYV");
else if (m_snapshot_v4lformat == V4L2_PIX_FMT_UYVY)
- LOGV("SnapshotFormat:V4L2_PIX_FMT_UYVY");
+ ALOGV("SnapshotFormat:V4L2_PIX_FMT_UYVY");
else if (m_snapshot_v4lformat == V4L2_PIX_FMT_RGB565)
- LOGV("SnapshotFormat:V4L2_PIX_FMT_RGB565");
+ ALOGV("SnapshotFormat:V4L2_PIX_FMT_RGB565");
else
- LOGV("SnapshotFormat:UnknownFormat");
+ ALOGV("SnapshotFormat:UnknownFormat");
#endif
LOG_TIME_START(1) // prepare
@@ -1361,12 +1341,12 @@ int SecCamera::getSnapshotAndJpeg(unsigned char *yuv_buf, unsigned char *jpeg_bu
fimc_poll(&m_events_c);
index = fimc_v4l2_dqbuf(m_cam_fd);
fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_STREAM_PAUSE, 0);
- LOGV("\nsnapshot dequeued buffer = %d snapshot_width = %d snapshot_height = %d\n\n",
+ ALOGV("\nsnapshot dequeued buffer = %d snapshot_width = %d snapshot_height = %d\n\n",
index, m_snapshot_width, m_snapshot_height);
LOG_TIME_END(2)
- LOGI("%s : calling memcpy from m_capture_buf", __func__);
+ ALOGI("%s : calling memcpy from m_capture_buf", __func__);
memcpy(yuv_buf, (unsigned char*)m_capture_buf.start, m_snapshot_width * m_snapshot_height * 2);
LOG_TIME_START(5) // post
fimc_v4l2_streamoff(m_cam_fd);
@@ -1396,10 +1376,10 @@ int SecCamera::getSnapshotAndJpeg(unsigned char *yuv_buf, unsigned char *jpeg_bu
}
if (jpgEnc.setConfig(JPEG_SET_ENCODE_IN_FORMAT, inFormat) != JPG_SUCCESS)
- LOGE("[JPEG_SET_ENCODE_IN_FORMAT] Error\n");
+ ALOGE("[JPEG_SET_ENCODE_IN_FORMAT] Error\n");
if (jpgEnc.setConfig(JPEG_SET_SAMPING_MODE, outFormat) != JPG_SUCCESS)
- LOGE("[JPEG_SET_SAMPING_MODE] Error\n");
+ ALOGE("[JPEG_SET_SAMPING_MODE] Error\n");
image_quality_type_t jpegQuality;
if (m_jpeg_quality >= 90)
@@ -1412,18 +1392,18 @@ int SecCamera::getSnapshotAndJpeg(unsigned char *yuv_buf, unsigned char *jpeg_bu
jpegQuality = JPG_QUALITY_LEVEL_4;
if (jpgEnc.setConfig(JPEG_SET_ENCODE_QUALITY, jpegQuality) != JPG_SUCCESS)
- LOGE("[JPEG_SET_ENCODE_QUALITY] Error\n");
+ ALOGE("[JPEG_SET_ENCODE_QUALITY] Error\n");
if (jpgEnc.setConfig(JPEG_SET_ENCODE_WIDTH, m_snapshot_width) != JPG_SUCCESS)
- LOGE("[JPEG_SET_ENCODE_WIDTH] Error\n");
+ ALOGE("[JPEG_SET_ENCODE_WIDTH] Error\n");
if (jpgEnc.setConfig(JPEG_SET_ENCODE_HEIGHT, m_snapshot_height) != JPG_SUCCESS)
- LOGE("[JPEG_SET_ENCODE_HEIGHT] Error\n");
+ ALOGE("[JPEG_SET_ENCODE_HEIGHT] Error\n");
unsigned int snapshot_size = m_snapshot_width * m_snapshot_height * 2;
unsigned char *pInBuf = (unsigned char *)jpgEnc.getInBuf(snapshot_size);
if (pInBuf == NULL) {
- LOGE("JPEG input buffer is NULL!!\n");
+ ALOGE("JPEG input buffer is NULL!!\n");
return -1;
}
memcpy(pInBuf, yuv_buf, snapshot_size);
@@ -1435,7 +1415,7 @@ int SecCamera::getSnapshotAndJpeg(unsigned char *yuv_buf, unsigned char *jpeg_bu
unsigned char *pOutBuf = (unsigned char *)jpgEnc.getOutBuf(&outbuf_size);
if (pOutBuf == NULL) {
- LOGE("JPEG output buffer is NULL!!\n");
+ ALOGE("JPEG output buffer is NULL!!\n");
return -1;
}
@@ -1447,7 +1427,7 @@ int SecCamera::getSnapshotAndJpeg(unsigned char *yuv_buf, unsigned char *jpeg_bu
int SecCamera::setSnapshotSize(int width, int height)
{
- LOGV("%s(width(%d), height(%d))", __func__, width, height);
+ ALOGV("%s(width(%d), height(%d))", __func__, width, height);
m_snapshot_width = width;
m_snapshot_height = height;
@@ -1504,23 +1484,23 @@ int SecCamera::setSnapshotPixelFormat(int pixel_format)
#if defined(LOG_NDEBUG) && LOG_NDEBUG == 0
if (m_snapshot_v4lformat == V4L2_PIX_FMT_YUV420)
- LOGE("%s : SnapshotFormat:V4L2_PIX_FMT_YUV420", __func__);
+ ALOGE("%s : SnapshotFormat:V4L2_PIX_FMT_YUV420", __func__);
else if (m_snapshot_v4lformat == V4L2_PIX_FMT_NV12)
- LOGD("%s : SnapshotFormat:V4L2_PIX_FMT_NV12", __func__);
+ ALOGD("%s : SnapshotFormat:V4L2_PIX_FMT_NV12", __func__);
else if (m_snapshot_v4lformat == V4L2_PIX_FMT_NV12T)
- LOGD("%s : SnapshotFormat:V4L2_PIX_FMT_NV12T", __func__);
+ ALOGD("%s : SnapshotFormat:V4L2_PIX_FMT_NV12T", __func__);
else if (m_snapshot_v4lformat == V4L2_PIX_FMT_NV21)
- LOGD("%s : SnapshotFormat:V4L2_PIX_FMT_NV21", __func__);
+ ALOGD("%s : SnapshotFormat:V4L2_PIX_FMT_NV21", __func__);
else if (m_snapshot_v4lformat == V4L2_PIX_FMT_YUV422P)
- LOGD("%s : SnapshotFormat:V4L2_PIX_FMT_YUV422P", __func__);
+ ALOGD("%s : SnapshotFormat:V4L2_PIX_FMT_YUV422P", __func__);
else if (m_snapshot_v4lformat == V4L2_PIX_FMT_YUYV)
- LOGD("%s : SnapshotFormat:V4L2_PIX_FMT_YUYV", __func__);
+ ALOGD("%s : SnapshotFormat:V4L2_PIX_FMT_YUYV", __func__);
else if (m_snapshot_v4lformat == V4L2_PIX_FMT_UYVY)
- LOGD("%s : SnapshotFormat:V4L2_PIX_FMT_UYVY", __func__);
+ ALOGD("%s : SnapshotFormat:V4L2_PIX_FMT_UYVY", __func__);
else if (m_snapshot_v4lformat == V4L2_PIX_FMT_RGB565)
- LOGD("%s : SnapshotFormat:V4L2_PIX_FMT_RGB565", __func__);
+ ALOGD("%s : SnapshotFormat:V4L2_PIX_FMT_RGB565", __func__);
else
- LOGD("SnapshotFormat:UnknownFormat");
+ ALOGD("SnapshotFormat:UnknownFormat");
#endif
return 0;
}
@@ -1542,15 +1522,15 @@ int SecCamera::getCameraId(void)
int SecCamera::setAutofocus(void)
{
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
if (m_cam_fd <= 0) {
- LOGE("ERR(%s):Camera was closed\n", __func__);
+ ALOGE("ERR(%s):Camera was closed\n", __func__);
return -1;
}
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_SET_AUTO_FOCUS, AUTO_FOCUS_ON) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_SET_AUTO_FOCUS", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_SET_AUTO_FOCUS", __func__);
return -1;
}
@@ -1568,7 +1548,7 @@ int SecCamera::getAutoFocusResult(void)
usleep(AF_DELAY);
}
if ((count >= FIRST_AF_SEARCH_COUNT) || (ret != AF_SUCCESS)) {
- LOGV("%s : 1st AF timed out, failed, or was canceled", __func__);
+ ALOGV("%s : 1st AF timed out, failed, or was canceled", __func__);
af_result = 0;
goto finish_auto_focus;
}
@@ -1581,17 +1561,17 @@ int SecCamera::getAutoFocusResult(void)
usleep(AF_DELAY);
}
if (count >= SECOND_AF_SEARCH_COUNT) {
- LOGV("%s : 2nd AF timed out, failed, or was canceled", __func__);
+ ALOGV("%s : 2nd AF timed out, failed, or was canceled", __func__);
af_result = 0;
goto finish_auto_focus;
}
af_result = 1;
- LOGV("%s : AF was successful, returning %d", __func__, af_result);
+ ALOGV("%s : AF was successful, returning %d", __func__, af_result);
finish_auto_focus:
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_FINISH_AUTO_FOCUS, 0) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_SET_PRE_FLASH", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_SET_PRE_FLASH", __func__);
return -1;
}
return af_result;
@@ -1599,15 +1579,15 @@ finish_auto_focus:
int SecCamera::cancelAutofocus(void)
{
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
if (m_cam_fd <= 0) {
- LOGE("ERR(%s):Camera was closed\n", __func__);
+ ALOGE("ERR(%s):Camera was closed\n", __func__);
return -1;
}
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_SET_AUTO_FOCUS, AUTO_FOCUS_OFF) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_SET_AUTO_FOCUS", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_SET_AUTO_FOCUS", __func__);
return -1;
}
@@ -1618,13 +1598,13 @@ int SecCamera::cancelAutofocus(void)
int SecCamera::zoomIn(void)
{
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
return 0;
}
int SecCamera::zoomOut(void)
{
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
return 0;
}
@@ -1632,7 +1612,7 @@ int SecCamera::zoomOut(void)
int SecCamera::SetRotate(int angle)
{
- LOGE("%s(angle(%d))", __func__, angle);
+ ALOGE("%s(angle(%d))", __func__, angle);
if (m_angle != angle) {
switch (angle) {
@@ -1658,13 +1638,13 @@ int SecCamera::SetRotate(int angle)
break;
default:
- LOGE("ERR(%s):Invalid angle(%d)", __func__, angle);
+ ALOGE("ERR(%s):Invalid angle(%d)", __func__, angle);
return -1;
}
if (m_flag_camera_start) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_ROTATION, angle) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_ROTATION", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_ROTATION", __func__);
return -1;
}
}
@@ -1675,22 +1655,22 @@ int SecCamera::SetRotate(int angle)
int SecCamera::getRotate(void)
{
- LOGV("%s : angle(%d)", __func__, m_angle);
+ ALOGV("%s : angle(%d)", __func__, m_angle);
return m_angle;
}
int SecCamera::setFrameRate(int frame_rate)
{
- LOGV("%s(FrameRate(%d))", __func__, frame_rate);
+ ALOGV("%s(FrameRate(%d))", __func__, frame_rate);
if (frame_rate < FRAME_RATE_AUTO || FRAME_RATE_MAX < frame_rate )
- LOGE("ERR(%s):Invalid frame_rate(%d)", __func__, frame_rate);
+ ALOGE("ERR(%s):Invalid frame_rate(%d)", __func__, frame_rate);
if (m_params->capture.timeperframe.denominator != (unsigned)frame_rate) {
m_params->capture.timeperframe.denominator = frame_rate;
if (m_flag_camera_start) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_FRAME_RATE, frame_rate) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_FRAME_RATE", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_FRAME_RATE", __func__);
return -1;
}
}
@@ -1703,15 +1683,15 @@ int SecCamera::setFrameRate(int frame_rate)
int SecCamera::setVerticalMirror(void)
{
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
if (m_cam_fd <= 0) {
- LOGE("ERR(%s):Camera was closed\n", __func__);
+ ALOGE("ERR(%s):Camera was closed\n", __func__);
return -1;
}
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_VFLIP, 0) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_VFLIP", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_VFLIP", __func__);
return -1;
}
@@ -1720,15 +1700,15 @@ int SecCamera::setVerticalMirror(void)
int SecCamera::setHorizontalMirror(void)
{
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
if (m_cam_fd <= 0) {
- LOGE("ERR(%s):Camera was closed\n", __func__);
+ ALOGE("ERR(%s):Camera was closed\n", __func__);
return -1;
}
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_HFLIP, 0) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_HFLIP", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_HFLIP", __func__);
return -1;
}
@@ -1739,10 +1719,10 @@ int SecCamera::setHorizontalMirror(void)
int SecCamera::setWhiteBalance(int white_balance)
{
- LOGV("%s(white_balance(%d))", __func__, white_balance);
+ ALOGV("%s(white_balance(%d))", __func__, white_balance);
if (white_balance <= WHITE_BALANCE_BASE || WHITE_BALANCE_MAX <= white_balance) {
- LOGE("ERR(%s):Invalid white_balance(%d)", __func__, white_balance);
+ ALOGE("ERR(%s):Invalid white_balance(%d)", __func__, white_balance);
return -1;
}
@@ -1750,7 +1730,7 @@ int SecCamera::setWhiteBalance(int white_balance)
m_params->white_balance = white_balance;
if (m_flag_camera_start) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_WHITE_BALANCE, white_balance) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_WHITE_BALANCE", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_WHITE_BALANCE", __func__);
return -1;
}
}
@@ -1761,7 +1741,7 @@ int SecCamera::setWhiteBalance(int white_balance)
int SecCamera::getWhiteBalance(void)
{
- LOGV("%s : white_balance(%d)", __func__, m_params->white_balance);
+ ALOGV("%s : white_balance(%d)", __func__, m_params->white_balance);
return m_params->white_balance;
}
@@ -1769,12 +1749,12 @@ int SecCamera::getWhiteBalance(void)
int SecCamera::setBrightness(int brightness)
{
- LOGV("%s(brightness(%d))", __func__, brightness);
+ ALOGV("%s(brightness(%d))", __func__, brightness);
brightness += EV_DEFAULT;
if (brightness < EV_MINUS_4 || EV_PLUS_4 < brightness) {
- LOGE("ERR(%s):Invalid brightness(%d)", __func__, brightness);
+ ALOGE("ERR(%s):Invalid brightness(%d)", __func__, brightness);
return -1;
}
@@ -1782,7 +1762,7 @@ int SecCamera::setBrightness(int brightness)
m_params->brightness = brightness;
if (m_flag_camera_start) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_BRIGHTNESS, brightness) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_BRIGHTNESS", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_BRIGHTNESS", __func__);
return -1;
}
}
@@ -1793,7 +1773,7 @@ int SecCamera::setBrightness(int brightness)
int SecCamera::getBrightness(void)
{
- LOGV("%s : brightness(%d)", __func__, m_params->brightness);
+ ALOGV("%s : brightness(%d)", __func__, m_params->brightness);
return m_params->brightness;
}
@@ -1801,10 +1781,10 @@ int SecCamera::getBrightness(void)
int SecCamera::setImageEffect(int image_effect)
{
- LOGV("%s(image_effect(%d))", __func__, image_effect);
+ ALOGV("%s(image_effect(%d))", __func__, image_effect);
if (image_effect <= IMAGE_EFFECT_BASE || IMAGE_EFFECT_MAX <= image_effect) {
- LOGE("ERR(%s):Invalid image_effect(%d)", __func__, image_effect);
+ ALOGE("ERR(%s):Invalid image_effect(%d)", __func__, image_effect);
return -1;
}
@@ -1812,7 +1792,7 @@ int SecCamera::setImageEffect(int image_effect)
m_params->effects = image_effect;
if (m_flag_camera_start) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_EFFECT, image_effect) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_EFFECT", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_EFFECT", __func__);
return -1;
}
}
@@ -1823,17 +1803,17 @@ int SecCamera::setImageEffect(int image_effect)
int SecCamera::getImageEffect(void)
{
- LOGV("%s : image_effect(%d)", __func__, m_params->effects);
+ ALOGV("%s : image_effect(%d)", __func__, m_params->effects);
return m_params->effects;
}
// ======================================================================
int SecCamera::setAntiBanding(int anti_banding)
{
- LOGV("%s(anti_banding(%d))", __func__, anti_banding);
+ ALOGV("%s(anti_banding(%d))", __func__, anti_banding);
if (anti_banding < ANTI_BANDING_AUTO || ANTI_BANDING_OFF < anti_banding) {
- LOGE("ERR(%s):Invalid anti_banding (%d)", __func__, anti_banding);
+ ALOGE("ERR(%s):Invalid anti_banding (%d)", __func__, anti_banding);
return -1;
}
@@ -1841,7 +1821,7 @@ int SecCamera::setAntiBanding(int anti_banding)
m_anti_banding = anti_banding;
if (m_flag_camera_start) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_ANTI_BANDING, anti_banding) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_ANTI_BANDING", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_ANTI_BANDING", __func__);
return -1;
}
}
@@ -1853,10 +1833,10 @@ int SecCamera::setAntiBanding(int anti_banding)
//======================================================================
int SecCamera::setSceneMode(int scene_mode)
{
- LOGV("%s(scene_mode(%d))", __func__, scene_mode);
+ ALOGV("%s(scene_mode(%d))", __func__, scene_mode);
if (scene_mode <= SCENE_MODE_BASE || SCENE_MODE_MAX <= scene_mode) {
- LOGE("ERR(%s):Invalid scene_mode (%d)", __func__, scene_mode);
+ ALOGE("ERR(%s):Invalid scene_mode (%d)", __func__, scene_mode);
return -1;
}
@@ -1864,7 +1844,7 @@ int SecCamera::setSceneMode(int scene_mode)
m_params->scene_mode = scene_mode;
if (m_flag_camera_start) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_SCENE_MODE, scene_mode) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_SCENE_MODE", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_SCENE_MODE", __func__);
return -1;
}
}
@@ -1882,10 +1862,10 @@ int SecCamera::getSceneMode(void)
int SecCamera::setFlashMode(int flash_mode)
{
- LOGV("%s(flash_mode(%d))", __func__, flash_mode);
+ ALOGV("%s(flash_mode(%d))", __func__, flash_mode);
if (flash_mode <= FLASH_MODE_BASE || FLASH_MODE_MAX <= flash_mode) {
- LOGE("ERR(%s):Invalid flash_mode (%d)", __func__, flash_mode);
+ ALOGE("ERR(%s):Invalid flash_mode (%d)", __func__, flash_mode);
return -1;
}
@@ -1893,7 +1873,7 @@ int SecCamera::setFlashMode(int flash_mode)
m_params->flash_mode = flash_mode;
if (m_flag_camera_start) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_FLASH_MODE, flash_mode) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_FLASH_MODE", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_FLASH_MODE", __func__);
return -1;
}
}
@@ -1911,9 +1891,9 @@ int SecCamera::getFlashMode(void)
int SecCamera::setISO(int iso_value)
{
- LOGV("%s(iso_value(%d))", __func__, iso_value);
+ ALOGV("%s(iso_value(%d))", __func__, iso_value);
if (iso_value < ISO_AUTO || ISO_MAX <= iso_value) {
- LOGE("ERR(%s):Invalid iso_value (%d)", __func__, iso_value);
+ ALOGE("ERR(%s):Invalid iso_value (%d)", __func__, iso_value);
return -1;
}
@@ -1921,7 +1901,7 @@ int SecCamera::setISO(int iso_value)
m_params->iso = iso_value;
if (m_flag_camera_start) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_ISO, iso_value) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_ISO", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_ISO", __func__);
return -1;
}
}
@@ -1939,10 +1919,10 @@ int SecCamera::getISO(void)
int SecCamera::setContrast(int contrast_value)
{
- LOGV("%s(contrast_value(%d))", __func__, contrast_value);
+ ALOGV("%s(contrast_value(%d))", __func__, contrast_value);
if (contrast_value < CONTRAST_MINUS_2 || CONTRAST_MAX <= contrast_value) {
- LOGE("ERR(%s):Invalid contrast_value (%d)", __func__, contrast_value);
+ ALOGE("ERR(%s):Invalid contrast_value (%d)", __func__, contrast_value);
return -1;
}
@@ -1950,7 +1930,7 @@ int SecCamera::setContrast(int contrast_value)
m_params->contrast = contrast_value;
if (m_flag_camera_start) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_CONTRAST, contrast_value) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_CONTRAST", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_CONTRAST", __func__);
return -1;
}
}
@@ -1968,10 +1948,10 @@ int SecCamera::getContrast(void)
int SecCamera::setSaturation(int saturation_value)
{
- LOGV("%s(saturation_value(%d))", __func__, saturation_value);
+ ALOGV("%s(saturation_value(%d))", __func__, saturation_value);
if (saturation_value <SATURATION_MINUS_2 || SATURATION_MAX<= saturation_value) {
- LOGE("ERR(%s):Invalid saturation_value (%d)", __func__, saturation_value);
+ ALOGE("ERR(%s):Invalid saturation_value (%d)", __func__, saturation_value);
return -1;
}
@@ -1979,7 +1959,7 @@ int SecCamera::setSaturation(int saturation_value)
m_params->saturation = saturation_value;
if (m_flag_camera_start) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_SATURATION, saturation_value) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_SATURATION", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_SATURATION", __func__);
return -1;
}
}
@@ -1997,10 +1977,10 @@ int SecCamera::getSaturation(void)
int SecCamera::setSharpness(int sharpness_value)
{
- LOGV("%s(sharpness_value(%d))", __func__, sharpness_value);
+ ALOGV("%s(sharpness_value(%d))", __func__, sharpness_value);
if (sharpness_value < SHARPNESS_MINUS_2 || SHARPNESS_MAX <= sharpness_value) {
- LOGE("ERR(%s):Invalid sharpness_value (%d)", __func__, sharpness_value);
+ ALOGE("ERR(%s):Invalid sharpness_value (%d)", __func__, sharpness_value);
return -1;
}
@@ -2008,7 +1988,7 @@ int SecCamera::setSharpness(int sharpness_value)
m_params->sharpness = sharpness_value;
if (m_flag_camera_start) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_SHARPNESS, sharpness_value) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_SHARPNESS", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_SHARPNESS", __func__);
return -1;
}
}
@@ -2026,10 +2006,10 @@ int SecCamera::getSharpness(void)
int SecCamera::setWDR(int wdr_value)
{
- LOGV("%s(wdr_value(%d))", __func__, wdr_value);
+ ALOGV("%s(wdr_value(%d))", __func__, wdr_value);
if (wdr_value < WDR_OFF || WDR_MAX <= wdr_value) {
- LOGE("ERR(%s):Invalid wdr_value (%d)", __func__, wdr_value);
+ ALOGE("ERR(%s):Invalid wdr_value (%d)", __func__, wdr_value);
return -1;
}
@@ -2037,7 +2017,7 @@ int SecCamera::setWDR(int wdr_value)
m_wdr = wdr_value;
if (m_flag_camera_start) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_WDR, wdr_value) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_WDR", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_WDR", __func__);
return -1;
}
}
@@ -2055,10 +2035,10 @@ int SecCamera::getWDR(void)
int SecCamera::setAntiShake(int anti_shake)
{
- LOGV("%s(anti_shake(%d))", __func__, anti_shake);
+ ALOGV("%s(anti_shake(%d))", __func__, anti_shake);
if (anti_shake < ANTI_SHAKE_OFF || ANTI_SHAKE_MAX <= anti_shake) {
- LOGE("ERR(%s):Invalid anti_shake (%d)", __func__, anti_shake);
+ ALOGE("ERR(%s):Invalid anti_shake (%d)", __func__, anti_shake);
return -1;
}
@@ -2066,7 +2046,7 @@ int SecCamera::setAntiShake(int anti_shake)
m_anti_shake = anti_shake;
if (m_flag_camera_start) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_ANTI_SHAKE, anti_shake) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_ANTI_SHAKE", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_ANTI_SHAKE", __func__);
return -1;
}
}
@@ -2085,10 +2065,10 @@ int SecCamera::getAntiShake(void)
int SecCamera::setMetering(int metering_value)
{
- LOGV("%s(metering (%d))", __func__, metering_value);
+ ALOGV("%s(metering (%d))", __func__, metering_value);
if (metering_value <= METERING_BASE || METERING_MAX <= metering_value) {
- LOGE("ERR(%s):Invalid metering_value (%d)", __func__, metering_value);
+ ALOGE("ERR(%s):Invalid metering_value (%d)", __func__, metering_value);
return -1;
}
@@ -2096,7 +2076,7 @@ int SecCamera::setMetering(int metering_value)
m_params->metering = metering_value;
if (m_flag_camera_start) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_METERING, metering_value) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_METERING", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_METERING", __func__);
return -1;
}
}
@@ -2114,10 +2094,10 @@ int SecCamera::getMetering(void)
int SecCamera::setJpegQuality(int jpeg_quality)
{
- LOGV("%s(jpeg_quality (%d))", __func__, jpeg_quality);
+ ALOGV("%s(jpeg_quality (%d))", __func__, jpeg_quality);
if (jpeg_quality < JPEG_QUALITY_ECONOMY || JPEG_QUALITY_MAX <= jpeg_quality) {
- LOGE("ERR(%s):Invalid jpeg_quality (%d)", __func__, jpeg_quality);
+ ALOGE("ERR(%s):Invalid jpeg_quality (%d)", __func__, jpeg_quality);
return -1;
}
@@ -2125,7 +2105,7 @@ int SecCamera::setJpegQuality(int jpeg_quality)
m_jpeg_quality = jpeg_quality;
if (m_flag_camera_start && (m_camera_id == CAMERA_ID_BACK)) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAM_JPEG_QUALITY, jpeg_quality) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAM_JPEG_QUALITY", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAM_JPEG_QUALITY", __func__);
return -1;
}
}
@@ -2143,10 +2123,10 @@ int SecCamera::getJpegQuality(void)
int SecCamera::setZoom(int zoom_level)
{
- LOGV("%s(zoom_level (%d))", __func__, zoom_level);
+ ALOGV("%s(zoom_level (%d))", __func__, zoom_level);
if (zoom_level < ZOOM_LEVEL_0 || ZOOM_LEVEL_MAX <= zoom_level) {
- LOGE("ERR(%s):Invalid zoom_level (%d)", __func__, zoom_level);
+ ALOGE("ERR(%s):Invalid zoom_level (%d)", __func__, zoom_level);
return -1;
}
@@ -2154,7 +2134,7 @@ int SecCamera::setZoom(int zoom_level)
m_zoom_level = zoom_level;
if (m_flag_camera_start) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_ZOOM, zoom_level) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_ZOOM", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_ZOOM", __func__);
return -1;
}
}
@@ -2172,10 +2152,10 @@ int SecCamera::getZoom(void)
int SecCamera::setObjectTracking(int object_tracking)
{
- LOGV("%s(object_tracking (%d))", __func__, object_tracking);
+ ALOGV("%s(object_tracking (%d))", __func__, object_tracking);
if (object_tracking < OBJECT_TRACKING_OFF || OBJECT_TRACKING_MAX <= object_tracking) {
- LOGE("ERR(%s):Invalid object_tracking (%d)", __func__, object_tracking);
+ ALOGE("ERR(%s):Invalid object_tracking (%d)", __func__, object_tracking);
return -1;
}
@@ -2200,12 +2180,12 @@ int SecCamera::getObjectTrackingStatus(void)
int SecCamera::setObjectTrackingStartStop(int start_stop)
{
- LOGV("%s(object_tracking_start_stop (%d))", __func__, start_stop);
+ ALOGV("%s(object_tracking_start_stop (%d))", __func__, start_stop);
if (m_object_tracking_start_stop != start_stop) {
m_object_tracking_start_stop = start_stop;
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_OBJ_TRACKING_START_STOP, start_stop) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_OBJ_TRACKING_START_STOP", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_OBJ_TRACKING_START_STOP", __func__);
return -1;
}
}
@@ -2215,12 +2195,12 @@ int SecCamera::setObjectTrackingStartStop(int start_stop)
int SecCamera::setTouchAFStartStop(int start_stop)
{
- LOGV("%s(touch_af_start_stop (%d))", __func__, start_stop);
+ ALOGV("%s(touch_af_start_stop (%d))", __func__, start_stop);
if (m_touch_af_start_stop != start_stop) {
m_touch_af_start_stop = start_stop;
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_TOUCH_AF_START_STOP, start_stop) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_TOUCH_AF_START_STOP", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_TOUCH_AF_START_STOP", __func__);
return -1;
}
}
@@ -2232,10 +2212,10 @@ int SecCamera::setTouchAFStartStop(int start_stop)
int SecCamera::setSmartAuto(int smart_auto)
{
- LOGV("%s(smart_auto (%d))", __func__, smart_auto);
+ ALOGV("%s(smart_auto (%d))", __func__, smart_auto);
if (smart_auto < SMART_AUTO_OFF || SMART_AUTO_MAX <= smart_auto) {
- LOGE("ERR(%s):Invalid smart_auto (%d)", __func__, smart_auto);
+ ALOGE("ERR(%s):Invalid smart_auto (%d)", __func__, smart_auto);
return -1;
}
@@ -2243,7 +2223,7 @@ int SecCamera::setSmartAuto(int smart_auto)
m_smart_auto = smart_auto;
if (m_flag_camera_start) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_SMART_AUTO, smart_auto) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_SMART_AUTO", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_SMART_AUTO", __func__);
return -1;
}
}
@@ -2265,21 +2245,21 @@ int SecCamera::getAutosceneStatus(void)
autoscene_status = fimc_v4l2_g_ctrl(m_cam_fd, V4L2_CID_CAMERA_SMART_AUTO_STATUS);
if ((autoscene_status < SMART_AUTO_STATUS_AUTO) || (autoscene_status > SMART_AUTO_STATUS_MAX)) {
- LOGE("ERR(%s):Invalid getAutosceneStatus (%d)", __func__, autoscene_status);
+ ALOGE("ERR(%s):Invalid getAutosceneStatus (%d)", __func__, autoscene_status);
return -1;
}
}
- //LOGV("%s : autoscene_status (%d)", __func__, autoscene_status);
+ //ALOGV("%s : autoscene_status (%d)", __func__, autoscene_status);
return autoscene_status;
}
//======================================================================
int SecCamera::setBeautyShot(int beauty_shot)
{
- LOGV("%s(beauty_shot (%d))", __func__, beauty_shot);
+ ALOGV("%s(beauty_shot (%d))", __func__, beauty_shot);
if (beauty_shot < BEAUTY_SHOT_OFF || BEAUTY_SHOT_MAX <= beauty_shot) {
- LOGE("ERR(%s):Invalid beauty_shot (%d)", __func__, beauty_shot);
+ ALOGE("ERR(%s):Invalid beauty_shot (%d)", __func__, beauty_shot);
return -1;
}
@@ -2287,7 +2267,7 @@ int SecCamera::setBeautyShot(int beauty_shot)
m_beauty_shot = beauty_shot;
if (m_flag_camera_start) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_BEAUTY_SHOT, beauty_shot) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_BEAUTY_SHOT", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_BEAUTY_SHOT", __func__);
return -1;
}
}
@@ -2307,10 +2287,10 @@ int SecCamera::getBeautyShot(void)
int SecCamera::setVintageMode(int vintage_mode)
{
- LOGV("%s(vintage_mode(%d))", __func__, vintage_mode);
+ ALOGV("%s(vintage_mode(%d))", __func__, vintage_mode);
if (vintage_mode <= VINTAGE_MODE_BASE || VINTAGE_MODE_MAX <= vintage_mode) {
- LOGE("ERR(%s):Invalid vintage_mode (%d)", __func__, vintage_mode);
+ ALOGE("ERR(%s):Invalid vintage_mode (%d)", __func__, vintage_mode);
return -1;
}
@@ -2318,7 +2298,7 @@ int SecCamera::setVintageMode(int vintage_mode)
m_vintage_mode = vintage_mode;
if (m_flag_camera_start) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_VINTAGE_MODE, vintage_mode) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_VINTAGE_MODE", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_VINTAGE_MODE", __func__);
return -1;
}
}
@@ -2336,10 +2316,10 @@ int SecCamera::getVintageMode(void)
int SecCamera::setFocusMode(int focus_mode)
{
- LOGV("%s(focus_mode(%d))", __func__, focus_mode);
+ ALOGV("%s(focus_mode(%d))", __func__, focus_mode);
if (FOCUS_MODE_MAX <= focus_mode) {
- LOGE("ERR(%s):Invalid focus_mode (%d)", __func__, focus_mode);
+ ALOGE("ERR(%s):Invalid focus_mode (%d)", __func__, focus_mode);
return -1;
}
@@ -2348,7 +2328,7 @@ int SecCamera::setFocusMode(int focus_mode)
if (m_flag_camera_start) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_FOCUS_MODE, focus_mode) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_FOCUS_MODE", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_FOCUS_MODE", __func__);
return -1;
}
}
@@ -2366,19 +2346,19 @@ int SecCamera::getFocusMode(void)
int SecCamera::setFaceDetect(int face_detect)
{
- LOGV("%s(face_detect(%d))", __func__, face_detect);
+ ALOGV("%s(face_detect(%d))", __func__, face_detect);
if (m_face_detect != face_detect) {
m_face_detect = face_detect;
if (m_flag_camera_start) {
if (m_face_detect != FACE_DETECTION_OFF) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_FOCUS_MODE, FOCUS_MODE_AUTO) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_FOCUS_MODin face detecion", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_FOCUS_MODin face detecion", __func__);
return -1;
}
}
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_FACE_DETECTION, face_detect) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_FACE_DETECTION", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_FACE_DETECTION", __func__);
return -1;
}
}
@@ -2396,7 +2376,7 @@ int SecCamera::getFaceDetect(void)
int SecCamera::setGPSLatitude(const char *gps_latitude)
{
- LOGV("%s(gps_latitude(%s))", __func__, gps_latitude);
+ ALOGV("%s(gps_latitude(%s))", __func__, gps_latitude);
if (gps_latitude == NULL)
m_gps_enabled = false;
else {
@@ -2404,13 +2384,13 @@ int SecCamera::setGPSLatitude(const char *gps_latitude)
m_gps_latitude = lround(strtod(gps_latitude, NULL) * 10000000);
}
- LOGV("%s(m_gps_latitude(%ld))", __func__, m_gps_latitude);
+ ALOGV("%s(m_gps_latitude(%ld))", __func__, m_gps_latitude);
return 0;
}
int SecCamera::setGPSLongitude(const char *gps_longitude)
{
- LOGV("%s(gps_longitude(%s))", __func__, gps_longitude);
+ ALOGV("%s(gps_longitude(%s))", __func__, gps_longitude);
if (gps_longitude == NULL)
m_gps_enabled = false;
else {
@@ -2418,38 +2398,38 @@ int SecCamera::setGPSLongitude(const char *gps_longitude)
m_gps_longitude = lround(strtod(gps_longitude, NULL) * 10000000);
}
- LOGV("%s(m_gps_longitude(%ld))", __func__, m_gps_longitude);
+ ALOGV("%s(m_gps_longitude(%ld))", __func__, m_gps_longitude);
return 0;
}
int SecCamera::setGPSAltitude(const char *gps_altitude)
{
- LOGV("%s(gps_altitude(%s))", __func__, gps_altitude);
+ ALOGV("%s(gps_altitude(%s))", __func__, gps_altitude);
if (gps_altitude == NULL)
m_gps_altitude = 0;
else {
m_gps_altitude = lround(strtod(gps_altitude, NULL) * 100);
}
- LOGV("%s(m_gps_altitude(%ld))", __func__, m_gps_altitude);
+ ALOGV("%s(m_gps_altitude(%ld))", __func__, m_gps_altitude);
return 0;
}
int SecCamera::setGPSTimeStamp(const char *gps_timestamp)
{
- LOGV("%s(gps_timestamp(%s))", __func__, gps_timestamp);
+ ALOGV("%s(gps_timestamp(%s))", __func__, gps_timestamp);
if (gps_timestamp == NULL)
m_gps_timestamp = 0;
else
m_gps_timestamp = atol(gps_timestamp);
- LOGV("%s(m_gps_timestamp(%ld))", __func__, m_gps_timestamp);
+ ALOGV("%s(m_gps_timestamp(%ld))", __func__, m_gps_timestamp);
return 0;
}
int SecCamera::setGPSProcessingMethod(const char *gps_processing_method)
{
- LOGV("%s(gps_processing_method(%s))", __func__, gps_processing_method);
+ ALOGV("%s(gps_processing_method(%s))", __func__, gps_processing_method);
memset(mExifInfo.gps_processing_method, 0, sizeof(mExifInfo.gps_processing_method));
if (gps_processing_method != NULL) {
size_t len = strlen(gps_processing_method);
@@ -2463,10 +2443,10 @@ int SecCamera::setGPSProcessingMethod(const char *gps_processing_method)
int SecCamera::setFaceDetectLockUnlock(int facedetect_lockunlock)
{
- LOGV("%s(facedetect_lockunlock(%d))", __func__, facedetect_lockunlock);
+ ALOGV("%s(facedetect_lockunlock(%d))", __func__, facedetect_lockunlock);
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_FACEDETECT_LOCKUNLOCK, facedetect_lockunlock) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_FACEDETECT_LOCKUNLOCK", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_FACEDETECT_LOCKUNLOCK", __func__);
return -1;
}
@@ -2475,15 +2455,15 @@ int SecCamera::setFaceDetectLockUnlock(int facedetect_lockunlock)
int SecCamera::setObjectPosition(int x, int y)
{
- LOGV("%s(setObjectPosition(x=%d, y=%d))", __func__, x, y);
+ ALOGV("%s(setObjectPosition(x=%d, y=%d))", __func__, x, y);
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_OBJECT_POSITION_X, x) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_OBJECT_POSITION_X", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_OBJECT_POSITION_X", __func__);
return -1;
}
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_OBJECT_POSITION_Y, y) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_OBJECT_POSITION_Y", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_OBJECT_POSITION_Y", __func__);
return -1;
}
@@ -2494,10 +2474,10 @@ int SecCamera::setObjectPosition(int x, int y)
int SecCamera::setGamma(int gamma)
{
- LOGV("%s(gamma(%d))", __func__, gamma);
+ ALOGV("%s(gamma(%d))", __func__, gamma);
if (gamma < GAMMA_OFF || GAMMA_MAX <= gamma) {
- LOGE("ERR(%s):Invalid gamma (%d)", __func__, gamma);
+ ALOGE("ERR(%s):Invalid gamma (%d)", __func__, gamma);
return -1;
}
@@ -2505,7 +2485,7 @@ int SecCamera::setGamma(int gamma)
m_video_gamma = gamma;
if (m_flag_camera_start) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_SET_GAMMA, gamma) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_SET_GAMMA", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_SET_GAMMA", __func__);
return -1;
}
}
@@ -2518,10 +2498,10 @@ int SecCamera::setGamma(int gamma)
int SecCamera::setSlowAE(int slow_ae)
{
- LOGV("%s(slow_ae(%d))", __func__, slow_ae);
+ ALOGV("%s(slow_ae(%d))", __func__, slow_ae);
if (slow_ae < GAMMA_OFF || GAMMA_MAX <= slow_ae) {
- LOGE("ERR(%s):Invalid slow_ae (%d)", __func__, slow_ae);
+ ALOGE("ERR(%s):Invalid slow_ae (%d)", __func__, slow_ae);
return -1;
}
@@ -2529,7 +2509,7 @@ int SecCamera::setSlowAE(int slow_ae)
m_slow_ae = slow_ae;
if (m_flag_camera_start) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_SET_SLOW_AE, slow_ae) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_SET_SLOW_AE", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_SET_SLOW_AE", __func__);
return -1;
}
}
@@ -2541,7 +2521,7 @@ int SecCamera::setSlowAE(int slow_ae)
//======================================================================
int SecCamera::setRecordingSize(int width, int height)
{
- LOGV("%s(width(%d), height(%d))", __func__, width, height);
+ ALOGV("%s(width(%d), height(%d))", __func__, width, height);
m_recording_width = width;
m_recording_height = height;
@@ -2553,10 +2533,10 @@ int SecCamera::setRecordingSize(int width, int height)
int SecCamera::setExifOrientationInfo(int orientationInfo)
{
- LOGV("%s(orientationInfo(%d))", __func__, orientationInfo);
+ ALOGV("%s(orientationInfo(%d))", __func__, orientationInfo);
if (orientationInfo < 0) {
- LOGE("ERR(%s):Invalid orientationInfo (%d)", __func__, orientationInfo);
+ ALOGE("ERR(%s):Invalid orientationInfo (%d)", __func__, orientationInfo);
return -1;
}
m_exif_orientation = orientationInfo;
@@ -2569,7 +2549,7 @@ int SecCamera::setBatchReflection()
{
if (m_flag_camera_start) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_BATCH_REFLECTION, 1) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_BATCH_REFLECTION", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_BATCH_REFLECTION", __func__);
return -1;
}
}
@@ -2580,10 +2560,10 @@ int SecCamera::setBatchReflection()
/*Video call*/
int SecCamera::setVTmode(int vtmode)
{
- LOGV("%s(vtmode (%d))", __func__, vtmode);
+ ALOGV("%s(vtmode (%d))", __func__, vtmode);
if (vtmode < VT_MODE_OFF || VT_MODE_MAX <= vtmode) {
- LOGE("ERR(%s):Invalid vtmode (%d)", __func__, vtmode);
+ ALOGE("ERR(%s):Invalid vtmode (%d)", __func__, vtmode);
return -1;
}
@@ -2597,10 +2577,10 @@ int SecCamera::setVTmode(int vtmode)
/* Camcorder fix fps */
int SecCamera::setSensorMode(int sensor_mode)
{
- LOGV("%s(sensor_mode (%d))", __func__, sensor_mode);
+ ALOGV("%s(sensor_mode (%d))", __func__, sensor_mode);
if (sensor_mode < SENSOR_MODE_CAMERA || SENSOR_MODE_MOVIE < sensor_mode) {
- LOGE("ERR(%s):Invalid sensor mode (%d)", __func__, sensor_mode);
+ ALOGE("ERR(%s):Invalid sensor mode (%d)", __func__, sensor_mode);
return -1;
}
@@ -2620,9 +2600,9 @@ int SecCamera::setSensorMode(int sensor_mode)
*/
int SecCamera::setShotMode(int shot_mode)
{
- LOGV("%s(shot_mode (%d))", __func__, shot_mode);
+ ALOGV("%s(shot_mode (%d))", __func__, shot_mode);
if (shot_mode < SHOT_MODE_SINGLE || SHOT_MODE_SELF < shot_mode) {
- LOGE("ERR(%s):Invalid shot_mode (%d)", __func__, shot_mode);
+ ALOGE("ERR(%s):Invalid shot_mode (%d)", __func__, shot_mode);
return -1;
}
m_shot_mode = shot_mode;
@@ -2637,10 +2617,10 @@ int SecCamera::getVTmode(void)
int SecCamera::setBlur(int blur_level)
{
- LOGV("%s(level (%d))", __func__, blur_level);
+ ALOGV("%s(level (%d))", __func__, blur_level);
if (blur_level < BLUR_LEVEL_0 || BLUR_LEVEL_MAX <= blur_level) {
- LOGE("ERR(%s):Invalid level (%d)", __func__, blur_level);
+ ALOGE("ERR(%s):Invalid level (%d)", __func__, blur_level);
return -1;
}
@@ -2648,7 +2628,7 @@ int SecCamera::setBlur(int blur_level)
m_blur_level = blur_level;
if (m_flag_camera_start) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_VGA_BLUR, blur_level) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_VGA_BLUR", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_VGA_BLUR", __func__);
return -1;
}
}
@@ -2663,10 +2643,10 @@ int SecCamera::getBlur(void)
int SecCamera::setDataLineCheck(int chk_dataline)
{
- LOGV("%s(chk_dataline (%d))", __func__, chk_dataline);
+ ALOGV("%s(chk_dataline (%d))", __func__, chk_dataline);
if (chk_dataline < CHK_DATALINE_OFF || CHK_DATALINE_MAX <= chk_dataline) {
- LOGE("ERR(%s):Invalid chk_dataline (%d)", __func__, chk_dataline);
+ ALOGE("ERR(%s):Invalid chk_dataline (%d)", __func__, chk_dataline);
return -1;
}
@@ -2682,11 +2662,11 @@ int SecCamera::getDataLineCheck(void)
int SecCamera::setDataLineCheckStop(void)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
if (m_flag_camera_start) {
if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_CHECK_DATALINE_STOP, 1) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_CHECK_DATALINE_STOP", __func__);
+ ALOGE("ERR(%s):Fail on V4L2_CID_CAMERA_CHECK_DATALINE_STOP", __func__);
return -1;
}
}
@@ -2695,7 +2675,7 @@ int SecCamera::setDataLineCheckStop(void)
const __u8* SecCamera::getCameraSensorName(void)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
return fimc_v4l2_enuminput(m_cam_fd, getCameraId());
}
@@ -2703,7 +2683,7 @@ const __u8* SecCamera::getCameraSensorName(void)
#ifdef ENABLE_ESD_PREVIEW_CHECK
int SecCamera::getCameraSensorESDStatus(void)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
// 0 : normal operation, 1 : abnormal operation
int status = fimc_v4l2_g_ctrl(m_cam_fd, V4L2_CID_ESD_INT);
@@ -2717,7 +2697,7 @@ int SecCamera::getCameraSensorESDStatus(void)
int SecCamera::setJpegThumbnailSize(int width, int height)
{
- LOGV("%s(width(%d), height(%d))", __func__, width, height);
+ ALOGV("%s(width(%d), height(%d))", __func__, width, height);
m_jpeg_thumbnail_width = width;
m_jpeg_thumbnail_height = height;
@@ -2841,7 +2821,7 @@ void SecCamera::setExifChangedAttribute()
it current returns a negative err value, so avoid putting
odd value into exif for now */
if (shutterSpeed < 0) {
- LOGE("%s: error %d getting shutterSpeed, camera_id = %d, using 100",
+ ALOGE("%s: error %d getting shutterSpeed, camera_id = %d, using 100",
__func__, shutterSpeed, m_camera_id);
shutterSpeed = 100;
}
@@ -2855,7 +2835,7 @@ void SecCamera::setExifChangedAttribute()
it current returns a negative err value, so avoid putting
odd value into exif for now */
if (iso < 0) {
- LOGE("%s: error %d getting iso, camera_id = %d, using 100",
+ ALOGE("%s: error %d getting iso, camera_id = %d, using 100",
__func__, iso, m_camera_id);
iso = ISO_100;
}
@@ -2889,8 +2869,8 @@ void SecCamera::setExifChangedAttribute()
sv = APEX_ISO_TO_FILMSENSITIVITY(mExifInfo.iso_speed_rating);
bv = av + tv - sv;
ev = av + tv;
- LOGD("Shutter speed=%d us, iso=%d\n", shutterSpeed, mExifInfo.iso_speed_rating);
- LOGD("AV=%d, TV=%d, SV=%d\n", av, tv, sv);
+ ALOGD("Shutter speed=%d us, iso=%d\n", shutterSpeed, mExifInfo.iso_speed_rating);
+ ALOGD("AV=%d, TV=%d, SV=%d\n", av, tv, sv);
//3 Shutter Speed
mExifInfo.shutter_speed.num = tv*EXIF_DEF_APEX_DEN;
@@ -3031,7 +3011,7 @@ inline int SecCamera::m_frameSize(int format, int width, int height)
break;
default :
- LOGE("ERR(%s):Invalid V4L2 pixel format(%d)\n", __func__, format);
+ ALOGE("ERR(%s):Invalid V4L2 pixel format(%d)\n", __func__, format);
case V4L2_PIX_FMT_RGB565:
size = (width * height * BPP);
break;
diff --git a/libcamera/SecCamera.h b/libcamera/SecCamera.h
index ec0e470..a6cca4e 100755
--- a/libcamera/SecCamera.h
+++ b/libcamera/SecCamera.h
@@ -46,8 +46,8 @@ namespace android {
#define ENABLE_ESD_PREVIEW_CHECK
#if defined(LOG_NDEBUG) && LOG_NDEBUG == 0
-#define LOG_CAMERA LOGD
-#define LOG_CAMERA_PREVIEW LOGD
+#define LOG_CAMERA ALOGD
+#define LOG_CAMERA_PREVIEW ALOGD
#define LOG_TIME_DEFINE(n) \
struct timeval time_start_##n, time_stop_##n; unsigned long log_time_##n = 0;
diff --git a/libcamera/SecCameraHWInterface.cpp b/libcamera/SecCameraHWInterface.cpp
index 87c2b96..63574e6 100755
--- a/libcamera/SecCameraHWInterface.cpp
+++ b/libcamera/SecCameraHWInterface.cpp
@@ -27,7 +27,7 @@
#include <fcntl.h>
#include <sys/mman.h>
#include <camera/Camera.h>
-#include <media/stagefright/MetadataBufferType.h>
+#include <MetadataBufferType.h>
#define VIDEO_COMMENT_MARKER_H 0xFFBE
#define VIDEO_COMMENT_MARKER_L 0xFFBF
@@ -92,7 +92,7 @@ CameraHardwareSec::CameraHardwareSec(int cameraId, camera_device_t *dev)
mPostViewSize(0),
mHalDevice(dev)
{
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
int ret = 0;
mPreviewWindow = NULL;
@@ -105,16 +105,16 @@ CameraHardwareSec::CameraHardwareSec(int cameraId, camera_device_t *dev)
if (!mGrallocHal) {
ret = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, (const hw_module_t **)&mGrallocHal);
if (ret)
- LOGE("ERR(%s):Fail on loading gralloc HAL", __func__);
+ ALOGE("ERR(%s):Fail on loading gralloc HAL", __func__);
}
ret = mSecCamera->initCamera(cameraId);
if (ret < 0) {
- LOGE("ERR(%s):Fail on mSecCamera init", __func__);
+ ALOGE("ERR(%s):Fail on mSecCamera init", __func__);
}
mSecCamera->getPostViewConfig(&mPostViewWidth, &mPostViewHeight, &mPostViewSize);
- LOGV("mPostViewWidth = %d mPostViewHeight = %d mPostViewSize = %d",
+ ALOGV("mPostViewWidth = %d mPostViewHeight = %d mPostViewSize = %d",
mPostViewWidth,mPostViewHeight,mPostViewSize);
initDefaultParameters(cameraId);
@@ -139,7 +139,7 @@ int CameraHardwareSec::getCameraId() const
void CameraHardwareSec::initDefaultParameters(int cameraId)
{
if (mSecCamera == NULL) {
- LOGE("ERR(%s):mSecCamera object is NULL", __func__);
+ ALOGE("ERR(%s):mSecCamera object is NULL", __func__);
return;
}
@@ -147,7 +147,7 @@ void CameraHardwareSec::initDefaultParameters(int cameraId)
CameraParameters ip;
mCameraSensorName = mSecCamera->getCameraSensorName();
- LOGV("CameraSensorName: %s", mCameraSensorName);
+ ALOGV("CameraSensorName: %s", mCameraSensorName);
int preview_max_width = 0;
int preview_max_height = 0;
@@ -172,11 +172,11 @@ void CameraHardwareSec::initDefaultParameters(int cameraId)
// sizes at zero to catch the error.
if (mSecCamera->getPreviewMaxSize(&preview_max_width,
&preview_max_height) < 0)
- LOGE("getPreviewMaxSize fail (%d / %d) \n",
+ ALOGE("getPreviewMaxSize fail (%d / %d) \n",
preview_max_width, preview_max_height);
if (mSecCamera->getSnapshotMaxSize(&snapshot_max_width,
&snapshot_max_height) < 0)
- LOGE("getSnapshotMaxSize fail (%d / %d) \n",
+ ALOGE("getSnapshotMaxSize fail (%d / %d) \n",
snapshot_max_width, snapshot_max_height);
String8 previewColorString;
previewColorString = CameraParameters::PIXEL_FORMAT_YUV420SP;
@@ -363,7 +363,7 @@ void CameraHardwareSec::initDefaultParameters(int cameraId)
CameraHardwareSec::~CameraHardwareSec()
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
mSecCamera->DeinitCamera();
}
@@ -372,33 +372,33 @@ status_t CameraHardwareSec::setPreviewWindow(preview_stream_ops *w)
int min_bufs;
mPreviewWindow = w;
- LOGV("%s: mPreviewWindow %p", __func__, mPreviewWindow);
+ ALOGV("%s: mPreviewWindow %p", __func__, mPreviewWindow);
if (!w) {
- LOGE("preview window is NULL!");
+ ALOGE("preview window is NULL!");
return OK;
}
mPreviewLock.lock();
if (mPreviewRunning && !mPreviewStartDeferred) {
- LOGI("stop preview (window change)");
+ ALOGI("stop preview (window change)");
stopPreviewInternal();
}
if (w->get_min_undequeued_buffer_count(w, &min_bufs)) {
- LOGE("%s: could not retrieve min undequeued buffer count", __func__);
+ ALOGE("%s: could not retrieve min undequeued buffer count", __func__);
return INVALID_OPERATION;
}
if (min_bufs >= kBufferCount) {
- LOGE("%s: min undequeued buffer count %d is too high (expecting at most %d)", __func__,
+ ALOGE("%s: min undequeued buffer count %d is too high (expecting at most %d)", __func__,
min_bufs, kBufferCount - 1);
}
- LOGV("%s: setting buffer count to %d", __func__, kBufferCount);
+ ALOGV("%s: setting buffer count to %d", __func__, kBufferCount);
if (w->set_buffer_count(w, kBufferCount)) {
- LOGE("%s: could not set buffer count", __func__);
+ ALOGE("%s: could not set buffer count", __func__);
return INVALID_OPERATION;
}
@@ -408,23 +408,23 @@ status_t CameraHardwareSec::setPreviewWindow(preview_stream_ops *w)
int hal_pixel_format = HAL_PIXEL_FORMAT_YV12;
const char *str_preview_format = mParameters.getPreviewFormat();
- LOGV("%s: preview format %s", __func__, str_preview_format);
+ ALOGV("%s: preview format %s", __func__, str_preview_format);
if (w->set_usage(w, GRALLOC_USAGE_SW_WRITE_OFTEN)) {
- LOGE("%s: could not set usage on gralloc buffer", __func__);
+ ALOGE("%s: could not set usage on gralloc buffer", __func__);
return INVALID_OPERATION;
}
if (w->set_buffers_geometry(w,
preview_width, preview_height,
hal_pixel_format)) {
- LOGE("%s: could not set buffers geometry to %s",
+ ALOGE("%s: could not set buffers geometry to %s",
__func__, str_preview_format);
return INVALID_OPERATION;
}
if (mPreviewRunning && mPreviewStartDeferred) {
- LOGV("start/resume preview");
+ ALOGV("start/resume preview");
status_t ret = startPreviewInternal();
if (ret == OK) {
mPreviewStartDeferred = false;
@@ -451,19 +451,19 @@ void CameraHardwareSec::setCallbacks(camera_notify_callback notify_cb,
void CameraHardwareSec::enableMsgType(int32_t msgType)
{
- LOGV("%s : msgType = 0x%x, mMsgEnabled before = 0x%x",
+ ALOGV("%s : msgType = 0x%x, mMsgEnabled before = 0x%x",
__func__, msgType, mMsgEnabled);
mMsgEnabled |= msgType;
- LOGV("%s : mMsgEnabled = 0x%x", __func__, mMsgEnabled);
+ ALOGV("%s : mMsgEnabled = 0x%x", __func__, mMsgEnabled);
}
void CameraHardwareSec::disableMsgType(int32_t msgType)
{
- LOGV("%s : msgType = 0x%x, mMsgEnabled before = 0x%x",
+ ALOGV("%s : msgType = 0x%x, mMsgEnabled before = 0x%x",
__func__, msgType, mMsgEnabled);
mMsgEnabled &= ~msgType;
- LOGV("%s : mMsgEnabled = 0x%x", __func__, mMsgEnabled);
+ ALOGV("%s : mMsgEnabled = 0x%x", __func__, mMsgEnabled);
}
bool CameraHardwareSec::msgTypeEnabled(int32_t msgType)
@@ -483,21 +483,21 @@ void CameraHardwareSec::setSkipFrame(int frame)
int CameraHardwareSec::previewThreadWrapper()
{
- LOGI("%s: starting", __func__);
+ ALOGI("%s: starting", __func__);
while (1) {
mPreviewLock.lock();
while (!mPreviewRunning) {
- LOGI("%s: calling mSecCamera->stopPreview() and waiting", __func__);
+ ALOGI("%s: calling mSecCamera->stopPreview() and waiting", __func__);
mSecCamera->stopPreview();
/* signal that we're stopping */
mPreviewStoppedCondition.signal();
mPreviewCondition.wait(mPreviewLock);
- LOGI("%s: return from wait", __func__);
+ ALOGI("%s: return from wait", __func__);
}
mPreviewLock.unlock();
if (mExitPreviewThread) {
- LOGI("%s: exiting", __func__);
+ ALOGI("%s: exiting", __func__);
mSecCamera->stopPreview();
return 0;
}
@@ -515,17 +515,17 @@ int CameraHardwareSec::previewThread()
index = mSecCamera->getPreview();
if (index < 0) {
- LOGE("ERR(%s):Fail on SecCamera->getPreview()", __func__);
+ ALOGE("ERR(%s):Fail on SecCamera->getPreview()", __func__);
return UNKNOWN_ERROR;
}
-// LOGV("%s: index %d", __func__, index);
+// ALOGV("%s: index %d", __func__, index);
mSkipFrameLock.lock();
if (mSkipFrame > 0) {
mSkipFrame--;
mSkipFrameLock.unlock();
- LOGV("%s: index %d skipping frame", __func__, index);
+ ALOGV("%s: index %d skipping frame", __func__, index);
return NO_ERROR;
}
mSkipFrameLock.unlock();
@@ -536,7 +536,7 @@ int CameraHardwareSec::previewThread()
phyCAddr = mSecCamera->getPhyAddrC(index);
if (phyYAddr == 0xffffffff || phyCAddr == 0xffffffff) {
- LOGE("ERR(%s):Fail on SecCamera getPhyAddr Y addr = %0x C addr = %0x",
+ ALOGE("ERR(%s):Fail on SecCamera getPhyAddr Y addr = %0x C addr = %0x",
__func__, phyYAddr, phyCAddr);
return UNKNOWN_ERROR;
}
@@ -551,7 +551,7 @@ int CameraHardwareSec::previewThread()
buffer_handle_t *buf_handle;
int stride;
if (0 != mPreviewWindow->dequeue_buffer(mPreviewWindow, &buf_handle, &stride)) {
- LOGE("Could not dequeue gralloc buffer!\n");
+ ALOGE("Could not dequeue gralloc buffer!\n");
goto callbacks;
}
@@ -597,10 +597,10 @@ int CameraHardwareSec::previewThread()
mGrallocHal->unlock(mGrallocHal, *buf_handle);
}
else
- LOGE("%s: could not obtain gralloc buffer", __func__);
+ ALOGE("%s: could not obtain gralloc buffer", __func__);
if (0 != mPreviewWindow->enqueue_buffer(mPreviewWindow, buf_handle)) {
- LOGE("Could not enqueue gralloc buffer!\n");
+ ALOGE("Could not enqueue gralloc buffer!\n");
goto callbacks;
}
}
@@ -632,7 +632,7 @@ callbacks:
if (mRecordRunning == true) {
index = mSecCamera->getRecordFrame();
if (index < 0) {
- LOGE("ERR(%s):Fail on SecCamera->getRecord()", __func__);
+ ALOGE("ERR(%s):Fail on SecCamera->getRecord()", __func__);
return UNKNOWN_ERROR;
}
@@ -640,7 +640,7 @@ callbacks:
phyCAddr = mSecCamera->getRecPhyAddrC(index);
if (phyYAddr == 0xffffffff || phyCAddr == 0xffffffff) {
- LOGE("ERR(%s):Fail on SecCamera getRectPhyAddr Y addr = %0x C addr = %0x", __func__,
+ ALOGE("ERR(%s):Fail on SecCamera getRectPhyAddr Y addr = %0x C addr = %0x", __func__,
phyYAddr, phyCAddr);
return UNKNOWN_ERROR;
}
@@ -668,7 +668,7 @@ status_t CameraHardwareSec::startPreview()
{
int ret = 0; //s1 [Apply factory standard]
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
if (waitCaptureCompletion() != NO_ERROR) {
return TIMED_OUT;
@@ -677,7 +677,7 @@ status_t CameraHardwareSec::startPreview()
mPreviewLock.lock();
if (mPreviewRunning) {
// already running
- LOGE("%s : preview thread already running", __func__);
+ ALOGE("%s : preview thread already running", __func__);
mPreviewLock.unlock();
return INVALID_OPERATION;
}
@@ -686,7 +686,7 @@ status_t CameraHardwareSec::startPreview()
mPreviewStartDeferred = false;
if (!mPreviewWindow) {
- LOGI("%s : deferring", __func__);
+ ALOGI("%s : deferring", __func__);
mPreviewStartDeferred = true;
mPreviewLock.unlock();
return NO_ERROR;
@@ -702,13 +702,13 @@ status_t CameraHardwareSec::startPreview()
status_t CameraHardwareSec::startPreviewInternal()
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
int ret = mSecCamera->startPreview();
- LOGV("%s : mSecCamera->startPreview() returned %d", __func__, ret);
+ ALOGV("%s : mSecCamera->startPreview() returned %d", __func__, ret);
if (ret < 0) {
- LOGE("ERR(%s):Fail on mSecCamera->startPreview()", __func__);
+ ALOGE("ERR(%s):Fail on mSecCamera->startPreview()", __func__);
return UNKNOWN_ERROR;
}
@@ -718,7 +718,7 @@ status_t CameraHardwareSec::startPreviewInternal()
mSecCamera->getPreviewSize(&width, &height, &frame_size);
- LOGD("mPreviewHeap(fd(%d), size(%d), width(%d), height(%d))",
+ ALOGD("mPreviewHeap(fd(%d), size(%d), width(%d), height(%d))",
mSecCamera->getCameraFd(), frame_size, width, height);
if (mPreviewHeap) {
mPreviewHeap->release(mPreviewHeap);
@@ -731,7 +731,7 @@ status_t CameraHardwareSec::startPreviewInternal()
0); // no cookie
mSecCamera->getPostViewConfig(&mPostViewWidth, &mPostViewHeight, &mPostViewSize);
- LOGV("CameraHardwareSec: mPostViewWidth = %d mPostViewHeight = %d mPostViewSize = %d",
+ ALOGV("CameraHardwareSec: mPostViewWidth = %d mPostViewHeight = %d mPostViewSize = %d",
mPostViewWidth,mPostViewHeight,mPostViewSize);
return NO_ERROR;
@@ -739,7 +739,7 @@ status_t CameraHardwareSec::startPreviewInternal()
void CameraHardwareSec::stopPreviewInternal()
{
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
/* request that the preview thread stop. */
if (mPreviewRunning) {
@@ -750,14 +750,14 @@ void CameraHardwareSec::stopPreviewInternal()
mPreviewStoppedCondition.wait(mPreviewLock);
}
else
- LOGV("%s : preview running but deferred, doing nothing", __func__);
+ ALOGV("%s : preview running but deferred, doing nothing", __func__);
} else
- LOGI("%s : preview not running, doing nothing", __func__);
+ ALOGI("%s : preview not running, doing nothing", __func__);
}
void CameraHardwareSec::stopPreview()
{
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
/* request that the preview thread stop. */
mPreviewLock.lock();
@@ -768,7 +768,7 @@ void CameraHardwareSec::stopPreview()
bool CameraHardwareSec::previewEnabled()
{
Mutex::Autolock lock(mPreviewLock);
- LOGV("%s : %d", __func__, mPreviewRunning);
+ ALOGV("%s : %d", __func__, mPreviewRunning);
return mPreviewRunning;
}
@@ -776,7 +776,7 @@ bool CameraHardwareSec::previewEnabled()
status_t CameraHardwareSec::startRecording()
{
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
Mutex::Autolock lock(mRecordLock);
@@ -786,13 +786,13 @@ status_t CameraHardwareSec::startRecording()
}
mRecordHeap = mGetMemoryCb(-1, sizeof(struct addrs), kBufferCount, NULL);
if (!mRecordHeap) {
- LOGE("ERR(%s): Record heap creation fail", __func__);
+ ALOGE("ERR(%s): Record heap creation fail", __func__);
return UNKNOWN_ERROR;
}
if (mRecordRunning == false) {
if (mSecCamera->startRecord() < 0) {
- LOGE("ERR(%s):Fail on mSecCamera->startRecord()", __func__);
+ ALOGE("ERR(%s):Fail on mSecCamera->startRecord()", __func__);
return UNKNOWN_ERROR;
}
mRecordRunning = true;
@@ -802,13 +802,13 @@ status_t CameraHardwareSec::startRecording()
void CameraHardwareSec::stopRecording()
{
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
Mutex::Autolock lock(mRecordLock);
if (mRecordRunning == true) {
if (mSecCamera->stopRecord() < 0) {
- LOGE("ERR(%s):Fail on mSecCamera->stopRecord()", __func__);
+ ALOGE("ERR(%s):Fail on mSecCamera->stopRecord()", __func__);
return;
}
mRecordRunning = false;
@@ -817,7 +817,7 @@ void CameraHardwareSec::stopRecording()
bool CameraHardwareSec::recordingEnabled()
{
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
return mRecordRunning;
}
@@ -835,7 +835,7 @@ int CameraHardwareSec::autoFocusThread()
int count =0;
int af_status =0 ;
- LOGV("%s : starting", __func__);
+ ALOGV("%s : starting", __func__);
/* block until we're told to start. we don't want to use
* a restartable thread and requestExitAndWait() in cancelAutoFocus()
@@ -847,32 +847,32 @@ int CameraHardwareSec::autoFocusThread()
/* check early exit request */
if (mExitAutoFocusThread) {
mFocusLock.unlock();
- LOGV("%s : exiting on request0", __func__);
+ ALOGV("%s : exiting on request0", __func__);
return NO_ERROR;
}
mFocusCondition.wait(mFocusLock);
/* check early exit request */
if (mExitAutoFocusThread) {
mFocusLock.unlock();
- LOGV("%s : exiting on request1", __func__);
+ ALOGV("%s : exiting on request1", __func__);
return NO_ERROR;
}
mFocusLock.unlock();
- LOGV("%s : calling setAutoFocus", __func__);
+ ALOGV("%s : calling setAutoFocus", __func__);
if (mSecCamera->setAutofocus() < 0) {
- LOGE("ERR(%s):Fail on mSecCamera->setAutofocus()", __func__);
+ ALOGE("ERR(%s):Fail on mSecCamera->setAutofocus()", __func__);
return UNKNOWN_ERROR;
}
af_status = mSecCamera->getAutoFocusResult();
if (af_status == 0x01) {
- LOGV("%s : AF Success!!", __func__);
+ ALOGV("%s : AF Success!!", __func__);
if (mMsgEnabled & CAMERA_MSG_FOCUS)
mNotifyCb(CAMERA_MSG_FOCUS, true, 0, mCallbackCookie);
} else if (af_status == 0x02) {
- LOGV("%s : AF Cancelled !!", __func__);
+ ALOGV("%s : AF Cancelled !!", __func__);
if (mMsgEnabled & CAMERA_MSG_FOCUS) {
/* CAMERA_MSG_FOCUS only takes a bool. true for
* finished and false for failure. cancel is still
@@ -881,19 +881,19 @@ int CameraHardwareSec::autoFocusThread()
mNotifyCb(CAMERA_MSG_FOCUS, true, 0, mCallbackCookie);
}
} else {
- LOGV("%s : AF Fail !!", __func__);
- LOGV("%s : mMsgEnabled = 0x%x", __func__, mMsgEnabled);
+ ALOGV("%s : AF Fail !!", __func__);
+ ALOGV("%s : mMsgEnabled = 0x%x", __func__, mMsgEnabled);
if (mMsgEnabled & CAMERA_MSG_FOCUS)
mNotifyCb(CAMERA_MSG_FOCUS, false, 0, mCallbackCookie);
}
- LOGV("%s : exiting with no error", __func__);
+ ALOGV("%s : exiting with no error", __func__);
return NO_ERROR;
}
status_t CameraHardwareSec::autoFocus()
{
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
/* signal autoFocusThread to run once */
mFocusCondition.signal();
return NO_ERROR;
@@ -902,7 +902,12 @@ status_t CameraHardwareSec::autoFocus()
/* 2009.10.14 by icarus for added interface */
status_t CameraHardwareSec::cancelAutoFocus()
{
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
+
+ // If preview is not running, cancel autofocus can still be called.
+ // Since the camera subsystem is completely reset on preview start,
+ // cancel AF is a no-op.
+ if (!mPreviewRunning) return NO_ERROR;
// cancelAutoFocus should be allowed after preview is started. But if
// the preview is deferred, cancelAutoFocus will fail. Ignore it if that is
@@ -910,7 +915,7 @@ status_t CameraHardwareSec::cancelAutoFocus()
if (mPreviewRunning && mPreviewStartDeferred) return NO_ERROR;
if (mSecCamera->cancelAutofocus() < 0) {
- LOGE("ERR(%s):Fail on mSecCamera->cancelAutofocus()", __func__);
+ ALOGE("ERR(%s):Fail on mSecCamera->cancelAutofocus()", __func__);
return UNKNOWN_ERROR;
}
@@ -925,14 +930,14 @@ int CameraHardwareSec::save_jpeg( unsigned char *real_jpeg, int jpeg_size)
/* file create/open, note to "wb" */
yuv_fp = fopen("/data/camera_dump.jpeg", "wb");
if (yuv_fp == NULL) {
- LOGE("Save jpeg file open error");
+ ALOGE("Save jpeg file open error");
return -1;
}
- LOGV("[BestIQ] real_jpeg size ========> %d\n", jpeg_size);
+ ALOGV("[BestIQ] real_jpeg size ========> %d\n", jpeg_size);
buffer = (char *) malloc(jpeg_size);
if (buffer == NULL) {
- LOGE("Save YUV] buffer alloc failed");
+ ALOGE("Save YUV] buffer alloc failed");
if (yuv_fp)
fclose(yuv_fp);
@@ -961,24 +966,24 @@ void CameraHardwareSec::save_postview(const char *fname, uint8_t *buf, uint32_t
int cnt = 0;
uint32_t written = 0;
- LOGD("opening file [%s]\n", fname);
+ ALOGD("opening file [%s]\n", fname);
int fd = open(fname, O_RDWR | O_CREAT);
if (fd < 0) {
- LOGE("failed to create file [%s]: %s", fname, strerror(errno));
+ ALOGE("failed to create file [%s]: %s", fname, strerror(errno));
return;
}
- LOGD("writing %d bytes to file [%s]\n", size, fname);
+ ALOGD("writing %d bytes to file [%s]\n", size, fname);
while (written < size) {
nw = ::write(fd, buf + written, size - written);
if (nw < 0) {
- LOGE("failed to write to file %d [%s]: %s",written,fname, strerror(errno));
+ ALOGE("failed to write to file %d [%s]: %s",written,fname, strerror(errno));
break;
}
written += nw;
cnt++;
}
- LOGD("done writing %d bytes to file [%s] in %d passes\n",size, fname, cnt);
+ ALOGD("done writing %d bytes to file [%s] in %d passes\n",size, fname, cnt);
::close(fd);
}
@@ -990,7 +995,7 @@ bool CameraHardwareSec::scaleDownYuv422(char *srcBuf, uint32_t srcWidth, uint32_
int32_t x, y, src_y_start_pos, dst_pos, src_pos;
if (dstWidth % 2 != 0 || dstHeight % 2 != 0){
- LOGE("scale_down_yuv422: invalid width, height for scaling");
+ ALOGE("scale_down_yuv422: invalid width, height for scaling");
return false;
}
@@ -1047,7 +1052,7 @@ bool CameraHardwareSec::YUY2toNV21(void *srcBuf, void *dstBuf, uint32_t srcWidth
int CameraHardwareSec::pictureThread()
{
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
int jpeg_size = 0;
int ret = NO_ERROR;
@@ -1082,7 +1087,7 @@ int CameraHardwareSec::pictureThread()
addrs[0].width = mPostViewWidth;
addrs[0].height = mPostViewHeight;
- LOGV("[5B] mPostViewWidth = %d mPostViewHeight = %d\n",mPostViewWidth,mPostViewHeight);
+ ALOGV("[5B] mPostViewWidth = %d mPostViewHeight = %d\n",mPostViewWidth,mPostViewHeight);
camera_memory_t *JpegHeap = mGetMemoryCb(-1, mJpegHeapSize, 1, 0);
sp<MemoryHeapBase> PostviewHeap = new MemoryHeapBase(mPostViewSize);
@@ -1107,7 +1112,7 @@ int CameraHardwareSec::pictureThread()
if (mSecCamera->getCameraId() == SecCamera::CAMERA_ID_BACK){
jpeg_data = mSecCamera->getJpeg(&jpeg_size, &phyAddr);
if (jpeg_data == NULL) {
- LOGE("ERR(%s):Fail on SecCamera->getSnapshot()", __func__);
+ ALOGE("ERR(%s):Fail on SecCamera->getSnapshot()", __func__);
ret = UNKNOWN_ERROR;
goto out;
}
@@ -1117,7 +1122,7 @@ int CameraHardwareSec::pictureThread()
ret = UNKNOWN_ERROR;
goto out;
}
- LOGI("snapshotandjpeg done\n");
+ ALOGI("snapshotandjpeg done\n");
}
LOG_TIME_END(1)
@@ -1126,7 +1131,7 @@ int CameraHardwareSec::pictureThread()
if (mSecCamera->getCameraId() == SecCamera::CAMERA_ID_BACK) {
isLSISensor = !strncmp((const char*)mCameraSensorName, "S5K4ECGX", 8);
if(isLSISensor) {
- LOGI("== Camera Sensor Detect %s - Samsung LSI SOC 5M ==\n", mCameraSensorName);
+ ALOGI("== Camera Sensor Detect %s - Samsung LSI SOC 5M ==\n", mCameraSensorName);
// LSI 5M SOC
if (!SplitFrame(jpeg_data, SecCamera::getInterleaveDataSize(),
SecCamera::getJpegLineLength(),
@@ -1137,7 +1142,7 @@ int CameraHardwareSec::pictureThread()
goto out;
}
} else {
- LOGI("== Camera Sensor Detect %s Sony SOC 5M ==\n", mCameraSensorName);
+ ALOGI("== Camera Sensor Detect %s Sony SOC 5M ==\n", mCameraSensorName);
decodeInterleaveData(jpeg_data,
SecCamera::getInterleaveDataSize(),
mPostViewWidth, mPostViewHeight,
@@ -1163,7 +1168,7 @@ int CameraHardwareSec::pictureThread()
JpegExifSize = mSecCamera->getExif((unsigned char *)ExifHeap->data,
(unsigned char *)ThumbnailHeap->base());
- LOGV("JpegExifSize=%d", JpegExifSize);
+ ALOGV("JpegExifSize=%d", JpegExifSize);
if (JpegExifSize < 0) {
ret = UNKNOWN_ERROR;
@@ -1184,7 +1189,7 @@ int CameraHardwareSec::pictureThread()
LOG_TIME_END(0)
LOG_CAMERA("pictureThread interval: %lu us", LOG_TIME(0));
- LOGV("%s : pictureThread end", __func__);
+ ALOGV("%s : pictureThread end", __func__);
out:
JpegHeap->release(JpegHeap);
@@ -1204,10 +1209,10 @@ status_t CameraHardwareSec::waitCaptureCompletion() {
while (mCaptureInProgress) {
nsecs_t remainingTime = endTime - systemTime(SYSTEM_TIME_MONOTONIC);
if (remainingTime <= 0) {
- LOGE("Timed out waiting picture thread.");
+ ALOGE("Timed out waiting picture thread.");
return TIMED_OUT;
}
- LOGD("Waiting for picture thread to complete.");
+ ALOGD("Waiting for picture thread to complete.");
mCaptureCondition.waitRelative(mCaptureLock, remainingTime);
}
return NO_ERROR;
@@ -1215,16 +1220,16 @@ status_t CameraHardwareSec::waitCaptureCompletion() {
status_t CameraHardwareSec::takePicture()
{
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
stopPreview();
if (!mRawHeap) {
int rawHeapSize = mPostViewSize;
- LOGV("mRawHeap : MemoryHeapBase(previewHeapSize(%d))", rawHeapSize);
+ ALOGV("mRawHeap : MemoryHeapBase(previewHeapSize(%d))", rawHeapSize);
mRawHeap = mGetMemoryCb(-1, rawHeapSize, 1, 0);
if (!mRawHeap) {
- LOGE("ERR(%s): Raw heap creation fail", __func__);
+ ALOGE("ERR(%s): Raw heap creation fail", __func__);
}
}
@@ -1233,7 +1238,7 @@ status_t CameraHardwareSec::takePicture()
}
if (mPictureThread->run("CameraPictureThread", PRIORITY_DEFAULT) != NO_ERROR) {
- LOGE("%s : couldn't run picture thread", __func__);
+ ALOGE("%s : couldn't run picture thread", __func__);
return INVALID_OPERATION;
}
mCaptureLock.lock();
@@ -1245,12 +1250,12 @@ status_t CameraHardwareSec::takePicture()
status_t CameraHardwareSec::cancelPicture()
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
if (mPictureThread.get()) {
- LOGV("%s: waiting for picture thread to exit", __func__);
+ ALOGV("%s: waiting for picture thread to exit", __func__);
mPictureThread->requestExitAndWait();
- LOGV("%s: picture thread has exited", __func__);
+ ALOGV("%s: picture thread has exited", __func__);
}
return NO_ERROR;
@@ -1259,7 +1264,7 @@ status_t CameraHardwareSec::cancelPicture()
bool CameraHardwareSec::CheckVideoStartMarker(unsigned char *pBuf)
{
if (!pBuf) {
- LOGE("CheckVideoStartMarker() => pBuf is NULL\n");
+ ALOGE("CheckVideoStartMarker() => pBuf is NULL\n");
return false;
}
@@ -1273,7 +1278,7 @@ bool CameraHardwareSec::CheckVideoStartMarker(unsigned char *pBuf)
bool CameraHardwareSec::CheckEOIMarker(unsigned char *pBuf)
{
if (!pBuf) {
- LOGE("CheckEOIMarker() => pBuf is NULL\n");
+ ALOGE("CheckEOIMarker() => pBuf is NULL\n");
return false;
}
@@ -1287,7 +1292,7 @@ bool CameraHardwareSec::CheckEOIMarker(unsigned char *pBuf)
bool CameraHardwareSec::FindEOIMarkerInJPEG(unsigned char *pBuf, int dwBufSize, int *pnJPEGsize)
{
if (NULL == pBuf || 0 >= dwBufSize) {
- LOGE("FindEOIMarkerInJPEG() => There is no contents.");
+ ALOGE("FindEOIMarkerInJPEG() => There is no contents.");
return false;
}
@@ -1308,15 +1313,15 @@ bool CameraHardwareSec::SplitFrame(unsigned char *pFrame, int dwSize,
void *pJPEG, int *pdwJPEGSize,
void *pVideo, int *pdwVideoSize)
{
- LOGV("===========SplitFrame Start==============");
+ ALOGV("===========SplitFrame Start==============");
if (NULL == pFrame || 0 >= dwSize) {
- LOGE("There is no contents (pFrame=%p, dwSize=%d", pFrame, dwSize);
+ ALOGE("There is no contents (pFrame=%p, dwSize=%d", pFrame, dwSize);
return false;
}
if (0 == dwJPEGLineLength || 0 == dwVideoLineLength) {
- LOGE("There in no input information for decoding interleaved jpeg");
+ ALOGE("There in no input information for decoding interleaved jpeg");
return false;
}
@@ -1385,14 +1390,14 @@ bool CameraHardwareSec::SplitFrame(unsigned char *pFrame, int dwSize,
if(pdwVideoSize)
*pdwVideoSize = dwVSize;
} else {
- LOGE("DecodeInterleaveJPEG_WithOutDT() => Can not find EOI");
+ ALOGE("DecodeInterleaveJPEG_WithOutDT() => Can not find EOI");
bRet = false;
if(pdwJPEGSize)
*pdwJPEGSize = 0;
if(pdwVideoSize)
*pdwVideoSize = 0;
}
- LOGV("===========SplitFrame end==============");
+ ALOGV("===========SplitFrame end==============");
return bRet;
}
@@ -1418,18 +1423,18 @@ int CameraHardwareSec::decodeInterleaveData(unsigned char *pInterleaveData,
int i = 0;
- LOGV("decodeInterleaveData Start~~~");
+ ALOGV("decodeInterleaveData Start~~~");
while (i < interleaveDataSize) {
if ((*interleave_ptr == 0xFFFFFFFF) || (*interleave_ptr == 0x02FFFFFF) ||
(*interleave_ptr == 0xFF02FFFF)) {
// Padding Data
-// LOGE("%d(%x) padding data\n", i, *interleave_ptr);
+// ALOGE("%d(%x) padding data\n", i, *interleave_ptr);
interleave_ptr++;
i += 4;
}
else if ((*interleave_ptr & 0xFFFF) == 0x05FF) {
// Start-code of YUV Data
-// LOGE("%d(%x) yuv data\n", i, *interleave_ptr);
+// ALOGE("%d(%x) yuv data\n", i, *interleave_ptr);
p = (unsigned char *)interleave_ptr;
p += 2;
i += 2;
@@ -1453,7 +1458,7 @@ int CameraHardwareSec::decodeInterleaveData(unsigned char *pInterleaveData,
}
} else {
// Extract JPEG Data
-// LOGE("%d(%x) jpg data, jpeg_size = %d bytes\n", i, *interleave_ptr, jpeg_size);
+// ALOGE("%d(%x) jpg data, jpeg_size = %d bytes\n", i, *interleave_ptr, jpeg_size);
if (pJpegData != NULL) {
memcpy(jpeg_ptr, interleave_ptr, 4);
jpeg_ptr += 4;
@@ -1482,7 +1487,7 @@ int CameraHardwareSec::decodeInterleaveData(unsigned char *pInterleaveData,
}
}
}
- LOGV("decodeInterleaveData End~~~");
+ ALOGV("decodeInterleaveData End~~~");
return ret;
}
@@ -1549,7 +1554,7 @@ bool CameraHardwareSec::isSupportedParameter(const char * const parm,
status_t CameraHardwareSec::setParameters(const CameraParameters& params)
{
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
status_t ret = NO_ERROR;
@@ -1565,12 +1570,12 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
int new_preview_height = 0;
params.getPreviewSize(&new_preview_width, &new_preview_height);
const char *new_str_preview_format = params.getPreviewFormat();
- LOGV("%s : new_preview_width x new_preview_height = %dx%d, format = %s",
+ ALOGV("%s : new_preview_width x new_preview_height = %dx%d, format = %s",
__func__, new_preview_width, new_preview_height, new_str_preview_format);
if (strcmp(new_str_preview_format, CameraParameters::PIXEL_FORMAT_YUV420SP) &&
strcmp(new_str_preview_format, CameraParameters::PIXEL_FORMAT_YUV420P)) {
- LOGE("Unsupported preview color format: %s", new_str_preview_format);
+ ALOGE("Unsupported preview color format: %s", new_str_preview_format);
return BAD_VALUE;
}
@@ -1590,33 +1595,33 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
current_pixel_format != new_preview_format) {
if (mSecCamera->setPreviewSize(new_preview_width, new_preview_height,
new_preview_format) < 0) {
- LOGE("ERR(%s):Fail on mSecCamera->setPreviewSize(width(%d), height(%d), format(%d))",
+ ALOGE("ERR(%s):Fail on mSecCamera->setPreviewSize(width(%d), height(%d), format(%d))",
__func__, new_preview_width, new_preview_height, new_preview_format);
ret = UNKNOWN_ERROR;
} else {
if (mPreviewWindow) {
if (mPreviewRunning && !mPreviewStartDeferred) {
- LOGE("ERR(%s): preview is running, cannot change size and format!",
+ ALOGE("ERR(%s): preview is running, cannot change size and format!",
__func__);
ret = INVALID_OPERATION;
}
- LOGV("%s: mPreviewWindow (%p) set_buffers_geometry", __func__, mPreviewWindow);
- LOGV("%s: mPreviewWindow->set_buffers_geometry (%p)", __func__,
+ ALOGV("%s: mPreviewWindow (%p) set_buffers_geometry", __func__, mPreviewWindow);
+ ALOGV("%s: mPreviewWindow->set_buffers_geometry (%p)", __func__,
mPreviewWindow->set_buffers_geometry);
mPreviewWindow->set_buffers_geometry(mPreviewWindow,
new_preview_width, new_preview_height,
new_preview_format);
- LOGV("%s: DONE mPreviewWindow (%p) set_buffers_geometry", __func__, mPreviewWindow);
+ ALOGV("%s: DONE mPreviewWindow (%p) set_buffers_geometry", __func__, mPreviewWindow);
}
mParameters.setPreviewSize(new_preview_width, new_preview_height);
mParameters.setPreviewFormat(new_str_preview_format);
}
}
- else LOGV("%s: preview size and format has not changed", __func__);
+ else ALOGV("%s: preview size and format has not changed", __func__);
} else {
- LOGE("%s: Invalid preview size(%dx%d)",
+ ALOGE("%s: Invalid preview size(%dx%d)",
__func__, new_preview_width, new_preview_height);
ret = INVALID_OPERATION;
@@ -1626,11 +1631,11 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
int new_picture_height = 0;
params.getPictureSize(&new_picture_width, &new_picture_height);
- LOGV("%s : new_picture_width x new_picture_height = %dx%d", __func__, new_picture_width, new_picture_height);
+ ALOGV("%s : new_picture_width x new_picture_height = %dx%d", __func__, new_picture_width, new_picture_height);
if (0 < new_picture_width && 0 < new_picture_height) {
- LOGV("%s: setSnapshotSize", __func__);
+ ALOGV("%s: setSnapshotSize", __func__);
if (mSecCamera->setSnapshotSize(new_picture_width, new_picture_height) < 0) {
- LOGE("ERR(%s):Fail on mSecCamera->setSnapshotSize(width(%d), height(%d))",
+ ALOGE("ERR(%s):Fail on mSecCamera->setSnapshotSize(width(%d), height(%d))",
__func__, new_picture_width, new_picture_height);
ret = UNKNOWN_ERROR;
} else {
@@ -1640,7 +1645,7 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
// picture format
const char *new_str_picture_format = params.getPictureFormat();
- LOGV("%s : new_str_picture_format %s", __func__, new_str_picture_format);
+ ALOGV("%s : new_str_picture_format %s", __func__, new_str_picture_format);
if (new_str_picture_format != NULL) {
int new_picture_format = 0;
@@ -1668,7 +1673,7 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
new_picture_format = V4L2_PIX_FMT_NV21; //for 3rd party
if (mSecCamera->setSnapshotPixelFormat(new_picture_format) < 0) {
- LOGE("ERR(%s):Fail on mSecCamera->setSnapshotPixelFormat(format(%d))", __func__, new_picture_format);
+ ALOGE("ERR(%s):Fail on mSecCamera->setSnapshotPixelFormat(format(%d))", __func__, new_picture_format);
ret = UNKNOWN_ERROR;
} else {
mParameters.setPictureFormat(new_str_picture_format);
@@ -1677,11 +1682,11 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
//JPEG image quality
int new_jpeg_quality = params.getInt(CameraParameters::KEY_JPEG_QUALITY);
- LOGV("%s : new_jpeg_quality %d", __func__, new_jpeg_quality);
+ ALOGV("%s : new_jpeg_quality %d", __func__, new_jpeg_quality);
/* we ignore bad values */
if (new_jpeg_quality >=1 && new_jpeg_quality <= 100) {
if (mSecCamera->setJpegQuality(new_jpeg_quality) < 0) {
- LOGE("ERR(%s):Fail on mSecCamera->setJpegQuality(quality(%d))", __func__, new_jpeg_quality);
+ ALOGE("ERR(%s):Fail on mSecCamera->setJpegQuality(quality(%d))", __func__, new_jpeg_quality);
ret = UNKNOWN_ERROR;
} else {
mParameters.set(CameraParameters::KEY_JPEG_QUALITY, new_jpeg_quality);
@@ -1693,7 +1698,7 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
int new_jpeg_thumbnail_height= params.getInt(CameraParameters::KEY_JPEG_THUMBNAIL_HEIGHT);
if (0 <= new_jpeg_thumbnail_width && 0 <= new_jpeg_thumbnail_height) {
if (mSecCamera->setJpegThumbnailSize(new_jpeg_thumbnail_width, new_jpeg_thumbnail_height) < 0) {
- LOGE("ERR(%s):Fail on mSecCamera->setJpegThumbnailSize(width(%d), height(%d))", __func__, new_jpeg_thumbnail_width, new_jpeg_thumbnail_height);
+ ALOGE("ERR(%s):Fail on mSecCamera->setJpegThumbnailSize(width(%d), height(%d))", __func__, new_jpeg_thumbnail_width, new_jpeg_thumbnail_height);
ret = UNKNOWN_ERROR;
} else {
mParameters.set(CameraParameters::KEY_JPEG_THUMBNAIL_WIDTH, new_jpeg_thumbnail_width);
@@ -1707,17 +1712,17 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
* on scene mode. don't return an error because it causes CTS failure.
*/
if (new_frame_rate != mParameters.getPreviewFrameRate()) {
- LOGW("WARN(%s): request for preview frame %d not allowed, != %d\n",
+ ALOGW("WARN(%s): request for preview frame %d not allowed, != %d\n",
__func__, new_frame_rate, mParameters.getPreviewFrameRate());
}
// rotation
int new_rotation = params.getInt(CameraParameters::KEY_ROTATION);
- LOGV("%s : new_rotation %d", __func__, new_rotation);
+ ALOGV("%s : new_rotation %d", __func__, new_rotation);
if (0 <= new_rotation) {
- LOGV("%s : set orientation:%d\n", __func__, new_rotation);
+ ALOGV("%s : set orientation:%d\n", __func__, new_rotation);
if (mSecCamera->setExifOrientationInfo(new_rotation) < 0) {
- LOGE("ERR(%s):Fail on mSecCamera->setExifOrientationInfo(%d)", __func__, new_rotation);
+ ALOGE("ERR(%s):Fail on mSecCamera->setExifOrientationInfo(%d)", __func__, new_rotation);
ret = UNKNOWN_ERROR;
} else {
mParameters.set(CameraParameters::KEY_ROTATION, new_rotation);
@@ -1728,11 +1733,11 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
int new_exposure_compensation = params.getInt(CameraParameters::KEY_EXPOSURE_COMPENSATION);
int max_exposure_compensation = params.getInt(CameraParameters::KEY_MAX_EXPOSURE_COMPENSATION);
int min_exposure_compensation = params.getInt(CameraParameters::KEY_MIN_EXPOSURE_COMPENSATION);
- LOGV("%s : new_exposure_compensation %d", __func__, new_exposure_compensation);
+ ALOGV("%s : new_exposure_compensation %d", __func__, new_exposure_compensation);
if ((min_exposure_compensation <= new_exposure_compensation) &&
(max_exposure_compensation >= new_exposure_compensation)) {
if (mSecCamera->setBrightness(new_exposure_compensation) < 0) {
- LOGE("ERR(%s):Fail on mSecCamera->setBrightness(brightness(%d))", __func__, new_exposure_compensation);
+ ALOGE("ERR(%s):Fail on mSecCamera->setBrightness(brightness(%d))", __func__, new_exposure_compensation);
ret = UNKNOWN_ERROR;
} else {
mParameters.set(CameraParameters::KEY_EXPOSURE_COMPENSATION, new_exposure_compensation);
@@ -1741,7 +1746,7 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
// whitebalance
const char *new_white_str = params.get(CameraParameters::KEY_WHITE_BALANCE);
- LOGV("%s : new_white_str %s", __func__, new_white_str);
+ ALOGV("%s : new_white_str %s", __func__, new_white_str);
if (new_white_str != NULL) {
int new_white = -1;
@@ -1760,13 +1765,13 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
CameraParameters::WHITE_BALANCE_INCANDESCENT))
new_white = WHITE_BALANCE_TUNGSTEN;
else {
- LOGE("ERR(%s):Invalid white balance(%s)", __func__, new_white_str); //twilight, shade, warm_flourescent
+ ALOGE("ERR(%s):Invalid white balance(%s)", __func__, new_white_str); //twilight, shade, warm_flourescent
ret = UNKNOWN_ERROR;
}
if (0 <= new_white) {
if (mSecCamera->setWhiteBalance(new_white) < 0) {
- LOGE("ERR(%s):Fail on mSecCamera->setWhiteBalance(white(%d))", __func__, new_white);
+ ALOGE("ERR(%s):Fail on mSecCamera->setWhiteBalance(white(%d))", __func__, new_white);
ret = UNKNOWN_ERROR;
} else {
mParameters.set(CameraParameters::KEY_WHITE_BALANCE, new_white_str);
@@ -1791,9 +1796,9 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
if (new_scene_mode_str && current_scene_mode_str) {
if (!strcmp(new_scene_mode_str, current_scene_mode_str)) {
if ((new_min_fps != current_min_fps) || (new_max_fps != current_max_fps)) {
- LOGW("%s : requested new_min_fps = %d, new_max_fps = %d not allowed",
+ ALOGW("%s : requested new_min_fps = %d, new_max_fps = %d not allowed",
__func__, new_min_fps, new_max_fps);
- LOGE("%s : current_min_fps = %d, current_max_fps = %d",
+ ALOGE("%s : current_min_fps = %d, current_max_fps = %d",
__func__, current_min_fps, current_max_fps);
ret = UNKNOWN_ERROR;
}
@@ -1878,7 +1883,7 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
new_flash_mode_str = CameraParameters::FLASH_MODE_OFF;
mParameters.set(CameraParameters::KEY_SUPPORTED_FLASH_MODES, "off");
} else {
- LOGE("%s::unmatched scene_mode(%s)",
+ ALOGE("%s::unmatched scene_mode(%s)",
__func__, new_scene_mode_str); //action, night-portrait, theatre, steadyphoto
ret = UNKNOWN_ERROR;
}
@@ -1907,13 +1912,13 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
BACK_CAMERA_INFINITY_FOCUS_DISTANCES_STR);
}
else {
- LOGE("%s::unmatched focus_mode(%s)", __func__, new_focus_mode_str);
+ ALOGE("%s::unmatched focus_mode(%s)", __func__, new_focus_mode_str);
ret = UNKNOWN_ERROR;
}
if (0 <= new_focus_mode) {
if (mSecCamera->setFocusMode(new_focus_mode) < 0) {
- LOGE("%s::mSecCamera->setFocusMode(%d) fail", __func__, new_focus_mode);
+ ALOGE("%s::mSecCamera->setFocusMode(%d) fail", __func__, new_focus_mode);
ret = UNKNOWN_ERROR;
} else {
mParameters.set(CameraParameters::KEY_FOCUS_MODE, new_focus_mode_str);
@@ -1934,12 +1939,12 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
else if (!strcmp(new_flash_mode_str, CameraParameters::FLASH_MODE_TORCH))
new_flash_mode = FLASH_MODE_TORCH;
else {
- LOGE("%s::unmatched flash_mode(%s)", __func__, new_flash_mode_str); //red-eye
+ ALOGE("%s::unmatched flash_mode(%s)", __func__, new_flash_mode_str); //red-eye
ret = UNKNOWN_ERROR;
}
if (0 <= new_flash_mode) {
if (mSecCamera->setFlashMode(new_flash_mode) < 0) {
- LOGE("%s::mSecCamera->setFlashMode(%d) fail", __func__, new_flash_mode);
+ ALOGE("%s::mSecCamera->setFlashMode(%d) fail", __func__, new_flash_mode);
ret = UNKNOWN_ERROR;
} else {
mParameters.set(CameraParameters::KEY_FLASH_MODE, new_flash_mode_str);
@@ -1950,7 +1955,7 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
// scene..
if (0 <= new_scene_mode) {
if (mSecCamera->setSceneMode(new_scene_mode) < 0) {
- LOGE("%s::mSecCamera->setSceneMode(%d) fail", __func__, new_scene_mode);
+ ALOGE("%s::mSecCamera->setSceneMode(%d) fail", __func__, new_scene_mode);
ret = UNKNOWN_ERROR;
} else {
mParameters.set(CameraParameters::KEY_SCENE_MODE, new_scene_mode_str);
@@ -1982,7 +1987,7 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
} else {
if (!isSupportedParameter(new_focus_mode_str,
mParameters.get(CameraParameters::KEY_SUPPORTED_FOCUS_MODES))) {
- LOGE("%s: Unsupported focus mode: %s", __func__, new_focus_mode_str);
+ ALOGE("%s: Unsupported focus mode: %s", __func__, new_focus_mode_str);
ret = UNKNOWN_ERROR;
}
}
@@ -2007,13 +2012,13 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
new_image_effect = IMAGE_EFFECT_NEGATIVE;
else {
//posterize, whiteboard, blackboard, solarize
- LOGE("ERR(%s):Invalid effect(%s)", __func__, new_image_effect_str);
+ ALOGE("ERR(%s):Invalid effect(%s)", __func__, new_image_effect_str);
ret = UNKNOWN_ERROR;
}
if (new_image_effect >= 0) {
if (mSecCamera->setImageEffect(new_image_effect) < 0) {
- LOGE("ERR(%s):Fail on mSecCamera->setImageEffect(effect(%d))", __func__, new_image_effect);
+ ALOGE("ERR(%s):Fail on mSecCamera->setImageEffect(effect(%d))", __func__, new_image_effect);
ret = UNKNOWN_ERROR;
} else {
const char *old_image_effect_str = mParameters.get(CameraParameters::KEY_EFFECT);
@@ -2033,7 +2038,7 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
int new_vtmode = mInternalParameters.getInt("vtmode");
if (0 <= new_vtmode) {
if (mSecCamera->setVTmode(new_vtmode) < 0) {
- LOGE("ERR(%s):Fail on mSecCamera->setVTMode(%d)", __func__, new_vtmode);
+ ALOGE("ERR(%s):Fail on mSecCamera->setVTMode(%d)", __func__, new_vtmode);
ret = UNKNOWN_ERROR;
}
}
@@ -2043,7 +2048,7 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
if (0 <= new_contrast) {
if (mSecCamera->setContrast(new_contrast) < 0) {
- LOGE("ERR(%s):Fail on mSecCamera->setContrast(%d)", __func__, new_contrast);
+ ALOGE("ERR(%s):Fail on mSecCamera->setContrast(%d)", __func__, new_contrast);
ret = UNKNOWN_ERROR;
}
}
@@ -2053,7 +2058,7 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
if (0 <= new_wdr) {
if (mSecCamera->setWDR(new_wdr) < 0) {
- LOGE("ERR(%s):Fail on mSecCamera->setWDR(%d)", __func__, new_wdr);
+ ALOGE("ERR(%s):Fail on mSecCamera->setWDR(%d)", __func__, new_wdr);
ret = UNKNOWN_ERROR;
}
}
@@ -2063,7 +2068,7 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
if (0 <= new_anti_shake) {
if (mSecCamera->setAntiShake(new_anti_shake) < 0) {
- LOGE("ERR(%s):Fail on mSecCamera->setWDR(%d)", __func__, new_anti_shake);
+ ALOGE("ERR(%s):Fail on mSecCamera->setWDR(%d)", __func__, new_anti_shake);
ret = UNKNOWN_ERROR;
}
}
@@ -2071,7 +2076,7 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
// gps latitude
const char *new_gps_latitude_str = params.get(CameraParameters::KEY_GPS_LATITUDE);
if (mSecCamera->setGPSLatitude(new_gps_latitude_str) < 0) {
- LOGE("%s::mSecCamera->setGPSLatitude(%s) fail", __func__, new_gps_latitude_str);
+ ALOGE("%s::mSecCamera->setGPSLatitude(%s) fail", __func__, new_gps_latitude_str);
ret = UNKNOWN_ERROR;
} else {
if (new_gps_latitude_str) {
@@ -2085,7 +2090,7 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
const char *new_gps_longitude_str = params.get(CameraParameters::KEY_GPS_LONGITUDE);
if (mSecCamera->setGPSLongitude(new_gps_longitude_str) < 0) {
- LOGE("%s::mSecCamera->setGPSLongitude(%s) fail", __func__, new_gps_longitude_str);
+ ALOGE("%s::mSecCamera->setGPSLongitude(%s) fail", __func__, new_gps_longitude_str);
ret = UNKNOWN_ERROR;
} else {
if (new_gps_longitude_str) {
@@ -2099,7 +2104,7 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
const char *new_gps_altitude_str = params.get(CameraParameters::KEY_GPS_ALTITUDE);
if (mSecCamera->setGPSAltitude(new_gps_altitude_str) < 0) {
- LOGE("%s::mSecCamera->setGPSAltitude(%s) fail", __func__, new_gps_altitude_str);
+ ALOGE("%s::mSecCamera->setGPSAltitude(%s) fail", __func__, new_gps_altitude_str);
ret = UNKNOWN_ERROR;
} else {
if (new_gps_altitude_str) {
@@ -2113,7 +2118,7 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
const char *new_gps_timestamp_str = params.get(CameraParameters::KEY_GPS_TIMESTAMP);
if (mSecCamera->setGPSTimeStamp(new_gps_timestamp_str) < 0) {
- LOGE("%s::mSecCamera->setGPSTimeStamp(%s) fail", __func__, new_gps_timestamp_str);
+ ALOGE("%s::mSecCamera->setGPSTimeStamp(%s) fail", __func__, new_gps_timestamp_str);
ret = UNKNOWN_ERROR;
} else {
if (new_gps_timestamp_str) {
@@ -2127,7 +2132,7 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
const char *new_gps_processing_method_str = params.get(CameraParameters::KEY_GPS_PROCESSING_METHOD);
if (mSecCamera->setGPSProcessingMethod(new_gps_processing_method_str) < 0) {
- LOGE("%s::mSecCamera->setGPSProcessingMethod(%s) fail", __func__, new_gps_processing_method_str);
+ ALOGE("%s::mSecCamera->setGPSProcessingMethod(%s) fail", __func__, new_gps_processing_method_str);
ret = UNKNOWN_ERROR;
} else {
if (new_gps_processing_method_str) {
@@ -2143,12 +2148,12 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
if (0 < new_recording_width && 0 < new_recording_height) {
if (mSecCamera->setRecordingSize(new_recording_width, new_recording_height) < 0) {
- LOGE("ERR(%s):Fail on mSecCamera->setRecordingSize(width(%d), height(%d))", __func__, new_recording_width, new_recording_height);
+ ALOGE("ERR(%s):Fail on mSecCamera->setRecordingSize(width(%d), height(%d))", __func__, new_recording_width, new_recording_height);
ret = UNKNOWN_ERROR;
}
} else {
if (mSecCamera->setRecordingSize(new_preview_width, new_preview_height) < 0) {
- LOGE("ERR(%s):Fail on mSecCamera->setRecordingSize(width(%d), height(%d))", __func__, new_preview_width, new_preview_height);
+ ALOGE("ERR(%s):Fail on mSecCamera->setRecordingSize(width(%d), height(%d))", __func__, new_preview_width, new_preview_height);
ret = UNKNOWN_ERROR;
}
}
@@ -2163,13 +2168,13 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
else if (!strcmp(new_gamma_str, "on"))
new_gamma = GAMMA_ON;
else {
- LOGE("%s::unmatched gamma(%s)", __func__, new_gamma_str);
+ ALOGE("%s::unmatched gamma(%s)", __func__, new_gamma_str);
ret = UNKNOWN_ERROR;
}
if (0 <= new_gamma) {
if (mSecCamera->setGamma(new_gamma) < 0) {
- LOGE("%s::mSecCamera->setGamma(%d) fail", __func__, new_gamma);
+ ALOGE("%s::mSecCamera->setGamma(%d) fail", __func__, new_gamma);
ret = UNKNOWN_ERROR;
}
}
@@ -2186,13 +2191,13 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
else if (!strcmp(new_slow_ae_str, "on"))
new_slow_ae = SLOW_AE_ON;
else {
- LOGE("%s::unmatched slow_ae(%s)", __func__, new_slow_ae_str);
+ ALOGE("%s::unmatched slow_ae(%s)", __func__, new_slow_ae_str);
ret = UNKNOWN_ERROR;
}
if (0 <= new_slow_ae) {
if (mSecCamera->setSlowAE(new_slow_ae) < 0) {
- LOGE("%s::mSecCamera->setSlowAE(%d) fail", __func__, new_slow_ae);
+ ALOGE("%s::mSecCamera->setSlowAE(%d) fail", __func__, new_slow_ae);
ret = UNKNOWN_ERROR;
}
}
@@ -2203,7 +2208,7 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
if (0 <= new_sensor_mode) {
if (mSecCamera->setSensorMode(new_sensor_mode) < 0) {
- LOGE("ERR(%s):Fail on mSecCamera->setSensorMode(%d)", __func__, new_sensor_mode);
+ ALOGE("ERR(%s):Fail on mSecCamera->setSensorMode(%d)", __func__, new_sensor_mode);
ret = UNKNOWN_ERROR;
}
} else {
@@ -2215,7 +2220,7 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
if (0 <= new_shot_mode) {
if (mSecCamera->setShotMode(new_shot_mode) < 0) {
- LOGE("ERR(%s):Fail on mSecCamera->setShotMode(%d)", __func__, new_shot_mode);
+ ALOGE("ERR(%s):Fail on mSecCamera->setShotMode(%d)", __func__, new_shot_mode);
ret = UNKNOWN_ERROR;
}
} else {
@@ -2227,7 +2232,7 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
if (0 <= new_blur_level) {
if (mSecCamera->setBlur(new_blur_level) < 0) {
- LOGE("ERR(%s):Fail on mSecCamera->setBlur(%d)", __func__, new_blur_level);
+ ALOGE("ERR(%s):Fail on mSecCamera->setBlur(%d)", __func__, new_blur_level);
ret = UNKNOWN_ERROR;
}
}
@@ -2238,18 +2243,18 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
if (0 <= new_dataline) {
if (mSecCamera->setDataLineCheck(new_dataline) < 0) {
- LOGE("ERR(%s):Fail on mSecCamera->setDataLineCheck(%d)", __func__, new_dataline);
+ ALOGE("ERR(%s):Fail on mSecCamera->setDataLineCheck(%d)", __func__, new_dataline);
ret = UNKNOWN_ERROR;
}
}
- LOGV("%s return ret = %d", __func__, ret);
+ ALOGV("%s return ret = %d", __func__, ret);
return ret;
}
CameraParameters CameraHardwareSec::getParameters() const
{
- LOGV("%s :", __func__);
+ ALOGV("%s :", __func__);
return mParameters;
}
@@ -2260,7 +2265,7 @@ status_t CameraHardwareSec::sendCommand(int32_t command, int32_t arg1, int32_t a
void CameraHardwareSec::release()
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
/* shut down any threads we have that might be running. do it here
* instead of the destructor. we're guaranteed to be on another thread
@@ -2322,7 +2327,7 @@ status_t CameraHardwareSec::storeMetaDataInBuffers(bool enable)
// metadata buffer mode can be turned on or off.
// Samsung needs to fix this.
if (!enable) {
- LOGE("Non-metadata buffer mode is not supported!");
+ ALOGE("Non-metadata buffer mode is not supported!");
return INVALID_OPERATION;
}
return OK;
@@ -2345,7 +2350,7 @@ static camera_device_t *g_cam_device;
static int HAL_camera_device_close(struct hw_device_t* device)
{
- LOGI("%s", __func__);
+ ALOGI("%s", __func__);
if (device) {
camera_device_t *cam_device = (camera_device_t *)device;
delete static_cast<CameraHardwareSec *>(cam_device->priv);
@@ -2364,7 +2369,7 @@ static inline CameraHardwareSec *obj(struct camera_device *dev)
static int HAL_camera_device_set_preview_window(struct camera_device *dev,
struct preview_stream_ops *buf)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
return obj(dev)->setPreviewWindow(buf);
}
@@ -2376,7 +2381,7 @@ static void HAL_camera_device_set_callbacks(struct camera_device *dev,
camera_request_memory get_memory,
void* user)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
obj(dev)->setCallbacks(notify_cb, data_cb, data_cb_timestamp,
get_memory,
user);
@@ -2392,7 +2397,7 @@ static void HAL_camera_device_set_callbacks(struct camera_device *dev,
*/
static void HAL_camera_device_enable_msg_type(struct camera_device *dev, int32_t msg_type)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
obj(dev)->enableMsgType(msg_type);
}
@@ -2408,7 +2413,7 @@ static void HAL_camera_device_enable_msg_type(struct camera_device *dev, int32_t
*/
static void HAL_camera_device_disable_msg_type(struct camera_device *dev, int32_t msg_type)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
obj(dev)->disableMsgType(msg_type);
}
@@ -2419,7 +2424,7 @@ static void HAL_camera_device_disable_msg_type(struct camera_device *dev, int32_
*/
static int HAL_camera_device_msg_type_enabled(struct camera_device *dev, int32_t msg_type)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
return obj(dev)->msgTypeEnabled(msg_type);
}
@@ -2428,7 +2433,7 @@ static int HAL_camera_device_msg_type_enabled(struct camera_device *dev, int32_t
*/
static int HAL_camera_device_start_preview(struct camera_device *dev)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
return obj(dev)->startPreview();
}
@@ -2437,7 +2442,7 @@ static int HAL_camera_device_start_preview(struct camera_device *dev)
*/
static void HAL_camera_device_stop_preview(struct camera_device *dev)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
obj(dev)->stopPreview();
}
@@ -2446,7 +2451,7 @@ static void HAL_camera_device_stop_preview(struct camera_device *dev)
*/
static int HAL_camera_device_preview_enabled(struct camera_device *dev)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
return obj(dev)->previewEnabled();
}
@@ -2482,7 +2487,7 @@ static int HAL_camera_device_preview_enabled(struct camera_device *dev)
*/
static int HAL_camera_device_store_meta_data_in_buffers(struct camera_device *dev, int enable)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
return obj(dev)->storeMetaDataInBuffers(enable);
}
@@ -2498,7 +2503,7 @@ static int HAL_camera_device_store_meta_data_in_buffers(struct camera_device *de
*/
static int HAL_camera_device_start_recording(struct camera_device *dev)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
return obj(dev)->startRecording();
}
@@ -2507,7 +2512,7 @@ static int HAL_camera_device_start_recording(struct camera_device *dev)
*/
static void HAL_camera_device_stop_recording(struct camera_device *dev)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
obj(dev)->stopRecording();
}
@@ -2516,7 +2521,7 @@ static void HAL_camera_device_stop_recording(struct camera_device *dev)
*/
static int HAL_camera_device_recording_enabled(struct camera_device *dev)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
return obj(dev)->recordingEnabled();
}
@@ -2532,7 +2537,7 @@ static int HAL_camera_device_recording_enabled(struct camera_device *dev)
static void HAL_camera_device_release_recording_frame(struct camera_device *dev,
const void *opaque)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
obj(dev)->releaseRecordingFrame(opaque);
}
@@ -2543,7 +2548,7 @@ static void HAL_camera_device_release_recording_frame(struct camera_device *dev,
*/
static int HAL_camera_device_auto_focus(struct camera_device *dev)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
return obj(dev)->autoFocus();
}
@@ -2555,7 +2560,7 @@ static int HAL_camera_device_auto_focus(struct camera_device *dev)
*/
static int HAL_camera_device_cancel_auto_focus(struct camera_device *dev)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
return obj(dev)->cancelAutoFocus();
}
@@ -2564,7 +2569,7 @@ static int HAL_camera_device_cancel_auto_focus(struct camera_device *dev)
*/
static int HAL_camera_device_take_picture(struct camera_device *dev)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
return obj(dev)->takePicture();
}
@@ -2574,7 +2579,7 @@ static int HAL_camera_device_take_picture(struct camera_device *dev)
*/
static int HAL_camera_device_cancel_picture(struct camera_device *dev)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
return obj(dev)->cancelPicture();
}
@@ -2585,7 +2590,7 @@ static int HAL_camera_device_cancel_picture(struct camera_device *dev)
static int HAL_camera_device_set_parameters(struct camera_device *dev,
const char *parms)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
String8 str(parms);
CameraParameters p(str);
return obj(dev)->setParameters(p);
@@ -2594,7 +2599,7 @@ static int HAL_camera_device_set_parameters(struct camera_device *dev,
/** Return the camera parameters. */
char *HAL_camera_device_get_parameters(struct camera_device *dev)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
String8 str;
CameraParameters parms = obj(dev)->getParameters();
str = parms.flatten();
@@ -2603,7 +2608,7 @@ char *HAL_camera_device_get_parameters(struct camera_device *dev)
void HAL_camera_device_put_parameters(struct camera_device *dev, char *parms)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
free(parms);
}
@@ -2613,7 +2618,7 @@ void HAL_camera_device_put_parameters(struct camera_device *dev, char *parms)
static int HAL_camera_device_send_command(struct camera_device *dev,
int32_t cmd, int32_t arg1, int32_t arg2)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
return obj(dev)->sendCommand(cmd, arg1, arg2);
}
@@ -2623,7 +2628,7 @@ static int HAL_camera_device_send_command(struct camera_device *dev,
*/
static void HAL_camera_device_release(struct camera_device *dev)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
obj(dev)->release();
}
@@ -2632,19 +2637,19 @@ static void HAL_camera_device_release(struct camera_device *dev)
*/
static int HAL_camera_device_dump(struct camera_device *dev, int fd)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
return obj(dev)->dump(fd);
}
static int HAL_getNumberOfCameras()
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
return sizeof(sCameraInfo) / sizeof(sCameraInfo[0]);
}
static int HAL_getCameraInfo(int cameraId, struct camera_info *cameraInfo)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
memcpy(cameraInfo, &sCameraInfo[cameraId], sizeof(CameraInfo));
return 0;
}
@@ -2683,20 +2688,20 @@ static int HAL_camera_device_open(const struct hw_module_t* module,
const char *id,
struct hw_device_t** device)
{
- LOGV("%s", __func__);
+ ALOGV("%s", __func__);
int cameraId = atoi(id);
if (cameraId < 0 || cameraId >= HAL_getNumberOfCameras()) {
- LOGE("Invalid camera ID %s", id);
+ ALOGE("Invalid camera ID %s", id);
return -EINVAL;
}
if (g_cam_device) {
if (obj(g_cam_device)->getCameraId() == cameraId) {
- LOGV("returning existing camera ID %s", id);
+ ALOGV("returning existing camera ID %s", id);
goto done;
} else {
- LOGE("Cannot open camera %d. camera %d is already running!",
+ ALOGE("Cannot open camera %d. camera %d is already running!",
cameraId, obj(g_cam_device)->getCameraId());
return -ENOSYS;
}
@@ -2713,13 +2718,13 @@ static int HAL_camera_device_open(const struct hw_module_t* module,
g_cam_device->ops = &camera_device_ops;
- LOGI("%s: open camera %s", __func__, id);
+ ALOGI("%s: open camera %s", __func__, id);
g_cam_device->priv = new CameraHardwareSec(cameraId, g_cam_device);
done:
*device = (hw_device_t *)g_cam_device;
- LOGI("%s: opened camera %s (%p)", __func__, id, *device);
+ ALOGI("%s: opened camera %s (%p)", __func__, id, *device);
return 0;
}