Replace or suppress deprecated usages

Many usages are needed to support other deprecations and some
can be replaced by the recommended direct alternative.

Also replace links to deprecated/redirected dev site

PiperOrigin-RevId: 601795998
(cherry picked from commit ed5b7004b435f71c5a37f5db12c3641fbba9be48)
This commit is contained in:
tonihei 2024-01-26 10:03:55 -08:00 committed by SheenaChhabra
parent 0886da450d
commit 4a7442ef3a
75 changed files with 400 additions and 199 deletions

View File

@ -44,6 +44,7 @@ import androidx.recyclerview.widget.RecyclerView.ViewHolder;
import com.google.android.gms.cast.framework.CastButtonFactory; import com.google.android.gms.cast.framework.CastButtonFactory;
import com.google.android.gms.cast.framework.CastContext; import com.google.android.gms.cast.framework.CastContext;
import com.google.android.gms.dynamite.DynamiteModule; import com.google.android.gms.dynamite.DynamiteModule;
import com.google.common.util.concurrent.MoreExecutors;
/** /**
* An activity that plays video using {@link ExoPlayer} and supports casting using ExoPlayer's Cast * An activity that plays video using {@link ExoPlayer} and supports casting using ExoPlayer's Cast
@ -65,7 +66,7 @@ public class MainActivity extends AppCompatActivity
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
// Getting the cast context later than onStart can cause device discovery not to take place. // Getting the cast context later than onStart can cause device discovery not to take place.
try { try {
castContext = CastContext.getSharedInstance(this); castContext = CastContext.getSharedInstance(this, MoreExecutors.directExecutor()).getResult();
} catch (RuntimeException e) { } catch (RuntimeException e) {
Throwable cause = e.getCause(); Throwable cause = e.getCause();
while (cause != null) { while (cause != null) {

View File

@ -20,7 +20,8 @@ import static com.google.common.base.Preconditions.checkNotNull;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.net.Uri; import android.net.Uri;
import android.os.AsyncTask; import android.os.Handler;
import android.os.Looper;
import android.widget.Toast; import android.widget.Toast;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.OptIn; import androidx.annotation.OptIn;
@ -54,6 +55,9 @@ import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.CopyOnWriteArraySet; import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
/** Tracks media that has been downloaded. */ /** Tracks media that has been downloaded. */
@OptIn(markerClass = androidx.media3.common.util.UnstableApi.class) @OptIn(markerClass = androidx.media3.common.util.UnstableApi.class)
@ -182,7 +186,7 @@ public class DownloadTracker {
trackSelectionDialog.dismiss(); trackSelectionDialog.dismiss();
} }
if (widevineOfflineLicenseFetchTask != null) { if (widevineOfflineLicenseFetchTask != null) {
widevineOfflineLicenseFetchTask.cancel(false); widevineOfflineLicenseFetchTask.cancel();
} }
} }
@ -358,14 +362,16 @@ public class DownloadTracker {
/** Downloads a Widevine offline license in a background thread. */ /** Downloads a Widevine offline license in a background thread. */
@RequiresApi(18) @RequiresApi(18)
private static final class WidevineOfflineLicenseFetchTask extends AsyncTask<Void, Void, Void> { private static final class WidevineOfflineLicenseFetchTask {
private final Format format; private final Format format;
private final MediaItem.DrmConfiguration drmConfiguration; private final MediaItem.DrmConfiguration drmConfiguration;
private final DataSource.Factory dataSourceFactory; private final DataSource.Factory dataSourceFactory;
private final StartDownloadDialogHelper dialogHelper; private final StartDownloadDialogHelper dialogHelper;
private final DownloadHelper downloadHelper; private final DownloadHelper downloadHelper;
private final ExecutorService executorService;
@Nullable Future<?> future;
@Nullable private byte[] keySetId; @Nullable private byte[] keySetId;
@Nullable private DrmSession.DrmSessionException drmSessionException; @Nullable private DrmSession.DrmSessionException drmSessionException;
@ -375,6 +381,7 @@ public class DownloadTracker {
DataSource.Factory dataSourceFactory, DataSource.Factory dataSourceFactory,
StartDownloadDialogHelper dialogHelper, StartDownloadDialogHelper dialogHelper,
DownloadHelper downloadHelper) { DownloadHelper downloadHelper) {
this.executorService = Executors.newSingleThreadExecutor();
this.format = format; this.format = format;
this.drmConfiguration = drmConfiguration; this.drmConfiguration = drmConfiguration;
this.dataSourceFactory = dataSourceFactory; this.dataSourceFactory = dataSourceFactory;
@ -382,8 +389,16 @@ public class DownloadTracker {
this.downloadHelper = downloadHelper; this.downloadHelper = downloadHelper;
} }
@Override public void cancel() {
protected Void doInBackground(Void... voids) { if (future != null) {
future.cancel(/* mayInterruptIfRunning= */ false);
}
}
public void execute() {
future =
executorService.submit(
() -> {
OfflineLicenseHelper offlineLicenseHelper = OfflineLicenseHelper offlineLicenseHelper =
OfflineLicenseHelper.newWidevineInstance( OfflineLicenseHelper.newWidevineInstance(
drmConfiguration.licenseUri.toString(), drmConfiguration.licenseUri.toString(),
@ -397,17 +412,18 @@ public class DownloadTracker {
drmSessionException = e; drmSessionException = e;
} finally { } finally {
offlineLicenseHelper.release(); offlineLicenseHelper.release();
} new Handler(Looper.getMainLooper())
return null; .post(
} () -> {
@Override
protected void onPostExecute(Void aVoid) {
if (drmSessionException != null) { if (drmSessionException != null) {
dialogHelper.onOfflineLicenseFetchedError(drmSessionException); dialogHelper.onOfflineLicenseFetchedError(drmSessionException);
} else { } else {
dialogHelper.onOfflineLicenseFetched(downloadHelper, checkNotNull(keySetId)); dialogHelper.onOfflineLicenseFetched(
downloadHelper, checkNotNull(keySetId));
} }
});
}
});
} }
} }
} }

View File

@ -26,9 +26,10 @@ import android.content.SharedPreferences;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.res.AssetManager; import android.content.res.AssetManager;
import android.net.Uri; import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.JsonReader; import android.util.JsonReader;
import android.view.Menu; import android.view.Menu;
@ -72,6 +73,8 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/** An activity for selecting from a list of media samples. */ /** An activity for selecting from a list of media samples. */
public class SampleChooserActivity extends AppCompatActivity public class SampleChooserActivity extends AppCompatActivity
@ -282,13 +285,20 @@ public class SampleChooserActivity extends AppCompatActivity
return menuItem != null && menuItem.isChecked(); return menuItem != null && menuItem.isChecked();
} }
private final class SampleListLoader extends AsyncTask<String, Void, List<PlaylistGroup>> { private final class SampleListLoader {
private final ExecutorService executorService;
private boolean sawError; private boolean sawError;
public SampleListLoader() {
executorService = Executors.newSingleThreadExecutor();
}
@OptIn(markerClass = androidx.media3.common.util.UnstableApi.class) @OptIn(markerClass = androidx.media3.common.util.UnstableApi.class)
@Override public void execute(String... uris) {
protected List<PlaylistGroup> doInBackground(String... uris) { executorService.execute(
() -> {
List<PlaylistGroup> result = new ArrayList<>(); List<PlaylistGroup> result = new ArrayList<>();
Context context = getApplicationContext(); Context context = getApplicationContext();
DataSource dataSource = DemoUtil.getDataSourceFactory(context).createDataSource(); DataSource dataSource = DemoUtil.getDataSourceFactory(context).createDataSource();
@ -296,7 +306,8 @@ public class SampleChooserActivity extends AppCompatActivity
DataSpec dataSpec = new DataSpec(Uri.parse(uri)); DataSpec dataSpec = new DataSpec(Uri.parse(uri));
InputStream inputStream = new DataSourceInputStream(dataSource, dataSpec); InputStream inputStream = new DataSourceInputStream(dataSource, dataSpec);
try { try {
readPlaylistGroups(new JsonReader(new InputStreamReader(inputStream, "UTF-8")), result); readPlaylistGroups(
new JsonReader(new InputStreamReader(inputStream, "UTF-8")), result);
} catch (Exception e) { } catch (Exception e) {
Log.e(TAG, "Error loading sample list: " + uri, e); Log.e(TAG, "Error loading sample list: " + uri, e);
sawError = true; sawError = true;
@ -304,12 +315,12 @@ public class SampleChooserActivity extends AppCompatActivity
DataSourceUtil.closeQuietly(dataSource); DataSourceUtil.closeQuietly(dataSource);
} }
} }
return result; new Handler(Looper.getMainLooper())
} .post(
() -> {
@Override
protected void onPostExecute(List<PlaylistGroup> result) {
onPlaylistGroups(result, sawError); onPlaylistGroups(result, sawError);
});
});
} }
private void readPlaylistGroups(JsonReader reader, List<PlaylistGroup> groups) private void readPlaylistGroups(JsonReader reader, List<PlaylistGroup> groups)

View File

@ -61,6 +61,6 @@ manual steps.
(this will only appear if the AAR is present), then build and run the demo (this will only appear if the AAR is present), then build and run the demo
app and select a MediaPipe-based effect. app and select a MediaPipe-based effect.
[Transformer]: https://developer.android.com/guide/topics/media/transforming-media [Transformer]: https://developer.android.com/media/media3/transformer
[MediaPipe]: https://google.github.io/mediapipe/ [MediaPipe]: https://google.github.io/mediapipe/
[build an AAR]: https://google.github.io/mediapipe/getting_started/android_archive_library.html [build an AAR]: https://google.github.io/mediapipe/getting_started/android_archive_library.html

View File

@ -109,6 +109,7 @@ public final class AdOverlayInfo {
* @deprecated Use {@link Builder} instead. * @deprecated Use {@link Builder} instead.
*/ */
@UnstableApi @UnstableApi
@SuppressWarnings("deprecation") // Intentionally using deprecated constructor
@Deprecated @Deprecated
public AdOverlayInfo(View view, @Purpose int purpose) { public AdOverlayInfo(View view, @Purpose int purpose) {
this(view, purpose, /* detailedReason= */ null); this(view, purpose, /* detailedReason= */ null);

View File

@ -117,6 +117,7 @@ public final class AdPlaybackState implements Bundleable {
/* isServerSideInserted= */ false); /* isServerSideInserted= */ false);
} }
@SuppressWarnings("deprecation") // Intentionally assigning deprecated field
private AdGroup( private AdGroup(
long timeUs, long timeUs,
int count, int count,
@ -502,8 +503,9 @@ public final class AdPlaybackState implements Bundleable {
private static final String FIELD_ORIGINAL_COUNT = Util.intToStringMaxRadix(7); private static final String FIELD_ORIGINAL_COUNT = Util.intToStringMaxRadix(7);
@VisibleForTesting static final String FIELD_MEDIA_ITEMS = Util.intToStringMaxRadix(8); @VisibleForTesting static final String FIELD_MEDIA_ITEMS = Util.intToStringMaxRadix(8);
// Intentionally assigning deprecated field.
// putParcelableArrayList actually supports null elements. // putParcelableArrayList actually supports null elements.
@SuppressWarnings("nullness:argument") @SuppressWarnings({"deprecation", "nullness:argument"})
@Override @Override
public Bundle toBundle() { public Bundle toBundle() {
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();

View File

@ -42,8 +42,8 @@ import java.util.UUID;
* *
* <p>When building formats, populate all fields whose values are known and relevant to the type of * <p>When building formats, populate all fields whose values are known and relevant to the type of
* format being constructed. For information about different types of format, see ExoPlayer's <a * format being constructed. For information about different types of format, see ExoPlayer's <a
* href="https://developer.android.com/guide/topics/media/exoplayer/supported-formats">Supported * href="https://developer.android.com/media/media3/exoplayer/supported-formats">Supported formats
* formats page</a>. * page</a>.
* *
* <h2>Fields commonly relevant to all formats</h2> * <h2>Fields commonly relevant to all formats</h2>
* *

View File

@ -860,6 +860,7 @@ public class ForwardingPlayer implements Player {
/** /**
* @deprecated Use {@link #setDeviceVolume(int, int)} instead. * @deprecated Use {@link #setDeviceVolume(int, int)} instead.
*/ */
@SuppressWarnings("deprecation") // Intentionally forwarding deprecated method
@Deprecated @Deprecated
@Override @Override
public void setDeviceVolume(int volume) { public void setDeviceVolume(int volume) {
@ -875,6 +876,7 @@ public class ForwardingPlayer implements Player {
/** /**
* @deprecated Use {@link #increaseDeviceVolume(int)} instead. * @deprecated Use {@link #increaseDeviceVolume(int)} instead.
*/ */
@SuppressWarnings("deprecation") // Intentionally forwarding deprecated method
@Deprecated @Deprecated
@Override @Override
public void increaseDeviceVolume() { public void increaseDeviceVolume() {
@ -890,6 +892,7 @@ public class ForwardingPlayer implements Player {
/** /**
* @deprecated Use {@link #decreaseDeviceVolume(int)} instead. * @deprecated Use {@link #decreaseDeviceVolume(int)} instead.
*/ */
@SuppressWarnings("deprecation") // Intentionally forwarding deprecated method
@Deprecated @Deprecated
@Override @Override
public void decreaseDeviceVolume() { public void decreaseDeviceVolume() {
@ -905,6 +908,7 @@ public class ForwardingPlayer implements Player {
/** /**
* @deprecated Use {@link #setDeviceMuted(boolean, int)} instead. * @deprecated Use {@link #setDeviceMuted(boolean, int)} instead.
*/ */
@SuppressWarnings("deprecation") // Intentionally forwarding deprecated method
@Deprecated @Deprecated
@Override @Override
public void setDeviceMuted(boolean muted) { public void setDeviceMuted(boolean muted) {
@ -1106,6 +1110,7 @@ public class ForwardingPlayer implements Player {
listener.onSkipSilenceEnabledChanged(skipSilenceEnabled); listener.onSkipSilenceEnabledChanged(skipSilenceEnabled);
} }
@SuppressWarnings("deprecation") // Intentionally forwarding deprecated method
@Override @Override
public void onCues(List<Cue> cues) { public void onCues(List<Cue> cues) {
listener.onCues(cues); listener.onCues(cues);

View File

@ -100,6 +100,8 @@ public final class MediaItem implements Bundleable {
imageDurationMs = C.TIME_UNSET; imageDurationMs = C.TIME_UNSET;
} }
// Using deprecated DrmConfiguration.Builder to support deprecated methods.
@SuppressWarnings("deprecation")
private Builder(MediaItem mediaItem) { private Builder(MediaItem mediaItem) {
this(); this();
clippingConfiguration = mediaItem.clippingConfiguration.buildUpon(); clippingConfiguration = mediaItem.clippingConfiguration.buildUpon();
@ -243,6 +245,8 @@ public final class MediaItem implements Bundleable {
} }
/** Sets the optional DRM configuration. */ /** Sets the optional DRM configuration. */
// Using deprecated DrmConfiguration.Builder to support deprecated methods.
@SuppressWarnings("deprecation")
@CanIgnoreReturnValue @CanIgnoreReturnValue
public Builder setDrmConfiguration(@Nullable DrmConfiguration drmConfiguration) { public Builder setDrmConfiguration(@Nullable DrmConfiguration drmConfiguration) {
this.drmConfiguration = this.drmConfiguration =
@ -294,6 +298,7 @@ public final class MediaItem implements Bundleable {
* @deprecated Use {@link #setDrmConfiguration(DrmConfiguration)} and pass the {@code uuid} to * @deprecated Use {@link #setDrmConfiguration(DrmConfiguration)} and pass the {@code uuid} to
* {@link DrmConfiguration.Builder#Builder(UUID)} instead. * {@link DrmConfiguration.Builder#Builder(UUID)} instead.
*/ */
@SuppressWarnings("deprecation") // Forwarding deprecated call
@CanIgnoreReturnValue @CanIgnoreReturnValue
@UnstableApi @UnstableApi
@Deprecated @Deprecated
@ -414,6 +419,7 @@ public final class MediaItem implements Bundleable {
* #setSubtitleConfigurations(List)} doesn't accept null, use an empty list to clear the * #setSubtitleConfigurations(List)} doesn't accept null, use an empty list to clear the
* contents. * contents.
*/ */
@SuppressWarnings("deprecation") // Supporting deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@UnstableApi @UnstableApi
@Deprecated @Deprecated
@ -450,6 +456,7 @@ public final class MediaItem implements Bundleable {
* with {@link Uri#parse(String)} and pass the result to {@link * with {@link Uri#parse(String)} and pass the result to {@link
* AdsConfiguration.Builder#Builder(Uri)} instead. * AdsConfiguration.Builder#Builder(Uri)} instead.
*/ */
@SuppressWarnings("deprecation") // Forwarding to other deprecated setter
@CanIgnoreReturnValue @CanIgnoreReturnValue
@UnstableApi @UnstableApi
@Deprecated @Deprecated
@ -461,6 +468,7 @@ public final class MediaItem implements Bundleable {
* @deprecated Use {@link #setAdsConfiguration(AdsConfiguration)} and pass the {@code adTagUri} * @deprecated Use {@link #setAdsConfiguration(AdsConfiguration)} and pass the {@code adTagUri}
* to {@link AdsConfiguration.Builder#Builder(Uri)} instead. * to {@link AdsConfiguration.Builder#Builder(Uri)} instead.
*/ */
@SuppressWarnings("deprecation") // Forwarding to other deprecated setter
@CanIgnoreReturnValue @CanIgnoreReturnValue
@UnstableApi @UnstableApi
@Deprecated @Deprecated
@ -593,6 +601,7 @@ public final class MediaItem implements Bundleable {
} }
/** Returns a new {@link MediaItem} instance with the current builder values. */ /** Returns a new {@link MediaItem} instance with the current builder values. */
@SuppressWarnings("deprecation") // Building deprecated ClippingProperties type
public MediaItem build() { public MediaItem build() {
// TODO: remove this check once all the deprecated individual DRM setters are removed. // TODO: remove this check once all the deprecated individual DRM setters are removed.
checkState(drmConfiguration.licenseUri == null || drmConfiguration.scheme != null); checkState(drmConfiguration.licenseUri == null || drmConfiguration.scheme != null);
@ -1172,7 +1181,10 @@ public final class MediaItem implements Bundleable {
/** /**
* @deprecated Use {@link #subtitleConfigurations} instead. * @deprecated Use {@link #subtitleConfigurations} instead.
*/ */
@UnstableApi @Deprecated public final List<Subtitle> subtitles; @SuppressWarnings("deprecation") // Using deprecated type in deprecated field
@UnstableApi
@Deprecated
public final List<Subtitle> subtitles;
/** /**
* Optional tag for custom attributes. The tag for the media source which will be published in * Optional tag for custom attributes. The tag for the media source which will be published in
@ -1577,12 +1589,18 @@ public final class MediaItem implements Bundleable {
/** Restores a {@code LiveConfiguration} from a {@link Bundle}. */ /** Restores a {@code LiveConfiguration} from a {@link Bundle}. */
@UnstableApi @UnstableApi
public static LiveConfiguration fromBundle(Bundle bundle) { public static LiveConfiguration fromBundle(Bundle bundle) {
return new LiveConfiguration( return new LiveConfiguration.Builder()
bundle.getLong(FIELD_TARGET_OFFSET_MS, /* defaultValue= */ UNSET.targetOffsetMs), .setTargetOffsetMs(
bundle.getLong(FIELD_MIN_OFFSET_MS, /* defaultValue= */ UNSET.minOffsetMs), bundle.getLong(FIELD_TARGET_OFFSET_MS, /* defaultValue= */ UNSET.targetOffsetMs))
bundle.getLong(FIELD_MAX_OFFSET_MS, /* defaultValue= */ UNSET.maxOffsetMs), .setMinOffsetMs(
bundle.getFloat(FIELD_MIN_PLAYBACK_SPEED, /* defaultValue= */ UNSET.minPlaybackSpeed), bundle.getLong(FIELD_MIN_OFFSET_MS, /* defaultValue= */ UNSET.minOffsetMs))
bundle.getFloat(FIELD_MAX_PLAYBACK_SPEED, /* defaultValue= */ UNSET.maxPlaybackSpeed)); .setMaxOffsetMs(
bundle.getLong(FIELD_MAX_OFFSET_MS, /* defaultValue= */ UNSET.maxOffsetMs))
.setMinPlaybackSpeed(
bundle.getFloat(FIELD_MIN_PLAYBACK_SPEED, /* defaultValue= */ UNSET.minPlaybackSpeed))
.setMaxPlaybackSpeed(
bundle.getFloat(FIELD_MAX_PLAYBACK_SPEED, /* defaultValue= */ UNSET.maxPlaybackSpeed))
.build();
} }
} }
@ -1673,6 +1691,7 @@ public final class MediaItem implements Bundleable {
return new SubtitleConfiguration(this); return new SubtitleConfiguration(this);
} }
@SuppressWarnings("deprecation") // Building deprecated type to support deprecated builder
private Subtitle buildSubtitle() { private Subtitle buildSubtitle() {
return new Subtitle(this); return new Subtitle(this);
} }
@ -1845,6 +1864,7 @@ public final class MediaItem implements Bundleable {
/** /**
* @deprecated Use {@link Builder} instead. * @deprecated Use {@link Builder} instead.
*/ */
@SuppressWarnings("deprecation") // Forwarding to other deprecated constructor
@UnstableApi @UnstableApi
@Deprecated @Deprecated
public Subtitle(Uri uri, String mimeType, @Nullable String language) { public Subtitle(Uri uri, String mimeType, @Nullable String language) {
@ -1854,6 +1874,7 @@ public final class MediaItem implements Bundleable {
/** /**
* @deprecated Use {@link Builder} instead. * @deprecated Use {@link Builder} instead.
*/ */
@SuppressWarnings("deprecation") // Forwarding to other deprecated constructor
@UnstableApi @UnstableApi
@Deprecated @Deprecated
public Subtitle( public Subtitle(
@ -1989,12 +2010,13 @@ public final class MediaItem implements Bundleable {
* builder. * builder.
*/ */
public ClippingConfiguration build() { public ClippingConfiguration build() {
return buildClippingProperties(); return new ClippingConfiguration(this);
} }
/** /**
* @deprecated Use {@link #build()} instead. * @deprecated Use {@link #build()} instead.
*/ */
@SuppressWarnings("deprecation") // Building deprecated type to support deprecated methods
@UnstableApi @UnstableApi
@Deprecated @Deprecated
public ClippingProperties buildClippingProperties() { public ClippingProperties buildClippingProperties() {
@ -2130,6 +2152,7 @@ public final class MediaItem implements Bundleable {
public static final Creator<ClippingProperties> CREATOR = ClippingConfiguration::fromBundle; public static final Creator<ClippingProperties> CREATOR = ClippingConfiguration::fromBundle;
/** Restores a {@code ClippingProperties} from a {@link Bundle}. */ /** Restores a {@code ClippingProperties} from a {@link Bundle}. */
@SuppressWarnings("deprecation") // Building deprecated type for backwards compatibility
@UnstableApi @UnstableApi
public static ClippingProperties fromBundle(Bundle bundle) { public static ClippingProperties fromBundle(Bundle bundle) {
ClippingConfiguration.Builder clippingConfiguration = ClippingConfiguration.Builder clippingConfiguration =
@ -2170,6 +2193,7 @@ public final class MediaItem implements Bundleable {
@UnstableApi @UnstableApi
@Deprecated @Deprecated
public static final class ClippingProperties extends ClippingConfiguration { public static final class ClippingProperties extends ClippingConfiguration {
@SuppressWarnings("deprecation") // Using deprecated type
public static final ClippingProperties UNSET = public static final ClippingProperties UNSET =
new ClippingConfiguration.Builder().buildClippingProperties(); new ClippingConfiguration.Builder().buildClippingProperties();
@ -2356,7 +2380,10 @@ public final class MediaItem implements Bundleable {
/** /**
* @deprecated Use {@link #clippingConfiguration} instead. * @deprecated Use {@link #clippingConfiguration} instead.
*/ */
@UnstableApi @Deprecated public final ClippingProperties clippingProperties; @SuppressWarnings("deprecation") // Keeping deprecated field with deprecated type
@UnstableApi
@Deprecated
public final ClippingProperties clippingProperties;
/** The media {@link RequestMetadata}. */ /** The media {@link RequestMetadata}. */
public final RequestMetadata requestMetadata; public final RequestMetadata requestMetadata;

View File

@ -219,6 +219,7 @@ public final class MimeTypes {
* Returns whether the given string is a text MIME type, including known text types that use * Returns whether the given string is a text MIME type, including known text types that use
* &quot;application&quot; as their base type. * &quot;application&quot; as their base type.
*/ */
@SuppressWarnings("deprecation") // Supporting deprecated MIME types
@UnstableApi @UnstableApi
@Pure @Pure
public static boolean isText(@Nullable String mimeType) { public static boolean isText(@Nullable String mimeType) {

View File

@ -520,6 +520,7 @@ public interface Player {
@UnstableApi @UnstableApi
public static final class Builder { public static final class Builder {
@SuppressWarnings("deprecation") // Includes deprecated commands
private static final @Command int[] SUPPORTED_COMMANDS = { private static final @Command int[] SUPPORTED_COMMANDS = {
COMMAND_PLAY_PAUSE, COMMAND_PLAY_PAUSE,
COMMAND_PREPARE, COMMAND_PREPARE,
@ -1315,6 +1316,7 @@ public interface Player {
*/ */
// @Target list includes both 'default' targets and TYPE_USE, to ensure backwards compatibility // @Target list includes both 'default' targets and TYPE_USE, to ensure backwards compatibility
// with Kotlin usages from before TYPE_USE was added. // with Kotlin usages from before TYPE_USE was added.
@SuppressWarnings("deprecation") // Includes deprecated command
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target({FIELD, METHOD, PARAMETER, LOCAL_VARIABLE, TYPE_USE}) @Target({FIELD, METHOD, PARAMETER, LOCAL_VARIABLE, TYPE_USE})

View File

@ -2767,6 +2767,7 @@ public abstract class SimpleBasePlayer extends BasePlayer {
/** /**
* @deprecated Use {@link #setDeviceVolume(int, int)} instead. * @deprecated Use {@link #setDeviceVolume(int, int)} instead.
*/ */
@SuppressWarnings("deprecation") // Using deprecated command code
@Deprecated @Deprecated
@Override @Override
public final void setDeviceVolume(int volume) { public final void setDeviceVolume(int volume) {
@ -2797,6 +2798,7 @@ public abstract class SimpleBasePlayer extends BasePlayer {
/** /**
* @deprecated Use {@link #increaseDeviceVolume(int)} instead. * @deprecated Use {@link #increaseDeviceVolume(int)} instead.
*/ */
@SuppressWarnings("deprecation") // Using deprecated command code
@Deprecated @Deprecated
@Override @Override
public final void increaseDeviceVolume() { public final void increaseDeviceVolume() {
@ -2829,6 +2831,7 @@ public abstract class SimpleBasePlayer extends BasePlayer {
/** /**
* @deprecated Use {@link #decreaseDeviceVolume(int)} instead. * @deprecated Use {@link #decreaseDeviceVolume(int)} instead.
*/ */
@SuppressWarnings("deprecation") // Using deprecated command code
@Deprecated @Deprecated
@Override @Override
public final void decreaseDeviceVolume() { public final void decreaseDeviceVolume() {
@ -2861,6 +2864,7 @@ public abstract class SimpleBasePlayer extends BasePlayer {
/** /**
* @deprecated Use {@link #setDeviceMuted(boolean, int)} instead. * @deprecated Use {@link #setDeviceMuted(boolean, int)} instead.
*/ */
@SuppressWarnings("deprecation") // Using deprecated command code
@Deprecated @Deprecated
@Override @Override
public final void setDeviceMuted(boolean muted) { public final void setDeviceMuted(boolean muted) {

View File

@ -144,6 +144,7 @@ public final class NetworkTypeObserver {
} }
} }
@SuppressWarnings("deprecation") // Using deprecated NetworkInfo for compatibility to older APIs
private static @C.NetworkType int getNetworkTypeFromConnectivityManager(Context context) { private static @C.NetworkType int getNetworkTypeFromConnectivityManager(Context context) {
NetworkInfo networkInfo; NetworkInfo networkInfo;
@Nullable @Nullable

View File

@ -27,6 +27,8 @@ import kotlin.annotations.jvm.UnderMigration;
* Annotation to declare all type usages in the annotated instance as {@link Nonnull}, unless * Annotation to declare all type usages in the annotated instance as {@link Nonnull}, unless
* explicitly marked with a nullable annotation. * explicitly marked with a nullable annotation.
*/ */
// MigrationStatus.STRICT is marked as deprecated because it's considered experimental
@SuppressWarnings("deprecation")
@Nonnull @Nonnull
@TypeQualifierDefault(ElementType.TYPE_USE) @TypeQualifierDefault(ElementType.TYPE_USE)
@UnderMigration(status = MigrationStatus.STRICT) @UnderMigration(status = MigrationStatus.STRICT)

View File

@ -2558,7 +2558,7 @@ public final class Util {
return C.CONTENT_TYPE_HLS; return C.CONTENT_TYPE_HLS;
case "ism": case "ism":
case "isml": case "isml":
return C.TYPE_SS; return C.CONTENT_TYPE_SS;
default: default:
return C.CONTENT_TYPE_OTHER; return C.CONTENT_TYPE_OTHER;
} }

View File

@ -133,6 +133,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
* CronetEngineWrapper#getCronetEngine()} would have returned {@code null}. * CronetEngineWrapper#getCronetEngine()} would have returned {@code null}.
*/ */
@UnstableApi @UnstableApi
@SuppressWarnings("deprecation") // Intentionally using deprecated parameter
@Deprecated @Deprecated
public Factory(CronetEngineWrapper cronetEngineWrapper, Executor executor) { public Factory(CronetEngineWrapper cronetEngineWrapper, Executor executor) {
this.cronetEngine = cronetEngineWrapper.getCronetEngine(); this.cronetEngine = cronetEngineWrapper.getCronetEngine();
@ -325,6 +326,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
* {@link CronetEngine} is not available. Use the fallback factory directly in such cases. * {@link CronetEngine} is not available. Use the fallback factory directly in such cases.
*/ */
@CanIgnoreReturnValue @CanIgnoreReturnValue
@SuppressWarnings("deprecation") // Intentionally referring to deprecated parameter
@UnstableApi @UnstableApi
@Deprecated @Deprecated
public Factory setFallbackFactory(@Nullable HttpDataSource.Factory fallbackFactory) { public Factory setFallbackFactory(@Nullable HttpDataSource.Factory fallbackFactory) {

View File

@ -41,7 +41,9 @@ public final class CronetDataSourceFactory extends BaseFactory {
public static final int DEFAULT_READ_TIMEOUT_MILLIS = public static final int DEFAULT_READ_TIMEOUT_MILLIS =
CronetDataSource.DEFAULT_READ_TIMEOUT_MILLIS; CronetDataSource.DEFAULT_READ_TIMEOUT_MILLIS;
@SuppressWarnings("deprecation") // Intentionally using deprecated type
private final CronetEngineWrapper cronetEngineWrapper; private final CronetEngineWrapper cronetEngineWrapper;
private final Executor executor; private final Executor executor;
@Nullable private final TransferListener transferListener; @Nullable private final TransferListener transferListener;
private final int connectTimeoutMs; private final int connectTimeoutMs;
@ -63,6 +65,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
* @param fallbackFactory A {@link HttpDataSource.Factory} which is used as a fallback in case no * @param fallbackFactory A {@link HttpDataSource.Factory} which is used as a fallback in case no
* suitable CronetEngine can be build. * suitable CronetEngine can be build.
*/ */
@SuppressWarnings("deprecation") // Intentionally using deprecated parameter
public CronetDataSourceFactory( public CronetDataSourceFactory(
CronetEngineWrapper cronetEngineWrapper, CronetEngineWrapper cronetEngineWrapper,
Executor executor, Executor executor,
@ -89,6 +92,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
* @param cronetEngineWrapper A {@link CronetEngineWrapper}. * @param cronetEngineWrapper A {@link CronetEngineWrapper}.
* @param executor The {@link java.util.concurrent.Executor} that will perform the requests. * @param executor The {@link java.util.concurrent.Executor} that will perform the requests.
*/ */
@SuppressWarnings("deprecation") // Intentionally using deprecated parameter
public CronetDataSourceFactory(CronetEngineWrapper cronetEngineWrapper, Executor executor) { public CronetDataSourceFactory(CronetEngineWrapper cronetEngineWrapper, Executor executor) {
this(cronetEngineWrapper, executor, /* userAgent= */ (String) null); this(cronetEngineWrapper, executor, /* userAgent= */ (String) null);
} }
@ -108,6 +112,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
* needed, or {@code null} for the fallback to use the default user agent of the underlying * needed, or {@code null} for the fallback to use the default user agent of the underlying
* platform. * platform.
*/ */
@SuppressWarnings("deprecation") // Intentionally using deprecated parameter
public CronetDataSourceFactory( public CronetDataSourceFactory(
CronetEngineWrapper cronetEngineWrapper, Executor executor, @Nullable String userAgent) { CronetEngineWrapper cronetEngineWrapper, Executor executor, @Nullable String userAgent) {
this( this(
@ -135,6 +140,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
* needed, or {@code null} for the fallback to use the default user agent of the underlying * needed, or {@code null} for the fallback to use the default user agent of the underlying
* platform. * platform.
*/ */
@SuppressWarnings("deprecation") // Intentionally using deprecated parameter
public CronetDataSourceFactory( public CronetDataSourceFactory(
CronetEngineWrapper cronetEngineWrapper, CronetEngineWrapper cronetEngineWrapper,
Executor executor, Executor executor,
@ -169,6 +175,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
* @param fallbackFactory A {@link HttpDataSource.Factory} which is used as a fallback in case no * @param fallbackFactory A {@link HttpDataSource.Factory} which is used as a fallback in case no
* suitable CronetEngine can be build. * suitable CronetEngine can be build.
*/ */
@SuppressWarnings("deprecation") // Intentionally using deprecated parameter
public CronetDataSourceFactory( public CronetDataSourceFactory(
CronetEngineWrapper cronetEngineWrapper, CronetEngineWrapper cronetEngineWrapper,
Executor executor, Executor executor,
@ -201,6 +208,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
* @param fallbackFactory A {@link HttpDataSource.Factory} which is used as a fallback in case no * @param fallbackFactory A {@link HttpDataSource.Factory} which is used as a fallback in case no
* suitable CronetEngine can be build. * suitable CronetEngine can be build.
*/ */
@SuppressWarnings("deprecation") // Intentionally using deprecated parameter
public CronetDataSourceFactory( public CronetDataSourceFactory(
CronetEngineWrapper cronetEngineWrapper, CronetEngineWrapper cronetEngineWrapper,
Executor executor, Executor executor,
@ -229,6 +237,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
* @param executor The {@link java.util.concurrent.Executor} that will perform the requests. * @param executor The {@link java.util.concurrent.Executor} that will perform the requests.
* @param transferListener An optional listener. * @param transferListener An optional listener.
*/ */
@SuppressWarnings("deprecation") // Intentionally using deprecated parameter
public CronetDataSourceFactory( public CronetDataSourceFactory(
CronetEngineWrapper cronetEngineWrapper, CronetEngineWrapper cronetEngineWrapper,
Executor executor, Executor executor,
@ -252,6 +261,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
* needed, or {@code null} for the fallback to use the default user agent of the underlying * needed, or {@code null} for the fallback to use the default user agent of the underlying
* platform. * platform.
*/ */
@SuppressWarnings("deprecation") // Intentionally using deprecated parameter
public CronetDataSourceFactory( public CronetDataSourceFactory(
CronetEngineWrapper cronetEngineWrapper, CronetEngineWrapper cronetEngineWrapper,
Executor executor, Executor executor,
@ -285,6 +295,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
* needed, or {@code null} for the fallback to use the default user agent of the underlying * needed, or {@code null} for the fallback to use the default user agent of the underlying
* platform. * platform.
*/ */
@SuppressWarnings("deprecation") // Intentionally using deprecated parameter
public CronetDataSourceFactory( public CronetDataSourceFactory(
CronetEngineWrapper cronetEngineWrapper, CronetEngineWrapper cronetEngineWrapper,
Executor executor, Executor executor,
@ -322,6 +333,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
* @param fallbackFactory A {@link HttpDataSource.Factory} which is used as a fallback in case no * @param fallbackFactory A {@link HttpDataSource.Factory} which is used as a fallback in case no
* suitable CronetEngine can be build. * suitable CronetEngine can be build.
*/ */
@SuppressWarnings("deprecation") // Intentionally using deprecated parameter
public CronetDataSourceFactory( public CronetDataSourceFactory(
CronetEngineWrapper cronetEngineWrapper, CronetEngineWrapper cronetEngineWrapper,
Executor executor, Executor executor,

View File

@ -452,10 +452,10 @@ public class OkHttpDataSource extends BaseDataSource implements HttpDataSource {
@Nullable RequestBody requestBody = null; @Nullable RequestBody requestBody = null;
if (dataSpec.httpBody != null) { if (dataSpec.httpBody != null) {
requestBody = RequestBody.create(null, dataSpec.httpBody); requestBody = RequestBody.create(dataSpec.httpBody);
} else if (dataSpec.httpMethod == DataSpec.HTTP_METHOD_POST) { } else if (dataSpec.httpMethod == DataSpec.HTTP_METHOD_POST) {
// OkHttp requires a non-null body for POST requests. // OkHttp requires a non-null body for POST requests.
requestBody = RequestBody.create(null, Util.EMPTY_BYTE_ARRAY); requestBody = RequestBody.create(Util.EMPTY_BYTE_ARRAY);
} }
builder.method(dataSpec.getHttpMethodString(), requestBody); builder.method(dataSpec.getHttpMethodString(), requestBody);
return builder.build(); return builder.build();

View File

@ -128,4 +128,4 @@ GL rendering mode has better performance, so should be preferred
* [Troubleshooting using decoding extensions][] * [Troubleshooting using decoding extensions][]
[Troubleshooting using decoding extensions]: https://developer.android.com/guide/topics/media/exoplayer/troubleshooting#how-can-i-get-a-decoding-library-to-load-and-be-used-for-playbacks [Troubleshooting using decoding extensions]: https://developer.android.com/media/media3/exoplayer/troubleshooting#how-can-i-get-a-decoding-library-to-load-and-be-used-for-playback

View File

@ -124,10 +124,10 @@ then implement your own logic to use the renderer for a given track.
[top level README]: ../../README.md [top level README]: ../../README.md
[Android NDK]: https://developer.android.com/tools/sdk/ndk/index.html [Android NDK]: https://developer.android.com/tools/sdk/ndk/index.html
[ExoPlayer issue 2781]: https://github.com/google/ExoPlayer/issues/2781 [ExoPlayer issue 2781]: https://github.com/google/ExoPlayer/issues/2781
[Supported formats]: https://developer.android.com/guide/topics/media/exoplayer/supported-formats#ffmpeg-library [Supported formats]: https://developer.android.com/media/media3/exoplayer/supported-formats#ffmpeg-library
## Links ## Links
* [Troubleshooting using decoding extensions][] * [Troubleshooting using decoding extensions][]
[Troubleshooting using decoding extensions]: https://developer.android.com/guide/topics/media/exoplayer/troubleshooting#how-can-i-get-a-decoding-library-to-load-and-be-used-for-playback [Troubleshooting using decoding extensions]: https://developer.android.com/media/media3/exoplayer/troubleshooting#how-can-i-get-a-decoding-library-to-load-and-be-used-for-playback

View File

@ -100,4 +100,4 @@ player, then implement your own logic to use the renderer for a given track.
* [Troubleshooting using decoding extensions][] * [Troubleshooting using decoding extensions][]
[Troubleshooting using decoding extensions]: https://developer.android.com/guide/topics/media/exoplayer/troubleshooting#how-can-i-get-a-decoding-library-to-load-and-be-used-for-playback [Troubleshooting using decoding extensions]: https://developer.android.com/media/media3/exoplayer/troubleshooting#how-can-i-get-a-decoding-library-to-load-and-be-used-for-playback

View File

@ -104,4 +104,4 @@ player, then implement your own logic to use the renderer for a given track.
* [Troubleshooting using decoding extensions][] * [Troubleshooting using decoding extensions][]
[Troubleshooting using decoding extensions]: https://developer.android.com/guide/topics/media/exoplayer/troubleshooting#how-can-i-get-a-decoding-library-to-load-and-be-used-for-playback [Troubleshooting using decoding extensions]: https://developer.android.com/media/media3/exoplayer/troubleshooting#how-can-i-get-a-decoding-library-to-load-and-be-used-for-playback

View File

@ -141,4 +141,4 @@ GL rendering mode has better performance, so should be preferred.
* [Troubleshooting using decoding extensions][] * [Troubleshooting using decoding extensions][]
[Troubleshooting using decoding extensions]: https://developer.android.com/guide/topics/media/exoplayer/troubleshooting#how-can-i-get-a-decoding-library-to-load-and-be-used-for-playback [Troubleshooting using decoding extensions]: https://developer.android.com/media/media3/exoplayer/troubleshooting#how-can-i-get-a-decoding-library-to-load-and-be-used-for-playback

View File

@ -25,7 +25,7 @@ import androidx.media3.common.util.Size;
import java.io.IOException; import java.io.IOException;
/** Scales the alpha value for each pixel in the fragment shader. */ /** Scales the alpha value for each pixel in the fragment shader. */
/* package */ final class AlphaScaleShaderProgram extends SingleFrameGlShaderProgram { /* package */ final class AlphaScaleShaderProgram extends BaseGlShaderProgram {
private static final String VERTEX_SHADER_PATH = "shaders/vertex_shader_transformation_es2.glsl"; private static final String VERTEX_SHADER_PATH = "shaders/vertex_shader_transformation_es2.glsl";
private static final String FRAGMENT_SHADER_PATH = "shaders/fragment_shader_alpha_scale_es2.glsl"; private static final String FRAGMENT_SHADER_PATH = "shaders/fragment_shader_alpha_scale_es2.glsl";
@ -42,7 +42,7 @@ import java.io.IOException;
*/ */
public AlphaScaleShaderProgram(Context context, boolean useHdr, float alphaScale) public AlphaScaleShaderProgram(Context context, boolean useHdr, float alphaScale)
throws VideoFrameProcessingException { throws VideoFrameProcessingException {
super(/* useHighPrecisionColorComponents= */ useHdr); super(/* useHighPrecisionColorComponents= */ useHdr, /* texturePoolCapacity= */ 1);
try { try {
glProgram = new GlProgram(context, VERTEX_SHADER_PATH, FRAGMENT_SHADER_PATH); glProgram = new GlProgram(context, VERTEX_SHADER_PATH, FRAGMENT_SHADER_PATH);

View File

@ -16,6 +16,7 @@
package androidx.media3.exoplayer; package androidx.media3.exoplayer;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.media3.common.PlaybackException;
import androidx.media3.common.PlaybackParameters; import androidx.media3.common.PlaybackParameters;
import androidx.media3.common.util.Assertions; import androidx.media3.common.util.Assertions;
import androidx.media3.common.util.Clock; import androidx.media3.common.util.Clock;
@ -93,7 +94,8 @@ import androidx.media3.common.util.Clock;
if (rendererMediaClock != null && rendererMediaClock != rendererClock) { if (rendererMediaClock != null && rendererMediaClock != rendererClock) {
if (rendererClock != null) { if (rendererClock != null) {
throw ExoPlaybackException.createForUnexpected( throw ExoPlaybackException.createForUnexpected(
new IllegalStateException("Multiple renderer media clocks enabled.")); new IllegalStateException("Multiple renderer media clocks enabled."),
PlaybackException.ERROR_CODE_UNSPECIFIED);
} }
this.rendererClock = rendererMediaClock; this.rendererClock = rendererMediaClock;
this.rendererClockSource = renderer; this.rendererClockSource = renderer;

View File

@ -166,8 +166,7 @@ import java.util.List;
public interface ExoPlayer extends Player { public interface ExoPlayer extends Player {
/** /**
* @deprecated Use {@link ExoPlayer}, as the {@link AudioComponent} methods are defined by that * @deprecated Use {@link ExoPlayer}, as all methods are defined by that interface.
* interface.
*/ */
@UnstableApi @UnstableApi
@Deprecated @Deprecated
@ -235,8 +234,7 @@ public interface ExoPlayer extends Player {
} }
/** /**
* @deprecated Use {@link ExoPlayer}, as the {@link VideoComponent} methods are defined by that * @deprecated Use {@link ExoPlayer}, as all methods are defined by that interface.
* interface.
*/ */
@UnstableApi @UnstableApi
@Deprecated @Deprecated
@ -357,8 +355,7 @@ public interface ExoPlayer extends Player {
} }
/** /**
* @deprecated Use {@link Player}, as the {@link TextComponent} methods are defined by that * @deprecated Use {@link Player}, as all methods are defined by that interface.
* interface.
*/ */
@UnstableApi @UnstableApi
@Deprecated @Deprecated
@ -372,8 +369,7 @@ public interface ExoPlayer extends Player {
} }
/** /**
* @deprecated Use {@link Player}, as the {@link DeviceComponent} methods are defined by that * @deprecated Use {@link Player}, as all methods are defined by that interface.
* interface.
*/ */
@UnstableApi @UnstableApi
@Deprecated @Deprecated
@ -905,8 +901,8 @@ public interface ExoPlayer extends Player {
/** /**
* Sets whether the player should pause automatically when audio is rerouted from a headset to * Sets whether the player should pause automatically when audio is rerouted from a headset to
* device speakers. See the <a * device speakers. See the <a
* href="https://developer.android.com/guide/topics/media-apps/volume-and-earphones#becoming-noisy"> * href="https://developer.android.com/media/platform/output#becoming-noisy">audio becoming
* audio becoming noisy</a> documentation for more information. * noisy</a> documentation for more information.
* *
* @param handleAudioBecomingNoisy Whether the player should pause automatically when audio is * @param handleAudioBecomingNoisy Whether the player should pause automatically when audio is
* rerouted from a headset to device speakers. * rerouted from a headset to device speakers.
@ -1230,6 +1226,7 @@ public interface ExoPlayer extends Player {
* @deprecated Use {@link ExoPlayer}, as the {@link AudioComponent} methods are defined by that * @deprecated Use {@link ExoPlayer}, as the {@link AudioComponent} methods are defined by that
* interface. * interface.
*/ */
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@UnstableApi @UnstableApi
@Nullable @Nullable
@Deprecated @Deprecated
@ -1239,6 +1236,7 @@ public interface ExoPlayer extends Player {
* @deprecated Use {@link ExoPlayer}, as the {@link VideoComponent} methods are defined by that * @deprecated Use {@link ExoPlayer}, as the {@link VideoComponent} methods are defined by that
* interface. * interface.
*/ */
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@UnstableApi @UnstableApi
@Nullable @Nullable
@Deprecated @Deprecated
@ -1248,6 +1246,7 @@ public interface ExoPlayer extends Player {
* @deprecated Use {@link Player}, as the {@link TextComponent} methods are defined by that * @deprecated Use {@link Player}, as the {@link TextComponent} methods are defined by that
* interface. * interface.
*/ */
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@UnstableApi @UnstableApi
@Nullable @Nullable
@Deprecated @Deprecated
@ -1257,6 +1256,7 @@ public interface ExoPlayer extends Player {
* @deprecated Use {@link Player}, as the {@link DeviceComponent} methods are defined by that * @deprecated Use {@link Player}, as the {@link DeviceComponent} methods are defined by that
* interface. * interface.
*/ */
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@UnstableApi @UnstableApi
@Nullable @Nullable
@Deprecated @Deprecated

View File

@ -3150,6 +3150,7 @@ import java.util.concurrent.TimeoutException;
} }
// TextOutput implementation // TextOutput implementation
@SuppressWarnings("deprecation") // Intentionally forwarding deprecating callback
@Override @Override
public void onCues(List<Cue> cues) { public void onCues(List<Cue> cues) {
listeners.sendEvent(EVENT_CUES, listener -> listener.onCues(cues)); listeners.sendEvent(EVENT_CUES, listener -> listener.onCues(cues));

View File

@ -66,6 +66,7 @@ public interface LoadControl {
* @deprecated Implement {@link #onTracksSelected(Timeline, MediaPeriodId, Renderer[], * @deprecated Implement {@link #onTracksSelected(Timeline, MediaPeriodId, Renderer[],
* TrackGroupArray, ExoTrackSelection[])} instead. * TrackGroupArray, ExoTrackSelection[])} instead.
*/ */
@SuppressWarnings("deprecation") // Intentionally referencing deprecated constant
@Deprecated @Deprecated
default void onTracksSelected( default void onTracksSelected(
Renderer[] renderers, TrackGroupArray trackGroups, ExoTrackSelection[] trackSelections) { Renderer[] renderers, TrackGroupArray trackGroups, ExoTrackSelection[] trackSelections) {
@ -168,6 +169,7 @@ public interface LoadControl {
* @deprecated Implement {@link #shouldStartPlayback(Timeline, MediaPeriodId, long, float, * @deprecated Implement {@link #shouldStartPlayback(Timeline, MediaPeriodId, long, float,
* boolean, long)} instead. * boolean, long)} instead.
*/ */
@SuppressWarnings("deprecation") // Intentionally referencing deprecated constant
@Deprecated @Deprecated
default boolean shouldStartPlayback( default boolean shouldStartPlayback(
long bufferedDurationUs, float playbackSpeed, boolean rebuffering, long targetLiveOffsetUs) { long bufferedDurationUs, float playbackSpeed, boolean rebuffering, long targetLiveOffsetUs) {

View File

@ -70,6 +70,7 @@ import java.util.List;
*/ */
@UnstableApi @UnstableApi
@Deprecated @Deprecated
@SuppressWarnings("deprecation") // Supporting deprecated base classes
public class SimpleExoPlayer extends BasePlayer public class SimpleExoPlayer extends BasePlayer
implements ExoPlayer, implements ExoPlayer,
ExoPlayer.AudioComponent, ExoPlayer.AudioComponent,

View File

@ -147,21 +147,15 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
mediaCodecSelector, mediaCodecSelector,
eventHandler, eventHandler,
eventListener, eventListener,
AudioCapabilities.DEFAULT_AUDIO_CAPABILITIES); new DefaultAudioSink.Builder(context).build());
} }
/** /**
* @param context A context. * @deprecated Use a constructor without {@link AudioCapabilities}. These are obtained
* @param mediaCodecSelector A decoder selector. * automatically from the {@link Context}.
* @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
* null if delivery of events is not required.
* @param eventListener A listener of events. May be null if delivery of events is not required.
* @param audioCapabilities The audio capabilities for playback on this device. Use {@link
* AudioCapabilities#DEFAULT_AUDIO_CAPABILITIES} if default capabilities (no encoded audio
* passthrough support) should be assumed.
* @param audioProcessors Optional {@link AudioProcessor}s that will process PCM audio before
* output.
*/ */
@SuppressWarnings("deprecation") // Calling deprecated method for compatibility
@Deprecated
public MediaCodecAudioRenderer( public MediaCodecAudioRenderer(
Context context, Context context,
MediaCodecSelector mediaCodecSelector, MediaCodecSelector mediaCodecSelector,

View File

@ -424,6 +424,7 @@ public class ImageRenderer extends BaseRenderer {
* current iteration of the rendering loop. * current iteration of the rendering loop.
* @return Whether we can feed more input data to the decoder. * @return Whether we can feed more input data to the decoder.
*/ */
@SuppressWarnings("deprecation") // Clearing C.BUFFER_FLAG_DECODE_ONLY for compatibility
private boolean feedInputBuffer(long positionUs) throws ImageDecoderException { private boolean feedInputBuffer(long positionUs) throws ImageDecoderException {
if (readyToOutputTiles && tileInfo != null) { if (readyToOutputTiles && tileInfo != null) {
return false; return false;

View File

@ -163,6 +163,7 @@ public final class Requirements implements Parcelable {
return notMetRequirements; return notMetRequirements;
} }
@SuppressWarnings("deprecation") // Using deprecated NetworkInfo for compatibility with older APIs
private @RequirementFlags int getNotMetNetworkRequirements(Context context) { private @RequirementFlags int getNotMetNetworkRequirements(Context context) {
if (!isNetworkRequired()) { if (!isNetworkRequired()) {
return 0; return 0;

View File

@ -76,17 +76,17 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
* <li>{@code DashMediaSource.Factory} if the item's {@link MediaItem.LocalConfiguration#uri uri} * <li>{@code DashMediaSource.Factory} if the item's {@link MediaItem.LocalConfiguration#uri uri}
* ends in '.mpd' or if its {@link MediaItem.LocalConfiguration#mimeType mimeType field} is * ends in '.mpd' or if its {@link MediaItem.LocalConfiguration#mimeType mimeType field} is
* explicitly set to {@link MimeTypes#APPLICATION_MPD} (Requires the <a * explicitly set to {@link MimeTypes#APPLICATION_MPD} (Requires the <a
* href="https://developer.android.com/guide/topics/media/exoplayer/hello-world#add-exoplayer-modules">exoplayer-dash * href="https://developer.android.com/media/media3/exoplayer/hello-world#add-exoplayer-modules">exoplayer-dash
* module to be added</a> to the app). * module to be added</a> to the app).
* <li>{@code HlsMediaSource.Factory} if the item's {@link MediaItem.LocalConfiguration#uri uri} * <li>{@code HlsMediaSource.Factory} if the item's {@link MediaItem.LocalConfiguration#uri uri}
* ends in '.m3u8' or if its {@link MediaItem.LocalConfiguration#mimeType mimeType field} is * ends in '.m3u8' or if its {@link MediaItem.LocalConfiguration#mimeType mimeType field} is
* explicitly set to {@link MimeTypes#APPLICATION_M3U8} (Requires the <a * explicitly set to {@link MimeTypes#APPLICATION_M3U8} (Requires the <a
* href="https://developer.android.com/guide/topics/media/exoplayer/hello-world#add-exoplayer-modules">exoplayer-hls * href="https://developer.android.com/media/media3/exoplayer/hello-world#add-exoplayer-modules">exoplayer-hls
* module to be added</a> to the app). * module to be added</a> to the app).
* <li>{@code SsMediaSource.Factory} if the item's {@link MediaItem.LocalConfiguration#uri uri} * <li>{@code SsMediaSource.Factory} if the item's {@link MediaItem.LocalConfiguration#uri uri}
* ends in '.ism', '.ism/Manifest' or if its {@link MediaItem.LocalConfiguration#mimeType * ends in '.ism', '.ism/Manifest' or if its {@link MediaItem.LocalConfiguration#mimeType
* mimeType field} is explicitly set to {@link MimeTypes#APPLICATION_SS} (Requires the <a * mimeType field} is explicitly set to {@link MimeTypes#APPLICATION_SS} (Requires the <a
* href="https://developer.android.com/guide/topics/media/exoplayer/hello-world#add-exoplayer-modules"> * href="https://developer.android.com/media/media3/exoplayer/hello-world#add-exoplayer-modules">
* exoplayer-smoothstreaming module to be added</a> to the app). * exoplayer-smoothstreaming module to be added</a> to the app).
* <li>{@link ProgressiveMediaSource.Factory} serves as a fallback if the item's {@link * <li>{@link ProgressiveMediaSource.Factory} serves as a fallback if the item's {@link
* MediaItem.LocalConfiguration#uri uri} doesn't match one of the above. It tries to infer the * MediaItem.LocalConfiguration#uri uri} doesn't match one of the above. It tries to infer the

View File

@ -33,6 +33,7 @@ public interface MediaSourceFactory extends MediaSource.Factory {
* An instance that throws {@link UnsupportedOperationException} from {@link #createMediaSource} * An instance that throws {@link UnsupportedOperationException} from {@link #createMediaSource}
* and {@link #getSupportedTypes()}. * and {@link #getSupportedTypes()}.
*/ */
@SuppressWarnings("deprecation") // Creating instance of deprecated type
@UnstableApi @UnstableApi
MediaSourceFactory UNSUPPORTED = MediaSourceFactory UNSUPPORTED =
new MediaSourceFactory() { new MediaSourceFactory() {

View File

@ -347,6 +347,7 @@ public final class TextRenderer extends BaseRenderer implements Callback {
} }
} }
@SuppressWarnings("deprecation") // Using deprecated C.BUFFER_FLAG_DECODE_ONLY for compatibility
private void renderFromSubtitles(long positionUs) { private void renderFromSubtitles(long positionUs) {
lastRendererPositionUs = positionUs; lastRendererPositionUs = positionUs;
if (nextSubtitle == null) { if (nextSubtitle == null) {

View File

@ -151,10 +151,12 @@ public class DefaultTrackSelector extends MappingTrackSelector
* *
* @param context Any context. * @param context Any context.
*/ */
@SuppressWarnings({"deprecation"}) // Supporting deprecated builder pattern
public ParametersBuilder(Context context) { public ParametersBuilder(Context context) {
delegate = new Parameters.Builder(context); delegate = new Parameters.Builder(context);
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
protected ParametersBuilder set(TrackSelectionParameters parameters) { protected ParametersBuilder set(TrackSelectionParameters parameters) {
@ -164,6 +166,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
// Video // Video
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public DefaultTrackSelector.ParametersBuilder setMaxVideoSizeSd() { public DefaultTrackSelector.ParametersBuilder setMaxVideoSizeSd() {
@ -171,6 +174,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public DefaultTrackSelector.ParametersBuilder clearVideoSizeConstraints() { public DefaultTrackSelector.ParametersBuilder clearVideoSizeConstraints() {
@ -178,6 +182,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public DefaultTrackSelector.ParametersBuilder setMaxVideoSize( public DefaultTrackSelector.ParametersBuilder setMaxVideoSize(
@ -186,6 +191,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public DefaultTrackSelector.ParametersBuilder setMaxVideoFrameRate(int maxVideoFrameRate) { public DefaultTrackSelector.ParametersBuilder setMaxVideoFrameRate(int maxVideoFrameRate) {
@ -193,6 +199,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public DefaultTrackSelector.ParametersBuilder setMaxVideoBitrate(int maxVideoBitrate) { public DefaultTrackSelector.ParametersBuilder setMaxVideoBitrate(int maxVideoBitrate) {
@ -200,6 +207,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public DefaultTrackSelector.ParametersBuilder setMinVideoSize( public DefaultTrackSelector.ParametersBuilder setMinVideoSize(
@ -208,6 +216,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public DefaultTrackSelector.ParametersBuilder setMinVideoFrameRate(int minVideoFrameRate) { public DefaultTrackSelector.ParametersBuilder setMinVideoFrameRate(int minVideoFrameRate) {
@ -215,6 +224,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public DefaultTrackSelector.ParametersBuilder setMinVideoBitrate(int minVideoBitrate) { public DefaultTrackSelector.ParametersBuilder setMinVideoBitrate(int minVideoBitrate) {
@ -230,6 +240,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
* selection can be made otherwise. * selection can be made otherwise.
* @return This builder. * @return This builder.
*/ */
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
public ParametersBuilder setExceedVideoConstraintsIfNecessary( public ParametersBuilder setExceedVideoConstraintsIfNecessary(
boolean exceedVideoConstraintsIfNecessary) { boolean exceedVideoConstraintsIfNecessary) {
@ -248,6 +259,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
* containing mixed MIME types. * containing mixed MIME types.
* @return This builder. * @return This builder.
*/ */
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
public ParametersBuilder setAllowVideoMixedMimeTypeAdaptiveness( public ParametersBuilder setAllowVideoMixedMimeTypeAdaptiveness(
boolean allowVideoMixedMimeTypeAdaptiveness) { boolean allowVideoMixedMimeTypeAdaptiveness) {
@ -263,6 +275,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
* adaptation may not be completely seamless. * adaptation may not be completely seamless.
* @return This builder. * @return This builder.
*/ */
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
public ParametersBuilder setAllowVideoNonSeamlessAdaptiveness( public ParametersBuilder setAllowVideoNonSeamlessAdaptiveness(
boolean allowVideoNonSeamlessAdaptiveness) { boolean allowVideoNonSeamlessAdaptiveness) {
@ -279,6 +292,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
* with mixed levels of decoder and hardware acceleration support. * with mixed levels of decoder and hardware acceleration support.
* @return This builder. * @return This builder.
*/ */
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
public ParametersBuilder setAllowVideoMixedDecoderSupportAdaptiveness( public ParametersBuilder setAllowVideoMixedDecoderSupportAdaptiveness(
boolean allowVideoMixedDecoderSupportAdaptiveness) { boolean allowVideoMixedDecoderSupportAdaptiveness) {
@ -287,6 +301,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder setViewportSizeToPhysicalDisplaySize( public ParametersBuilder setViewportSizeToPhysicalDisplaySize(
@ -295,6 +310,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder clearViewportSizeConstraints() { public ParametersBuilder clearViewportSizeConstraints() {
@ -302,6 +318,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder setViewportSize( public ParametersBuilder setViewportSize(
@ -310,6 +327,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder setPreferredVideoMimeType(@Nullable String mimeType) { public ParametersBuilder setPreferredVideoMimeType(@Nullable String mimeType) {
@ -317,6 +335,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder setPreferredVideoMimeTypes(String... mimeTypes) { public ParametersBuilder setPreferredVideoMimeTypes(String... mimeTypes) {
@ -324,6 +343,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public DefaultTrackSelector.ParametersBuilder setPreferredVideoRoleFlags( public DefaultTrackSelector.ParametersBuilder setPreferredVideoRoleFlags(
@ -334,6 +354,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
// Audio // Audio
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder setPreferredAudioLanguage(@Nullable String preferredAudioLanguage) { public ParametersBuilder setPreferredAudioLanguage(@Nullable String preferredAudioLanguage) {
@ -341,6 +362,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder setPreferredAudioLanguages(String... preferredAudioLanguages) { public ParametersBuilder setPreferredAudioLanguages(String... preferredAudioLanguages) {
@ -348,6 +370,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder setPreferredAudioRoleFlags(@C.RoleFlags int preferredAudioRoleFlags) { public ParametersBuilder setPreferredAudioRoleFlags(@C.RoleFlags int preferredAudioRoleFlags) {
@ -355,6 +378,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder setMaxAudioChannelCount(int maxAudioChannelCount) { public ParametersBuilder setMaxAudioChannelCount(int maxAudioChannelCount) {
@ -362,6 +386,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder setMaxAudioBitrate(int maxAudioBitrate) { public ParametersBuilder setMaxAudioBitrate(int maxAudioBitrate) {
@ -377,6 +402,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
* selection can be made otherwise. * selection can be made otherwise.
* @return This builder. * @return This builder.
*/ */
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
public ParametersBuilder setExceedAudioConstraintsIfNecessary( public ParametersBuilder setExceedAudioConstraintsIfNecessary(
boolean exceedAudioConstraintsIfNecessary) { boolean exceedAudioConstraintsIfNecessary) {
@ -395,6 +421,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
* containing mixed MIME types. * containing mixed MIME types.
* @return This builder. * @return This builder.
*/ */
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
public ParametersBuilder setAllowAudioMixedMimeTypeAdaptiveness( public ParametersBuilder setAllowAudioMixedMimeTypeAdaptiveness(
boolean allowAudioMixedMimeTypeAdaptiveness) { boolean allowAudioMixedMimeTypeAdaptiveness) {
@ -411,6 +438,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
* containing mixed sample rates. * containing mixed sample rates.
* @return This builder. * @return This builder.
*/ */
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
public ParametersBuilder setAllowAudioMixedSampleRateAdaptiveness( public ParametersBuilder setAllowAudioMixedSampleRateAdaptiveness(
boolean allowAudioMixedSampleRateAdaptiveness) { boolean allowAudioMixedSampleRateAdaptiveness) {
@ -427,6 +455,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
* containing mixed channel counts. * containing mixed channel counts.
* @return This builder. * @return This builder.
*/ */
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
public ParametersBuilder setAllowAudioMixedChannelCountAdaptiveness( public ParametersBuilder setAllowAudioMixedChannelCountAdaptiveness(
boolean allowAudioMixedChannelCountAdaptiveness) { boolean allowAudioMixedChannelCountAdaptiveness) {
@ -443,6 +472,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
* with mixed levels of decoder and hardware acceleration support. * with mixed levels of decoder and hardware acceleration support.
* @return This builder. * @return This builder.
*/ */
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
public ParametersBuilder setAllowAudioMixedDecoderSupportAdaptiveness( public ParametersBuilder setAllowAudioMixedDecoderSupportAdaptiveness(
boolean allowAudioMixedDecoderSupportAdaptiveness) { boolean allowAudioMixedDecoderSupportAdaptiveness) {
@ -451,6 +481,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder setPreferredAudioMimeType(@Nullable String mimeType) { public ParametersBuilder setPreferredAudioMimeType(@Nullable String mimeType) {
@ -458,6 +489,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder setPreferredAudioMimeTypes(String... mimeTypes) { public ParametersBuilder setPreferredAudioMimeTypes(String... mimeTypes) {
@ -465,6 +497,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder setAudioOffloadPreferences( public ParametersBuilder setAudioOffloadPreferences(
@ -475,6 +508,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
// Text // Text
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder setPreferredTextLanguageAndRoleFlagsToCaptioningManagerSettings( public ParametersBuilder setPreferredTextLanguageAndRoleFlagsToCaptioningManagerSettings(
@ -483,6 +517,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder setPreferredTextLanguage(@Nullable String preferredTextLanguage) { public ParametersBuilder setPreferredTextLanguage(@Nullable String preferredTextLanguage) {
@ -490,6 +525,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder setPreferredTextLanguages(String... preferredTextLanguages) { public ParametersBuilder setPreferredTextLanguages(String... preferredTextLanguages) {
@ -497,6 +533,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder setPreferredTextRoleFlags(@C.RoleFlags int preferredTextRoleFlags) { public ParametersBuilder setPreferredTextRoleFlags(@C.RoleFlags int preferredTextRoleFlags) {
@ -504,6 +541,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder setIgnoredTextSelectionFlags( public ParametersBuilder setIgnoredTextSelectionFlags(
@ -512,6 +550,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder setSelectUndeterminedTextLanguage( public ParametersBuilder setSelectUndeterminedTextLanguage(
@ -523,6 +562,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
/** /**
* @deprecated Use {@link #setIgnoredTextSelectionFlags}. * @deprecated Use {@link #setIgnoredTextSelectionFlags}.
*/ */
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Deprecated @Deprecated
public ParametersBuilder setDisabledTextTrackSelectionFlags( public ParametersBuilder setDisabledTextTrackSelectionFlags(
@ -532,7 +572,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
} }
// Image // Image
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder setPrioritizeImageOverVideoEnabled( public ParametersBuilder setPrioritizeImageOverVideoEnabled(
@ -543,6 +583,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
// General // General
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder setForceLowestBitrate(boolean forceLowestBitrate) { public ParametersBuilder setForceLowestBitrate(boolean forceLowestBitrate) {
@ -550,6 +591,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder setForceHighestSupportedBitrate(boolean forceHighestSupportedBitrate) { public ParametersBuilder setForceHighestSupportedBitrate(boolean forceHighestSupportedBitrate) {
@ -557,6 +599,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder addOverride(TrackSelectionOverride override) { public ParametersBuilder addOverride(TrackSelectionOverride override) {
@ -564,6 +607,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder clearOverride(TrackGroup trackGroup) { public ParametersBuilder clearOverride(TrackGroup trackGroup) {
@ -571,6 +615,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder setOverrideForType(TrackSelectionOverride override) { public ParametersBuilder setOverrideForType(TrackSelectionOverride override) {
@ -578,6 +623,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder clearOverridesOfType(@C.TrackType int trackType) { public ParametersBuilder clearOverridesOfType(@C.TrackType int trackType) {
@ -585,6 +631,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder clearOverrides() { public ParametersBuilder clearOverrides() {
@ -598,12 +645,13 @@ public class DefaultTrackSelector extends MappingTrackSelector
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
@Deprecated @Deprecated
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation") // Intentionally returning deprecated type
public ParametersBuilder setDisabledTrackTypes(Set<@C.TrackType Integer> disabledTrackTypes) { public ParametersBuilder setDisabledTrackTypes(Set<@C.TrackType Integer> disabledTrackTypes) {
delegate.setDisabledTrackTypes(disabledTrackTypes); delegate.setDisabledTrackTypes(disabledTrackTypes);
return this; return this;
} }
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Override @Override
public ParametersBuilder setTrackTypeDisabled(@C.TrackType int trackType, boolean disabled) { public ParametersBuilder setTrackTypeDisabled(@C.TrackType int trackType, boolean disabled) {
@ -623,6 +671,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
* selection can be made otherwise. * selection can be made otherwise.
* @return This builder. * @return This builder.
*/ */
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
public ParametersBuilder setExceedRendererCapabilitiesIfNecessary( public ParametersBuilder setExceedRendererCapabilitiesIfNecessary(
boolean exceedRendererCapabilitiesIfNecessary) { boolean exceedRendererCapabilitiesIfNecessary) {
@ -644,6 +693,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
* @param tunnelingEnabled Whether to enable tunneling if possible. * @param tunnelingEnabled Whether to enable tunneling if possible.
* @return This builder. * @return This builder.
*/ */
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
public ParametersBuilder setTunnelingEnabled(boolean tunnelingEnabled) { public ParametersBuilder setTunnelingEnabled(boolean tunnelingEnabled) {
delegate.setTunnelingEnabled(tunnelingEnabled); delegate.setTunnelingEnabled(tunnelingEnabled);
@ -656,6 +706,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
* @param allowMultipleAdaptiveSelections Whether multiple adaptive selections are allowed. * @param allowMultipleAdaptiveSelections Whether multiple adaptive selections are allowed.
* @return This builder. * @return This builder.
*/ */
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
public ParametersBuilder setAllowMultipleAdaptiveSelections( public ParametersBuilder setAllowMultipleAdaptiveSelections(
boolean allowMultipleAdaptiveSelections) { boolean allowMultipleAdaptiveSelections) {
@ -673,6 +724,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
* @param disabled Whether the renderer is disabled. * @param disabled Whether the renderer is disabled.
* @return This builder. * @return This builder.
*/ */
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
public ParametersBuilder setRendererDisabled(int rendererIndex, boolean disabled) { public ParametersBuilder setRendererDisabled(int rendererIndex, boolean disabled) {
delegate.setRendererDisabled(rendererIndex, disabled); delegate.setRendererDisabled(rendererIndex, disabled);
@ -703,6 +755,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
* @return This builder. * @return This builder.
* @deprecated Use {@link TrackSelectionParameters.Builder#addOverride(TrackSelectionOverride)}. * @deprecated Use {@link TrackSelectionParameters.Builder#addOverride(TrackSelectionOverride)}.
*/ */
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Deprecated @Deprecated
public ParametersBuilder setSelectionOverride( public ParametersBuilder setSelectionOverride(
@ -719,6 +772,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
* @return This builder. * @return This builder.
* @deprecated Use {@link TrackSelectionParameters.Builder#clearOverride(TrackGroup)}. * @deprecated Use {@link TrackSelectionParameters.Builder#clearOverride(TrackGroup)}.
*/ */
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Deprecated @Deprecated
public ParametersBuilder clearSelectionOverride(int rendererIndex, TrackGroupArray groups) { public ParametersBuilder clearSelectionOverride(int rendererIndex, TrackGroupArray groups) {
@ -733,6 +787,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
* @return This builder. * @return This builder.
* @deprecated Use {@link TrackSelectionParameters.Builder#clearOverridesOfType(int)}. * @deprecated Use {@link TrackSelectionParameters.Builder#clearOverridesOfType(int)}.
*/ */
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Deprecated @Deprecated
public ParametersBuilder clearSelectionOverrides(int rendererIndex) { public ParametersBuilder clearSelectionOverrides(int rendererIndex) {
@ -746,6 +801,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
* @return This builder. * @return This builder.
* @deprecated Use {@link TrackSelectionParameters.Builder#clearOverrides()}. * @deprecated Use {@link TrackSelectionParameters.Builder#clearOverrides()}.
*/ */
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
@CanIgnoreReturnValue @CanIgnoreReturnValue
@Deprecated @Deprecated
public ParametersBuilder clearSelectionOverrides() { public ParametersBuilder clearSelectionOverrides() {
@ -1637,6 +1693,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
return clone; return clone;
} }
@SuppressWarnings("deprecation") // Filling deprecated field from Bundle
private void setSelectionOverridesFromBundle(Bundle bundle) { private void setSelectionOverridesFromBundle(Bundle bundle) {
@Nullable @Nullable
int[] rendererIndices = int[] rendererIndices =

View File

@ -82,16 +82,10 @@ public final class TrackSelectionUtil {
} }
/** /**
* Updates {@link DefaultTrackSelector.Parameters} with an override. * @deprecated Use {@link DefaultTrackSelector.Parameters.Builder#addOverride} instead.
*
* @param parameters The current {@link DefaultTrackSelector.Parameters} to build upon.
* @param rendererIndex The renderer index to update.
* @param trackGroupArray The {@link TrackGroupArray} of the renderer.
* @param isDisabled Whether the renderer should be set disabled.
* @param override An optional override for the renderer. If null, no override will be set and an
* existing override for this renderer will be cleared.
* @return The updated {@link DefaultTrackSelector.Parameters}.
*/ */
@SuppressWarnings("deprecation") // Forwarding to deprecated methods
@Deprecated
public static DefaultTrackSelector.Parameters updateParametersWithOverride( public static DefaultTrackSelector.Parameters updateParametersWithOverride(
DefaultTrackSelector.Parameters parameters, DefaultTrackSelector.Parameters parameters,
int rendererIndex, int rendererIndex,

View File

@ -39,5 +39,5 @@ instances and pass them directly to the player. For advanced download use cases,
* [Developer Guide][] * [Developer Guide][]
* [Javadoc][] * [Javadoc][]
[Developer Guide]: https://developer.android.com/guide/topics/media/exoplayer/dash [Developer Guide]: https://developer.android.com/media/media3/exoplayer/dash
[Javadoc]: https://developer.android.com/reference/androidx/media3/exoplayer/dash/package-summary [Javadoc]: https://developer.android.com/reference/androidx/media3/exoplayer/dash/package-summary

View File

@ -37,6 +37,7 @@ import androidx.media3.extractor.ChunkIndex;
import androidx.media3.extractor.Extractor; import androidx.media3.extractor.Extractor;
import androidx.media3.extractor.mkv.MatroskaExtractor; import androidx.media3.extractor.mkv.MatroskaExtractor;
import androidx.media3.extractor.mp4.FragmentedMp4Extractor; import androidx.media3.extractor.mp4.FragmentedMp4Extractor;
import androidx.media3.extractor.text.SubtitleParser;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
@ -342,7 +343,13 @@ public final class DashUtil {
mimeType != null mimeType != null
&& (mimeType.startsWith(MimeTypes.VIDEO_WEBM) && (mimeType.startsWith(MimeTypes.VIDEO_WEBM)
|| mimeType.startsWith(MimeTypes.AUDIO_WEBM)); || mimeType.startsWith(MimeTypes.AUDIO_WEBM));
Extractor extractor = isWebm ? new MatroskaExtractor() : new FragmentedMp4Extractor(); Extractor extractor =
isWebm
? new MatroskaExtractor(
SubtitleParser.Factory.UNSUPPORTED, MatroskaExtractor.FLAG_EMIT_RAW_SUBTITLE_DATA)
: new FragmentedMp4Extractor(
SubtitleParser.Factory.UNSUPPORTED,
FragmentedMp4Extractor.FLAG_EMIT_RAW_SUBTITLE_DATA);
return new BundledChunkExtractor(extractor, trackType, format); return new BundledChunkExtractor(extractor, trackType, format);
} }

View File

@ -38,5 +38,5 @@ instances and pass them directly to the player. For advanced download use cases,
* [Developer Guide][] * [Developer Guide][]
* [Javadoc][] * [Javadoc][]
[Developer Guide]: https://developer.android.com/guide/topics/media/exoplayer/hls [Developer Guide]: https://developer.android.com/media/media3/exoplayer/hls
[Javadoc]: https://developer.android.com/reference/androidx/media3/exoplayer/hls/package-summary [Javadoc]: https://developer.android.com/reference/androidx/media3/exoplayer/hls/package-summary

View File

@ -45,6 +45,7 @@ import androidx.media3.exoplayer.source.mediaparser.MediaParserUtil;
import androidx.media3.exoplayer.source.mediaparser.OutputConsumerAdapterV30; import androidx.media3.exoplayer.source.mediaparser.OutputConsumerAdapterV30;
import androidx.media3.extractor.ExtractorInput; import androidx.media3.extractor.ExtractorInput;
import androidx.media3.extractor.ExtractorOutput; import androidx.media3.extractor.ExtractorOutput;
import androidx.media3.extractor.text.SubtitleParser;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import java.io.IOException; import java.io.IOException;
@ -70,7 +71,13 @@ public final class MediaParserHlsMediaChunkExtractor implements HlsMediaChunkExt
// The segment contains WebVTT. MediaParser does not support WebVTT parsing, so we use the // The segment contains WebVTT. MediaParser does not support WebVTT parsing, so we use the
// bundled extractor. // bundled extractor.
return new BundledHlsMediaChunkExtractor( return new BundledHlsMediaChunkExtractor(
new WebvttExtractor(format.language, timestampAdjuster), format, timestampAdjuster); new WebvttExtractor(
format.language,
timestampAdjuster,
SubtitleParser.Factory.UNSUPPORTED,
/* parseSubtitlesDuringExtraction= */ false),
format,
timestampAdjuster);
} }
boolean overrideInBandCaptionDeclarations = muxedCaptionFormats != null; boolean overrideInBandCaptionDeclarations = muxedCaptionFormats != null;

View File

@ -26,7 +26,7 @@ locally. Instructions for doing this can be found in the [top level README][].
## Using the module ## Using the module
To use the module, follow the instructions on the To use the module, follow the instructions on the
[Ad insertion page](https://developer.android.com/guide/topics/media/exoplayer/ad-insertion#declarative-ad-support) [Ad insertion page](https://developer.android.com/media/media3/exoplayer/ad-insertion#declarative-ad-support)
of the developer guide. The `AdsLoaderProvider` passed to the player's of the developer guide. The `AdsLoaderProvider` passed to the player's
`DefaultMediaSourceFactory` should return an `ImaAdsLoader`. Note that the IMA `DefaultMediaSourceFactory` should return an `ImaAdsLoader`. Note that the IMA
module only supports players that are accessed on the application's main thread. module only supports players that are accessed on the application's main thread.
@ -56,7 +56,6 @@ player position when backgrounded during ad playback.
* [Javadoc][] * [Javadoc][]
* [Supported platforms][] * [Supported platforms][]
[Developer Guide]: https://developer.android.com/guide/topics/media/exoplayer/ad-insertion [Developer Guide]: https://developer.android.com/media/media3/exoplayer/ad-insertion
[Javadoc]: https://developer.android.com/reference/androidx/media3/exoplayer/ima/package-summary [Javadoc]: https://developer.android.com/reference/androidx/media3/exoplayer/ima/package-summary
[Supported platforms]: https://developers.google.com/interactive-media-ads/docs/sdks/other [Supported platforms]: https://developers.google.com/interactive-media-ads/docs/sdks/other

View File

@ -823,6 +823,7 @@ public final class ImaServerSideAdInsertionMediaSource extends CompositeMediaSou
// Static methods. // Static methods.
@SuppressWarnings("deprecation") // b/192231683 prevents using non-deprecated method
private static AdPlaybackState setVodAdGroupPlaceholders( private static AdPlaybackState setVodAdGroupPlaceholders(
List<CuePoint> cuePoints, AdPlaybackState adPlaybackState) { List<CuePoint> cuePoints, AdPlaybackState adPlaybackState) {
// TODO(b/192231683) Use getEndTimeMs()/getStartTimeMs() after jar target was removed // TODO(b/192231683) Use getEndTimeMs()/getStartTimeMs() after jar target was removed

View File

@ -33,5 +33,5 @@ instances and pass them directly to the player.
* [Developer Guide][] * [Developer Guide][]
* [Javadoc][] * [Javadoc][]
[Developer Guide]: https://developer.android.com/guide/topics/media/exoplayer/rtsp [Developer Guide]: https://developer.android.com/media/media3/exoplayer/rtsp
[Javadoc]: https://developer.android.com/reference/androidx/media3/exoplayer/rtsp/package-summary [Javadoc]: https://developer.android.com/reference/androidx/media3/exoplayer/rtsp/package-summary

View File

@ -38,5 +38,5 @@ instances and pass them directly to the player. For advanced download use cases,
* [Developer Guide][] * [Developer Guide][]
* [Javadoc][] * [Javadoc][]
[Developer Guide]: https://developer.android.com/guide/topics/media/exoplayer/smoothstreaming [Developer Guide]: https://developer.android.com/media/media3/exoplayer/smoothstreaming
[Javadoc]: https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/package-summary [Javadoc]: https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/package-summary

View File

@ -28,6 +28,7 @@ import com.google.common.base.Ascii;
/** /**
* @deprecated Use {@link androidx.media3.extractor.metadata.vorbis.VorbisComment} instead. * @deprecated Use {@link androidx.media3.extractor.metadata.vorbis.VorbisComment} instead.
*/ */
@SuppressWarnings("deprecation") // Internal references to own class
@Deprecated @Deprecated
@UnstableApi @UnstableApi
public class VorbisComment implements Metadata.Entry { public class VorbisComment implements Metadata.Entry {

View File

@ -43,6 +43,7 @@ public final class TextInformationFrame extends Id3Frame {
/** The text values of this frame. Will always have at least one element. */ /** The text values of this frame. Will always have at least one element. */
public final ImmutableList<String> values; public final ImmutableList<String> values;
@SuppressWarnings("deprecation") // Assigning deprecated public field
public TextInformationFrame(String id, @Nullable String description, List<String> values) { public TextInformationFrame(String id, @Nullable String description, List<String> values) {
super(id); super(id);
checkArgument(!values.isEmpty()); checkArgument(!values.isEmpty());

View File

@ -82,12 +82,6 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
@UnstableApi @UnstableApi
public class MatroskaExtractor implements Extractor { public class MatroskaExtractor implements Extractor {
/**
* @deprecated Use {@link #newFactory(SubtitleParser.Factory)} instead.
*/
@Deprecated
public static final ExtractorsFactory FACTORY = () -> new Extractor[] {new MatroskaExtractor()};
/** /**
* Creates a factory for {@link MatroskaExtractor} instances with the provided {@link * Creates a factory for {@link MatroskaExtractor} instances with the provided {@link
* SubtitleParser.Factory}. * SubtitleParser.Factory}.
@ -124,6 +118,16 @@ public class MatroskaExtractor implements Extractor {
*/ */
public static final int FLAG_EMIT_RAW_SUBTITLE_DATA = 1 << 1; // 2 public static final int FLAG_EMIT_RAW_SUBTITLE_DATA = 1 << 1; // 2
/**
* @deprecated Use {@link #newFactory(SubtitleParser.Factory)} instead.
*/
@Deprecated
public static final ExtractorsFactory FACTORY =
() ->
new Extractor[] {
new MatroskaExtractor(SubtitleParser.Factory.UNSUPPORTED, FLAG_EMIT_RAW_SUBTITLE_DATA)
};
private static final String TAG = "MatroskaExtractor"; private static final String TAG = "MatroskaExtractor";
private static final int UNSET_ENTRY_ID = -1; private static final int UNSET_ENTRY_ID = -1;

View File

@ -74,13 +74,6 @@ import java.util.UUID;
@UnstableApi @UnstableApi
public class FragmentedMp4Extractor implements Extractor { public class FragmentedMp4Extractor implements Extractor {
/**
* @deprecated Use {@link #newFactory(SubtitleParser.Factory)} instead.
*/
@Deprecated
public static final ExtractorsFactory FACTORY =
() -> new Extractor[] {new FragmentedMp4Extractor()};
/** /**
* Creates a factory for {@link FragmentedMp4Extractor} instances with the provided {@link * Creates a factory for {@link FragmentedMp4Extractor} instances with the provided {@link
* SubtitleParser.Factory}. * SubtitleParser.Factory}.
@ -135,6 +128,17 @@ public class FragmentedMp4Extractor implements Extractor {
*/ */
public static final int FLAG_EMIT_RAW_SUBTITLE_DATA = 1 << 5; // 32 public static final int FLAG_EMIT_RAW_SUBTITLE_DATA = 1 << 5; // 32
/**
* @deprecated Use {@link #newFactory(SubtitleParser.Factory)} instead.
*/
@Deprecated
public static final ExtractorsFactory FACTORY =
() ->
new Extractor[] {
new FragmentedMp4Extractor(
SubtitleParser.Factory.UNSUPPORTED, /* flags= */ FLAG_EMIT_RAW_SUBTITLE_DATA)
};
private static final String TAG = "FragmentedMp4Extractor"; private static final String TAG = "FragmentedMp4Extractor";
@SuppressWarnings("ConstantCaseForConstants") @SuppressWarnings("ConstantCaseForConstants")

View File

@ -66,12 +66,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
@UnstableApi @UnstableApi
public final class Mp4Extractor implements Extractor, SeekMap { public final class Mp4Extractor implements Extractor, SeekMap {
/**
* @deprecated Use {@link #newFactory(SubtitleParser.Factory)} instead.
*/
@Deprecated
public static final ExtractorsFactory FACTORY = () -> new Extractor[] {new Mp4Extractor()};
/** /**
* Creates a factory for {@link Mp4Extractor} instances with the provided {@link * Creates a factory for {@link Mp4Extractor} instances with the provided {@link
* SubtitleParser.Factory}. * SubtitleParser.Factory}.
@ -125,6 +119,16 @@ public final class Mp4Extractor implements Extractor, SeekMap {
public static final int FLAG_EMIT_RAW_SUBTITLE_DATA = 1 << 4; public static final int FLAG_EMIT_RAW_SUBTITLE_DATA = 1 << 4;
/**
* @deprecated Use {@link #newFactory(SubtitleParser.Factory)} instead.
*/
@Deprecated
public static final ExtractorsFactory FACTORY =
() ->
new Extractor[] {
new Mp4Extractor(SubtitleParser.Factory.UNSUPPORTED, FLAG_EMIT_RAW_SUBTITLE_DATA)
};
/** Parser states. */ /** Parser states. */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)

View File

@ -61,12 +61,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
@UnstableApi @UnstableApi
public final class TsExtractor implements Extractor { public final class TsExtractor implements Extractor {
/**
* @deprecated Use {@link #newFactory(SubtitleParser.Factory)} instead.
*/
@Deprecated
public static final ExtractorsFactory FACTORY = () -> new Extractor[] {new TsExtractor()};
/** /**
* Creates a factory for {@link TsExtractor} instances with the provided {@link * Creates a factory for {@link TsExtractor} instances with the provided {@link
* SubtitleParser.Factory}. * SubtitleParser.Factory}.
@ -115,6 +109,16 @@ public final class TsExtractor implements Extractor {
*/ */
public static final int FLAG_EMIT_RAW_SUBTITLE_DATA = 1; public static final int FLAG_EMIT_RAW_SUBTITLE_DATA = 1;
/**
* @deprecated Use {@link #newFactory(SubtitleParser.Factory)} instead.
*/
@Deprecated
public static final ExtractorsFactory FACTORY =
() ->
new Extractor[] {
new TsExtractor(FLAG_EMIT_RAW_SUBTITLE_DATA, SubtitleParser.Factory.UNSUPPORTED)
};
public static final int TS_PACKET_SIZE = 188; public static final int TS_PACKET_SIZE = 188;
public static final int DEFAULT_TIMESTAMP_SEARCH_BYTES = 600 * TS_PACKET_SIZE; public static final int DEFAULT_TIMESTAMP_SEARCH_BYTES = 600 * TS_PACKET_SIZE;

View File

@ -17,7 +17,6 @@ package androidx.media3.session;
import static android.support.v4.media.session.MediaSessionCompat.FLAG_HANDLES_QUEUE_COMMANDS; import static android.support.v4.media.session.MediaSessionCompat.FLAG_HANDLES_QUEUE_COMMANDS;
import static androidx.media.utils.MediaConstants.BROWSER_ROOT_HINTS_KEY_ROOT_CHILDREN_SUPPORTED_FLAGS; import static androidx.media.utils.MediaConstants.BROWSER_ROOT_HINTS_KEY_ROOT_CHILDREN_SUPPORTED_FLAGS;
import static androidx.media3.common.Player.COMMAND_ADJUST_DEVICE_VOLUME;
import static androidx.media3.common.Player.COMMAND_ADJUST_DEVICE_VOLUME_WITH_FLAGS; import static androidx.media3.common.Player.COMMAND_ADJUST_DEVICE_VOLUME_WITH_FLAGS;
import static androidx.media3.common.Player.COMMAND_CHANGE_MEDIA_ITEMS; import static androidx.media3.common.Player.COMMAND_CHANGE_MEDIA_ITEMS;
import static androidx.media3.common.Player.COMMAND_GET_AUDIO_ATTRIBUTES; import static androidx.media3.common.Player.COMMAND_GET_AUDIO_ATTRIBUTES;
@ -36,7 +35,6 @@ import static androidx.media3.common.Player.COMMAND_SEEK_TO_NEXT;
import static androidx.media3.common.Player.COMMAND_SEEK_TO_NEXT_MEDIA_ITEM; import static androidx.media3.common.Player.COMMAND_SEEK_TO_NEXT_MEDIA_ITEM;
import static androidx.media3.common.Player.COMMAND_SEEK_TO_PREVIOUS; import static androidx.media3.common.Player.COMMAND_SEEK_TO_PREVIOUS;
import static androidx.media3.common.Player.COMMAND_SEEK_TO_PREVIOUS_MEDIA_ITEM; import static androidx.media3.common.Player.COMMAND_SEEK_TO_PREVIOUS_MEDIA_ITEM;
import static androidx.media3.common.Player.COMMAND_SET_DEVICE_VOLUME;
import static androidx.media3.common.Player.COMMAND_SET_DEVICE_VOLUME_WITH_FLAGS; import static androidx.media3.common.Player.COMMAND_SET_DEVICE_VOLUME_WITH_FLAGS;
import static androidx.media3.common.Player.COMMAND_SET_MEDIA_ITEM; import static androidx.media3.common.Player.COMMAND_SET_MEDIA_ITEM;
import static androidx.media3.common.Player.COMMAND_SET_REPEAT_MODE; import static androidx.media3.common.Player.COMMAND_SET_REPEAT_MODE;
@ -1169,12 +1167,12 @@ import java.util.concurrent.TimeoutException;
} }
if (volumeControlType == VolumeProviderCompat.VOLUME_CONTROL_RELATIVE) { if (volumeControlType == VolumeProviderCompat.VOLUME_CONTROL_RELATIVE) {
playerCommandsBuilder.addAll( playerCommandsBuilder.addAll(
COMMAND_ADJUST_DEVICE_VOLUME, COMMAND_ADJUST_DEVICE_VOLUME_WITH_FLAGS); Player.COMMAND_ADJUST_DEVICE_VOLUME, COMMAND_ADJUST_DEVICE_VOLUME_WITH_FLAGS);
} else if (volumeControlType == VolumeProviderCompat.VOLUME_CONTROL_ABSOLUTE) { } else if (volumeControlType == VolumeProviderCompat.VOLUME_CONTROL_ABSOLUTE) {
playerCommandsBuilder.addAll( playerCommandsBuilder.addAll(
COMMAND_ADJUST_DEVICE_VOLUME, Player.COMMAND_ADJUST_DEVICE_VOLUME,
COMMAND_ADJUST_DEVICE_VOLUME_WITH_FLAGS, COMMAND_ADJUST_DEVICE_VOLUME_WITH_FLAGS,
COMMAND_SET_DEVICE_VOLUME, Player.COMMAND_SET_DEVICE_VOLUME,
COMMAND_SET_DEVICE_VOLUME_WITH_FLAGS); COMMAND_SET_DEVICE_VOLUME_WITH_FLAGS);
} }
playerCommandsBuilder.addAll( playerCommandsBuilder.addAll(

View File

@ -129,7 +129,7 @@ public class MediaButtonReceiver extends BroadcastReceiver {
// button intents to this receiver only when the session is released or not active, meaning // button intents to this receiver only when the session is released or not active, meaning
// the service is not running. Hence we only accept a PLAY command here that ensures that // the service is not running. Hence we only accept a PLAY command here that ensures that
// playback is started and the MediaSessionService/MediaLibraryService is put into the // playback is started and the MediaSessionService/MediaLibraryService is put into the
// foreground (see https://developer.android.com/guide/topics/media-apps/mediabuttons and // foreground (see https://developer.android.com/media/legacy/media-buttons and
// https://developer.android.com/about/versions/oreo/android-8.0-changes#back-all). // https://developer.android.com/about/versions/oreo/android-8.0-changes#back-all).
android.util.Log.w( android.util.Log.w(
TAG, TAG,

View File

@ -1525,6 +1525,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
/** /**
* @deprecated Use {@link #setDeviceVolume(int, int)} instead. * @deprecated Use {@link #setDeviceVolume(int, int)} instead.
*/ */
@SuppressWarnings("deprecation") // Checking deprecated command codes
@Deprecated @Deprecated
@Override @Override
public void setDeviceVolume(int volume) { public void setDeviceVolume(int volume) {
@ -1573,6 +1574,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
/** /**
* @deprecated Use {@link #increaseDeviceVolume(int)} instead. * @deprecated Use {@link #increaseDeviceVolume(int)} instead.
*/ */
@SuppressWarnings("deprecation") // Checking deprecated command codes
@Deprecated @Deprecated
@Override @Override
public void increaseDeviceVolume() { public void increaseDeviceVolume() {
@ -1617,6 +1619,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
/** /**
* @deprecated Use {@link #decreaseDeviceVolume(int)} instead. * @deprecated Use {@link #decreaseDeviceVolume(int)} instead.
*/ */
@SuppressWarnings("deprecation") // Checking deprecated command codes
@Deprecated @Deprecated
@Override @Override
public void decreaseDeviceVolume() { public void decreaseDeviceVolume() {
@ -1659,6 +1662,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
/** /**
* @deprecated Use {@link #setDeviceMuted(boolean, int)} instead. * @deprecated Use {@link #setDeviceMuted(boolean, int)} instead.
*/ */
@SuppressWarnings("deprecation") // Checking deprecated command codes
@Deprecated @Deprecated
@Override @Override
public void setDeviceMuted(boolean muted) { public void setDeviceMuted(boolean muted) {

View File

@ -202,10 +202,10 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
* <p>Generally, multiple sessions aren't necessary for most media apps. One exception is if your * <p>Generally, multiple sessions aren't necessary for most media apps. One exception is if your
* app can play multiple media content at the same time, but only for the playback of video-only * app can play multiple media content at the same time, but only for the playback of video-only
* media or remote playback, since the <a * media or remote playback, since the <a
* href="https://developer.android.com/guide/topics/media-apps/audio-focus">audio focus policy</a> * href="https://developer.android.com/media/optimize/audio-focus">audio focus policy</a> recommends
* recommends not playing multiple audio content at the same time. Also, keep in mind that multiple * not playing multiple audio content at the same time. Also, keep in mind that multiple media
* media sessions would make Android Auto and Bluetooth devices with display to show your app * sessions would make Android Auto and Bluetooth devices with display to show your app multiple
* multiple times, because they list up media sessions, not media apps. * times, because they list up media sessions, not media apps.
* *
* <h2 id="BackwardCompatibility">Backward Compatibility with Legacy Session APIs</h2> * <h2 id="BackwardCompatibility">Backward Compatibility with Legacy Session APIs</h2>
* *
@ -1328,7 +1328,7 @@ public class MediaSession {
/** /**
* Called when a controller requested to add new {@linkplain MediaItem media items} to the * Called when a controller requested to add new {@linkplain MediaItem media items} to the
* playlist via one of the {@code Player.addMediaItem(s)} methods. Unless overriden, {@link * playlist via one of the {@code Player.addMediaItem(s)} methods. Unless overridden, {@link
* Callback#onSetMediaItems} will direct {@code Player.setMediaItem(s)} to this method as well. * Callback#onSetMediaItems} will direct {@code Player.setMediaItem(s)} to this method as well.
* *
* <p>In addition, unless {@link Callback#onSetMediaItems} is overridden, this callback is also * <p>In addition, unless {@link Callback#onSetMediaItems} is overridden, this callback is also

View File

@ -598,20 +598,6 @@ import org.checkerframework.checker.initialization.qual.Initialized;
sessionCompat.getCurrentControllerInfo()); sessionCompat.getCurrentControllerInfo());
} }
@Override
public void onRemoveQueueItemAt(int index) {
dispatchSessionTaskWithPlayerCommand(
COMMAND_CHANGE_MEDIA_ITEMS,
controller -> {
if (index < 0) {
Log.w(TAG, "onRemoveQueueItem(): index shouldn't be negative");
return;
}
sessionImpl.getPlayerWrapper().removeMediaItem(index);
},
sessionCompat.getCurrentControllerInfo());
}
public ControllerCb getControllerLegacyCbForBroadcast() { public ControllerCb getControllerLegacyCbForBroadcast() {
return controllerLegacyCbForBroadcast; return controllerLegacyCbForBroadcast;
} }

View File

@ -124,10 +124,10 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
* <p>Generally, multiple sessions aren't necessary for most media apps. One exception is if your * <p>Generally, multiple sessions aren't necessary for most media apps. One exception is if your
* app can play multiple media contents at the same time, but only for playback of video-only media * app can play multiple media contents at the same time, but only for playback of video-only media
* or remote playback, since the <a * or remote playback, since the <a
* href="https://developer.android.com/guide/topics/media-apps/audio-focus">audio focus policy</a> * href="https://developer.android.com/media/optimize/audio-focus">audio focus policy</a> recommends
* recommends not playing multiple audio contents at the same time. Also, keep in mind that multiple * not playing multiple audio contents at the same time. Also, keep in mind that multiple media
* media sessions would make Android Auto and Bluetooth devices with a display to show your apps * sessions would make Android Auto and Bluetooth devices with a display to show your apps multiple
* multiple times, because they list up media sessions, not media apps. * times, because they list up media sessions, not media apps.
* *
* <p>However, if you're capable of handling multiple playbacks and want to keep their sessions * <p>However, if you're capable of handling multiple playbacks and want to keep their sessions
* while the app is in the background, create multiple sessions and add them to this service with * while the app is in the background, create multiple sessions and add them to this service with

View File

@ -15,7 +15,6 @@
*/ */
package androidx.media3.session; package androidx.media3.session;
import static androidx.media3.common.Player.COMMAND_ADJUST_DEVICE_VOLUME;
import static androidx.media3.common.Player.COMMAND_ADJUST_DEVICE_VOLUME_WITH_FLAGS; import static androidx.media3.common.Player.COMMAND_ADJUST_DEVICE_VOLUME_WITH_FLAGS;
import static androidx.media3.common.Player.COMMAND_CHANGE_MEDIA_ITEMS; import static androidx.media3.common.Player.COMMAND_CHANGE_MEDIA_ITEMS;
import static androidx.media3.common.Player.COMMAND_PLAY_PAUSE; import static androidx.media3.common.Player.COMMAND_PLAY_PAUSE;
@ -30,7 +29,6 @@ import static androidx.media3.common.Player.COMMAND_SEEK_TO_NEXT_MEDIA_ITEM;
import static androidx.media3.common.Player.COMMAND_SEEK_TO_PREVIOUS; import static androidx.media3.common.Player.COMMAND_SEEK_TO_PREVIOUS;
import static androidx.media3.common.Player.COMMAND_SEEK_TO_PREVIOUS_MEDIA_ITEM; import static androidx.media3.common.Player.COMMAND_SEEK_TO_PREVIOUS_MEDIA_ITEM;
import static androidx.media3.common.Player.COMMAND_SET_AUDIO_ATTRIBUTES; import static androidx.media3.common.Player.COMMAND_SET_AUDIO_ATTRIBUTES;
import static androidx.media3.common.Player.COMMAND_SET_DEVICE_VOLUME;
import static androidx.media3.common.Player.COMMAND_SET_DEVICE_VOLUME_WITH_FLAGS; import static androidx.media3.common.Player.COMMAND_SET_DEVICE_VOLUME_WITH_FLAGS;
import static androidx.media3.common.Player.COMMAND_SET_MEDIA_ITEM; import static androidx.media3.common.Player.COMMAND_SET_MEDIA_ITEM;
import static androidx.media3.common.Player.COMMAND_SET_PLAYLIST_METADATA; import static androidx.media3.common.Player.COMMAND_SET_PLAYLIST_METADATA;
@ -1529,7 +1527,7 @@ import java.util.concurrent.ExecutionException;
queueSessionTaskWithPlayerCommand( queueSessionTaskWithPlayerCommand(
caller, caller,
sequenceNumber, sequenceNumber,
COMMAND_SET_DEVICE_VOLUME, Player.COMMAND_SET_DEVICE_VOLUME,
sendSessionResultSuccess(player -> player.setDeviceVolume(volume))); sendSessionResultSuccess(player -> player.setDeviceVolume(volume)));
} }
@ -1555,7 +1553,7 @@ import java.util.concurrent.ExecutionException;
queueSessionTaskWithPlayerCommand( queueSessionTaskWithPlayerCommand(
caller, caller,
sequenceNumber, sequenceNumber,
COMMAND_ADJUST_DEVICE_VOLUME, Player.COMMAND_ADJUST_DEVICE_VOLUME,
sendSessionResultSuccess(player -> player.increaseDeviceVolume())); sendSessionResultSuccess(player -> player.increaseDeviceVolume()));
} }
@ -1581,7 +1579,7 @@ import java.util.concurrent.ExecutionException;
queueSessionTaskWithPlayerCommand( queueSessionTaskWithPlayerCommand(
caller, caller,
sequenceNumber, sequenceNumber,
COMMAND_ADJUST_DEVICE_VOLUME, Player.COMMAND_ADJUST_DEVICE_VOLUME,
sendSessionResultSuccess(player -> player.decreaseDeviceVolume())); sendSessionResultSuccess(player -> player.decreaseDeviceVolume()));
} }
@ -1607,7 +1605,7 @@ import java.util.concurrent.ExecutionException;
queueSessionTaskWithPlayerCommand( queueSessionTaskWithPlayerCommand(
caller, caller,
sequenceNumber, sequenceNumber,
COMMAND_ADJUST_DEVICE_VOLUME, Player.COMMAND_ADJUST_DEVICE_VOLUME,
sendSessionResultSuccess(player -> player.setDeviceMuted(muted))); sendSessionResultSuccess(player -> player.setDeviceMuted(muted)));
} }

View File

@ -34,6 +34,7 @@ import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
import androidx.annotation.RequiresPermission; import androidx.annotation.RequiresPermission;
import androidx.core.app.NotificationBuilderWithBuilderAccessor; import androidx.core.app.NotificationBuilderWithBuilderAccessor;
import androidx.core.graphics.drawable.IconCompat;
import androidx.media3.common.util.NullableType; import androidx.media3.common.util.NullableType;
import androidx.media3.common.util.UnstableApi; import androidx.media3.common.util.UnstableApi;
import androidx.media3.common.util.Util; import androidx.media3.common.util.Util;
@ -303,7 +304,10 @@ public class MediaStyleNotificationHelper {
new RemoteViews( new RemoteViews(
mBuilder.mContext.getPackageName(), mBuilder.mContext.getPackageName(),
androidx.media.R.layout.notification_media_action); androidx.media.R.layout.notification_media_action);
button.setImageViewResource(androidx.media.R.id.action0, action.getIcon()); IconCompat iconCompat = action.getIconCompat();
if (iconCompat != null) {
button.setImageViewResource(androidx.media.R.id.action0, iconCompat.getResId());
}
if (!tombstone) { if (!tombstone) {
button.setOnClickPendingIntent(androidx.media.R.id.action0, action.getActionIntent()); button.setOnClickPendingIntent(androidx.media.R.id.action0, action.getActionIntent());
} }

View File

@ -526,6 +526,7 @@ import java.util.List;
super.replaceMediaItems(fromIndex, toIndex, mediaItems); super.replaceMediaItems(fromIndex, toIndex, mediaItems);
} }
@SuppressWarnings("deprecation") // Forwarding deprecated call
@Deprecated @Deprecated
@Override @Override
public boolean hasPrevious() { public boolean hasPrevious() {
@ -533,6 +534,7 @@ import java.util.List;
return super.hasPrevious(); return super.hasPrevious();
} }
@SuppressWarnings("deprecation") // Forwarding deprecated call
@Deprecated @Deprecated
@Override @Override
public boolean hasNext() { public boolean hasNext() {
@ -540,6 +542,7 @@ import java.util.List;
return super.hasNext(); return super.hasNext();
} }
@SuppressWarnings("deprecation") // Forwarding deprecated call
@Deprecated @Deprecated
@Override @Override
public boolean hasPreviousWindow() { public boolean hasPreviousWindow() {
@ -547,6 +550,7 @@ import java.util.List;
return super.hasPreviousWindow(); return super.hasPreviousWindow();
} }
@SuppressWarnings("deprecation") // Forwarding deprecated call
@Deprecated @Deprecated
@Override @Override
public boolean hasNextWindow() { public boolean hasNextWindow() {
@ -566,6 +570,7 @@ import java.util.List;
return super.hasNextMediaItem(); return super.hasNextMediaItem();
} }
@SuppressWarnings("deprecation") // Forwarding deprecated call
@Deprecated @Deprecated
@Override @Override
public void previous() { public void previous() {
@ -573,6 +578,7 @@ import java.util.List;
super.previous(); super.previous();
} }
@SuppressWarnings("deprecation") // Forwarding deprecated call
@Deprecated @Deprecated
@Override @Override
public void next() { public void next() {
@ -580,6 +586,7 @@ import java.util.List;
super.next(); super.next();
} }
@SuppressWarnings("deprecation") // Forwarding deprecated call
@Deprecated @Deprecated
@Override @Override
public void seekToPreviousWindow() { public void seekToPreviousWindow() {
@ -587,6 +594,7 @@ import java.util.List;
super.seekToPreviousWindow(); super.seekToPreviousWindow();
} }
@SuppressWarnings("deprecation") // Forwarding deprecated call
@Deprecated @Deprecated
@Override @Override
public void seekToNextWindow() { public void seekToNextWindow() {
@ -687,6 +695,7 @@ import java.util.List;
return super.getMediaItemAt(index); return super.getMediaItemAt(index);
} }
@SuppressWarnings("deprecation") // Forwarding deprecated call
@Deprecated @Deprecated
@Override @Override
public int getCurrentWindowIndex() { public int getCurrentWindowIndex() {
@ -700,6 +709,7 @@ import java.util.List;
return super.getCurrentMediaItemIndex(); return super.getCurrentMediaItemIndex();
} }
@SuppressWarnings("deprecation") // Forwarding deprecated call
@Deprecated @Deprecated
@Override @Override
public int getPreviousWindowIndex() { public int getPreviousWindowIndex() {
@ -713,6 +723,7 @@ import java.util.List;
return super.getPreviousMediaItemIndex(); return super.getPreviousMediaItemIndex();
} }
@SuppressWarnings("deprecation") // Forwarding deprecated call
@Deprecated @Deprecated
@Override @Override
public int getNextWindowIndex() { public int getNextWindowIndex() {

View File

@ -630,6 +630,7 @@ public class MediaControllerProviderService extends Service {
}); });
} }
@SuppressWarnings("deprecation") // Forwarding deprecated method call
@Override @Override
public void setDeviceVolume(String controllerId, int volume) throws RemoteException { public void setDeviceVolume(String controllerId, int volume) throws RemoteException {
runOnHandler( runOnHandler(
@ -649,6 +650,7 @@ public class MediaControllerProviderService extends Service {
}); });
} }
@SuppressWarnings("deprecation") // Forwarding deprecated method call
@Override @Override
public void increaseDeviceVolume(String controllerId) throws RemoteException { public void increaseDeviceVolume(String controllerId) throws RemoteException {
runOnHandler( runOnHandler(
@ -668,6 +670,7 @@ public class MediaControllerProviderService extends Service {
}); });
} }
@SuppressWarnings("deprecation") // Forwarding deprecated method call
@Override @Override
public void decreaseDeviceVolume(String controllerId) throws RemoteException { public void decreaseDeviceVolume(String controllerId) throws RemoteException {
runOnHandler( runOnHandler(
@ -687,6 +690,7 @@ public class MediaControllerProviderService extends Service {
}); });
} }
@SuppressWarnings("deprecation") // Forwarding deprecated method call
@Override @Override
public void setDeviceMuted(String controllerId, boolean muted) throws RemoteException { public void setDeviceMuted(String controllerId, boolean muted) throws RemoteException {
runOnHandler( runOnHandler(

View File

@ -185,7 +185,11 @@ public final class FakeExoMediaDrm implements ExoMediaDrm {
*/ */
@Deprecated @Deprecated
public FakeExoMediaDrm() { public FakeExoMediaDrm() {
this(/* maxConcurrentSessions= */ Integer.MAX_VALUE); this(
/* enforceValidKeyResponses= */ true,
/* provisionsRequired= */ 0,
/* throwNotProvisionedExceptionFromGetKeyRequest= */ false,
/* maxConcurrentSessions= */ Integer.MAX_VALUE);
} }
/** /**

View File

@ -55,6 +55,7 @@ public class StubExoPlayer extends StubPlayer implements ExoPlayer {
* @deprecated Use {@link ExoPlayer}, as the {@link AudioComponent} methods are defined by that * @deprecated Use {@link ExoPlayer}, as the {@link AudioComponent} methods are defined by that
* interface. * interface.
*/ */
@SuppressWarnings("deprecation") // Returning deprecated type
@Override @Override
@Deprecated @Deprecated
public AudioComponent getAudioComponent() { public AudioComponent getAudioComponent() {
@ -65,6 +66,7 @@ public class StubExoPlayer extends StubPlayer implements ExoPlayer {
* @deprecated Use {@link ExoPlayer}, as the {@link VideoComponent} methods are defined by that * @deprecated Use {@link ExoPlayer}, as the {@link VideoComponent} methods are defined by that
* interface. * interface.
*/ */
@SuppressWarnings("deprecation") // Returning deprecated type
@Override @Override
@Deprecated @Deprecated
public VideoComponent getVideoComponent() { public VideoComponent getVideoComponent() {
@ -75,6 +77,7 @@ public class StubExoPlayer extends StubPlayer implements ExoPlayer {
* @deprecated Use {@link Player}, as the {@link TextComponent} methods are defined by that * @deprecated Use {@link Player}, as the {@link TextComponent} methods are defined by that
* interface. * interface.
*/ */
@SuppressWarnings("deprecation") // Returning deprecated type
@Override @Override
@Deprecated @Deprecated
public TextComponent getTextComponent() { public TextComponent getTextComponent() {
@ -85,6 +88,7 @@ public class StubExoPlayer extends StubPlayer implements ExoPlayer {
* @deprecated Use {@link Player}, as the {@link DeviceComponent} methods are defined by that * @deprecated Use {@link Player}, as the {@link DeviceComponent} methods are defined by that
* interface. * interface.
*/ */
@SuppressWarnings("deprecation") // Returning deprecated type
@Override @Override
@Deprecated @Deprecated
public DeviceComponent getDeviceComponent() { public DeviceComponent getDeviceComponent() {

View File

@ -77,6 +77,7 @@ public final class PlaybackOutput implements Dumper.Dumpable {
metadatas.add(metadata); metadatas.add(metadata);
} }
@SuppressWarnings("deprecation") // Intentionally testing deprecated output
@Override @Override
public void onCues(List<Cue> cues) { public void onCues(List<Cue> cues) {
subtitlesFromDeprecatedTextOutput.add(cues); subtitlesFromDeprecatedTextOutput.add(cues);

View File

@ -23,5 +23,5 @@ locally. Instructions for doing this can be found in the [top level README][].
* [Developer Guide][] * [Developer Guide][]
* [Javadoc][] * [Javadoc][]
[Developer Guide]: https://developer.android.com/guide/topics/media/transformer [Developer Guide]: https://developer.android.com/media/media3/transformer
[Javadoc]: https://developer.android.com/reference/androidx/media3/transformer/package-summary [Javadoc]: https://developer.android.com/reference/androidx/media3/transformer/package-summary

View File

@ -541,7 +541,7 @@ public final class DefaultEncoderFactory implements Codec.EncoderFactory {
/** /**
* Applying suggested profile/level settings from * Applying suggested profile/level settings from
* https://developer.android.com/guide/topics/media/sharing-video#b-frames_and_encoding_profiles * https://developer.android.com/media/optimize/sharing#b-frames_and_encoding_profiles
* *
* <p>The adjustment is applied in-place to {@code mediaFormat}. * <p>The adjustment is applied in-place to {@code mediaFormat}.
*/ */

View File

@ -50,7 +50,7 @@ import java.util.concurrent.ScheduledExecutorService;
* An {@link AssetLoader} implementation that loads images into {@link Bitmap} instances. * An {@link AssetLoader} implementation that loads images into {@link Bitmap} instances.
* *
* <p>Supports the image formats listed <a * <p>Supports the image formats listed <a
* href="https://developer.android.com/guide/topics/media/media-formats#image-formats">here</a> * href="https://developer.android.com/media/platform/supported-formats#image-formats">here</a>
* except from GIFs, which could exhibit unexpected behavior. * except from GIFs, which could exhibit unexpected behavior.
*/ */
@UnstableApi @UnstableApi

View File

@ -34,6 +34,7 @@ import androidx.media3.extractor.PositionHolder;
import androidx.media3.extractor.SeekMap; import androidx.media3.extractor.SeekMap;
import androidx.media3.extractor.TrackOutput; import androidx.media3.extractor.TrackOutput;
import androidx.media3.extractor.mp4.Mp4Extractor; import androidx.media3.extractor.mp4.Mp4Extractor;
import androidx.media3.extractor.text.SubtitleParser;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -104,7 +105,9 @@ import org.checkerframework.checker.nullness.qual.Nullable;
* @throws IOException If an error occurs during metadata extraction. * @throws IOException If an error occurs during metadata extraction.
*/ */
public static Mp4Info create(Context context, String filePath, long timeUs) throws IOException { public static Mp4Info create(Context context, String filePath, long timeUs) throws IOException {
Mp4Extractor mp4Extractor = new Mp4Extractor(); Mp4Extractor mp4Extractor =
new Mp4Extractor(
SubtitleParser.Factory.UNSUPPORTED, Mp4Extractor.FLAG_EMIT_RAW_SUBTITLE_DATA);
ExtractorOutputImpl extractorOutput = new ExtractorOutputImpl(); ExtractorOutputImpl extractorOutput = new ExtractorOutputImpl();
DefaultDataSource dataSource = DefaultDataSource dataSource =
new DefaultDataSource(context, /* allowCrossProtocolRedirects= */ false); new DefaultDataSource(context, /* allowCrossProtocolRedirects= */ false);

View File

@ -36,6 +36,7 @@ import java.lang.annotation.Target;
/** /**
* @deprecated Use {@link ExportException} instead. * @deprecated Use {@link ExportException} instead.
*/ */
@SuppressWarnings("deprecation") // Deprecated usages of own type
@Deprecated @Deprecated
@UnstableApi @UnstableApi
public final class TransformationException extends Exception { public final class TransformationException extends Exception {

View File

@ -30,6 +30,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
/** /**
* @deprecated Use {@link ExportResult} instead. * @deprecated Use {@link ExportResult} instead.
*/ */
@SuppressWarnings("deprecation") // Deprecated usages of own type
@Deprecated @Deprecated
@UnstableApi @UnstableApi
public final class TransformationResult { public final class TransformationResult {

View File

@ -598,6 +598,7 @@ public final class Transformer {
/** /**
* @deprecated Use {@link #onCompleted(Composition, ExportResult)} instead. * @deprecated Use {@link #onCompleted(Composition, ExportResult)} instead.
*/ */
@SuppressWarnings("deprecation") // Using deprecated type in callback
@Deprecated @Deprecated
default void onTransformationCompleted(MediaItem inputMediaItem, TransformationResult result) { default void onTransformationCompleted(MediaItem inputMediaItem, TransformationResult result) {
onTransformationCompleted(inputMediaItem); onTransformationCompleted(inputMediaItem);
@ -624,6 +625,7 @@ public final class Transformer {
/** /**
* @deprecated Use {@link #onError(Composition, ExportResult, ExportException)} instead. * @deprecated Use {@link #onError(Composition, ExportResult, ExportException)} instead.
*/ */
@SuppressWarnings("deprecation") // Using deprecated type in callback
@Deprecated @Deprecated
default void onTransformationError( default void onTransformationError(
MediaItem inputMediaItem, TransformationException exception) { MediaItem inputMediaItem, TransformationException exception) {
@ -633,6 +635,7 @@ public final class Transformer {
/** /**
* @deprecated Use {@link #onError(Composition, ExportResult, ExportException)} instead. * @deprecated Use {@link #onError(Composition, ExportResult, ExportException)} instead.
*/ */
@SuppressWarnings("deprecation") // Using deprecated type in callback
@Deprecated @Deprecated
default void onTransformationError( default void onTransformationError(
MediaItem inputMediaItem, TransformationResult result, TransformationException exception) { MediaItem inputMediaItem, TransformationResult result, TransformationException exception) {

View File

@ -23,5 +23,5 @@ locally. Instructions for doing this can be found in the [top level README][].
* [Developer Guide][] * [Developer Guide][]
* [Javadoc][] * [Javadoc][]
[Developer Guide]: https://developer.android.com/guide/topics/media/ui/playerview [Developer Guide]: https://developer.android.com/media/media3/ui/playerview
[Javadoc]: https://developer.android.com/reference/androidx/media3/ui/package-summary [Javadoc]: https://developer.android.com/reference/androidx/media3/ui/package-summary

View File

@ -331,7 +331,10 @@ public class PlayerControlView extends FrameLayout {
@Nullable private Player player; @Nullable private Player player;
@Nullable private ProgressUpdateListener progressUpdateListener; @Nullable private ProgressUpdateListener progressUpdateListener;
@Nullable private OnFullScreenModeChangedListener onFullScreenModeChangedListener; @SuppressWarnings("deprecation") // Supporting deprecated listener
@Nullable
private OnFullScreenModeChangedListener onFullScreenModeChangedListener;
private boolean isFullScreen; private boolean isFullScreen;
private boolean isAttachedToWindow; private boolean isAttachedToWindow;
private boolean showMultiWindowTimeBar; private boolean showMultiWindowTimeBar;
@ -1847,7 +1850,7 @@ public class PlayerControlView extends FrameLayout {
mainTextView = itemView.findViewById(R.id.exo_main_text); mainTextView = itemView.findViewById(R.id.exo_main_text);
subTextView = itemView.findViewById(R.id.exo_sub_text); subTextView = itemView.findViewById(R.id.exo_sub_text);
iconView = itemView.findViewById(R.id.exo_icon); iconView = itemView.findViewById(R.id.exo_icon);
itemView.setOnClickListener(v -> onSettingViewClicked(getAdapterPosition())); itemView.setOnClickListener(v -> onSettingViewClicked(getBindingAdapterPosition()));
} }
} }

View File

@ -147,8 +147,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
* {@code video_decoder_gl_surface_view} and {@code none}. Using {@code none} is recommended * {@code video_decoder_gl_surface_view} and {@code none}. Using {@code none} is recommended
* for audio only applications, since creating the surface can be expensive. Using {@code * for audio only applications, since creating the surface can be expensive. Using {@code
* surface_view} is recommended for video applications. See <a * surface_view} is recommended for video applications. See <a
* href="https://developer.android.com/guide/topics/media/ui/playerview#surfacetype">Choosing * href="https://developer.android.com/media/media3/ui/playerview#surfacetype">Choosing a
* a surface type</a> for more information. * surface type</a> for more information.
* <ul> * <ul>
* <li>Corresponding method: None * <li>Corresponding method: None
* <li>Default: {@code surface_view} * <li>Default: {@code surface_view}
@ -306,7 +306,8 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
this(context, attrs, /* defStyleAttr= */ 0); this(context, attrs, /* defStyleAttr= */ 0);
} }
@SuppressWarnings({"nullness:argument", "nullness:method.invocation"}) // Using deprecated PlayerControlView.VisibilityListener internally
@SuppressWarnings({"nullness:argument", "nullness:method.invocation", "deprecation"})
public PlayerView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { public PlayerView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr); super(context, attrs, defStyleAttr);
@ -1021,6 +1022,7 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
* @deprecated Use {@link #setFullscreenButtonClickListener(FullscreenButtonClickListener)} * @deprecated Use {@link #setFullscreenButtonClickListener(FullscreenButtonClickListener)}
* instead. * instead.
*/ */
@SuppressWarnings("deprecation") // Forwarding deprecated call
@Deprecated @Deprecated
@UnstableApi @UnstableApi
public void setControllerOnFullScreenModeChangedListener( public void setControllerOnFullScreenModeChangedListener(
@ -1292,13 +1294,13 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
List<AdOverlayInfo> overlayViews = new ArrayList<>(); List<AdOverlayInfo> overlayViews = new ArrayList<>();
if (overlayFrameLayout != null) { if (overlayFrameLayout != null) {
overlayViews.add( overlayViews.add(
new AdOverlayInfo( new AdOverlayInfo.Builder(overlayFrameLayout, AdOverlayInfo.PURPOSE_NOT_VISIBLE)
overlayFrameLayout, .setDetailedReason("Transparent overlay does not impact viewability")
AdOverlayInfo.PURPOSE_NOT_VISIBLE, .build());
/* detailedReason= */ "Transparent overlay does not impact viewability"));
} }
if (controller != null) { if (controller != null) {
overlayViews.add(new AdOverlayInfo(controller, AdOverlayInfo.PURPOSE_CONTROLS)); overlayViews.add(
new AdOverlayInfo.Builder(controller, AdOverlayInfo.PURPOSE_CONTROLS).build());
} }
return ImmutableList.copyOf(overlayViews); return ImmutableList.copyOf(overlayViews);
} }

View File

@ -50,8 +50,8 @@ import java.util.List;
* for non-Wear OS devices. * for non-Wear OS devices.
* *
* <p>The system dialog will be the <a * <p>The system dialog will be the <a
* href="https://developer.android.com/guide/topics/media/media-routing#output-switcher">Media * href="https://developer.android.com/media/routing#output-switcher">Media Output Switcher</a> if
* Output Switcher</a> if it is available on the device, or otherwise the Bluetooth settings screen. * it is available on the device, or otherwise the Bluetooth settings screen.
* *
* <p>This implementation also pauses playback when launching the system dialog. The underlying * <p>This implementation also pauses playback when launching the system dialog. The underlying
* {@link Player} implementation (e.g. ExoPlayer) is expected to resume playback automatically when * {@link Player} implementation (e.g. ExoPlayer) is expected to resume playback automatically when