diff options
author | Eric Laurent <elaurent@google.com> | 2013-11-04 16:08:15 -0800 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2013-11-07 16:42:06 -0800 |
commit | e8332ee38cc9778aa7898bbd75858561ed1e0ba3 (patch) | |
tree | 07dce7442357a537076cc8422d64b28fdd70ec46 /media/libstagefright/include/TimedEventQueue.h | |
parent | fd6ecdd39bd83ea020f78b425e96310380d66c35 (diff) | |
download | frameworks_av-e8332ee38cc9778aa7898bbd75858561ed1e0ba3.zip frameworks_av-e8332ee38cc9778aa7898bbd75858561ed1e0ba3.tar.gz frameworks_av-e8332ee38cc9778aa7898bbd75858561ed1e0ba3.tar.bz2 |
TimedEventQueue: improve wakelock management
Do not acquire a wakelock unless the event is delayed by more
than a given time. This prevents from acquiring/releasing
wakelocks too often which has adverse effects on performance.
Bug: 11509471.
Change-Id: Id06803b393b40c4db5095a6e7ec02339fa581a38
Diffstat (limited to 'media/libstagefright/include/TimedEventQueue.h')
-rw-r--r-- | media/libstagefright/include/TimedEventQueue.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/media/libstagefright/include/TimedEventQueue.h b/media/libstagefright/include/TimedEventQueue.h index 4e49c83..38a08b1 100644 --- a/media/libstagefright/include/TimedEventQueue.h +++ b/media/libstagefright/include/TimedEventQueue.h @@ -118,6 +118,7 @@ private: struct QueueItem { sp<Event> event; int64_t realtime_us; + bool has_wakelock; }; struct StopEvent : public TimedEventQueue::Event { @@ -139,6 +140,7 @@ private: sp<IPowerManager> mPowerManager; sp<IBinder> mWakeLockToken; const sp<PMDeathRecipient> mDeathRecipient; + uint32_t mWakeLockCount; static void *ThreadWrapper(void *me); void threadEntry(); @@ -146,7 +148,7 @@ private: sp<Event> removeEventFromQueue_l(event_id id); void acquireWakeLock_l(); - void releaseWakeLock_l(); + void releaseWakeLock_l(bool force = false); TimedEventQueue(const TimedEventQueue &); TimedEventQueue &operator=(const TimedEventQueue &); |