diff options
author | Gloria Wang <gwang@google.com> | 2011-02-19 18:37:57 -0800 |
---|---|---|
committer | Gloria Wang <gwang@google.com> | 2011-02-22 22:42:05 -0800 |
commit | 7cf180c9bff69e5cc4a2f4e53b432db45ebbebab (patch) | |
tree | 05d25862b1e1f30ffc31fe2ca2128ff68810df1b /media/libmediaplayerservice/MediaPlayerService.h | |
parent | 1de41a66e3e7b548ee44e6654580e5f6f7265b11 (diff) | |
download | frameworks_av-7cf180c9bff69e5cc4a2f4e53b432db45ebbebab.zip frameworks_av-7cf180c9bff69e5cc4a2f4e53b432db45ebbebab.tar.gz frameworks_av-7cf180c9bff69e5cc4a2f4e53b432db45ebbebab.tar.bz2 |
- Add method in MediaPlayerService to collect and pull
codec usage (duration) for the battery app
- Collect MediaPlayer decoding usage data
Change-Id: I0ef4e32b6a041ba1fe73c19f9c67185c61d03965
Diffstat (limited to 'media/libmediaplayerservice/MediaPlayerService.h')
-rw-r--r-- | media/libmediaplayerservice/MediaPlayerService.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/media/libmediaplayerservice/MediaPlayerService.h b/media/libmediaplayerservice/MediaPlayerService.h index 62f8ed6..9f41db0 100644 --- a/media/libmediaplayerservice/MediaPlayerService.h +++ b/media/libmediaplayerservice/MediaPlayerService.h @@ -204,7 +204,31 @@ public: void removeClient(wp<Client> client); + // For battery usage tracking purpose + struct BatteryUsageInfo { + // how many streams are being played by one UID + int refCount; + // a temp variable to store the duration(ms) of audio codecs + // when we start a audio codec, we minus the system time from audioLastTime + // when we pause it, we add the system time back to the audioLastTime + // so after the pause, audioLastTime = pause time - start time + // if multiple audio streams are played (or recorded), then audioLastTime + // = the total playing time of all the streams + int32_t audioLastTime; + // when all the audio streams are being paused, we assign audioLastTime to + // this variable, so this value could be provided to the battery app + // in the next pullBatteryData call + int32_t audioTotalTime; + + int32_t videoLastTime; + int32_t videoTotalTime; + }; + KeyedVector<int, BatteryUsageInfo> mBatteryData; + // Collect info of the codec usage from media player and media recorder + virtual void addBatteryData(uint32_t params); + // API for the Battery app to pull the data of codecs usage + virtual status_t pullBatteryData(Parcel* reply); private: class Client : public BnMediaPlayer { |