From: Eunhae Choi Date: Wed, 9 May 2018 08:50:39 +0000 (+0900) Subject: [ACR-1219] Add new feature for 360 api X-Git-Tag: submit/tizen/20180511.062936^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=08c6540832b269a3b4c24ebc23a8e862f38d80da;p=platform%2Fcore%2Fapi%2Fplayer.git [ACR-1219] Add new feature for 360 api Change-Id: I6910e001d9ac01eada8973d4e464cb7c6afc30e5 --- diff --git a/doc/player_doc.h b/doc/player_doc.h index 3d2d9d0..9bb3837 100644 --- a/doc/player_doc.h +++ b/doc/player_doc.h @@ -349,7 +349,8 @@ * @section CAPI_MEDIA_PLAYER_MODULE_FEATURE Related Features * This API is related with the following features: * - http://tizen.org/feature/opengles.version.2_0 - * This feature is required for 360 video playback. + * - http://tizen.org/feature/multimedia.player.spherical_video + * These features are required for 360 video playback. * @if WEARABLE * - http://tizen.org/feature/network.internet * This feature is required for network streaming. diff --git a/include/player.h b/include/player.h index c47eafa..b90975f 100644 --- a/include/player.h +++ b/include/player.h @@ -2388,6 +2388,9 @@ int player_get_streaming_buffering_time(player_h player, int *prebuffer_ms, int /** * @brief Gets information whether the current content of the player is spherical. * @since_tizen 5.0 + * @remarks This function is related to the following features:\n + * %http://tizen.org/feature/multimedia.player.spherical_video\n + * %http://tizen.org/feature/opengles.version.2_0\n * @param[in] player The handle to the media player * @param[out] is_spherical The value indicating whether the content is spherical * @return @c 0 on success, @@ -2405,6 +2408,9 @@ int player_360_is_content_spherical(player_h player, bool *is_spherical); * @brief Sets the 360 video mode. * @details In case the media content is spherical, display mode can be selected by this function. * @since_tizen 5.0 + * @remarks This function is related to the following features:\n + * %http://tizen.org/feature/multimedia.player.spherical_video\n + * %http://tizen.org/feature/opengles.version.2_0\n * @param[in] player The handle to the media player * @param[in] enabled The 360 video display status: @c true = display with 360 video mode, @c false = display with full panorama mode. The default value is @c true. @@ -2423,6 +2429,9 @@ int player_360_set_enabled(player_h player, bool enabled); /** * @brief Gets the 360 video display mode. * @since_tizen 5.0 + * @remarks This function is related to the following features:\n + * %http://tizen.org/feature/multimedia.player.spherical_video\n + * %http://tizen.org/feature/opengles.version.2_0\n * @param[in] player The handle to the media player * @param[out] enabled Pointer to store current 360 video display mode: * (@c true = display with 360 video mode, @@ -2447,6 +2456,9 @@ int player_360_is_enabled(player_h player, bool *enabled); * these values, zeros are assumed to be equal to the centre of the * panorama image. * @since_tizen 5.0 + * @remarks This function is related to the following features:\n + * %http://tizen.org/feature/multimedia.player.spherical_video\n + * %http://tizen.org/feature/opengles.version.2_0\n * @param[in] player The handle to the media player * @param[in] yaw The angle value around vertical axis. Valid values are in * range [-PI, PI]. @@ -2469,6 +2481,9 @@ int player_360_set_direction_of_view(player_h player, float yaw, float pitch); * @details This function is to get horizontal (yaw) and vertical (pitch) angles * of current direction of view in radians. * @since_tizen 5.0 + * @remarks This function is related to the following features:\n + * %http://tizen.org/feature/multimedia.player.spherical_video\n + * %http://tizen.org/feature/opengles.version.2_0\n * @param[in] player The handle to the media player * @param[out] yaw Pointer to store current value of direction of view * angle around vertical axis @@ -2492,6 +2507,9 @@ int player_360_get_direction_of_view(player_h player, float *yaw, float *pitch); * The valid range is from 1.0 to 10.0, where 1.0 is the actual image and * values above are zoom-in factor. Default value is 1.0 - no zoom. * @since_tizen 5.0 + * @remarks This function is related to the following features:\n + * %http://tizen.org/feature/multimedia.player.spherical_video\n + * %http://tizen.org/feature/opengles.version.2_0\n * @param[in] player The handle to the media player * @param[in] level The zoom level * @return @c 0 on success, @@ -2512,6 +2530,9 @@ int player_360_set_zoom(player_h player, float level); * The valid range is from 1.0 to 10.0. Where 1.0 is actual image and * values above are zoom-in factor. Default value is 1.0 - no zoom. * @since_tizen 5.0 + * @remarks This function is related to the following features:\n + * %http://tizen.org/feature/multimedia.player.spherical_video\n + * %http://tizen.org/feature/opengles.version.2_0\n * @param[in] player The handle to the media player * @param[out] level Pointer to store current value of zoom level * @return @c 0 on success, @@ -2532,6 +2553,9 @@ int player_360_get_zoom(player_h player, float *level); * @since_tizen 5.0 * @remarks values above the default ones extend the field of view to significantly * distorted areas and will not be useful in most cases. + * @remarks This function is related to the following features:\n + * %http://tizen.org/feature/multimedia.player.spherical_video\n + * %http://tizen.org/feature/opengles.version.2_0\n * @param[in] player The handle to the media player * @param[in] horizontal_degrees The horizontal field of view to display in degrees. * Valid range is 1-360 degrees. Default value is 120 degrees. @@ -2553,6 +2577,9 @@ int player_360_set_field_of_view(player_h player, int horizontal_degrees, int ve * @brief Gets the field of view information of 360 video. * @details This function is to get the field of view information. * @since_tizen 5.0 + * @remarks This function is related to the following features:\n + * %http://tizen.org/feature/multimedia.player.spherical_video\n + * %http://tizen.org/feature/opengles.version.2_0\n * @param[in] player The handle to the media player * @param[out] horizontal_degrees Pointer to store current value of horizontal * field of view to display in degrees. diff --git a/src/player.c b/src/player.c index 7e0f040..f667b31 100644 --- a/src/player.c +++ b/src/player.c @@ -38,8 +38,9 @@ #define INVALID_DEFAULT_VALUE -1 #define MAX_S_PATH_LEN 32 -#define PLAYER_FEATURE_SOUND_STREAM "http://tizen.org/feature/multimedia.player.stream_info" -#define PLAYER_FEATURE_OPENGL "http://tizen.org/feature/opengles.version.2_0" +#define PLAYER_FEATURE_SOUND_STREAM "http://tizen.org/feature/multimedia.player.stream_info" +#define PLAYER_FEATURE_OPENGL "http://tizen.org/feature/opengles.version.2_0" +#define PLAYER_FEATURE_SPHERICAL_VIDEO "http://tizen.org/feature/multimedia.player.spherical_video" typedef enum { TIZEN_PROFILE_UNKNOWN = 0, @@ -4428,6 +4429,8 @@ int player_get_streaming_buffering_time(player_h player, int *buffer_ms, int *re int player_360_is_content_spherical(player_h player, bool *is_spherical) { PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL); + PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO); + PLAYER_INSTANCE_CHECK(player); PLAYER_NULL_ARG_CHECK(is_spherical); @@ -4453,6 +4456,8 @@ int player_360_is_content_spherical(player_h player, bool *is_spherical) int player_360_set_enabled(player_h player, bool enabled) { PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL); + PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO); + PLAYER_INSTANCE_CHECK(player); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_360_SET_ENABLED; @@ -4472,6 +4477,8 @@ int player_360_set_enabled(player_h player, bool enabled) int player_360_is_enabled(player_h player, bool *enabled) { PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL); + PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO); + PLAYER_INSTANCE_CHECK(player); PLAYER_NULL_ARG_CHECK(enabled); int ret = PLAYER_ERROR_NONE; @@ -4496,6 +4503,8 @@ int player_360_is_enabled(player_h player, bool *enabled) int player_360_set_direction_of_view(player_h player, float yaw, float pitch) { PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL); + PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO); + PLAYER_INSTANCE_CHECK(player); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_360_SET_DIRECTION_OF_VIEW; @@ -4514,6 +4523,8 @@ int player_360_set_direction_of_view(player_h player, float yaw, float pitch) int player_360_get_direction_of_view(player_h player, float *yaw, float *pitch) { PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL); + PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO); + PLAYER_INSTANCE_CHECK(player); PLAYER_NULL_ARG_CHECK(yaw && pitch); int ret = PLAYER_ERROR_NONE; @@ -4548,6 +4559,8 @@ int player_360_get_direction_of_view(player_h player, float *yaw, float *pitch) int player_360_set_zoom(player_h player, float level) { PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL); + PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO); + PLAYER_INSTANCE_CHECK(player); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_360_SET_ZOOM; @@ -4566,6 +4579,8 @@ int player_360_set_zoom(player_h player, float level) int player_360_get_zoom(player_h player, float *level) { PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL); + PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO); + PLAYER_INSTANCE_CHECK(player); PLAYER_NULL_ARG_CHECK(level); int ret = PLAYER_ERROR_NONE; @@ -4597,6 +4612,8 @@ int player_360_get_zoom(player_h player, float *level) int player_360_set_field_of_view(player_h player, int horizontal_degrees, int vertical_degrees) { PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL); + PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO); + PLAYER_INSTANCE_CHECK(player); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_360_SET_FIELD_OF_VIEW; @@ -4615,6 +4632,8 @@ int player_360_set_field_of_view(player_h player, int horizontal_degrees, int ve int player_360_get_field_of_view(player_h player, int *horizontal_degrees, int *vertical_degrees) { PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL); + PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO); + PLAYER_INSTANCE_CHECK(player); PLAYER_NULL_ARG_CHECK(horizontal_degrees && vertical_degrees); int ret = PLAYER_ERROR_NONE;