From d2f2bfb198a8f8fc29a8a40a3dc78c39bda848eb Mon Sep 17 00:00:00 2001 From: Eunhae Choi Date: Wed, 20 Dec 2017 18:10:59 +0900 Subject: [PATCH] [0.3.79][ACR-1131] Add stream info feature Change-Id: I5ac4648c9854d7c344ed3b422109fdd4427baec0 --- doc/player_doc.h | 0 include/player.h | 4 +++- include/player_private.h | 13 +++++++++++++ packaging/capi-media-player.spec | 2 +- src/player.c | 4 +++- 5 files changed, 20 insertions(+), 3 deletions(-) mode change 100755 => 100644 doc/player_doc.h diff --git a/doc/player_doc.h b/doc/player_doc.h old mode 100755 new mode 100644 diff --git a/include/player.h b/include/player.h index e1bc904..2b897c6 100644 --- a/include/player.h +++ b/include/player.h @@ -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, diff --git a/include/player_private.h b/include/player_private.h index 9e55a8c..d2653f8 100644 --- a/include/player_private.h +++ b/include/player_private.h @@ -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 */ diff --git a/packaging/capi-media-player.spec b/packaging/capi-media-player.spec index 9423d7d..8f43c5b 100644 --- a/packaging/capi-media-player.spec +++ b/packaging/capi-media-player.spec @@ -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 diff --git a/src/player.c b/src/player.c index 4867aea..3d0d54a 100644 --- a/src/player.c +++ b/src/player.c @@ -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; -- 2.7.4