mirror of
https://github.com/androidx/media.git
synced 2025-04-29 22:36:54 +08:00
Add PlaybackParameters.withPitch() method
Issue: androidx/media#2257 PiperOrigin-RevId: 742693410 (cherry picked from commit ce3754a7409562724b5de399cfaab60b96d90da2)
This commit is contained in:
parent
9483cbfed4
commit
9d09840bad
@ -7,6 +7,9 @@
|
||||
### Unreleased changes
|
||||
|
||||
* Common Library:
|
||||
* Add `PlaybackParameters.withPitch(float)` method for easily copying a
|
||||
`PlaybackParameters` with a new `pitch` value
|
||||
([#2257](https://github.com/androidx/media/issues/2257)).
|
||||
* ExoPlayer:
|
||||
* Fix sending `CmcdData` in manifest requests for DASH, HLS, and
|
||||
SmoothStreaming ([#2253](https://github.com/androidx/media/pull/2253)).
|
||||
|
@ -88,6 +88,18 @@ public final class PlaybackParameters {
|
||||
return new PlaybackParameters(speed, pitch);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a copy with the given pitch.
|
||||
*
|
||||
* @param pitch The new pitch. Must be greater than zero.
|
||||
* @return The copied playback parameters.
|
||||
*/
|
||||
@UnstableApi
|
||||
@CheckResult
|
||||
public PlaybackParameters withPitch(@FloatRange(from = 0, fromInclusive = false) float pitch) {
|
||||
return new PlaybackParameters(speed, pitch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
if (this == obj) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user