From: Eunhae Choi Date: Mon, 3 Jul 2017 10:43:03 +0000 (+0900) Subject: [ACR-1010] add new APIs to set/get streaming variant X-Git-Tag: submit/tizen/20170707.065345~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=93b5b69aba786fd6ecbbc356981824512655a8e6;p=platform%2Fcore%2Fapi%2Fplayer.git [ACR-1010] add new APIs to set/get streaming variant - these apis are only for adaptive streaming (hls/mpeg dash) - Add API : to get all the streaming variant information - Add API : to set/get maximum variant limitation Change-Id: I4879e01bf6d747cf1387c8d820b0786b93cca785 --- diff --git a/include/player.h b/include/player.h index 998c8d3..af89c02 100644 --- a/include/player.h +++ b/include/player.h @@ -413,6 +413,19 @@ typedef void (*player_media_stream_seek_cb) (unsigned long long offset, void *us */ typedef void (*player_video_stream_changed_cb) (int width, int height, int fps, int bit_rate, void *user_data); +/** + * @brief Called to notify the streaming variant information. + * @since_tizen 4.0 + * @details The adaptive streaming protocol(hls, mpeg dash) can support variant stream condition. + * All the streaming variant information can be shared by calling player_foreach_adaptive_variant(). + * @param[in] bandwidth The bandwidth of the stream can be supportable, this is mandatory parameter + * @param[in] width The width of the stream, this is optional parameter + * @param[in] height The height of the stream, this is optional parameter + * @param[in] user_data The user data passed from the callback registration function + * @see player_foreach_adaptive_variant() + */ +typedef void (*player_adaptive_variant_cb) (int bandwidth, int width, int height, void *user_data); + /** * @brief Creates a player handle for playing multimedia content. * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif @@ -2109,6 +2122,65 @@ int player_get_track_count(player_h player, player_stream_type_e type, int *coun */ int player_select_track(player_h player, player_stream_type_e type, int index); +/** + * @brief Retrieves all the streaming variant information. + * @since_tizen 4.0 + * @remarks This API is used for adaptive streaming(hls/mpeg dash) only. + * @param[in] player The handle to the media player + * @param[in] callback The iteration callback function + * @param[in] user_data The user data to be passed to the callback function + * @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 + * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state + * @pre The player state must be one of #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED + * @see player_adaptive_variant_cb + */ +int player_foreach_adaptive_variant(player_h player, player_adaptive_variant_cb callback, void *user_data); + +/** + * @brief Sets the maximum limit of the streaming variant. + * @since_tizen 4.0 + * @remarks This API is used for adaptive streaming(hls/mpeg dash) only. + * @remarks The bandwidth setting can only be applied if there is no width, height information at streaming variant header. + * Application can get all the variant information by calling player_foreach_adaptive_variant() function. + * @remarks If there is no affordable stream for the condition, the minimum bandwidth stream will be selected. + * @param[in] player The handle to the media player + * @param[in] bandwidth The max bandwidth limit of the stream variant (default: -1) + * @param[in] width The max width limit of the stream variant (deafult: -1) + * @param[in] height The max height limit of the stream variant (deafult: -1) + * @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 + * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. + * @see player_foreach_adaptive_variant() + * @see player_get_max_adaptive_variant_limit() + */ +int player_set_max_adaptive_variant_limit(player_h player, int bandwidth, int width, int height); + +/** + * @brief Gets the maximum limit of the streaming variant. + * @since_tizen 4.0 + * @remarks This API is used for adaptive streaming(hls/mpeg dash) only. + * @param[in] player The handle to the media player + * @param[out] bandwidth The max bandwidth limit of the stream variant (default: -1) + * @param[out] width The max width limit of the stream variant (deafult: -1) + * @param[out] height The max height limit of the stream variant (deafult: -1) + * @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 + * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. + * @see player_foreach_adaptive_variant() + * @see player_set_max_adaptive_variant_limit() + */ +int player_get_max_adaptive_variant_limit(player_h player, int *bandwidth, int *width, int *height); + /** * @} */