OSDN Git Service

Fix videos app bandwidth accounting for 4G streaming
authorJeff Tinker <jtinker@google.com>
Tue, 14 Feb 2012 22:54:01 +0000 (14:54 -0800)
committerJeff Tinker <jtinker@google.com>
Tue, 14 Feb 2012 22:54:01 +0000 (14:54 -0800)
Register the app uid with the WV extractor so it can
attribute bandwidth usage to the proper process.

Multi-repository commit, also changes in vendor/widevine

Change-Id: I42395fd08bf0bfc7e224745f820a714400066456
related-to-bug: 5434244

media/libstagefright/AwesomePlayer.cpp
media/libstagefright/WVMExtractor.cpp
media/libstagefright/include/WVMExtractor.h

index 70945e3..9c975b7 100644 (file)
@@ -2111,6 +2111,8 @@ status_t AwesomePlayer::finishSetDataSource_l() {
 
         mWVMExtractor = new WVMExtractor(dataSource);
         mWVMExtractor->setAdaptiveStreamingMode(true);
+        if (mUIDValid)
+            mWVMExtractor->setUID(mUID);
         extractor = mWVMExtractor;
     } else {
         extractor = MediaExtractor::Create(
index c7ad513..dac8106 100644 (file)
@@ -123,6 +123,12 @@ void WVMExtractor::setAdaptiveStreamingMode(bool adaptive) {
     }
 }
 
+void WVMExtractor::setUID(uid_t uid) {
+    if (mImpl != NULL) {
+        mImpl->setUID(uid);
+    }
+}
+
 bool SniffWVM(
     const sp<DataSource> &source, String8 *mimeType, float *confidence,
         sp<AMessage> *) {
index 9f763f9..3c3ca89 100644 (file)
@@ -34,6 +34,7 @@ public:
 
     virtual int64_t getCachedDurationUs(status_t *finalStatus) = 0;
     virtual void setAdaptiveStreamingMode(bool adaptive) = 0;
+    virtual void setUID(uid_t uid) = 0;
 };
 
 class WVMExtractor : public MediaExtractor {
@@ -60,6 +61,8 @@ public:
     // is used.
     void setAdaptiveStreamingMode(bool adaptive);
 
+    void setUID(uid_t uid);
+
     static bool getVendorLibHandle();
 
 protected: