@@ -111,64 +111,16 @@ private InvalidAudioTrackTimestampException(String message) {
111
111
}
112
112
113
113
/**
114
- * Provides a chain of audio processors, which are used for any user-defined processing and
115
- * applying playback parameters (if supported). Because applying playback parameters can skip and
116
- * stretch/compress audio, the sink will query the chain for information on how to transform its
117
- * output position to map it onto a media position, via {@link #getMediaDuration(long)} and {@link
118
- * #getSkippedOutputFrameCount()}.
114
+ * @deprecated Use {@link androidx.media3.common.audio.AudioProcessorChain}.
119
115
*/
120
- public interface AudioProcessorChain {
121
-
122
- /**
123
- * Returns the fixed chain of audio processors that will process audio. This method is called
124
- * once during initialization, but audio processors may change state to become active/inactive
125
- * during playback.
126
- */
127
- AudioProcessor [] getAudioProcessors ();
128
-
129
- /**
130
- * Configures audio processors to apply the specified playback parameters immediately, returning
131
- * the new playback parameters, which may differ from those passed in. Only called when
132
- * processors have no input pending.
133
- *
134
- * @param playbackParameters The playback parameters to try to apply.
135
- * @return The playback parameters that were actually applied.
136
- */
137
- PlaybackParameters applyPlaybackParameters (PlaybackParameters playbackParameters );
138
-
139
- /**
140
- * Configures audio processors to apply whether to skip silences immediately, returning the new
141
- * value. Only called when processors have no input pending.
142
- *
143
- * @param skipSilenceEnabled Whether silences should be skipped in the audio stream.
144
- * @return The new value.
145
- */
146
- boolean applySkipSilenceEnabled (boolean skipSilenceEnabled );
147
-
148
- /**
149
- * Returns the media duration corresponding to the specified playout duration, taking speed
150
- * adjustment due to audio processing into account.
151
- *
152
- * The scaling performed by this method will use the actual playback speed achieved by the
153
- * audio processor chain, on average, since it was last flushed. This may differ very slightly
154
- * from the target playback speed.
155
- *
156
- * @param playoutDuration The playout duration to scale.
157
- * @return The corresponding media duration, in the same units as {@code duration}.
158
- */
159
- long getMediaDuration (long playoutDuration );
160
-
161
- /**
162
- * Returns the number of output audio frames skipped since the audio processors were last
163
- * flushed.
164
- */
165
- long getSkippedOutputFrameCount ();
166
- }
116
+ @ Deprecated
117
+ public interface AudioProcessorChain extends androidx .media3 .common .audio .AudioProcessorChain {}
167
118
168
119
/**
169
120
* The default audio processor chain, which applies a (possibly empty) chain of user-defined audio
170
121
* processors followed by {@link SilenceSkippingAudioProcessor} and {@link SonicAudioProcessor}.
171
122
*/
123
+ @ SuppressWarnings ("deprecation" )
172
124
public static class DefaultAudioProcessorChain implements AudioProcessorChain {
173
125
174
126
private final AudioProcessor [] audioProcessors ;
@@ -272,7 +224,7 @@ int getBufferSizeInBytes(
272
224
public static final class Builder {
273
225
274
226
private AudioCapabilities audioCapabilities ;
275
- @ Nullable private AudioProcessorChain audioProcessorChain ;
227
+ @ Nullable private androidx . media3 . common . audio . AudioProcessorChain audioProcessorChain ;
276
228
private boolean enableFloatOutput ;
277
229
private boolean enableAudioTrackPlaybackParams ;
278
230
private int offloadMode ;
@@ -313,14 +265,15 @@ public Builder setAudioProcessors(AudioProcessor[] audioProcessors) {
313
265
}
314
266
315
267
/**
316
- * Sets the {@link AudioProcessorChain} to process audio before playback. The instance passed in
317
- * must not be reused in other sinks. Processing chains are only supported for PCM playback (not
318
- * passthrough or offload).
268
+ * Sets the {@link androidx.media3.common.audio. AudioProcessorChain} to process audio before
269
+ * playback. The instance passed in must not be reused in other sinks. Processing chains are
270
+ * only supported for PCM playback (not passthrough or offload).
319
271
*
320
272
* By default, no processing will be applied.
321
273
*/
322
274
@ CanIgnoreReturnValue
323
- public Builder setAudioProcessorChain (AudioProcessorChain audioProcessorChain ) {
275
+ public Builder setAudioProcessorChain (
276
+ androidx .media3 .common .audio .AudioProcessorChain audioProcessorChain ) {
324
277
checkNotNull (audioProcessorChain );
325
278
this .audioProcessorChain = audioProcessorChain ;
326
279
return this ;
@@ -510,7 +463,7 @@ public DefaultAudioSink build() {
510
463
private static int pendingReleaseCount ;
511
464
512
465
private final AudioCapabilities audioCapabilities ;
513
- private final AudioProcessorChain audioProcessorChain ;
466
+ private final androidx . media3 . common . audio . AudioProcessorChain audioProcessorChain ;
514
467
private final boolean enableFloatOutput ;
515
468
private final ChannelMappingAudioProcessor channelMappingAudioProcessor ;
516
469
private final TrimmingAudioProcessor trimmingAudioProcessor ;
0 commit comments