* @see player_set_pcm_extraction_mode()
*/
int player_set_pcm_spec(player_h player, const char *format, int samplerate, int channel);
+
+/**
+ * @brief Sets the playback rate include streaming mode.
+ * @since_tizen 3.0
+ * @details The default value is @c 1.0.
+ * @remarks No operation is performed, if @a rate is @c 0.
+ * @remarks The sound is muted, when playback rate is under @c 0.0 and over @c 2.0.
+ * @param[in] player The handle to the media player
+ * @param[in] rate The playback rate
+ * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
+ * @pre The player state must be set to #PLAYER_STATE_PLAYING by calling player_start().
+ * @pre The player state must be set to #PLAYER_STATE_READY by calling player_prepare() or set to #PLAYER_STATE_PLAYING by calling player_start() or set to #PLAYER_STATE_PAUSED by calling player_pause().
+ */
+int player_set_streaming_playback_rate(player_h player, float rate);
+
+
/**
* @}
*/
* @post player_audio_pcm_extraction_cb() will be invoked.
*/
int player_set_pcm_extraction_mode(player_h player, bool sync, player_audio_pcm_extraction_cb callback, void *user_data);
+
/**
* @brief Set pcm mode spec. Samplerate, channel is needed.
* @since_tizen 2.4
int player_set_pcm_spec(player_h player, const char *format, int samplerate, int channel);
/**
+ * @brief Sets the playback rate include streaming mode.
+ * @since_tizen 3.0
+ * @details The default value is @c 1.0.
+ * @remarks No operation is performed, if @a rate is @c 0.
+ * @remarks The sound is muted, when playback rate is under @c 0.0 and over @c 2.0.
+ * @param[in] player The handle to the media player
+ * @param[in] rate The playback rate
+ * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
+ * @pre The player state must be set to #PLAYER_STATE_PLAYING by calling player_start().
+ * @pre The player state must be set to #PLAYER_STATE_READY by calling player_prepare() or set to #PLAYER_STATE_PLAYING by calling player_start() or set to #PLAYER_STATE_PAUSED by calling player_pause().
+ */
+int player_set_streaming_playback_rate(player_h player, float rate);
+
+
+/**
* @}
*/
return PLAYER_ERROR_INVALID_STATE;
}
- int ret = mm_player_set_play_speed(handle->mm_handle, rate);
+ int ret = mm_player_set_play_speed(handle->mm_handle, rate, FALSE);
switch (ret)
{
return PLAYER_ERROR_NONE;
}
+
+int player_set_streaming_playback_rate(player_h player, float rate)
+{
+ LOGI("[%s] rate : %0.1f", __FUNCTION__, rate);
+ PLAYER_INSTANCE_CHECK(player);
+ player_s * handle = (player_s *) player;
+
+ if (!__player_state_validate(handle, PLAYER_STATE_READY))
+ {
+ LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d" ,__FUNCTION__,PLAYER_ERROR_INVALID_STATE, handle->state);
+ return PLAYER_ERROR_INVALID_STATE;
+ }
+
+ int ret = mm_player_set_play_speed(handle->mm_handle, rate, TRUE);
+
+ switch (ret)
+ {
+ case MM_ERROR_NONE:
+ case MM_ERROR_PLAYER_NO_OP:
+ ret = PLAYER_ERROR_NONE;
+ break;
+ case MM_ERROR_NOT_SUPPORT_API:
+ case MM_ERROR_PLAYER_SEEK:
+ LOGE("[%s] PLAYER_ERROR_INVALID_OPERATION(0x%08x) : seek error",__FUNCTION__, PLAYER_ERROR_INVALID_OPERATION);
+ ret = PLAYER_ERROR_INVALID_OPERATION;
+ break;
+ default:
+ return __player_convert_error_code(ret,(char*)__FUNCTION__);
+ }
+ return ret;
+}
+
+