Add the SeekVideoKeyFrame method
authorEonseokLee <eonseok.lee@samsung.com>
Mon, 10 Jun 2013 08:05:27 +0000 (17:05 +0900)
committerEonseokLee <eonseok.lee@samsung.com>
Mon, 10 Jun 2013 08:12:44 +0000 (17:12 +0900)
Change-Id: I1f0d7a635f3d7d70656edc3fa9b24389f2bc5a54
Signed-off-by: EonseokLee <eonseok.lee@samsung.com>
inc/FMediaPlayer.h
src/FMediaPlayer.cpp

index 21519bd..feee922 100755 (executable)
@@ -835,6 +835,30 @@ public:
        */
        int GetHttpStreamingDownloadProgress(void) const;
 
+/**
+*  Seeks the current playback position of the video content to the nearest key frame at the specified time if the content
+*  contains key frames.
+*  This method works asynchronously with the event listener, IPlayerEventListener::OnPlayerSeekCompleted().
+*
+*  @since             2.2
+*  @return                         An error code
+*  @param[in]                   msTime      The time in milliseconds to move to the current playback position
+*                                                                                           @c 0 indicates the starting position.
+*  @exception                   E_SUCCESS                      The method is successful
+*  @exception                   E_INVALID_STATE              The given instance is in an invalid state for this method. @n
+*                                                                              While playing live streaming, this operation returns @c E_INVALID_STATE. @n
+*                                                                              This method returns @c E_INVALID_STATE, if this method is called again before
+*                                                                              IPlayerEventListener::OnPlayerSeekCompleted) is called.
+*  @exception                   E_OUT_OF_RANGE             The specified time is out of range
+*  @exception                   E_INVALID_DATA          The media data is inappropriate for seeking.
+*  @remarks
+*                   - This method only works for the PLAYER_STATE_PLAYING, PLAYER_STATE_PAUSED, and PLAYER_STATE_OPENED states of the player instance.
+*                   - This method is not guaranteed to work correctly when the content does not have key frames.
+*                   - This method is faster than @SeekTo() but the seeking accuracy is worse than @SeekTo().
+**/
+result SeekVideoKeyFrameCloseTo(long msTime);
+
+
 private:
        /**
         * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
index 3636c45..5f4d9f3 100644 (file)
@@ -474,4 +474,18 @@ Player::GetHttpStreamingDownloadProgress(void) const
        return curPosition;
 }
 
+result
+Player::SeekVideoKeyFrameCloseTo(long msTime)
+{
+       result r = E_SUCCESS;
+
+       ClearLastResult();
+
+       SysAssertf(__pPlayerImpl !=  null, "Not yet constructed! Construct() should be called before use");
+
+       r = __pPlayerImpl->SeekTo(msTime, false);
+       SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] SeekTo failed", GetErrorMessage(r));
+       return r;
+}
+
 }}  // Tizen::Media