* @retval #PLAYER_ERROR_NONE Successful
* @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
- * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare().
+ * @pre The player state must be one of these: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. (since 3.0)
* @see player_get_media_stream_buffer_max_size()
* @see player_media_stream_buffer_status_cb()
*/
* @retval #PLAYER_ERROR_NONE Successful
* @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
- * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare().
+ * @pre The player state must be one of these: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
* @see player_set_media_stream_buffer_max_size()
* @see player_media_stream_buffer_status_cb()
*/
* @retval #PLAYER_ERROR_NONE Successful
* @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
- * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare().
+ * @pre The player state must be one of these: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. (since 3.0)
* @see player_get_media_stream_buffer_min_threshold()
* @see player_media_stream_buffer_status_cb()
*/
* @retval #PLAYER_ERROR_NONE Successful
* @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
- * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare().
+ * @pre The player state must be one of these: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
* @see player_set_media_stream_buffer_min_threshold()
* @see player_media_stream_buffer_status_cb()
*/
int ret;
PLAYER_INSTANCE_CHECK(player);
player_s *handle = (player_s *)player;
- PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
+ if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) {
+ LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
+ return PLAYER_ERROR_INVALID_STATE;
+ }
ret = mm_player_set_media_stream_buffer_max_size(handle->mm_handle, type, max_size);
int ret;
PLAYER_INSTANCE_CHECK(player);
player_s *handle = (player_s *)player;
- PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
+ if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) {
+ LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
+ return PLAYER_ERROR_INVALID_STATE;
+ }
ret = mm_player_set_media_stream_buffer_min_percent(handle->mm_handle, type, percent);