summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei Jia <wjia@google.com>2015-04-09 23:59:06 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-04-09 23:59:06 +0000
commit541c1721e517a44127f0086f77b4e679849bb8cc (patch)
tree18d35f7ffc8bdd7dc5d006c548b20af554a7f42a
parent2fb25c873e1a7f346bd8c7c072a85ca6a74b0e95 (diff)
parentfa6a06765e7b92b7ba265482bd4cf3074f9ff6cc (diff)
downloadframeworks_av-541c1721e517a44127f0086f77b4e679849bb8cc.zip
frameworks_av-541c1721e517a44127f0086f77b4e679849bb8cc.tar.gz
frameworks_av-541c1721e517a44127f0086f77b4e679849bb8cc.tar.bz2
Merge "MediaClock: allow user to query playback rate."
-rw-r--r--include/media/stagefright/MediaClock.h1
-rw-r--r--media/libstagefright/MediaClock.cpp5
2 files changed, 6 insertions, 0 deletions
diff --git a/include/media/stagefright/MediaClock.h b/include/media/stagefright/MediaClock.h
index e9c09a1..dd1a809 100644
--- a/include/media/stagefright/MediaClock.h
+++ b/include/media/stagefright/MediaClock.h
@@ -42,6 +42,7 @@ struct MediaClock : public RefBase {
void updateMaxTimeMedia(int64_t maxTimeMediaUs);
void setPlaybackRate(float rate);
+ float getPlaybackRate() const;
// query media time corresponding to real time |realUs|, and save the
// result in |outMediaUs|.
diff --git a/media/libstagefright/MediaClock.cpp b/media/libstagefright/MediaClock.cpp
index 433f555..2641e4e 100644
--- a/media/libstagefright/MediaClock.cpp
+++ b/media/libstagefright/MediaClock.cpp
@@ -92,6 +92,11 @@ void MediaClock::setPlaybackRate(float rate) {
mPlaybackRate = rate;
}
+float MediaClock::getPlaybackRate() const {
+ Mutex::Autolock autoLock(mLock);
+ return mPlaybackRate;
+}
+
status_t MediaClock::getMediaTime(
int64_t realUs, int64_t *outMediaUs, bool allowPastMaxTime) const {
if (outMediaUs == NULL) {