g_main_context_unref(context);
}
-static bool storage_device_cb(int storage_id, storage_type_e type, storage_state_e state, const char* path, void* user_data)
-{
- unsigned int size_of_path = 0;
-
- if (type == STORAGE_TYPE_INTERNAL) {
- size_of_path = strlen(path) + strlen(audio) + 6;
- audio_path = (char*)malloc(size_of_path);
- snprintf(audio_path, size_of_path, "%s/res/%s", path, audio);
-
- size_of_path = strlen(path) + strlen(media) + 6;
- media_path = (char*)malloc(size_of_path);
- snprintf(media_path, size_of_path, "%s/res/%s", path, media);
-
- size_of_path = strlen(path) + strlen(subtitle) + 6;
- subtitle_path = (char*)malloc(size_of_path);
- snprintf(subtitle_path, size_of_path, "%s/res/%s", path, subtitle);
-
- return false;
- }
- return true;
-}
+ void focus_cb(sound_stream_info_h stream_info, sound_stream_focus_change_reason_e reason, const char *extra_info, void *user_data)
+ {
+ g_print("FOCUS callback is called, reason(%d), extra_info(%s), userdata(%p)", reason, extra_info, user_data);
+ return;
+ }
+
+ static void set_sound_stream_info()
+ {
+ sound_device_list_h device_list = NULL;
+ int ret = SOUND_MANAGER_ERROR_NONE;
+
+ if (g_stream_info_h) {
+ g_print("stream information is already set, please destory handle and try again\n");
+ return;
+ }
+ if (sound_manager_create_stream_information(SOUND_STREAM_TYPE_MEDIA, focus_cb, player, &g_stream_info_h)) {
+ g_print("failed to create stream_information()\n");
+ return;
+ }
+ return;
+ }
+
/**
* @function utc_media_player_startup