[0.3.79][ACR-1131] Add stream info feature 79/164679/7 accepted/tizen/4.0/unified/20171222.064335 submit/tizen_4.0/20171222.022934
authorEunhae Choi <eunhae1.choi@samsung.com>
Wed, 20 Dec 2017 09:10:59 +0000 (18:10 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Fri, 22 Dec 2017 02:27:12 +0000 (11:27 +0900)
Change-Id: I5ac4648c9854d7c344ed3b422109fdd4427baec0

doc/player_doc.h [changed mode: 0755->0644]
include/player.h
include/player_private.h
packaging/capi-media-player.spec
src/player.c

old mode 100755 (executable)
new mode 100644 (file)
index e1bc904..2b897c6 100644 (file)
@@ -671,7 +671,9 @@ int player_set_sound_type(player_h player, sound_type_e type) TIZEN_DEPRECATED_A
  *          For more details, please refer to sound_manager.h
  * @remarks This API must be called before calling the player_prepare() or player_prepare_async()
  *          to reflect the sound stream information when the player is building.
- *
+ * @remarks This function is related to the following feature:\n
+ *          %http://tizen.org/feature/multimedia.player.stream_info\n
+ *          If this feature is not supported, the stream_type of the player is fixed to the #SOUND_STREAM_TYPE_MEDIA.
  * @param[in] player The handle to the media player
  * @param[in] stream_info The sound manager info type
  * @return @c 0 on success,
index 9e55a8c..d2653f8 100644 (file)
@@ -54,6 +54,19 @@ do { \
        }       \
 } while (0)
 
+#define PLAYER_FEATURE_CHECK(fkey) \
+do { \
+       bool __supported__ = false; \
+       if (system_info_get_platform_bool(fkey, &__supported__) != SYSTEM_INFO_ERROR_NONE) { \
+               LOGE("failed to get system feature info"); \
+               return PLAYER_ERROR_INVALID_OPERATION; \
+       } \
+       if (!__supported__) { \
+               LOGW("sound stream feature is not supported."); \
+               return PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE; \
+       } \
+} while (0)
+
 #define CONNECTION_RETRY 51
 #define CONNECTION_TIME_OUT 50 /* ms */
 #define CREATE_CB_TIME_OUT 400 /* ms */
index 9423d7d..8f43c5b 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-player
 Summary:    A Media Player API
-Version:    0.3.78
+Version:    0.3.79
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 4867aea..3d0d54a 100644 (file)
@@ -38,6 +38,7 @@
 
 #define INVALID_DEFAULT_VALUE -1
 #define MAX_S_PATH_LEN 32
+#define PLAYER_FEATURE_SOUND_STREAM    "http://tizen.org/feature/multimedia.player.stream_info"
 
 typedef enum {
        TIZEN_PROFILE_UNKNOWN = 0,
@@ -2191,6 +2192,7 @@ int player_set_sound_type(player_h player, sound_type_e type)
 
 int player_set_sound_stream_info(player_h player, sound_stream_info_h stream_info)
 {
+       PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SOUND_STREAM);
        PLAYER_INSTANCE_CHECK(player);
 
        muse_player_api_e api = MUSE_PLAYER_API_SET_SOUND_STREAM_INFO;
@@ -2208,7 +2210,7 @@ int player_set_sound_stream_info(player_h player, sound_stream_info_h stream_inf
        }
 
        if (is_available == false) {
-               ret = PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE;
+               ret = PLAYER_ERROR_INVALID_PARAMETER;
        } else {
                char *stream_type = NULL;
                int stream_index = 0;