summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioStreamOut.h
diff options
context:
space:
mode:
authorPhil Burk <philburk@google.com>2015-07-06 16:24:14 -0700
committerPhil Burk <philburk@google.com>2015-07-07 16:40:00 -0700
commit90eea7631b07117e46ae8b84889a2baa3eee7aea (patch)
treee31c07b33a68919b011a031f08eb785bba0c066d /services/audioflinger/AudioStreamOut.h
parent29b7cec9a248828d2371bc8758d819308d0e84a4 (diff)
downloadframeworks_av-90eea7631b07117e46ae8b84889a2baa3eee7aea.zip
frameworks_av-90eea7631b07117e46ae8b84889a2baa3eee7aea.tar.gz
frameworks_av-90eea7631b07117e46ae8b84889a2baa3eee7aea.tar.bz2
AudioFlinger: reset frame position on standby
The HAL does not reset the frame position on standby(). But applications expect the frame position to be reset. So we subtract the position at standby from the current position. Bug: 21724210 Bug: 21930805 Change-Id: I0c4520ba1c6c06a580f45f6bafc8cf1d56969f07 Signed-off-by: Phil Burk <philburk@google.com>
Diffstat (limited to 'services/audioflinger/AudioStreamOut.h')
-rw-r--r--services/audioflinger/AudioStreamOut.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/services/audioflinger/AudioStreamOut.h b/services/audioflinger/AudioStreamOut.h
index e91ca9c..761e771 100644
--- a/services/audioflinger/AudioStreamOut.h
+++ b/services/audioflinger/AudioStreamOut.h
@@ -53,7 +53,10 @@ public:
virtual ~AudioStreamOut() { }
- virtual status_t getRenderPosition(uint32_t *frames);
+ // Get the bottom 32-bits of the 64-bit render position.
+ status_t getRenderPosition(uint32_t *frames);
+
+ virtual status_t getRenderPosition(uint64_t *frames);
virtual status_t getPresentationPosition(uint64_t *frames, struct timespec *timestamp);
@@ -76,6 +79,14 @@ public:
virtual status_t flush();
virtual status_t standby();
+
+protected:
+ uint64_t mFramesWritten; // reset by flush
+ uint64_t mFramesWrittenAtStandby;
+ uint64_t mRenderPosition; // reset by flush or standby
+ int mRateMultiplier;
+ bool mHalFormatIsLinearPcm;
+ size_t mHalFrameSize;
};
} // namespace android