diff options
author | Andreas Huber <andih@google.com> | 2011-06-30 15:47:02 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2011-07-01 13:18:43 -0700 |
commit | 9b80c2bdb205bc143104f54d0743b6eedd67b14e (patch) | |
tree | 7a035b1bbc67096fa775d41544f420a5eb6e0487 /media/libstagefright/rtsp/ARTSPConnection.cpp | |
parent | cebcdaef5b559f4db2a9d8b305d9d7da03525b62 (diff) | |
download | frameworks_av-9b80c2bdb205bc143104f54d0743b6eedd67b14e.zip frameworks_av-9b80c2bdb205bc143104f54d0743b6eedd67b14e.tar.gz frameworks_av-9b80c2bdb205bc143104f54d0743b6eedd67b14e.tar.bz2 |
Charge network traffic to the uid of the process using the MediaPlayer.
Change-Id: I2bcb54b8232afd3fc7ee16289f37c7a7b3f23067
related-to-bug: 4517282
Diffstat (limited to 'media/libstagefright/rtsp/ARTSPConnection.cpp')
-rw-r--r-- | media/libstagefright/rtsp/ARTSPConnection.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/media/libstagefright/rtsp/ARTSPConnection.cpp b/media/libstagefright/rtsp/ARTSPConnection.cpp index c4e0cdc..072d6b2 100644 --- a/media/libstagefright/rtsp/ARTSPConnection.cpp +++ b/media/libstagefright/rtsp/ARTSPConnection.cpp @@ -34,13 +34,17 @@ #include <openssl/md5.h> #include <sys/socket.h> +#include "HTTPStream.h" + namespace android { // static const int64_t ARTSPConnection::kSelectTimeoutUs = 1000ll; -ARTSPConnection::ARTSPConnection() - : mState(DISCONNECTED), +ARTSPConnection::ARTSPConnection(bool uidValid, uid_t uid) + : mUIDValid(uidValid), + mUID(uid), + mState(DISCONNECTED), mAuthType(NONE), mSocket(-1), mConnectionID(0), @@ -246,6 +250,10 @@ void ARTSPConnection::onConnect(const sp<AMessage> &msg) { mSocket = socket(AF_INET, SOCK_STREAM, 0); + if (mUIDValid) { + HTTPStream::RegisterSocketUser(mSocket, mUID); + } + MakeSocketBlocking(mSocket, false); struct sockaddr_in remote; |