From 538524e579496aa75469ddd8fea76a963236da42 Mon Sep 17 00:00:00 2001 From: rohks Date: Wed, 17 May 2023 17:54:57 +0000 Subject: [PATCH] Remove deprecated methods `Format.copyWithXXX` Use `Format.buildUpon()` and `setXXX` instead. #minor-release PiperOrigin-RevId: 532840625 --- RELEASENOTES.md | 6 ++ .../java/androidx/media3/common/Format.java | 93 ------------------- 2 files changed, 6 insertions(+), 93 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 8a2a49c8af..c3c3677ae3 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -44,6 +44,12 @@ `createAudioSampleFormat`, `createContainerFormat`, and `createSampleFormat`, which were used to instantiate the `Format` class. Instead use `Format.Builder` for creating instances of `Format`. + * Remove the deprecated methods `copyWithMaxInputSize`, + `copyWithSubsampleOffsetUs`, `copyWithLabel`, + `copyWithManifestFormatInfo`, `copyWithGaplessInfo`, + `copyWithFrameRate`, `copyWithDrmInitData`, `copyWithMetadata`, + `copyWithBitrate` and `copyWithVideoSize`, use `Format.buildUpon()` and + setter methods instead. ### 1.0.2 (2023-05-18) diff --git a/libraries/common/src/main/java/androidx/media3/common/Format.java b/libraries/common/src/main/java/androidx/media3/common/Format.java index e2e7e52f0b..d9e50851fd 100644 --- a/libraries/common/src/main/java/androidx/media3/common/Format.java +++ b/libraries/common/src/main/java/androidx/media3/common/Format.java @@ -902,42 +902,6 @@ public final class Format implements Bundleable { return new Builder(this); } - /** - * @deprecated Use {@link #buildUpon()} and {@link Builder#setMaxInputSize(int)}. - */ - @UnstableApi - @Deprecated - public Format copyWithMaxInputSize(int maxInputSize) { - return buildUpon().setMaxInputSize(maxInputSize).build(); - } - - /** - * @deprecated Use {@link #buildUpon()} and {@link Builder#setSubsampleOffsetUs(long)}. - */ - @UnstableApi - @Deprecated - public Format copyWithSubsampleOffsetUs(long subsampleOffsetUs) { - return buildUpon().setSubsampleOffsetUs(subsampleOffsetUs).build(); - } - - /** - * @deprecated Use {@link #buildUpon()} and {@link Builder#setLabel(String)} . - */ - @UnstableApi - @Deprecated - public Format copyWithLabel(@Nullable String label) { - return buildUpon().setLabel(label).build(); - } - - /** - * @deprecated Use {@link #withManifestFormatInfo(Format)}. - */ - @UnstableApi - @Deprecated - public Format copyWithManifestFormatInfo(Format manifestFormat) { - return withManifestFormatInfo(manifestFormat); - } - @UnstableApi @SuppressWarnings("ReferenceEquality") public Format withManifestFormatInfo(Format manifestFormat) { @@ -1006,63 +970,6 @@ public final class Format implements Bundleable { .build(); } - /** - * @deprecated Use {@link #buildUpon()}, {@link Builder#setEncoderDelay(int)} and {@link - * Builder#setEncoderPadding(int)}. - */ - @UnstableApi - @Deprecated - public Format copyWithGaplessInfo(int encoderDelay, int encoderPadding) { - return buildUpon().setEncoderDelay(encoderDelay).setEncoderPadding(encoderPadding).build(); - } - - /** - * @deprecated Use {@link #buildUpon()} and {@link Builder#setFrameRate(float)}. - */ - @UnstableApi - @Deprecated - public Format copyWithFrameRate(float frameRate) { - return buildUpon().setFrameRate(frameRate).build(); - } - - /** - * @deprecated Use {@link #buildUpon()} and {@link Builder#setDrmInitData(DrmInitData)}. - */ - @UnstableApi - @Deprecated - public Format copyWithDrmInitData(@Nullable DrmInitData drmInitData) { - return buildUpon().setDrmInitData(drmInitData).build(); - } - - /** - * @deprecated Use {@link #buildUpon()} and {@link Builder#setMetadata(Metadata)}. - */ - @UnstableApi - @Deprecated - public Format copyWithMetadata(@Nullable Metadata metadata) { - return buildUpon().setMetadata(metadata).build(); - } - - /** - * @deprecated Use {@link #buildUpon()} and {@link Builder#setAverageBitrate(int)} and {@link - * Builder#setPeakBitrate(int)}. - */ - @UnstableApi - @Deprecated - public Format copyWithBitrate(int bitrate) { - return buildUpon().setAverageBitrate(bitrate).setPeakBitrate(bitrate).build(); - } - - /** - * @deprecated Use {@link #buildUpon()}, {@link Builder#setWidth(int)} and {@link - * Builder#setHeight(int)}. - */ - @UnstableApi - @Deprecated - public Format copyWithVideoSize(int width, int height) { - return buildUpon().setWidth(width).setHeight(height).build(); - } - /** Returns a copy of this format with the specified {@link #cryptoType}. */ @UnstableApi public Format copyWithCryptoType(@C.CryptoType int cryptoType) {