summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeongmo Yang <jm80.yang@samsung.com>2017-02-02 15:32:13 +0900
committerJeongmo Yang <jm80.yang@samsung.com>2017-02-03 14:37:17 +0900
commitef75597c0cb73bcb3f5e19215f9eac73f068974c (patch)
tree3c3a10feabc53e5ef7f707a820d8f09a2583655e
parented863493a1188aa46c85ce8a6adb3c84022c85ed (diff)
downloadcamera-ef75597c0cb73bcb3f5e19215f9eac73f068974c.tar.gz
camera-ef75597c0cb73bcb3f5e19215f9eac73f068974c.tar.bz2
camera-ef75597c0cb73bcb3f5e19215f9eac73f068974c.zip
Update code for count 0 of face detection
[Version] 0.2.93 [Profile] Common [Issue Type] Update [Dependency module] N/A [Test] [M(T) - Boot=(OK), sdb=(OK), Home=(OK), Touch=(OK), Version=tizen-3.0-mobile_20170131.2] Change-Id: I464820eaef8b9ebc5c2a9f257d7b365f05a922ce Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
-rw-r--r--packaging/capi-media-camera.spec4
-rw-r--r--src/camera.c32
-rw-r--r--test/camera_test.c21
3 files changed, 27 insertions, 30 deletions
diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec
index c7baf6c..cc04db4 100644
--- a/packaging/capi-media-camera.spec
+++ b/packaging/capi-media-camera.spec
@@ -1,7 +1,7 @@
Name: capi-media-camera
Summary: A Camera API
-Version: 0.2.92
-Release: 1
+Version: 0.2.93
+Release: 0
Group: Multimedia/API
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
diff --git a/src/camera.c b/src/camera.c
index 7088bf3..77f7912 100644
--- a/src/camera.c
+++ b/src/camera.c
@@ -1329,36 +1329,28 @@ static void _camera_client_user_callback(camera_cb_info_s *cb_info, char *recv_m
muse_camera_msg_get(count, recv_msg);
muse_camera_msg_get(tbm_key, recv_msg);
- if (count > 0 && tbm_key > 0) {
+ if (count >= 0) {
LOGD("FACE_DETECTION - count %d, tbm_key %d", count, tbm_key);
- if (!_camera_import_tbm_key(cb_info->bufmgr, tbm_key, &bo, &bo_handle))
- break;
-
- /* set face info */
- faces = bo_handle.ptr;
-
- ((camera_face_detected_cb)cb_info->user_cb[event])(faces, count, cb_info->user_data[event]);
-
-#if 0
- {
- int i = 0;
+ if (tbm_key > 0) {
- for (i = 0 ; i < count ; i++) {
- LOGD("id[%2d] - score %d, position (%d,%d,%dx%d)",
- i, faces[i].score, faces[i].x, faces[i].y, faces[i].width, faces[i].height);
+ if (_camera_import_tbm_key(cb_info->bufmgr, tbm_key, &bo, &bo_handle)) {
+ /* set face info */
+ faces = bo_handle.ptr;
}
}
-#endif
+
+ ((camera_face_detected_cb)cb_info->user_cb[event])(faces, count, cb_info->user_data[event]);
/* release bo */
_camera_release_imported_bo(&bo);
/* return buffer */
- CAMERA_MSG_PARAM_SET(param, INT, tbm_key);
- _camera_msg_send_param1(MUSE_CAMERA_API_RETURN_BUFFER, cb_info, NULL, &param, 0);
-
- /*LOGD("return buffer done");*/
+ if (tbm_key > 0) {
+ CAMERA_MSG_PARAM_SET(param, INT, tbm_key);
+ _camera_msg_send_param1(MUSE_CAMERA_API_RETURN_BUFFER, cb_info, NULL, &param, 0);
+ /*LOGD("return buffer done");*/
+ }
} else {
LOGE("invalid message - count %d, key %d", count, tbm_key);
}
diff --git a/test/camera_test.c b/test/camera_test.c
index 7cb2630..8e4616f 100644
--- a/test/camera_test.c
+++ b/test/camera_test.c
@@ -566,7 +566,7 @@ static bool strobe_mode_cb(camera_attr_flash_mode_e mode, void *user_data)
static void _face_detected(camera_detected_face_s *faces, int count, void *user_data)
{
- g_print("face detected!!\n");
+ g_print("face detected!! - count %d\n", count);
int i;
for (i = 0 ; i < count ; i++)
@@ -1147,16 +1147,21 @@ static void setting_menu(gchar buf)
}
break;
case 'l': /* Setting > Face detection setting */
- g_print("* Face detect mode !\n");
- flush_stdin();
- for (i = 0 ; i < 2 ; i++)
- g_print("\t %d. %s \n", i+1, detection_mode[i]);
- err = scanf("%d", &idx);
if (camera_is_supported_face_detection(hcamcorder->camera)) {
- if (idx >= 0 && idx < 2)
+ g_print("* Face detect mode !\n");
+ flush_stdin();
+ for (i = 0 ; i < 2 ; i++)
+ g_print("\t %d. %s \n", i, detection_mode[i]);
+ err = scanf("%d", &idx);
+ if (idx == 0)
+ bret = camera_stop_face_detection(hcamcorder->camera);
+ else if (idx == 1)
bret = camera_start_face_detection(hcamcorder->camera, _face_detected, NULL);
- } else
+ else
+ g_print("\n invalid input [%d]\n\n", idx);
+ } else {
g_print("face detection_not supported");
+ }
break;
case 'k': /* Setting > Anti-handshake */
g_print("*Anti-handshake !\n");