summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2014-09-17 23:15:27 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-09-17 23:15:27 +0000
commita87be62b083fb969aeece99d6c29735ef9a5a373 (patch)
tree8a7d75e680d1133aa7993dae71ad82f33efbb28d /include
parent2720c8c45a0040d7007239c100591b9f092b780f (diff)
parent7f1bc8af1c46695191bf7e2aba6467f3616629c0 (diff)
downloadframeworks_av-a87be62b083fb969aeece99d6c29735ef9a5a373.zip
frameworks_av-a87be62b083fb969aeece99d6c29735ef9a5a373.tar.gz
frameworks_av-a87be62b083fb969aeece99d6c29735ef9a5a373.tar.bz2
Merge "Fix AudioTrack offloaded timestamp handling." into lmp-dev
Diffstat (limited to 'include')
-rw-r--r--include/media/AudioTrack.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h
index 72e51f9..b5256f0 100644
--- a/include/media/AudioTrack.h
+++ b/include/media/AudioTrack.h
@@ -580,7 +580,14 @@ public:
* Caution: calling this method too often may be inefficient;
* if you need a high resolution mapping between frame position and presentation time,
* consider implementing that at application level, based on the low resolution timestamps.
- * Returns NO_ERROR if timestamp is valid.
+ * Returns NO_ERROR if timestamp is valid.
+ * WOULD_BLOCK if called in STOPPED or FLUSHED state, or if called immediately after
+ * start/ACTIVE, when the number of frames consumed is less than the
+ * overall hardware latency to physical output. In WOULD_BLOCK cases,
+ * one might poll again, or use getPosition(), or use 0 position and
+ * current time for the timestamp.
+ * INVALID_OPERATION if called on a FastTrack, wrong state, or some other error.
+ *
* The timestamp parameter is undefined on return, if status is not NO_ERROR.
*/
status_t getTimestamp(AudioTimestamp& timestamp);
@@ -747,6 +754,8 @@ protected:
// reset by stop() but continues monotonically
// after new IAudioTrack to restore mPosition,
// and could be easily widened to uint64_t
+ int64_t mStartUs; // the start time after flush or stop.
+ // only used for offloaded and direct tracks.
audio_output_flags_t mFlags;
// const after set(), except for bits AUDIO_OUTPUT_FLAG_FAST and AUDIO_OUTPUT_FLAG_OFFLOAD.