diff options
author | Chong Zhang <chz@google.com> | 2015-01-30 17:13:27 -0800 |
---|---|---|
committer | Chong Zhang <chz@google.com> | 2015-02-03 16:36:09 -0800 |
commit | efbb61950db36a5eb789be83f077246172507c67 (patch) | |
tree | 0904a0a4b377dd60935c274b29bf1550d0038389 /media/libmediaplayerservice/nuplayer/GenericSource.h | |
parent | 77f877f82733263bca825b92a3f4537caafabf74 (diff) | |
download | frameworks_av-efbb61950db36a5eb789be83f077246172507c67.zip frameworks_av-efbb61950db36a5eb789be83f077246172507c67.tar.gz frameworks_av-efbb61950db36a5eb789be83f077246172507c67.tar.bz2 |
NuPlayer: pause playback when buffering is low
also fix buffering percentage report (should be the buffered position)
bug: 18730095
Change-Id: I11e7ca4ba9e772a1ae76861ca1ff1725b62f65ae
Diffstat (limited to 'media/libmediaplayerservice/nuplayer/GenericSource.h')
-rw-r--r-- | media/libmediaplayerservice/nuplayer/GenericSource.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/media/libmediaplayerservice/nuplayer/GenericSource.h b/media/libmediaplayerservice/nuplayer/GenericSource.h index 1b63a1f..385d73a 100644 --- a/media/libmediaplayerservice/nuplayer/GenericSource.h +++ b/media/libmediaplayerservice/nuplayer/GenericSource.h @@ -94,16 +94,17 @@ private: kWhatSeek, kWhatReadBuffer, kWhatStopWidevine, + kWhatStart, + kWhatResume, }; - Vector<sp<MediaSource> > mSources; - struct Track { size_t mIndex; sp<MediaSource> mSource; sp<AnotherPacketSource> mPackets; }; + Vector<sp<MediaSource> > mSources; Track mAudioTrack; int64_t mAudioTimeUs; int64_t mAudioLastDequeueTimeUs; @@ -119,6 +120,7 @@ private: bool mAudioIsVorbis; bool mIsWidevine; bool mIsSecure; + bool mIsStreaming; bool mUIDValid; uid_t mUID; sp<IMediaHTTPService> mHTTPService; @@ -143,6 +145,8 @@ private: int64_t mBitrate; int32_t mPollBufferingGeneration; uint32_t mPendingReadBufferTypes; + bool mBuffering; + bool mPrepareBuffering; mutable Mutex mReadBufferLock; sp<ALooper> mLooper; @@ -194,8 +198,13 @@ private: void schedulePollBuffering(); void cancelPollBuffering(); + void restartPollBuffering(); void onPollBuffering(); void notifyBufferingUpdate(int percentage); + void startBufferingIfNecessary(); + void stopBufferingIfNecessary(); + void sendCacheStats(); + void ensureCacheIsFetching(); DISALLOW_EVIL_CONSTRUCTORS(GenericSource); }; |