int legacy_player_get_volume(player_h player, float *left, float *right);
/**
- * @deprecated Deprecated since 3.0. Use legacy_player_set_sound_stream_info() instead.
- * @brief Sets the player's volume type.
- * @since_tizen 2.3
- * @remarks The default sound type of the player is #SOUND_TYPE_MEDIA.
- * To get the current sound type, use sound_manager_get_current_sound_type().
- * @remarks If stream_info already exists by calling sound_manager_create_stream_info(),
- * It will return error since 3.0.
- *
- * @param[in] player The handle to the media player
- * @param[in] type The sound type
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #PLAYER_ERROR_NONE Successful
- * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #PLAYER_ERROR_SOUND_POLICY Sound policy error
- * @pre The player state must be set to #PLAYER_STATE_IDLE by calling legacy_player_create().
- * @see sound_manager_get_current_sound_type()
- */
-int legacy_player_set_sound_type(player_h player, sound_type_e type);
-
-/**
* @brief Sets the player's sound manager stream information.
* @since_tizen 3.0
* @remarks You can set sound stream information including audio routing and volume type.
int legacy_player_set_sound_stream_info_for_mused(player_h player, char *stream_type, int stream_index);
/**
- * @brief Registers sound process id to ASM server
- * @since_tizen 3.0
- * @param[in] player The handle to the media player
- * @param[in] pid The sound process id
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #PLAYER_ERROR_NONE Successful
- * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
- */
-int legacy_player_sound_register(player_h player, int pid);
-
-/**
* @brief Gets time out time from muse-server
* @since_tizen 3.0
* @param[in] player The handle to the media player
#include <sound_manager.h>
#include <sound_manager_internal.h>
#include <dlog.h>
-#ifdef TIZEN_FEATURE_ASM
-#include <mm_session_private.h>
-#endif
#include "muse_player.h"
#include "legacy_player.h"
#include "legacy_player_private.h"
return PLAYER_ERROR_NONE;
}
}
-#ifdef TIZEN_FEATURE_ASM
-int legacy_player_set_sound_type(player_h player, sound_type_e type)
-{
- PLAYER_INSTANCE_CHECK(player);
- player_s *handle = (player_s *)player;
-
- PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
-
- char *stream_type = NULL;
- int stream_index = -1;
- int ret = 0;
- int pid = -1;
- int session_type = 0;
- int session_flags = 0;
-
- ret = mm_player_get_client_pid(handle->mm_handle, &pid);
- if (ret != MM_ERROR_NONE)
- return __player_convert_error_code(ret, (char *)__FUNCTION__);
- /* read session information */
- ret = _mm_session_util_read_information(pid, &session_type, &session_flags);
- if (ret == MM_ERROR_NONE) {
- /* in this case, this process is using stream info created by using sound-manager,
- * we're going to skip working on backward compatibility of session. */
- if (session_type == MM_SESSION_TYPE_REPLACED_BY_STREAM)
- return PLAYER_ERROR_SOUND_POLICY;
- } else if (ret == MM_ERROR_INVALID_HANDLE) { /* if there is no session */
- /* convert volume_type to stream_type */
- switch (type) {
- case SOUND_TYPE_SYSTEM:
- stream_type = "system";
- break;
- case SOUND_TYPE_NOTIFICATION:
- stream_type = "notification";
- break;
- case SOUND_TYPE_ALARM:
- stream_type = "alarm";
- break;
- case SOUND_TYPE_RINGTONE:
- stream_type = "ringtone-voip";
- break;
- case SOUND_TYPE_MEDIA:
- case SOUND_TYPE_CALL:
- stream_type = "media";
- break;
- case SOUND_TYPE_VOIP:
- stream_type = "voip";
- break;
- case SOUND_TYPE_VOICE:
- stream_type = "voice-information";
- break;
- default:
- LOGW("check the value[%d].\n", type);
- return PLAYER_ERROR_INVALID_PARAMETER;
- }
- LOGI("[%s] sound type = %s", __FUNCTION__, stream_type);
-
- ret = mm_player_set_attribute(handle->mm_handle, NULL, "sound_stream_type", stream_type, strlen(stream_type), "sound_stream_index", stream_index, (char *)NULL);
- if (ret == MM_ERROR_NONE)
- return PLAYER_ERROR_NONE;
- }
- return __player_convert_error_code(ret, (char *)__FUNCTION__);
-}
-#endif
int legacy_player_set_sound_stream_info(player_h player, sound_stream_info_h stream_info)
{
PLAYER_INSTANCE_CHECK(player);
return PLAYER_ERROR_NONE;
}
-int legacy_player_sound_register(player_h player, int pid)
-{
- PLAYER_INSTANCE_CHECK(player);
- player_s *handle = (player_s *)player;
- int ret;
-
- PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
-
- ret = mm_player_sound_register(handle->mm_handle, pid);
- if (ret != MM_ERROR_NONE)
- return __player_convert_error_code(ret, (char *)__FUNCTION__);
-
- return PLAYER_ERROR_NONE;
-}
-
int legacy_player_get_timeout_for_muse(player_h player, int *timeout)
{
PLAYER_INSTANCE_CHECK(player);
if (ret != PLAYER_ERROR_NONE)
goto ERROR;
- ret = legacy_player_sound_register(muse_player->player_handle, pid);
- if (ret != PLAYER_ERROR_NONE)
- goto ERROR;
-
muse_player->total_size_of_buffers = DEFAULT_VDEC_TOTAL_SIZE_OF_BUFFER;
muse_player->extra_size_of_buffers = DEFAULT_VDEC_EXTRA_SIZE_OF_BUFFER;
g_mutex_init(&muse_player->list_lock);
return ret;
}
+/* TODO: It will be removed */
int player_disp_set_sound_type(muse_module_h module)
{
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_SOUND_TYPE;
- muse_player_handle_s *muse_player = NULL;
int type;
- muse_player = (muse_player_handle_s *)muse_server_ipc_get_handle(module);
player_msg_get(type, muse_server_module_get_msg(module));
-#ifdef TIZEN_FEATURE_ASM
- ret = legacy_player_set_sound_type(muse_player->player_handle, (sound_type_e)type);
-#endif
+ LOGW("DEPRECATION WARNING: We remove subfunction, It return ERROR_NONE.");
player_msg_return(api, ret, module);
return ret;