diff options
author | Andreas Huber <andih@google.com> | 2012-10-01 16:03:44 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2012-10-01 16:03:44 -0700 |
commit | fa0e033ab5a0ab5d96e90c9f6d4d53bedc74514b (patch) | |
tree | 36a07a0e8484abeb2d8ec882833c6aef8aa7f231 /media/libstagefright/TimeSource.cpp | |
parent | 90689fda75c343ab9328ced63e58f45eabaa33cc (diff) | |
download | frameworks_av-fa0e033ab5a0ab5d96e90c9f6d4d53bedc74514b.zip frameworks_av-fa0e033ab5a0ab5d96e90c9f6d4d53bedc74514b.tar.gz frameworks_av-fa0e033ab5a0ab5d96e90c9f6d4d53bedc74514b.tar.bz2 |
ALooper::GetNowUs() now relies on systemTime instead of gettimeofday.
Change-Id: Ia31eb0940b02581327a8bf51af6df135f9ab6de3
related-to-bug: 7266324
Diffstat (limited to 'media/libstagefright/TimeSource.cpp')
-rw-r--r-- | media/libstagefright/TimeSource.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/media/libstagefright/TimeSource.cpp b/media/libstagefright/TimeSource.cpp index d987fbf..041980f 100644 --- a/media/libstagefright/TimeSource.cpp +++ b/media/libstagefright/TimeSource.cpp @@ -17,24 +17,17 @@ #include <stddef.h> #include <sys/time.h> +#include <media/stagefright/foundation/ALooper.h> #include <media/stagefright/TimeSource.h> namespace android { SystemTimeSource::SystemTimeSource() - : mStartTimeUs(GetSystemTimeUs()) { + : mStartTimeUs(ALooper::GetNowUs()) { } int64_t SystemTimeSource::getRealTimeUs() { - return GetSystemTimeUs() - mStartTimeUs; -} - -// static -int64_t SystemTimeSource::GetSystemTimeUs() { - struct timeval tv; - gettimeofday(&tv, NULL); - - return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec; + return ALooper::GetNowUs() - mStartTimeUs; } } // namespace android |