mediaplayer: add precise argument to seek function
Test: compiles
Bug: 32557491
Change-Id: Id8c3a938edd5a0b34a9b33e86a4dbff32cf10c98
diff --git a/include/media/IMediaPlayer.h b/include/media/IMediaPlayer.h
index 0fd8933..661eaa2 100644
--- a/include/media/IMediaPlayer.h
+++ b/include/media/IMediaPlayer.h
@@ -65,7 +65,7 @@
virtual status_t setSyncSettings(const AVSyncSettings& sync, float videoFpsHint) = 0;
virtual status_t getSyncSettings(AVSyncSettings* sync /* nonnull */,
float* videoFps /* nonnull */) = 0;
- virtual status_t seekTo(int msec) = 0;
+ virtual status_t seekTo(int msec, bool precise = false) = 0;
virtual status_t getCurrentPosition(int* msec) = 0;
virtual status_t getDuration(int* msec) = 0;
virtual status_t reset() = 0;
diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h
index 4977efd..b488159 100644
--- a/include/media/MediaPlayerInterface.h
+++ b/include/media/MediaPlayerInterface.h
@@ -205,7 +205,7 @@
*videoFps = -1.f;
return OK;
}
- virtual status_t seekTo(int msec) = 0;
+ virtual status_t seekTo(int msec, bool precise = false) = 0;
virtual status_t getCurrentPosition(int *msec) = 0;
virtual status_t getDuration(int *msec) = 0;
virtual status_t reset() = 0;
diff --git a/include/media/mediaplayer.h b/include/media/mediaplayer.h
index 389ec01..c556f0a 100644
--- a/include/media/mediaplayer.h
+++ b/include/media/mediaplayer.h
@@ -233,7 +233,7 @@
float* videoFps /* nonnull */);
status_t getVideoWidth(int *w);
status_t getVideoHeight(int *h);
- status_t seekTo(int msec);
+ status_t seekTo(int msec, bool precise = false);
status_t getCurrentPosition(int *msec);
status_t getDuration(int *msec);
status_t reset();
@@ -257,7 +257,7 @@
private:
void clear_l();
- status_t seekTo_l(int msec);
+ status_t seekTo_l(int msec, bool precise);
status_t prepareAsync_l();
status_t getDuration_l(int *msec);
status_t attachNewPlayer(const sp<IMediaPlayer>& player);
@@ -274,7 +274,9 @@
void* mCookie;
media_player_states mCurrentState;
int mCurrentPosition;
+ bool mCurrentSeekPrecise;
int mSeekPosition;
+ int mSeekPrecise;
bool mPrepareSync;
status_t mPrepareStatus;
audio_stream_type_t mStreamType;