diff options
author | Jeongmo Yang <jm80.yang@samsung.com> | 2016-12-08 15:05:00 +0900 |
---|---|---|
committer | Jeongmo Yang <jm80.yang@samsung.com> | 2016-12-08 15:05:00 +0900 |
commit | 7c2d80a0c3aa9b064e5f7ea92b9ac2e8c7beac90 (patch) | |
tree | dbc04b347fdb644acbab8027362479d1ab388318 | |
parent | 3ae032d25a0c7d905266ee28b6c5ef2700b87612 (diff) | |
download | camera-7c2d80a0c3aa9b064e5f7ea92b9ac2e8c7beac90.tar.gz camera-7c2d80a0c3aa9b064e5f7ea92b9ac2e8c7beac90.tar.bz2 camera-7c2d80a0c3aa9b064e5f7ea92b9ac2e8c7beac90.zip |
Reset user callback and data when camera_change_device is calledsubmit/tizen/20161213.083228accepted/tizen/wearable/20161214.015131accepted/tizen/tv/20161214.015042accepted/tizen/mobile/20161214.014740accepted/tizen/ivi/20161214.015301accepted/tizen/common/20161214.160424
[Version] 0.2.89
[Profile] Common
[Issue Type] Bug fix
[Dependency module] N/A
[Test] [M(T) - Boot=(OK), sdb=(OK), Home=(OK), Touch=(OK), Version=tizen-3.0-mobile_20161206.3]
Change-Id: I63b1037f2620935c170d10a3633ee8aa66b440fc
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
-rw-r--r-- | packaging/capi-media-camera.spec | 2 | ||||
-rw-r--r-- | src/camera.c | 10 | ||||
-rw-r--r-- | test/camera_test.c | 4 |
3 files changed, 15 insertions, 1 deletions
diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec index 4eb1ca4..85f05b0 100644 --- a/packaging/capi-media-camera.spec +++ b/packaging/capi-media-camera.spec @@ -1,6 +1,6 @@ Name: capi-media-camera Summary: A Camera API -Version: 0.2.88 +Version: 0.2.89 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/camera.c b/src/camera.c index 8919206..088d4e6 100644 --- a/src/camera.c +++ b/src/camera.c @@ -2578,6 +2578,7 @@ ErrorExit: int camera_change_device(camera_h camera, camera_device_e device) { + int i = 0; int ret = CAMERA_ERROR_NONE; muse_camera_api_e api = MUSE_CAMERA_API_CHANGE_DEVICE; camera_cli_s *pc = (camera_cli_s *)camera; @@ -2592,6 +2593,15 @@ int camera_change_device(camera_h camera, camera_device_e device) _camera_msg_send_param1(api, pc->cb_info, &ret, ¶m, CAMERA_CB_TIMEOUT); + if (ret == CAMERA_ERROR_NONE) { + /* reset callback and user data */ + for (i = 0 ; i < MUSE_CAMERA_EVENT_TYPE_NUM ; i++) { + pc->cb_info->user_cb[i] = NULL; + pc->cb_info->user_data[i] = NULL; + } + UNSET_PREVIEW_CB_TYPE(pc->cb_info, PREVIEW_CB_TYPE_USER); + } + return ret; } diff --git a/test/camera_test.c b/test/camera_test.c index e2ae643..88211eb 100644 --- a/test/camera_test.c +++ b/test/camera_test.c @@ -795,6 +795,10 @@ static void main_menu(gchar buf) camera_change_device(hcamcorder->camera, hcamcorder->type); + camera_set_error_cb(hcamcorder->camera, _camera_error_cb, NULL); + camera_set_state_changed_cb(hcamcorder->camera, _camera_state_changed_cb, NULL); + camera_set_interrupted_cb(hcamcorder->camera, _camera_interrupted_cb, NULL); + camera_set_display_mode(hcamcorder->camera, CAMERA_DISPLAY_MODE_LETTER_BOX); camera_start_preview(hcamcorder->camera); |