diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 934e02adb0..9b36cdd98e 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -41,6 +41,8 @@ Release notes ([#7279](https://github.com/google/ExoPlayer/issues/7279)). * Add `ExoPlayer.setPreferredAudioDevice` to set the preferred audio output device ([#135](https://github.com/androidx/media/issues/135)). + * Rename `androidx.media3.exoplayer.audio.AudioProcessor` to + `androidx.media3.common.audio.AudioProcessor`. * Metadata: * `MetadataRenderer` can now be configured to render metadata as soon as they are available. Create an instance with diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/AudioProcessor.java b/libraries/common/src/main/java/androidx/media3/common/audio/AudioProcessor.java similarity index 99% rename from libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/AudioProcessor.java rename to libraries/common/src/main/java/androidx/media3/common/audio/AudioProcessor.java index 5bba6cee8f..7f07c28d71 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/AudioProcessor.java +++ b/libraries/common/src/main/java/androidx/media3/common/audio/AudioProcessor.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package androidx.media3.exoplayer.audio; +package androidx.media3.common.audio; import androidx.media3.common.C; import androidx.media3.common.Format; diff --git a/libraries/common/src/main/java/androidx/media3/common/audio/package-info.java b/libraries/common/src/main/java/androidx/media3/common/audio/package-info.java new file mode 100644 index 0000000000..43c4c65ce1 --- /dev/null +++ b/libraries/common/src/main/java/androidx/media3/common/audio/package-info.java @@ -0,0 +1,19 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@NonNullApi +package androidx.media3.common.audio; + +import androidx.media3.common.util.NonNullApi; diff --git a/libraries/decoder_ffmpeg/src/main/java/androidx/media3/decoder/ffmpeg/FfmpegAudioRenderer.java b/libraries/decoder_ffmpeg/src/main/java/androidx/media3/decoder/ffmpeg/FfmpegAudioRenderer.java index f9119e5e43..3cf05a8ae5 100644 --- a/libraries/decoder_ffmpeg/src/main/java/androidx/media3/decoder/ffmpeg/FfmpegAudioRenderer.java +++ b/libraries/decoder_ffmpeg/src/main/java/androidx/media3/decoder/ffmpeg/FfmpegAudioRenderer.java @@ -24,12 +24,12 @@ import androidx.media3.common.C; import androidx.media3.common.Format; import androidx.media3.common.MimeTypes; +import androidx.media3.common.audio.AudioProcessor; import androidx.media3.common.util.Assertions; import androidx.media3.common.util.TraceUtil; import androidx.media3.common.util.UnstableApi; import androidx.media3.common.util.Util; import androidx.media3.decoder.CryptoConfig; -import androidx.media3.exoplayer.audio.AudioProcessor; import androidx.media3.exoplayer.audio.AudioRendererEventListener; import androidx.media3.exoplayer.audio.AudioSink; import androidx.media3.exoplayer.audio.AudioSink.SinkFormatSupport; diff --git a/libraries/decoder_flac/src/main/java/androidx/media3/decoder/flac/LibflacAudioRenderer.java b/libraries/decoder_flac/src/main/java/androidx/media3/decoder/flac/LibflacAudioRenderer.java index 721a6348ad..575e402535 100644 --- a/libraries/decoder_flac/src/main/java/androidx/media3/decoder/flac/LibflacAudioRenderer.java +++ b/libraries/decoder_flac/src/main/java/androidx/media3/decoder/flac/LibflacAudioRenderer.java @@ -20,11 +20,11 @@ import androidx.media3.common.C; import androidx.media3.common.Format; import androidx.media3.common.MimeTypes; +import androidx.media3.common.audio.AudioProcessor; import androidx.media3.common.util.TraceUtil; import androidx.media3.common.util.UnstableApi; import androidx.media3.common.util.Util; import androidx.media3.decoder.CryptoConfig; -import androidx.media3.exoplayer.audio.AudioProcessor; import androidx.media3.exoplayer.audio.AudioRendererEventListener; import androidx.media3.exoplayer.audio.AudioSink; import androidx.media3.exoplayer.audio.DecoderAudioRenderer; diff --git a/libraries/decoder_opus/src/main/java/androidx/media3/decoder/opus/LibopusAudioRenderer.java b/libraries/decoder_opus/src/main/java/androidx/media3/decoder/opus/LibopusAudioRenderer.java index ec9717366c..a8f2f7462f 100644 --- a/libraries/decoder_opus/src/main/java/androidx/media3/decoder/opus/LibopusAudioRenderer.java +++ b/libraries/decoder_opus/src/main/java/androidx/media3/decoder/opus/LibopusAudioRenderer.java @@ -20,11 +20,11 @@ import androidx.media3.common.C; import androidx.media3.common.Format; import androidx.media3.common.MimeTypes; +import androidx.media3.common.audio.AudioProcessor; import androidx.media3.common.util.TraceUtil; import androidx.media3.common.util.UnstableApi; import androidx.media3.common.util.Util; import androidx.media3.decoder.CryptoConfig; -import androidx.media3.exoplayer.audio.AudioProcessor; import androidx.media3.exoplayer.audio.AudioRendererEventListener; import androidx.media3.exoplayer.audio.AudioSink; import androidx.media3.exoplayer.audio.AudioSink.SinkFormatSupport; diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/BaseAudioProcessor.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/BaseAudioProcessor.java index faa561e484..46040e90e5 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/BaseAudioProcessor.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/BaseAudioProcessor.java @@ -16,6 +16,7 @@ package androidx.media3.exoplayer.audio; import androidx.annotation.CallSuper; +import androidx.media3.common.audio.AudioProcessor; import androidx.media3.common.util.UnstableApi; import com.google.errorprone.annotations.CanIgnoreReturnValue; import java.nio.ByteBuffer; diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/ChannelMappingAudioProcessor.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/ChannelMappingAudioProcessor.java index ce7f51bba0..2d5f0536ee 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/ChannelMappingAudioProcessor.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/ChannelMappingAudioProcessor.java @@ -18,6 +18,7 @@ import androidx.annotation.Nullable; import androidx.media3.common.C; import androidx.media3.common.Format; +import androidx.media3.common.audio.AudioProcessor; import androidx.media3.common.util.Assertions; import com.google.errorprone.annotations.CanIgnoreReturnValue; import java.nio.ByteBuffer; diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/DecoderAudioRenderer.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/DecoderAudioRenderer.java index 0dc2dcacd7..a11f5698ca 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/DecoderAudioRenderer.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/DecoderAudioRenderer.java @@ -38,6 +38,7 @@ import androidx.media3.common.MimeTypes; import androidx.media3.common.PlaybackException; import androidx.media3.common.PlaybackParameters; +import androidx.media3.common.audio.AudioProcessor; import androidx.media3.common.util.Assertions; import androidx.media3.common.util.Log; import androidx.media3.common.util.TraceUtil; diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/DefaultAudioSink.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/DefaultAudioSink.java index 34d131c208..14ecf4b79c 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/DefaultAudioSink.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/DefaultAudioSink.java @@ -44,6 +44,8 @@ import androidx.media3.common.Format; import androidx.media3.common.MimeTypes; import androidx.media3.common.PlaybackParameters; +import androidx.media3.common.audio.AudioProcessor; +import androidx.media3.common.audio.AudioProcessor.UnhandledAudioFormatException; import androidx.media3.common.util.Assertions; import androidx.media3.common.util.Clock; import androidx.media3.common.util.ConditionVariable; @@ -52,7 +54,6 @@ import androidx.media3.common.util.Util; import androidx.media3.exoplayer.ExoPlayer.AudioOffloadListener; import androidx.media3.exoplayer.analytics.PlayerId; -import androidx.media3.exoplayer.audio.AudioProcessor.UnhandledAudioFormatException; import androidx.media3.extractor.AacUtil; import androidx.media3.extractor.Ac3Util; import androidx.media3.extractor.Ac4Util; diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/FloatResamplingAudioProcessor.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/FloatResamplingAudioProcessor.java index 5bbebd30f2..16bcbd9a72 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/FloatResamplingAudioProcessor.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/FloatResamplingAudioProcessor.java @@ -17,6 +17,7 @@ import androidx.media3.common.C; import androidx.media3.common.Format; +import androidx.media3.common.audio.AudioProcessor; import androidx.media3.common.util.Util; import com.google.errorprone.annotations.CanIgnoreReturnValue; import java.nio.ByteBuffer; diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/MediaCodecAudioRenderer.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/MediaCodecAudioRenderer.java index 5999adb732..2f63b80cf8 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/MediaCodecAudioRenderer.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/MediaCodecAudioRenderer.java @@ -40,6 +40,7 @@ import androidx.media3.common.MimeTypes; import androidx.media3.common.PlaybackException; import androidx.media3.common.PlaybackParameters; +import androidx.media3.common.audio.AudioProcessor; import androidx.media3.common.util.Log; import androidx.media3.common.util.MediaFormatUtil; import androidx.media3.common.util.UnstableApi; diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/ResamplingAudioProcessor.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/ResamplingAudioProcessor.java index 50f3abcdfa..173138b42b 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/ResamplingAudioProcessor.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/ResamplingAudioProcessor.java @@ -17,6 +17,7 @@ import androidx.media3.common.C; import androidx.media3.common.Format; +import androidx.media3.common.audio.AudioProcessor; import androidx.media3.common.util.Util; import com.google.errorprone.annotations.CanIgnoreReturnValue; import java.nio.ByteBuffer; diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/SilenceSkippingAudioProcessor.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/SilenceSkippingAudioProcessor.java index 8bc15c4e70..e50750e5b4 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/SilenceSkippingAudioProcessor.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/SilenceSkippingAudioProcessor.java @@ -20,6 +20,7 @@ import androidx.annotation.IntDef; import androidx.media3.common.C; +import androidx.media3.common.audio.AudioProcessor; import androidx.media3.common.util.Assertions; import androidx.media3.common.util.UnstableApi; import androidx.media3.common.util.Util; diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/SonicAudioProcessor.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/SonicAudioProcessor.java index e928735db8..06bae86487 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/SonicAudioProcessor.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/SonicAudioProcessor.java @@ -20,6 +20,7 @@ import androidx.annotation.Nullable; import androidx.media3.common.C; import androidx.media3.common.Format; +import androidx.media3.common.audio.AudioProcessor; import androidx.media3.common.util.UnstableApi; import androidx.media3.common.util.Util; import com.google.errorprone.annotations.CanIgnoreReturnValue; diff --git a/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/audio/SilenceSkippingAudioProcessorTest.java b/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/audio/SilenceSkippingAudioProcessorTest.java index 60be021ba2..e9dfdf3e8e 100644 --- a/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/audio/SilenceSkippingAudioProcessorTest.java +++ b/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/audio/SilenceSkippingAudioProcessorTest.java @@ -19,8 +19,8 @@ import static java.lang.Math.min; import androidx.media3.common.C; +import androidx.media3.common.audio.AudioProcessor.AudioFormat; import androidx.media3.common.util.Assertions; -import androidx.media3.exoplayer.audio.AudioProcessor.AudioFormat; import androidx.test.ext.junit.runners.AndroidJUnit4; import java.nio.ByteBuffer; import java.nio.ByteOrder; diff --git a/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/audio/SonicAudioProcessorTest.java b/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/audio/SonicAudioProcessorTest.java index f9927bf7e3..65c38ee714 100644 --- a/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/audio/SonicAudioProcessorTest.java +++ b/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/audio/SonicAudioProcessorTest.java @@ -19,8 +19,8 @@ import static org.junit.Assert.fail; import androidx.media3.common.C; -import androidx.media3.exoplayer.audio.AudioProcessor.AudioFormat; -import androidx.media3.exoplayer.audio.AudioProcessor.UnhandledAudioFormatException; +import androidx.media3.common.audio.AudioProcessor.AudioFormat; +import androidx.media3.common.audio.AudioProcessor.UnhandledAudioFormatException; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Before; import org.junit.Test; diff --git a/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/audio/TeeAudioProcessorTest.java b/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/audio/TeeAudioProcessorTest.java index f0703653ad..b657be9103 100644 --- a/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/audio/TeeAudioProcessorTest.java +++ b/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/audio/TeeAudioProcessorTest.java @@ -18,7 +18,7 @@ import static org.mockito.Mockito.verify; import androidx.media3.common.C; -import androidx.media3.exoplayer.audio.AudioProcessor.AudioFormat; +import androidx.media3.common.audio.AudioProcessor.AudioFormat; import androidx.media3.exoplayer.audio.TeeAudioProcessor.AudioBufferSink; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Before; diff --git a/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/audio/TrimmingAudioProcessorTest.java b/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/audio/TrimmingAudioProcessorTest.java index 96d6a4ac44..82e8eec789 100644 --- a/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/audio/TrimmingAudioProcessorTest.java +++ b/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/audio/TrimmingAudioProcessorTest.java @@ -18,7 +18,7 @@ import static com.google.common.truth.Truth.assertThat; import androidx.media3.common.C; -import androidx.media3.exoplayer.audio.AudioProcessor.AudioFormat; +import androidx.media3.common.audio.AudioProcessor.AudioFormat; import androidx.test.ext.junit.runners.AndroidJUnit4; import java.nio.ByteBuffer; import org.junit.After; diff --git a/libraries/transformer/src/main/java/androidx/media3/transformer/AudioTranscodingSamplePipeline.java b/libraries/transformer/src/main/java/androidx/media3/transformer/AudioTranscodingSamplePipeline.java index deaa247f72..0cc7811235 100644 --- a/libraries/transformer/src/main/java/androidx/media3/transformer/AudioTranscodingSamplePipeline.java +++ b/libraries/transformer/src/main/java/androidx/media3/transformer/AudioTranscodingSamplePipeline.java @@ -23,10 +23,10 @@ import androidx.annotation.Nullable; import androidx.media3.common.C; import androidx.media3.common.Format; +import androidx.media3.common.audio.AudioProcessor; +import androidx.media3.common.audio.AudioProcessor.AudioFormat; import androidx.media3.common.util.Util; import androidx.media3.decoder.DecoderInputBuffer; -import androidx.media3.exoplayer.audio.AudioProcessor; -import androidx.media3.exoplayer.audio.AudioProcessor.AudioFormat; import java.nio.ByteBuffer; import java.util.List; import org.checkerframework.checker.nullness.qual.RequiresNonNull; diff --git a/libraries/transformer/src/main/java/androidx/media3/transformer/SpeedChangingAudioProcessor.java b/libraries/transformer/src/main/java/androidx/media3/transformer/SpeedChangingAudioProcessor.java index 4a567767c8..4ad62f4e84 100644 --- a/libraries/transformer/src/main/java/androidx/media3/transformer/SpeedChangingAudioProcessor.java +++ b/libraries/transformer/src/main/java/androidx/media3/transformer/SpeedChangingAudioProcessor.java @@ -19,8 +19,8 @@ import static java.lang.Math.min; import androidx.media3.common.C; +import androidx.media3.common.audio.AudioProcessor; import androidx.media3.common.util.Util; -import androidx.media3.exoplayer.audio.AudioProcessor; import androidx.media3.exoplayer.audio.BaseAudioProcessor; import androidx.media3.exoplayer.audio.SonicAudioProcessor; import com.google.errorprone.annotations.CanIgnoreReturnValue; diff --git a/libraries/transformer/src/main/java/androidx/media3/transformer/TransformationException.java b/libraries/transformer/src/main/java/androidx/media3/transformer/TransformationException.java index 44c5dad0f4..e31c26317a 100644 --- a/libraries/transformer/src/main/java/androidx/media3/transformer/TransformationException.java +++ b/libraries/transformer/src/main/java/androidx/media3/transformer/TransformationException.java @@ -26,11 +26,11 @@ import androidx.media3.common.FrameProcessingException; import androidx.media3.common.FrameProcessor; import androidx.media3.common.PlaybackException; +import androidx.media3.common.audio.AudioProcessor; +import androidx.media3.common.audio.AudioProcessor.AudioFormat; import androidx.media3.common.util.Clock; import androidx.media3.common.util.UnstableApi; import androidx.media3.common.util.Util; -import androidx.media3.exoplayer.audio.AudioProcessor; -import androidx.media3.exoplayer.audio.AudioProcessor.AudioFormat; import com.google.common.collect.ImmutableBiMap; import java.lang.annotation.Documented; import java.lang.annotation.Retention; diff --git a/libraries/transformer/src/test/java/androidx/media3/transformer/SpeedChangingAudioProcessorTest.java b/libraries/transformer/src/test/java/androidx/media3/transformer/SpeedChangingAudioProcessorTest.java index b62df9a91b..7f3814979c 100644 --- a/libraries/transformer/src/test/java/androidx/media3/transformer/SpeedChangingAudioProcessorTest.java +++ b/libraries/transformer/src/test/java/androidx/media3/transformer/SpeedChangingAudioProcessorTest.java @@ -19,8 +19,8 @@ import static com.google.common.truth.Truth.assertThat; import androidx.media3.common.C; +import androidx.media3.common.audio.AudioProcessor; import androidx.media3.common.util.Util; -import androidx.media3.exoplayer.audio.AudioProcessor; import androidx.test.ext.junit.runners.AndroidJUnit4; import java.nio.ByteBuffer; import java.nio.ByteOrder;