diff options
author | Andreas Huber <andih@google.com> | 2011-07-01 14:28:10 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-07-01 14:28:10 -0700 |
commit | 13b263c0fb2f03f12089150c3d05b545c25257ca (patch) | |
tree | 4ed42309ed640d52f1e03b29416df4c53d940278 /media/libstagefright/include | |
parent | ea317826269a1faecc2c61b76e2dab9bb7e70a62 (diff) | |
parent | 9b80c2bdb205bc143104f54d0743b6eedd67b14e (diff) | |
download | frameworks_av-13b263c0fb2f03f12089150c3d05b545c25257ca.zip frameworks_av-13b263c0fb2f03f12089150c3d05b545c25257ca.tar.gz frameworks_av-13b263c0fb2f03f12089150c3d05b545c25257ca.tar.bz2 |
Merge "Charge network traffic to the uid of the process using the MediaPlayer."
Diffstat (limited to 'media/libstagefright/include')
-rw-r--r-- | media/libstagefright/include/ARTSPController.h | 5 | ||||
-rw-r--r-- | media/libstagefright/include/AwesomePlayer.h | 3 | ||||
-rw-r--r-- | media/libstagefright/include/HTTPBase.h | 6 | ||||
-rw-r--r-- | media/libstagefright/include/HTTPStream.h | 8 | ||||
-rw-r--r-- | media/libstagefright/include/LiveSession.h | 4 |
5 files changed, 24 insertions, 2 deletions
diff --git a/media/libstagefright/include/ARTSPController.h b/media/libstagefright/include/ARTSPController.h index ce7ffe5..2bd5be6 100644 --- a/media/libstagefright/include/ARTSPController.h +++ b/media/libstagefright/include/ARTSPController.h @@ -30,6 +30,8 @@ struct MyHandler; struct ARTSPController : public MediaExtractor { ARTSPController(const sp<ALooper> &looper); + void setUID(uid_t uid); + status_t connect(const char *url); void disconnect(); @@ -80,6 +82,9 @@ private: sp<MyHandler> mHandler; sp<AHandlerReflector<ARTSPController> > mReflector; + bool mUIDValid; + uid_t mUID; + void (*mSeekDoneCb)(void *); void *mSeekDoneCookie; int64_t mLastSeekCompletedTimeUs; diff --git a/media/libstagefright/include/AwesomePlayer.h b/media/libstagefright/include/AwesomePlayer.h index f6df380..e069b4d 100644 --- a/media/libstagefright/include/AwesomePlayer.h +++ b/media/libstagefright/include/AwesomePlayer.h @@ -62,6 +62,7 @@ struct AwesomePlayer { ~AwesomePlayer(); void setListener(const wp<MediaPlayerBase> &listener); + void setUID(uid_t uid); status_t setDataSource( const char *uri, @@ -150,6 +151,8 @@ private: TimedEventQueue mQueue; bool mQueueStarted; wp<MediaPlayerBase> mListener; + bool mUIDValid; + uid_t mUID; sp<Surface> mSurface; sp<ANativeWindow> mNativeWindow; diff --git a/media/libstagefright/include/HTTPBase.h b/media/libstagefright/include/HTTPBase.h index 3a7fbb6..2e25dd9 100644 --- a/media/libstagefright/include/HTTPBase.h +++ b/media/libstagefright/include/HTTPBase.h @@ -48,13 +48,15 @@ struct HTTPBase : public DataSource { virtual status_t setBandwidthStatCollectFreq(int32_t freqMs); + void setUID(uid_t uid); + bool getUID(uid_t *uid) const; + static sp<HTTPBase> Create(uint32_t flags = 0); protected: void addBandwidthMeasurement(size_t numBytes, int64_t delayUs); private: - struct BandwidthEntry { int64_t mDelayUs; size_t mNumBytes; @@ -76,6 +78,8 @@ private: int32_t mPrevEstimatedBandWidthKbps; int32_t mBandWidthCollectFreqMs; + bool mUIDValid; + uid_t mUID; DISALLOW_EVIL_CONSTRUCTORS(HTTPBase); }; diff --git a/media/libstagefright/include/HTTPStream.h b/media/libstagefright/include/HTTPStream.h index 09e6a5f..88ba9d6 100644 --- a/media/libstagefright/include/HTTPStream.h +++ b/media/libstagefright/include/HTTPStream.h @@ -32,6 +32,8 @@ public: HTTPStream(); ~HTTPStream(); + void setUID(uid_t uid); + status_t connect(const char *server, int port = -1, bool https = false); status_t disconnect(); @@ -58,6 +60,8 @@ public: // _excluding_ the termianting CRLF. status_t receive_line(char *line, size_t size); + static void RegisterSocketUser(int s, uid_t uid); + private: enum State { READY, @@ -67,6 +71,10 @@ private: State mState; Mutex mLock; + + bool mUIDValid; + uid_t mUID; + int mSocket; KeyedVector<AString, AString> mHeaders; diff --git a/media/libstagefright/include/LiveSession.h b/media/libstagefright/include/LiveSession.h index 99abe64..188ef5e 100644 --- a/media/libstagefright/include/LiveSession.h +++ b/media/libstagefright/include/LiveSession.h @@ -35,7 +35,7 @@ struct LiveSession : public AHandler { // Don't log any URLs. kFlagIncognito = 1, }; - LiveSession(uint32_t flags = 0); + LiveSession(uint32_t flags = 0, bool uidValid = false, uid_t uid = 0); sp<DataSource> getDataSource(); @@ -77,6 +77,8 @@ private: }; uint32_t mFlags; + bool mUIDValid; + uid_t mUID; sp<LiveDataSource> mDataSource; |