NuPlayer2: support end position of data source
Test: cts
Bug: 112549021
Change-Id: I5143754eb22fa42c3134474c584d986eb6f2b33d
diff --git a/media/libmediaplayer2/nuplayer2/NuPlayer2.h b/media/libmediaplayer2/nuplayer2/NuPlayer2.h
index 4db0cbf..3ecdb01 100644
--- a/media/libmediaplayer2/nuplayer2/NuPlayer2.h
+++ b/media/libmediaplayer2/nuplayer2/NuPlayer2.h
@@ -79,6 +79,7 @@
int64_t seekTimeUs,
MediaPlayer2SeekMode mode = MediaPlayer2SeekMode::SEEK_PREVIOUS_SYNC,
bool needNotify = false);
+ void rewind();
status_t setVideoScalingMode(int32_t mode);
status_t getTrackInfo(PlayerMessage* reply) const;
@@ -154,6 +155,8 @@
kWhatSetBufferingSettings = 'sBuS',
kWhatPrepareDrm = 'pDrm',
kWhatReleaseDrm = 'rDrm',
+ kWhatRewind = 'reWd',
+ kWhatEOSMonitor = 'eosM',
};
typedef enum {
@@ -167,6 +170,7 @@
struct SourceInfo {
SourceInfo();
+ SourceInfo &operator=(const SourceInfo &);
sp<Source> mSource;
std::atomic<DATA_SOURCE_TYPE> mDataSourceType;
@@ -194,6 +198,7 @@
int32_t mAudioDecoderGeneration;
int32_t mVideoDecoderGeneration;
int32_t mRendererGeneration;
+ int32_t mEOSMonitorGeneration;
Mutex mPlayingTimeLock;
int64_t mLastStartedPlayingTimeNs;
@@ -302,6 +307,8 @@
void notifyListener(int64_t srcId, int msg, int ext1, int ext2, const PlayerMessage *in = NULL);
+ void addEndTimeMonitor();
+
void handleFlushComplete(bool audio, bool isDecoder);
void finishFlushIfPossible();