Remove sound-manager deprecated API 03/281903/1 tizen tizen_7.0 tizen_7.0_hotfix tizen_8.0 tizen_7.0_src.m2_release tizen_8.0_m2_release
authorSangchul Lee <sc11.lee@samsung.com>
Fri, 23 Sep 2022 05:46:10 +0000 (14:46 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Fri, 23 Sep 2022 05:46:41 +0000 (14:46 +0900)
Instead, sound_manager_add_device_running_changed_cb() is used.

Change-Id: I5907a964844f120c1ef5f92d13e1665bd70770dd
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
src/common/mp-app.c
src/mp-main.c

index 64d0c17..17b7ad6 100644 (file)
@@ -53,14 +53,14 @@ void mp_play_next_and_updateview(void *data);
 static Ecore_Pipe *gNotiPipe;
 typedef enum {
        MP_APP_PIPE_CB_AVAILABLE_ROUTE_CHANGED,
-       MP_APP_PIPE_CB_ACTIVE_DEVICE_CHANGED,
+       MP_APP_PIPE_CB_DEVICE_RUNNING_CHANGED,
 } mp_app_pipe_cb_type_e;
 
 typedef struct {
        mp_app_pipe_cb_type_e type;
        void *user_data;
        //Replaced for _prod dependency
-       sound_device_state_e out;
+       bool running;
 } mp_app_pipe_data_s;
 
 #ifdef MP_FEATURE_USB_OTG
@@ -246,24 +246,27 @@ _mp_add_available_route_changed_cb(sound_device_h device, bool available,
 }
 
 /*
-* The device state changed callback function
+* The device running changed callback function
 * @param  sound device
 * @param  Sound device changed info
 * @param  data appdata
 * @return void
 */
 static void
-_mp_app_active_device_chaged_cb(sound_device_h in,
-                                                               sound_device_state_e out,
+_mp_app_device_running_changed_cb(sound_device_h device,
+                                                               bool is_running,
                                                                void *user_data)
 {
-       EVENT_TRACE("input=[0x%x], output=[0x%x]", in, out);
+       sound_device_type_e type;
+
+       sound_manager_get_device_type(device, &type);
+       EVENT_TRACE("device[type:%d], is_running[%u]", type, is_running);
        MP_CHECK(gNotiPipe);
 
        mp_app_pipe_data_s pipe_data;
        memset(&pipe_data, 0, sizeof(mp_app_pipe_data_s));
-       pipe_data.type = MP_APP_PIPE_CB_ACTIVE_DEVICE_CHANGED;
-       pipe_data.out = out;
+       pipe_data.type = MP_APP_PIPE_CB_DEVICE_RUNNING_CHANGED;
+       pipe_data.running = is_running;
        pipe_data.user_data = user_data;
 
        ecore_pipe_write(gNotiPipe, &pipe_data, sizeof(mp_app_pipe_data_s));
@@ -291,8 +294,9 @@ _mp_app_noti_pipe_handler(void *data, void *buffer, unsigned int nbyte)
                mp_view_mgr_post_event(GET_VIEW_MGR, MP_ROUTE_CHANGED);
                break;
 
-       case MP_APP_PIPE_CB_ACTIVE_DEVICE_CHANGED:
-               mp_setting_update_active_device();
+       case MP_APP_PIPE_CB_DEVICE_RUNNING_CHANGED:
+               /* FIXME: check condition to do what it really wants. */
+               mp_setting_update_active_device(); /* empty function */
                mp_view_mgr_post_event(GET_VIEW_MGR, MP_ROUTE_CHANGED);
                break;
 
@@ -475,16 +479,16 @@ bool mp_app_noti_init(void *data)
        }
        WARN_TRACE("Leave sound_manager_set_available_route_changed_cb");
 
-       WARN_TRACE("Enter sound_manager_set_active_device_changed_cb");
+       WARN_TRACE("Enter sound_manager_add_device_running_changed_cb");
        ret =
-               sound_manager_add_device_state_changed_cb
-               (SOUND_DEVICE_ALL_MASK, _mp_app_active_device_chaged_cb, ad, &ad->device_state_id);
+               sound_manager_add_device_running_changed_cb
+               (SOUND_DEVICE_ALL_MASK, _mp_app_device_running_changed_cb, ad, &ad->device_state_id);
        if (ret != SOUND_MANAGER_ERROR_NONE) {
                ERROR_TRACE
-               ("sound_manager_set_active_device_changed_cb().. [0x%x]", ret);
+               ("sound_manager_add_device_running_changed_cb().. [0x%x]", ret);
                res = FALSE;
        }
-       WARN_TRACE("Leave sound_manager_set_active_device_changed_cb");
+       WARN_TRACE("Leave sound_manager_add_device_running_changed_cb");
 
        ret = mp_media_info_set_db_update_cb(_mp_app_db_update_cb, NULL);
        if (ret != 0) {
index c8f1bda..f72721c 100755 (executable)
@@ -1308,9 +1308,9 @@ static void mp_terminate(void *data)
        }
 
        int error = SOUND_MANAGER_ERROR_NONE;
-       error = sound_manager_remove_device_state_changed_cb(ad->device_state_id);
+       error = sound_manager_remove_device_running_changed_cb(ad->device_state_id);
        if (error != SOUND_MANAGER_ERROR_NONE) {
-               ERROR_TRACE("Cannot remove device state changed callback");
+               ERROR_TRACE("Cannot remove device running changed callback");
        }
 
        if (ad->stream_info) {