[ACR-1010] add new APIs to set/get streaming variant 99/136899/10
authorEunhae Choi <eunhae1.choi@samsung.com>
Mon, 3 Jul 2017 10:43:03 +0000 (19:43 +0900)
committereunhae choi <eunhae1.choi@samsung.com>
Thu, 6 Jul 2017 09:27:04 +0000 (09:27 +0000)
- 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

include/player.h

index 998c8d396274e298cd35a7905a9b358594ea2c95..af89c0253cbbe90a1b8ae235f456a30856ef6e7d 100644 (file)
@@ -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);
+
 /**
  * @}
  */