if stream info exists, error will be returned 03/56303/3
authorNAMJEONGYOON <just.nam@samsung.com>
Wed, 6 Jan 2016 06:50:33 +0000 (15:50 +0900)
committerNAMJEONGYOON <just.nam@samsung.com>
Wed, 6 Jan 2016 08:54:47 +0000 (17:54 +0900)
Change-Id: I1b0ca2cdf8f7dca73222d78d723c9f24c6d8f73c

include/mobile/player.h
include/wearable/player.h
src/player.c
test/legacy_player_test.c

index 6335133..e1a9715 100644 (file)
@@ -597,6 +597,8 @@ int player_get_volume(player_h player, float *left, float *right);
  * @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
@@ -604,6 +606,7 @@ int player_get_volume(player_h player, float *left, float *right);
  *         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 player_create().
  * @see sound_manager_get_current_sound_type()
  */
index 46e0a2d..c6f804d 100644 (file)
@@ -596,6 +596,8 @@ int player_get_volume(player_h player, float *left, float *right);
  * @since_tizen 2.3.1
  * @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 player_set_audio_policy_info(),
+ *          It will return error.
  *
  * @param[in]   player The handle to the media player
  * @param[in]   type The sound type
@@ -603,6 +605,7 @@ int player_get_volume(player_h player, float *left, float *right);
  *         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 player_create().
  * @see sound_manager_get_current_sound_type()
  */
index a3b92ce..c6bcb71 100644 (file)
@@ -1409,6 +1409,13 @@ int player_set_sound_type(player_h player, sound_type_e type)
 
        PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
 
+       bool sig_value = false;
+
+       /* check if focus is released */
+       mm_sound_get_signal_value(MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, &sig_value);
+       if(sig_value)
+               return PLAYER_ERROR_SOUND_POLICY;
+
        LOGI("[%s] sound type = %d", __FUNCTION__, type);
 
        int ret = mm_player_set_attribute(handle->mm_handle, NULL, "sound_volume_type", type, (char *)NULL);
index bae17b9..100c2f0 100644 (file)
 #include <Ecore.h>
 #include <Ecore_Wayland.h>
 #endif
-/* #define _USE_X_DIRECT_ */
-#ifdef _USE_X_DIRECT_
-#include <X11/Xlib.h>
-#endif
 #define PACKAGE "player_test"
 #define MAX_STRING_LEN 2048
 #define MMTS_SAMPLELIST_INI_DEFAULT_PATH "/opt/etc/mmts_filelist.ini"
@@ -131,7 +127,7 @@ static Evas_Object *create_win(const char *name)
        int w = 0;
        int h = 0;
 
-       printf("[%s][%d] name=%s\n", __func__, __LINE__, name);
+       g_print("[%s][%d] name=%s\n", __func__, __LINE__, name);
 
        eo = elm_win_add(NULL, name, ELM_WIN_BASIC);
        if (eo) {
@@ -139,7 +135,7 @@ static Evas_Object *create_win(const char *name)
                elm_win_borderless_set(eo, EINA_TRUE);
                evas_object_smart_callback_add(eo, "delete,request", win_del, NULL);
                elm_win_screen_size_get(eo, NULL, NULL, &w, &h);
-               printf("window size :%d,%d", w, h);
+               g_print("window size :%d,%d", w, h);
                evas_object_resize(eo, w, h);
                elm_win_autodel_set(eo, EINA_TRUE);
 #ifdef HAVE_WAYLAND