summaryrefslogtreecommitdiff
path: root/src/camera.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/camera.c')
-rw-r--r--src/camera.c10
1 files changed, 10 insertions, 0 deletions
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, &param, 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;
}