diff options
author | Andreas Huber <andih@google.com> | 2010-11-15 08:59:23 -0800 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2010-11-15 09:35:54 -0800 |
commit | c62165b829f0244ad8e3646b3c4e314d6b4ccbb1 (patch) | |
tree | 1d51d1690a4212fa7f023f30fb91e7b93a1ee3b3 /media/libstagefright/include | |
parent | 2d71233de5450f1b128c8149fdbdf39b937f3cb8 (diff) | |
download | frameworks_av-c62165b829f0244ad8e3646b3c4e314d6b4ccbb1.zip frameworks_av-c62165b829f0244ad8e3646b3c4e314d6b4ccbb1.tar.gz frameworks_av-c62165b829f0244ad8e3646b3c4e314d6b4ccbb1.tar.bz2 |
Provide bandwidth estimation support in NuHTTPDataSource
Change-Id: Ic98d8cf147bbba60ec735e7ca200addb2bd09f29
related-to-bug: 2368598
Diffstat (limited to 'media/libstagefright/include')
-rw-r--r-- | media/libstagefright/include/NuHTTPDataSource.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/media/libstagefright/include/NuHTTPDataSource.h b/media/libstagefright/include/NuHTTPDataSource.h index 93b7a76..c707fdc 100644 --- a/media/libstagefright/include/NuHTTPDataSource.h +++ b/media/libstagefright/include/NuHTTPDataSource.h @@ -3,6 +3,7 @@ #define NU_HTTP_DATA_SOURCE_H_ #include <media/stagefright/DataSource.h> +#include <utils/List.h> #include <utils/String8.h> #include <utils/threads.h> @@ -26,6 +27,10 @@ struct NuHTTPDataSource : public DataSource { virtual status_t getSize(off_t *size); virtual uint32_t flags(); + // Returns true if bandwidth could successfully be estimated, + // false otherwise. + bool estimateBandwidth(int32_t *bandwidth_bps); + virtual DecryptHandle* DrmInitialization(DrmManagerClient *client); virtual void getDrmInfo(DecryptHandle **handle, DrmManagerClient **client); @@ -39,6 +44,11 @@ private: CONNECTED }; + struct BandwidthEntry { + int64_t mDelayUs; + size_t mNumBytes; + }; + Mutex mLock; State mState; @@ -54,6 +64,11 @@ private: off_t mContentLength; bool mContentLengthValid; + List<BandwidthEntry> mBandwidthHistory; + size_t mNumBandwidthHistoryItems; + int64_t mTotalTransferTimeUs; + size_t mTotalTransferBytes; + DecryptHandle *mDecryptHandle; DrmManagerClient *mDrmManagerClient; @@ -66,6 +81,7 @@ private: off_t offset); void applyTimeoutResponse(); + void addBandwidthMeasurement_l(size_t numBytes, int64_t delayUs); static void MakeFullHeaders( const KeyedVector<String8, String8> *overrides, |