audio: Add playback rate parameters to IStreamOut
Playback rate parameters allow changing the playback speed
of audio streams optionally preserving the pitch (this is
often referred to as "timestretch"). HALs can apply these
parameters when decoding of streams is done in hardware.
Bug: 133526565
Test: atest VtsHalAudioV6_0TargetTest
Change-Id: Ie78cd924bd034b57bf5b6a74affd62641ffc0aba
diff --git a/audio/6.0/IStreamOut.hal b/audio/6.0/IStreamOut.hal
index 91668ba..13a86ec 100644
--- a/audio/6.0/IStreamOut.hal
+++ b/audio/6.0/IStreamOut.hal
@@ -333,4 +333,33 @@
* @return retval operation completion status.
*/
setAudioDescriptionMixLevel(float leveldB) generates (Result retval);
+
+ /**
+ * Retrieves current playback rate parameters.
+ *
+ * Optional method
+ *
+ * @return retval operation completion status.
+ * @return playbackRate current playback parameters
+ */
+ getPlaybackRateParameters()
+ generates (Result retval, PlaybackRate playbackRate);
+
+ /**
+ * Sets the playback rate parameters that control playback behavior.
+ * This is normally used when playing encoded content and decoding
+ * is performed in hardware. Otherwise, the framework can apply
+ * necessary transformations.
+ *
+ * Optional method
+ *
+ * If the HAL supports setting the playback rate, it is recommended
+ * to support speed and pitch values at least in the range
+ * from 0.5f to 2.0f, inclusive (see the definition of PlaybackRate struct).
+ *
+ * @param playbackRate playback parameters
+ * @return retval operation completion status.
+ */
+ setPlaybackRateParameters(PlaybackRate playbackRate)
+ generates (Result retval);
};