struct __answer_msg_data {
player_h player_handle; /**< Bike mode Handle to MM Player */
+ sound_stream_info_h stream_info;
callmgr_answer_msg_play_finished_cb finished_cb;
void *user_data;
};
+static int __callmgr_answer_msg_destory_stream_information(callmgr_answer_msg_h answer_msg_handle)
+{
+ dbg("..");
+
+ CM_RETURN_VAL_IF_FAIL(answer_msg_handle, -1);
+ int ret = SOUND_MANAGER_ERROR_NONE;
+ int ret_val = 0;
+
+ if (answer_msg_handle->player_handle != NULL) {
+ /* Destroy the player */
+ ret = sound_manager_destroy_stream_information(answer_msg_handle->stream_info);
+ if (ret != SOUND_MANAGER_ERROR_NONE) {
+ err("sound_manager_destroy_stream_information ERR: %x!!!!", ret);
+ ret_val = -1;
+ }
+ answer_msg_handle->stream_info = NULL;
+ }
+ return ret_val;
+}
+
+static int __callmgr_answer_msg_create_stream_information(callmgr_answer_msg_h answer_msg_handle)
+{
+ dbg("..");
+
+ CM_RETURN_VAL_IF_FAIL(answer_msg_handle, -1);
+ int ret = SOUND_MANAGER_ERROR_NONE;
+
+ sound_stream_type_e stream_type = SOUND_TYPE_CALL;
+
+ if (answer_msg_handle->stream_info != NULL) {
+ __callmgr_answer_msg_destory_stream_information(answer_msg_handle);
+ }
+
+ /* Create stream information */
+ ret = sound_manager_create_stream_information(stream_type, NULL, NULL, &answer_msg_handle->stream_info);
+ if (ret != SOUND_MANAGER_ERROR_NONE || answer_msg_handle->stream_info == NULL) {
+ err("sound_manager_create_stream_information ERR: %x!!!!", ret);
+ return -1;
+ }
+
+ return 0;
+}
+
static int __callmgr_answer_msg_destory_player(callmgr_answer_msg_h answer_msg_handle)
{
dbg("..");
return -1;
}
- /* Set the Sound type */
- ret = player_set_sound_type(answer_msg_handle->player_handle, SOUND_TYPE_CALL);
+ /* Set the Sound stream info */
+ ret = player_set_sound_stream_info(answer_msg_handle->player_handle, answer_msg_handle->stream_info);
if (ret != PLAYER_ERROR_NONE) {
err("player_set_sound_type() ERR: %x!!!!", ret);
return -1;
char *answer_msg_path = NULL;
int ret_val = 0;
+ if (__callmgr_answer_msg_create_stream_information(answer_msg_handle) < 0) {
+ err("__callmgr_answer_msg_create_stream_information() ERR");
+ return -1;
+ }
+
if (__callmgr_answer_msg_create_player(answer_msg_handle) < 0) {
err("__callmgr_answer_msg_create_player() ERR");
return -1;
__callmgr_answer_msg_stop_play(answer_msg_handle);
__callmgr_answer_msg_destory_player(answer_msg_handle);
+ __callmgr_answer_msg_destory_stream_information(answer_msg_handle);
return 0;
}