summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/MediaClock.cpp
diff options
context:
space:
mode:
authorWei Jia <wjia@google.com>2015-03-09 16:31:48 -0700
committerWei Jia <wjia@google.com>2015-03-20 11:10:33 -0700
commitc8db9712d9abe9b0d74193ea7d7cff428e32e62c (patch)
tree184bc7777bce86c268348ca946e5009612c0e0fd /media/libstagefright/MediaClock.cpp
parent0e4421286b92a81e952f53210227adbf05d97c25 (diff)
downloadframeworks_av-c8db9712d9abe9b0d74193ea7d7cff428e32e62c.zip
frameworks_av-c8db9712d9abe9b0d74193ea7d7cff428e32e62c.tar.gz
frameworks_av-c8db9712d9abe9b0d74193ea7d7cff428e32e62c.tar.bz2
MediaSync: support MediaSync in native code.
Bug: 19666434 Change-Id: Ib6678153f43f5063bdaaf53dd8ad5e8d26434e1e
Diffstat (limited to 'media/libstagefright/MediaClock.cpp')
-rw-r--r--media/libstagefright/MediaClock.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/media/libstagefright/MediaClock.cpp b/media/libstagefright/MediaClock.cpp
index 38db5e4..433f555 100644
--- a/media/libstagefright/MediaClock.cpp
+++ b/media/libstagefright/MediaClock.cpp
@@ -93,13 +93,17 @@ void MediaClock::setPlaybackRate(float rate) {
}
status_t MediaClock::getMediaTime(
- int64_t realUs, int64_t *outMediaUs, bool allowPastMaxTime) {
+ int64_t realUs, int64_t *outMediaUs, bool allowPastMaxTime) const {
+ if (outMediaUs == NULL) {
+ return BAD_VALUE;
+ }
+
Mutex::Autolock autoLock(mLock);
return getMediaTime_l(realUs, outMediaUs, allowPastMaxTime);
}
status_t MediaClock::getMediaTime_l(
- int64_t realUs, int64_t *outMediaUs, bool allowPastMaxTime) {
+ int64_t realUs, int64_t *outMediaUs, bool allowPastMaxTime) const {
if (mAnchorTimeRealUs == -1) {
return NO_INIT;
}
@@ -119,7 +123,12 @@ status_t MediaClock::getMediaTime_l(
return OK;
}
-status_t MediaClock::getRealTimeFor(int64_t targetMediaUs, int64_t *outRealUs) {
+status_t MediaClock::getRealTimeFor(
+ int64_t targetMediaUs, int64_t *outRealUs) const {
+ if (outRealUs == NULL) {
+ return BAD_VALUE;
+ }
+
Mutex::Autolock autoLock(mLock);
if (mPlaybackRate == 0.0) {
return NO_INIT;