Fix the position of IntDefs to match TYPE_USE

#minor-release

PiperOrigin-RevId: 427131569
This commit is contained in:
tonihei 2022-02-08 09:46:14 +00:00 committed by Ian Baker
parent caf62842c4
commit 287182952d
175 changed files with 439 additions and 595 deletions

View File

@ -150,7 +150,7 @@ public final class CastPlayer extends BasePlayer {
private TrackSelectionArray currentTrackSelection;
private TracksInfo currentTracksInfo;
private Commands availableCommands;
@Player.State private int playbackState;
private @Player.State int playbackState;
private int currentWindowIndex;
private long lastReportedPositionMs;
private int pendingSeekCount;
@ -387,14 +387,12 @@ public final class CastPlayer extends BasePlayer {
}
@Override
@Player.State
public int getPlaybackState() {
public @Player.State int getPlaybackState() {
return playbackState;
}
@Override
@PlaybackSuppressionReason
public int getPlaybackSuppressionReason() {
public @PlaybackSuppressionReason int getPlaybackSuppressionReason() {
return Player.PLAYBACK_SUPPRESSION_REASON_NONE;
}
@ -574,8 +572,7 @@ public final class CastPlayer extends BasePlayer {
}
@Override
@RepeatMode
public int getRepeatMode() {
public @RepeatMode int getRepeatMode() {
return repeatMode.value;
}
@ -1292,8 +1289,7 @@ public final class CastPlayer extends BasePlayer {
* Retrieves the repeat mode from {@code remoteMediaClient} and maps it into a {@link
* Player.RepeatMode}.
*/
@RepeatMode
private static int fetchRepeatMode(RemoteMediaClient remoteMediaClient) {
private static @RepeatMode int fetchRepeatMode(RemoteMediaClient remoteMediaClient) {
MediaStatus mediaStatus = remoteMediaClient.getMediaStatus();
if (mediaStatus == null) {
// No media session active, yet.

View File

@ -67,7 +67,7 @@ public final class AdPlaybackState implements Bundleable {
/** The URI of each ad in the ad group. */
public final @NullableType Uri[] uris;
/** The state of each ad in the ad group. */
@AdState public final int[] states;
public final @AdState int[] states;
/** The durations of each ad in the ad group, in microseconds. */
public final long[] durationsUs;
/**

View File

@ -384,8 +384,7 @@ public abstract class BasePlayer implements Player {
: timeline.getWindow(getCurrentMediaItemIndex(), window).getDurationMs();
}
@RepeatMode
private int getRepeatModeForNavigation() {
private @RepeatMode int getRepeatModeForNavigation() {
@RepeatMode int repeatMode = getRepeatMode();
return repeatMode == REPEAT_MODE_ONE ? REPEAT_MODE_OFF : repeatMode;
}

View File

@ -1250,8 +1250,8 @@ public final class C {
replacement = "Util.getErrorCodeForMediaDrmErrorCode(mediaDrmErrorCode)",
imports = {"androidx.media3.common.util.Util"})
@Deprecated
@PlaybackException.ErrorCode
public static int getErrorCodeForMediaDrmErrorCode(int mediaDrmErrorCode) {
public static @PlaybackException.ErrorCode int getErrorCodeForMediaDrmErrorCode(
int mediaDrmErrorCode) {
return Util.getErrorCodeForMediaDrmErrorCode(mediaDrmErrorCode);
}
}

View File

@ -38,8 +38,7 @@ public final class ColorInfo implements Bundleable {
* made.
*/
@Pure
@C.ColorSpace
public static int isoColorPrimariesToColorSpace(int isoColorPrimaries) {
public static @C.ColorSpace int isoColorPrimariesToColorSpace(int isoColorPrimaries) {
switch (isoColorPrimaries) {
case 1:
return C.COLOR_SPACE_BT709;
@ -61,8 +60,8 @@ public final class ColorInfo implements Bundleable {
* mapping can be made.
*/
@Pure
@C.ColorTransfer
public static int isoTransferCharacteristicsToColorTransfer(int isoTransferCharacteristics) {
public static @C.ColorTransfer int isoTransferCharacteristicsToColorTransfer(
int isoTransferCharacteristics) {
switch (isoTransferCharacteristics) {
case 1: // BT.709.
case 6: // SMPTE 170M.
@ -81,20 +80,20 @@ public final class ColorInfo implements Bundleable {
* The color space of the video. Valid values are {@link C#COLOR_SPACE_BT601}, {@link
* C#COLOR_SPACE_BT709}, {@link C#COLOR_SPACE_BT2020} or {@link Format#NO_VALUE} if unknown.
*/
@C.ColorSpace public final int colorSpace;
public final @C.ColorSpace int colorSpace;
/**
* The color range of the video. Valid values are {@link C#COLOR_RANGE_LIMITED}, {@link
* C#COLOR_RANGE_FULL} or {@link Format#NO_VALUE} if unknown.
*/
@C.ColorRange public final int colorRange;
public final @C.ColorRange int colorRange;
/**
* The color transfer characteristics of the video. Valid values are {@link C#COLOR_TRANSFER_HLG},
* {@link C#COLOR_TRANSFER_ST2084}, {@link C#COLOR_TRANSFER_SDR} or {@link Format#NO_VALUE} if
* unknown.
*/
@C.ColorTransfer public final int colorTransfer;
public final @C.ColorTransfer int colorTransfer;
/** HdrStaticInfo as defined in CTA-861.3, or null if none specified. */
@Nullable public final byte[] hdrStaticInfo;

View File

@ -52,7 +52,8 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable {
* @param mediaData DRM session acquisition data obtained from the media.
* @return A {@link DrmInitData} obtained from merging a media manifest and a media stream.
*/
public static @Nullable DrmInitData createSessionCreationData(
@Nullable
public static DrmInitData createSessionCreationData(
@Nullable DrmInitData manifestData, @Nullable DrmInitData mediaData) {
ArrayList<SchemeData> result = new ArrayList<>();
String schemeType = null;

View File

@ -114,8 +114,8 @@ public final class FileTypes {
private FileTypes() {}
/** Returns the {@link Type} corresponding to the response headers provided. */
@FileTypes.Type
public static int inferFileTypeFromResponseHeaders(Map<String, List<String>> responseHeaders) {
public static @FileTypes.Type int inferFileTypeFromResponseHeaders(
Map<String, List<String>> responseHeaders) {
@Nullable List<String> contentTypes = responseHeaders.get(HEADER_CONTENT_TYPE);
@Nullable
String mimeType = contentTypes == null || contentTypes.isEmpty() ? null : contentTypes.get(0);
@ -127,8 +127,7 @@ public final class FileTypes {
*
* <p>Returns {@link #UNKNOWN} if the mime type is {@code null}.
*/
@FileTypes.Type
public static int inferFileTypeFromMimeType(@Nullable String mimeType) {
public static @FileTypes.Type int inferFileTypeFromMimeType(@Nullable String mimeType) {
if (mimeType == null) {
return FileTypes.UNKNOWN;
}
@ -178,8 +177,7 @@ public final class FileTypes {
}
/** Returns the {@link Type} corresponding to the {@link Uri} provided. */
@FileTypes.Type
public static int inferFileTypeFromUri(Uri uri) {
public static @FileTypes.Type int inferFileTypeFromUri(Uri uri) {
@Nullable String filename = uri.getLastPathSegment();
if (filename == null) {
return FileTypes.UNKNOWN;

View File

@ -156,14 +156,14 @@ public final class Format implements Bundleable {
private int rotationDegrees;
private float pixelWidthHeightRatio;
@Nullable private byte[] projectionData;
@C.StereoMode private int stereoMode;
private @C.StereoMode int stereoMode;
@Nullable private ColorInfo colorInfo;
// Audio specific.
private int channelCount;
private int sampleRate;
@C.PcmEncoding private int pcmEncoding;
private @C.PcmEncoding int pcmEncoding;
private int encoderDelay;
private int encoderPadding;
@ -173,7 +173,7 @@ public final class Format implements Bundleable {
// Provided by the source.
@C.CryptoType private int cryptoType;
private @C.CryptoType int cryptoType;
/** Creates a new instance with default values. */
public Builder() {
@ -727,7 +727,7 @@ public final class Format implements Bundleable {
* modes are {@link C#STEREO_MODE_MONO}, {@link C#STEREO_MODE_TOP_BOTTOM}, {@link
* C#STEREO_MODE_LEFT_RIGHT}, {@link C#STEREO_MODE_STEREO_MESH}.
*/
@UnstableApi @C.StereoMode public final int stereoMode;
@UnstableApi public final @C.StereoMode int stereoMode;
/** The color metadata associated with the video, or null if not applicable. */
@UnstableApi @Nullable public final ColorInfo colorInfo;
@ -738,7 +738,7 @@ public final class Format implements Bundleable {
/** The audio sampling rate in Hz, or {@link #NO_VALUE} if unknown or not applicable. */
public final int sampleRate;
/** The {@link C.PcmEncoding} for PCM audio. Set to {@link #NO_VALUE} for other media types. */
@UnstableApi @C.PcmEncoding public final int pcmEncoding;
@UnstableApi public final @C.PcmEncoding int pcmEncoding;
/**
* The number of frames to trim from the start of the decoded audio stream, or 0 if not
* applicable.
@ -762,7 +762,7 @@ public final class Format implements Bundleable {
* {@link #drmInitData} is non-null, but may be {@link C#CRYPTO_TYPE_UNSUPPORTED} to indicate that
* the samples are encrypted using an unsupported crypto type.
*/
@UnstableApi @C.CryptoType public final int cryptoType;
@UnstableApi public final @C.CryptoType int cryptoType;
// Lazily initialized hashcode.
private int hashCode;

View File

@ -79,7 +79,7 @@ public final class HeartRating extends Rating {
// Bundleable implementation.
@RatingType private static final int TYPE = RATING_TYPE_HEART;
private static final @RatingType int TYPE = RATING_TYPE_HEART;
@Documented
@Retention(RetentionPolicy.SOURCE)

View File

@ -56,11 +56,11 @@ public final class MediaMetadata implements Bundleable {
@Nullable private Rating userRating;
@Nullable private Rating overallRating;
@Nullable private byte[] artworkData;
@Nullable @PictureType private Integer artworkDataType;
@Nullable private @PictureType Integer artworkDataType;
@Nullable private Uri artworkUri;
@Nullable private Integer trackNumber;
@Nullable private Integer totalTrackCount;
@Nullable @FolderType private Integer folderType;
@Nullable private @FolderType Integer folderType;
@Nullable private Boolean isPlayable;
@Nullable private Integer recordingYear;
@Nullable private Integer recordingMonth;

View File

@ -552,8 +552,7 @@ public final class MimeTypes {
* @return The corresponding {@link C.Encoding}, or {@link C#ENCODING_INVALID}.
*/
@UnstableApi
@C.Encoding
public static int getEncoding(String mimeType, @Nullable String codec) {
public static @C.Encoding int getEncoding(String mimeType, @Nullable String codec) {
switch (mimeType) {
case MimeTypes.AUDIO_MPEG:
return C.ENCODING_MP3;
@ -728,8 +727,7 @@ public final class MimeTypes {
}
/** Returns the encoding for {@link #audioObjectTypeIndication}. */
@C.Encoding
public int getEncoding() {
public @C.Encoding int getEncoding() {
// See AUDIO_OBJECT_TYPE_AAC_* constants in AacUtil.
switch (audioObjectTypeIndication) {
case 2:

View File

@ -77,7 +77,7 @@ public final class PercentageRating extends Rating {
// Bundleable implementation.
@RatingType private static final int TYPE = RATING_TYPE_PERCENTAGE;
private static final @RatingType int TYPE = RATING_TYPE_PERCENTAGE;
@Documented
@Retention(RetentionPolicy.SOURCE)

View File

@ -686,8 +686,7 @@ public interface Player {
@UnstableApi
public static final class Builder {
@Command
private static final int[] SUPPORTED_COMMANDS = {
private static final @Command int[] SUPPORTED_COMMANDS = {
COMMAND_PLAY_PAUSE,
COMMAND_PREPARE,
COMMAND_STOP,

View File

@ -103,7 +103,7 @@ public final class StarRating extends Rating {
// Bundleable implementation.
@RatingType private static final int TYPE = RATING_TYPE_STAR;
private static final @RatingType int TYPE = RATING_TYPE_STAR;
private static final int MAX_STARS_DEFAULT = 5;
@Documented

View File

@ -76,7 +76,7 @@ public final class ThumbRating extends Rating {
// Bundleable implementation.
@RatingType private static final int TYPE = RATING_TYPE_THUMB;
private static final @RatingType int TYPE = RATING_TYPE_THUMB;
@Documented
@Retention(RetentionPolicy.SOURCE)

View File

@ -207,8 +207,7 @@ public final class TrackGroup implements Bundleable {
return language == null || language.equals(C.LANGUAGE_UNDETERMINED) ? "" : language;
}
@C.RoleFlags
private static int normalizeRoleFlags(@C.RoleFlags int roleFlags) {
private static @C.RoleFlags int normalizeRoleFlags(@C.RoleFlags int roleFlags) {
// Treat trick-play and non-trick-play formats as compatible.
return roleFlags | C.ROLE_FLAG_TRICK_PLAY;
}

View File

@ -45,7 +45,7 @@ public final class TracksInfo implements Bundleable {
*/
public static final class TrackGroupInfo implements Bundleable {
private final TrackGroup trackGroup;
@C.FormatSupport private final int[] trackSupport;
private final @C.FormatSupport int[] trackSupport;
private final @C.TrackType int trackType;
private final boolean[] trackSelected;
@ -83,8 +83,7 @@ public final class TracksInfo implements Bundleable {
* @return The {@link C.FormatSupport} of the track.
*/
@UnstableApi
@C.FormatSupport
public int getTrackSupport(int trackIndex) {
public @C.FormatSupport int getTrackSupport(int trackIndex) {
return trackSupport[trackIndex];
}
@ -229,8 +228,7 @@ public final class TracksInfo implements Bundleable {
fromNullableBundle(
TrackGroup.CREATOR, bundle.getBundle(keyForField(FIELD_TRACK_GROUP)));
checkNotNull(trackGroup); // Can't create a trackGroup info without a trackGroup
@C.FormatSupport
final int[] trackSupport =
final @C.FormatSupport int[] trackSupport =
MoreObjects.firstNonNull(
bundle.getIntArray(keyForField(FIELD_TRACK_SUPPORT)), new int[trackGroup.length]);
@C.TrackType

View File

@ -569,7 +569,7 @@ public final class Cue implements Bundleable {
@Nullable private Alignment textAlignment;
@Nullable private Alignment multiRowAlignment;
private float line;
@LineType private int lineType;
private @LineType int lineType;
private @AnchorType int lineAnchor;
private float position;
private @AnchorType int positionAnchor;
@ -730,8 +730,7 @@ public final class Cue implements Bundleable {
* @see Cue#lineType
*/
@Pure
@LineType
public int getLineType() {
public @LineType int getLineType() {
return lineType;
}
@ -751,8 +750,7 @@ public final class Cue implements Bundleable {
* @see Cue#lineAnchor
*/
@Pure
@AnchorType
public int getLineAnchor() {
public @AnchorType int getLineAnchor() {
return lineAnchor;
}
@ -794,8 +792,7 @@ public final class Cue implements Bundleable {
* @see Cue#positionAnchor
*/
@Pure
@AnchorType
public int getPositionAnchor() {
public @AnchorType int getPositionAnchor() {
return positionAnchor;
}
@ -817,8 +814,7 @@ public final class Cue implements Bundleable {
* @see Cue#textSizeType
*/
@Pure
@TextSizeType
public int getTextSizeType() {
public @TextSizeType int getTextSizeType() {
return textSizeType;
}
@ -936,8 +932,7 @@ public final class Cue implements Bundleable {
* @see Cue#verticalType
*/
@Pure
@VerticalType
public int getVerticalType() {
public @VerticalType int getVerticalType() {
return verticalType;
}

View File

@ -39,7 +39,7 @@ public final class RubySpan implements LanguageFeatureSpan {
public final String rubyText;
/** The position of the ruby text relative to the base text. */
@TextAnnotation.Position public final int position;
public final @TextAnnotation.Position int position;
public RubySpan(String rubyText, @TextAnnotation.Position int position) {
this.rubyText = rubyText;

View File

@ -83,13 +83,13 @@ public final class TextEmphasisSpan implements LanguageFeatureSpan {
public static final int MARK_FILL_OPEN = 2;
/** The mark shape used for text emphasis. */
@MarkShape public int markShape;
public @MarkShape int markShape;
/** The mark fill for the text emphasis mark. */
@MarkShape public int markFill;
public @MarkShape int markFill;
/** The position of the text emphasis relative to the base text. */
@TextAnnotation.Position public final int position;
public final @TextAnnotation.Position int position;
public TextEmphasisSpan(
@MarkShape int shape, @MarkFill int fill, @TextAnnotation.Position int position) {

View File

@ -85,8 +85,7 @@ public final class NetworkTypeObserver {
private final Object networkTypeLock;
@GuardedBy("networkTypeLock")
@C.NetworkType
private int networkType;
private @C.NetworkType int networkType;
/**
* Returns a network type observer instance.
@ -132,8 +131,7 @@ public final class NetworkTypeObserver {
}
/** Returns the current network type. */
@C.NetworkType
public int getNetworkType() {
public @C.NetworkType int getNetworkType() {
synchronized (networkTypeLock) {
return networkType;
}
@ -164,8 +162,7 @@ public final class NetworkTypeObserver {
}
}
@C.NetworkType
private static int getNetworkTypeFromConnectivityManager(Context context) {
private static @C.NetworkType int getNetworkTypeFromConnectivityManager(Context context) {
NetworkInfo networkInfo;
@Nullable
ConnectivityManager connectivityManager =
@ -198,8 +195,7 @@ public final class NetworkTypeObserver {
}
}
@C.NetworkType
private static int getMobileNetworkType(NetworkInfo networkInfo) {
private static @C.NetworkType int getMobileNetworkType(NetworkInfo networkInfo) {
switch (networkInfo.getSubtype()) {
case TelephonyManager.NETWORK_TYPE_EDGE:
case TelephonyManager.NETWORK_TYPE_GPRS:

View File

@ -1560,8 +1560,7 @@ public final class Util {
* C#ENCODING_PCM_16BIT}, {@link C#ENCODING_PCM_24BIT} and {@link C#ENCODING_PCM_32BIT}. If
* the bit depth is unsupported then {@link C#ENCODING_INVALID} is returned.
*/
@C.PcmEncoding
public static int getPcmEncoding(int bitDepth) {
public static @C.PcmEncoding int getPcmEncoding(int bitDepth) {
switch (bitDepth) {
case 8:
return C.ENCODING_PCM_8BIT;
@ -1671,8 +1670,7 @@ public final class Util {
}
/** Returns the {@link C.AudioUsage} corresponding to the specified {@link C.StreamType}. */
@C.AudioUsage
public static int getAudioUsageForStreamType(@C.StreamType int streamType) {
public static @C.AudioUsage int getAudioUsageForStreamType(@C.StreamType int streamType) {
switch (streamType) {
case C.STREAM_TYPE_ALARM:
return C.USAGE_ALARM;
@ -1693,8 +1691,8 @@ public final class Util {
}
/** Returns the {@link C.AudioContentType} corresponding to the specified {@link C.StreamType}. */
@C.AudioContentType
public static int getAudioContentTypeForStreamType(@C.StreamType int streamType) {
public static @C.AudioContentType int getAudioContentTypeForStreamType(
@C.StreamType int streamType) {
switch (streamType) {
case C.STREAM_TYPE_ALARM:
case C.STREAM_TYPE_DTMF:
@ -1711,8 +1709,7 @@ public final class Util {
}
/** Returns the {@link C.StreamType} corresponding to the specified {@link C.AudioUsage}. */
@C.StreamType
public static int getStreamTypeForAudioUsage(@C.AudioUsage int usage) {
public static @C.StreamType int getStreamTypeForAudioUsage(@C.AudioUsage int usage) {
switch (usage) {
case C.USAGE_MEDIA:
case C.USAGE_GAME:
@ -1762,7 +1759,8 @@ public final class Util {
* "clearkey"}.
* @return The derived {@link UUID}, or {@code null} if one could not be derived.
*/
public static @Nullable UUID getDrmUuid(String drmScheme) {
@Nullable
public static UUID getDrmUuid(String drmScheme) {
switch (Ascii.toLowerCase(drmScheme)) {
case "widevine":
return C.WIDEVINE_UUID;
@ -1784,8 +1782,8 @@ public final class Util {
* MediaDrm.ErrorCodes} value. Returns {@link PlaybackException#ERROR_CODE_DRM_SYSTEM_ERROR} if
* the provided error code isn't recognised.
*/
@PlaybackException.ErrorCode
public static int getErrorCodeForMediaDrmErrorCode(int mediaDrmErrorCode) {
public static @PlaybackException.ErrorCode int getErrorCodeForMediaDrmErrorCode(
int mediaDrmErrorCode) {
switch (mediaDrmErrorCode) {
case MediaDrm.ErrorCodes.ERROR_PROVISIONING_CONFIG:
case MediaDrm.ErrorCodes.ERROR_PROVISIONING_PARSE:
@ -1821,8 +1819,7 @@ public final class Util {
* @param overrideExtension If not null, used to infer the type.
* @return The content type.
*/
@ContentType
public static int inferContentType(Uri uri, @Nullable String overrideExtension) {
public static @ContentType int inferContentType(Uri uri, @Nullable String overrideExtension) {
return TextUtils.isEmpty(overrideExtension)
? inferContentType(uri)
: inferContentType("." + overrideExtension);
@ -1834,8 +1831,7 @@ public final class Util {
* @param uri The {@link Uri}.
* @return The content type.
*/
@ContentType
public static int inferContentType(Uri uri) {
public static @ContentType int inferContentType(Uri uri) {
@Nullable String scheme = uri.getScheme();
if (scheme != null && Ascii.equalsIgnoreCase("rtsp", scheme)) {
return C.TYPE_RTSP;
@ -1851,8 +1847,7 @@ public final class Util {
* @param fileName Name of the file. It can include the path of the file.
* @return The content type.
*/
@ContentType
public static int inferContentType(String fileName) {
public static @ContentType int inferContentType(String fileName) {
fileName = Ascii.toLowerCase(fileName);
if (fileName.endsWith(".mpd")) {
return C.TYPE_DASH;
@ -1881,8 +1876,8 @@ public final class Util {
* @param mimeType If MIME type, or {@code null}.
* @return The content type.
*/
@ContentType
public static int inferContentTypeForUriAndMimeType(Uri uri, @Nullable String mimeType) {
public static @ContentType int inferContentTypeForUriAndMimeType(
Uri uri, @Nullable String mimeType) {
if (mimeType == null) {
return Util.inferContentType(uri);
}
@ -2032,7 +2027,8 @@ public final class Util {
* @return The original value of the file name before it was escaped, or null if the escaped
* fileName seems invalid.
*/
public static @Nullable String unescapeFileName(String fileName) {
@Nullable
public static String unescapeFileName(String fileName) {
int length = fileName.length();
int percentCharacterCount = 0;
for (int i = 0; i < length; i++) {

View File

@ -93,7 +93,8 @@ public final class XmlPullParserUtil {
* @return The value of the attribute, or null if the current event is not a start tag or if no
* such attribute was found.
*/
public static @Nullable String getAttributeValue(XmlPullParser xpp, String attributeName) {
@Nullable
public static String getAttributeValue(XmlPullParser xpp, String attributeName) {
int attributeCount = xpp.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
if (xpp.getAttributeName(i).equals(attributeName)) {
@ -112,8 +113,8 @@ public final class XmlPullParserUtil {
* @return The value of the attribute, or null if the current event is not a start tag or if no
* such attribute was found.
*/
public static @Nullable String getAttributeValueIgnorePrefix(
XmlPullParser xpp, String attributeName) {
@Nullable
public static String getAttributeValueIgnorePrefix(XmlPullParser xpp, String attributeName) {
int attributeCount = xpp.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
if (stripPrefix(xpp.getAttributeName(i)).equals(attributeName)) {

View File

@ -57,7 +57,7 @@ public class DataSourceException extends IOException {
* The reason of this {@link DataSourceException}, should be one of the {@code ERROR_CODE_IO_*} in
* {@link PlaybackException.ErrorCode}.
*/
@PlaybackException.ErrorCode public final int reason;
public final @PlaybackException.ErrorCode int reason;
/**
* Constructs a DataSourceException.

View File

@ -49,13 +49,13 @@ public final class DataSpec {
@Nullable private Uri uri;
private long uriPositionOffset;
@HttpMethod private int httpMethod;
private @HttpMethod int httpMethod;
@Nullable private byte[] httpBody;
private Map<String, String> httpRequestHeaders;
private long position;
private long length;
@Nullable private String key;
@Flags private int flags;
private @Flags int flags;
@Nullable private Object customData;
/** Creates a new instance with default values. */
@ -330,7 +330,7 @@ public final class DataSpec {
* The HTTP method to use when requesting the data. This value will be ignored by non-HTTP {@link
* DataSource} implementations.
*/
@HttpMethod public final int httpMethod;
public final @HttpMethod int httpMethod;
/**
* The HTTP request body, null otherwise. If the body is non-null, then {@code httpBody.length}
@ -382,7 +382,7 @@ public final class DataSpec {
@Nullable public final String key;
/** Request {@link Flags flags}. */
@Flags public final int flags;
public final @Flags int flags;
/**
* Application specific data.

View File

@ -233,7 +233,7 @@ public interface HttpDataSource extends DataSource {
/** The {@link DataSpec} associated with the current connection. */
public final DataSpec dataSpec;
@Type public final int type;
public final @Type int type;
/**
* @deprecated Use {@link #HttpDataSourceException(DataSpec, int, int)
@ -349,8 +349,8 @@ public interface HttpDataSource extends DataSource {
this.type = type;
}
@PlaybackException.ErrorCode
private static int assignErrorCode(@PlaybackException.ErrorCode int errorCode, @Type int type) {
private static @PlaybackException.ErrorCode int assignErrorCode(
@PlaybackException.ErrorCode int errorCode, @Type int type) {
return errorCode == PlaybackException.ERROR_CODE_IO_UNSPECIFIED && type == TYPE_OPEN
? PlaybackException.ERROR_CODE_IO_NETWORK_CONNECTION_FAILED
: errorCode;

View File

@ -72,7 +72,7 @@ public final class CacheDataSource implements DataSource {
@Nullable private DataSource.Factory upstreamDataSourceFactory;
@Nullable private PriorityTaskManager upstreamPriorityTaskManager;
private int upstreamPriority;
@CacheDataSource.Flags private int flags;
private @CacheDataSource.Flags int flags;
@Nullable private CacheDataSource.EventListener eventListener;
public Factory() {

View File

@ -22,7 +22,7 @@ import androidx.media3.common.util.UnstableApi;
@UnstableApi
public abstract class Buffer {
@C.BufferFlags private int flags;
private @C.BufferFlags int flags;
/** Clears the buffer. */
public void clear() {

View File

@ -48,7 +48,7 @@ public final class CryptoInfo {
*
* @see android.media.MediaCodec.CryptoInfo#mode
*/
@C.CryptoMode public int mode;
public @C.CryptoMode int mode;
/**
* The number of leading unencrypted bytes in each sub-sample. If null, all bytes are treated as
* encrypted and {@link #numBytesOfEncryptedData} must be specified.

View File

@ -111,7 +111,7 @@ public class DecoderInputBuffer extends Buffer {
*/
@Nullable public ByteBuffer supplementalData;
@BufferReplacementMode private final int bufferReplacementMode;
private final @BufferReplacementMode int bufferReplacementMode;
private final int paddingSize;
/** Returns a new instance that's not able to hold any data. */

View File

@ -34,7 +34,7 @@ public class VideoDecoderOutputBuffer extends DecoderOutputBuffer {
public int decoderPrivate;
/** Output mode. */
@C.VideoOutputMode public int mode;
public @C.VideoOutputMode int mode;
/** RGB buffer for RGB mode. */
@Nullable public ByteBuffer data;

View File

@ -41,7 +41,7 @@ public final class Gav1Decoder
private final long gav1DecoderContext;
@C.VideoOutputMode private volatile int outputMode;
private volatile @C.VideoOutputMode int outputMode;
/**
* Creates a Gav1Decoder.

View File

@ -128,8 +128,7 @@ public class Libgav1VideoRenderer extends DecoderVideoRenderer {
}
@Override
@Capabilities
public final int supportsFormat(Format format) {
public final @Capabilities int supportsFormat(Format format) {
if (!MimeTypes.VIDEO_AV1.equalsIgnoreCase(format.sampleMimeType)
|| !Gav1Library.isAvailable()) {
return RendererCapabilities.create(C.FORMAT_UNSUPPORTED_TYPE);

View File

@ -41,7 +41,7 @@ import java.util.List;
private final String codecName;
@Nullable private final byte[] extraData;
@C.PcmEncoding private final int encoding;
private final @C.PcmEncoding int encoding;
private final int outputBufferSize;
private long nativeContext; // May be reassigned on resetting the codec.
@ -158,8 +158,7 @@ import java.util.List;
}
/** Returns the encoding of output audio. */
@C.PcmEncoding
public int getEncoding() {
public @C.PcmEncoding int getEncoding() {
return encoding;
}

View File

@ -90,8 +90,7 @@ public final class FfmpegAudioRenderer extends DecoderAudioRenderer<FfmpegAudioD
}
@Override
@C.FormatSupport
protected int supportsFormatInternal(Format format) {
protected @C.FormatSupport int supportsFormatInternal(Format format) {
String mimeType = Assertions.checkNotNull(format.sampleMimeType);
if (!FfmpegLibrary.isAvailable() || !MimeTypes.isAudio(mimeType)) {
return C.FORMAT_UNSUPPORTED_TYPE;
@ -107,8 +106,7 @@ public final class FfmpegAudioRenderer extends DecoderAudioRenderer<FfmpegAudioD
}
@Override
@AdaptiveSupport
public final int supportsMixedMimeTypeAdaptation() {
public final @AdaptiveSupport int supportsMixedMimeTypeAdaptation() {
return ADAPTIVE_NOT_SEAMLESS;
}

View File

@ -73,8 +73,7 @@ public final class FfmpegVideoRenderer extends DecoderVideoRenderer {
}
@Override
@RendererCapabilities.Capabilities
public final int supportsFormat(Format format) {
public final @RendererCapabilities.Capabilities int supportsFormat(Format format) {
// TODO: Remove this line and uncomment the implementation below.
return C.FORMAT_UNSUPPORTED_TYPE;
/*

View File

@ -79,8 +79,7 @@ public final class LibflacAudioRenderer extends DecoderAudioRenderer<FlacDecoder
}
@Override
@C.FormatSupport
protected int supportsFormatInternal(Format format) {
protected @C.FormatSupport int supportsFormatInternal(Format format) {
if (!FlacLibrary.isAvailable()
|| !MimeTypes.AUDIO_FLAC.equalsIgnoreCase(format.sampleMimeType)) {
return C.FORMAT_UNSUPPORTED_TYPE;

View File

@ -80,8 +80,7 @@ public class LibopusAudioRenderer extends DecoderAudioRenderer<OpusDecoder> {
}
@Override
@C.FormatSupport
protected int supportsFormatInternal(Format format) {
protected @C.FormatSupport int supportsFormatInternal(Format format) {
boolean drmIsSupported = OpusLibrary.supportsCryptoType(format.cryptoType);
if (!OpusLibrary.isAvailable()
|| !MimeTypes.AUDIO_OPUS.equalsIgnoreCase(format.sampleMimeType)) {

View File

@ -126,8 +126,7 @@ public class LibvpxVideoRenderer extends DecoderVideoRenderer {
}
@Override
@Capabilities
public final int supportsFormat(Format format) {
public final @Capabilities int supportsFormat(Format format) {
if (!VpxLibrary.isAvailable() || !MimeTypes.VIDEO_VP9.equalsIgnoreCase(format.sampleMimeType)) {
return RendererCapabilities.create(C.FORMAT_UNSUPPORTED_TYPE);
}

View File

@ -49,7 +49,7 @@ public final class VpxDecoder
@Nullable private ByteBuffer lastSupplementalData;
@C.VideoOutputMode private volatile int outputMode;
private volatile @C.VideoOutputMode int outputMode;
/**
* Creates a VP9 decoder.

View File

@ -273,7 +273,7 @@ public class StreamVolumeManagerTest {
private static class TestListener implements StreamVolumeManager.Listener {
@C.StreamType private int lastStreamType;
private @C.StreamType int lastStreamType;
private int lastStreamVolume;
private boolean lastStreamVolumeMuted;
public final CountDownLatch onStreamVolumeChangedLatch;

View File

@ -139,7 +139,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
@Nullable private PlayerControl playerControl;
@Nullable private AudioAttributes audioAttributes;
@AudioFocusState private int audioFocusState;
private @AudioFocusState int audioFocusState;
private @AudioFocusGain int focusGainToRequest;
private float volumeMultiplier = VOLUME_MULTIPLIER_DEFAULT;
@ -193,8 +193,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
* @param playbackState The desired playback state.
* @return A {@link PlayerCommand} to execute on the player.
*/
@PlayerCommand
public int updateAudioFocus(boolean playWhenReady, @Player.State int playbackState) {
public @PlayerCommand int updateAudioFocus(
boolean playWhenReady, @Player.State int playbackState) {
if (shouldAbandonAudioFocusIfHeld(playbackState)) {
abandonAudioFocusIfHeld();
return playWhenReady ? PLAYER_COMMAND_PLAY_WHEN_READY : PLAYER_COMMAND_DO_NOT_PLAY;
@ -222,8 +222,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
return playbackState == Player.STATE_IDLE || focusGainToRequest != AUDIOFOCUS_GAIN;
}
@PlayerCommand
private int requestAudioFocus() {
private @PlayerCommand int requestAudioFocus() {
if (audioFocusState == AUDIO_FOCUS_STATE_HAVE_FOCUS) {
return PLAYER_COMMAND_PLAY_WHEN_READY;
}

View File

@ -200,8 +200,7 @@ public abstract class BaseRenderer implements Renderer, RendererCapabilities {
// RendererCapabilities implementation.
@Override
@AdaptiveSupport
public int supportsMixedMimeTypeAdaptation() throws ExoPlaybackException {
public @AdaptiveSupport int supportsMixedMimeTypeAdaptation() throws ExoPlaybackException {
return ADAPTIVE_NOT_SUPPORTED;
}
@ -424,8 +423,7 @@ public abstract class BaseRenderer implements Renderer, RendererCapabilities {
* the data of a sample being read. The buffer {@link DecoderInputBuffer#timeUs timestamp} and
* flags are populated if this exception is thrown, but the read position is not advanced.
*/
@ReadDataResult
protected final int readSource(
protected final @ReadDataResult int readSource(
FormatHolder formatHolder, DecoderInputBuffer buffer, @ReadFlags int readFlags) {
@ReadDataResult
int result = Assertions.checkNotNull(stream).readData(formatHolder, buffer, readFlags);

View File

@ -125,13 +125,13 @@ public final class DecoderReuseEvaluation {
public final Format newFormat;
/** The {@link DecoderReuseResult result} of the evaluation. */
@DecoderReuseResult public final int result;
public final @DecoderReuseResult int result;
/**
* {@link DecoderDiscardReasons Reasons} why the decoder cannot be reused. Always {@code 0} if
* reuse is possible. May also be {code 0} if reuse is not possible for an unspecified reason.
*/
@DecoderDiscardReasons public final int discardReasons;
public final @DecoderDiscardReasons int discardReasons;
/**
* @param decoderName The name of the decoder.

View File

@ -95,7 +95,7 @@ public class DefaultRenderersFactory implements RenderersFactory {
private final Context context;
private final DefaultMediaCodecAdapterFactory codecAdapterFactory;
@ExtensionRendererMode private int extensionRendererMode;
private @ExtensionRendererMode int extensionRendererMode;
private long allowedVideoJoiningTimeMs;
private boolean enableDecoderFallback;
private MediaCodecSelector mediaCodecSelector;

View File

@ -85,7 +85,7 @@ public final class ExoPlaybackException extends PlaybackException {
@UnstableApi public static final int TYPE_REMOTE = 3;
/** The {@link Type} of the playback failure. */
@UnstableApi @Type public final int type;
@UnstableApi public final @Type int type;
/** If {@link #type} is {@link #TYPE_RENDERER}, this is the name of the renderer. */
@UnstableApi @Nullable public final String rendererName;
@ -104,7 +104,7 @@ public final class ExoPlaybackException extends PlaybackException {
* renderer for {@link #rendererFormat}. If {@link #rendererFormat} is null, this is {@link
* C#FORMAT_HANDLED}.
*/
@UnstableApi @FormatSupport public final int rendererFormatSupport;
@UnstableApi public final @FormatSupport int rendererFormatSupport;
/** The {@link MediaPeriodId} of the media associated with this error, or null if undetermined. */
@UnstableApi @Nullable public final MediaPeriodId mediaPeriodId;

View File

@ -216,12 +216,12 @@ import java.util.concurrent.TimeoutException;
private final WifiLockManager wifiLockManager;
private final long detachSurfaceTimeoutMs;
@RepeatMode private int repeatMode;
private @RepeatMode int repeatMode;
private boolean shuffleModeEnabled;
private int pendingOperationAcks;
@DiscontinuityReason private int pendingDiscontinuityReason;
private @DiscontinuityReason int pendingDiscontinuityReason;
private boolean pendingDiscontinuity;
@PlayWhenReadyChangeReason private int pendingPlayWhenReadyChangeReason;
private @PlayWhenReadyChangeReason int pendingPlayWhenReadyChangeReason;
private boolean foregroundMode;
private SeekParameters seekParameters;
private ShuffleOrder shuffleOrder;
@ -238,8 +238,8 @@ import java.util.concurrent.TimeoutException;
@Nullable private SphericalGLSurfaceView sphericalGLSurfaceView;
private boolean surfaceHolderSurfaceIsVideoOutput;
@Nullable private TextureView textureView;
@C.VideoScalingMode private int videoScalingMode;
@C.VideoChangeFrameRateStrategy private int videoChangeFrameRateStrategy;
private @C.VideoScalingMode int videoScalingMode;
private @C.VideoChangeFrameRateStrategy int videoChangeFrameRateStrategy;
private int surfaceWidth;
private int surfaceHeight;
@Nullable private DecoderCounters videoDecoderCounters;
@ -515,14 +515,12 @@ import java.util.concurrent.TimeoutException;
return availableCommands;
}
@State
public int getPlaybackState() {
public @State int getPlaybackState() {
verifyApplicationThread();
return playbackInfo.playbackState;
}
@PlaybackSuppressionReason
public int getPlaybackSuppressionReason() {
public @PlaybackSuppressionReason int getPlaybackSuppressionReason() {
verifyApplicationThread();
return playbackInfo.playbackSuppressionReason;
}
@ -814,8 +812,7 @@ import java.util.concurrent.TimeoutException;
}
}
@RepeatMode
public int getRepeatMode() {
public @RepeatMode int getRepeatMode() {
verifyApplicationThread();
return repeatMode;
}
@ -1271,8 +1268,7 @@ import java.util.concurrent.TimeoutException;
sendRendererMessage(TRACK_TYPE_VIDEO, MSG_SET_SCALING_MODE, videoScalingMode);
}
@C.VideoScalingMode
public int getVideoScalingMode() {
public @C.VideoScalingMode int getVideoScalingMode() {
return videoScalingMode;
}
@ -1287,8 +1283,7 @@ import java.util.concurrent.TimeoutException;
TRACK_TYPE_VIDEO, MSG_SET_CHANGE_FRAME_RATE_STRATEGY, videoChangeFrameRateStrategy);
}
@C.VideoChangeFrameRateStrategy
public int getVideoChangeFrameRateStrategy() {
public @C.VideoChangeFrameRateStrategy int getVideoChangeFrameRateStrategy() {
return videoChangeFrameRateStrategy;
}
@ -2968,15 +2963,13 @@ import java.util.concurrent.TimeoutException;
private static final class FrameMetadataListener
implements VideoFrameMetadataListener, CameraMotionListener, PlayerMessage.Target {
@MessageType
public static final int MSG_SET_VIDEO_FRAME_METADATA_LISTENER =
public static final @MessageType int MSG_SET_VIDEO_FRAME_METADATA_LISTENER =
Renderer.MSG_SET_VIDEO_FRAME_METADATA_LISTENER;
@MessageType
public static final int MSG_SET_CAMERA_MOTION_LISTENER =
public static final @MessageType int MSG_SET_CAMERA_MOTION_LISTENER =
Renderer.MSG_SET_CAMERA_MOTION_LISTENER;
@MessageType public static final int MSG_SET_SPHERICAL_SURFACE_VIEW = Renderer.MSG_CUSTOM_BASE;
public static final @MessageType int MSG_SET_SPHERICAL_SURFACE_VIEW = Renderer.MSG_CUSTOM_BASE;
@Nullable private VideoFrameMetadataListener videoFrameMetadataListener;
@Nullable private CameraMotionListener cameraMotionListener;

View File

@ -93,9 +93,9 @@ import java.util.concurrent.atomic.AtomicBoolean;
public PlaybackInfo playbackInfo;
public int operationAcks;
public boolean positionDiscontinuity;
@DiscontinuityReason public int discontinuityReason;
public @DiscontinuityReason int discontinuityReason;
public boolean hasPlayWhenReadyChangeReason;
@PlayWhenReadyChangeReason public int playWhenReadyChangeReason;
public @PlayWhenReadyChangeReason int playWhenReadyChangeReason;
public PlaybackInfoUpdate(PlaybackInfo playbackInfo) {
this.playbackInfo = playbackInfo;
@ -216,7 +216,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
private boolean pendingPauseAtEndOfPeriod;
private boolean isRebuffering;
private boolean shouldContinueLoading;
@Player.RepeatMode private int repeatMode;
private @Player.RepeatMode int repeatMode;
private boolean shuffleModeEnabled;
private boolean foregroundMode;
private boolean requestForRendererSleep;
@ -2943,7 +2943,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
* @return The uid in the new timeline of the first subsequent period, or null if no such period
* was found.
*/
/* package */ static @Nullable Object resolveSubsequentPeriod(
/* package */ @Nullable
static Object resolveSubsequentPeriod(
Timeline.Window window,
Timeline.Period period,
@Player.RepeatMode int repeatMode,

View File

@ -62,7 +62,7 @@ public final class ExoTimeoutException extends RuntimeException {
public static final int TIMEOUT_OPERATION_DETACH_SURFACE = 3;
/** The operation on the ExoPlayer playback thread that timed out. */
@TimeoutOperation public final int timeoutOperation;
public final @TimeoutOperation int timeoutOperation;
/**
* Creates the timeout exception.

View File

@ -169,14 +169,12 @@ public abstract class NoSampleRenderer implements Renderer, RendererCapabilities
// RendererCapabilities implementation.
@Override
@Capabilities
public int supportsFormat(Format format) throws ExoPlaybackException {
public @Capabilities int supportsFormat(Format format) throws ExoPlaybackException {
return RendererCapabilities.create(C.FORMAT_UNSUPPORTED_TYPE);
}
@Override
@AdaptiveSupport
public int supportsMixedMimeTypeAdaptation() throws ExoPlaybackException {
public @AdaptiveSupport int supportsMixedMimeTypeAdaptation() throws ExoPlaybackException {
return ADAPTIVE_NOT_SUPPORTED;
}

View File

@ -55,7 +55,7 @@ import java.util.List;
/** The start position after a reported position discontinuity, in microseconds. */
public final long discontinuityStartPositionUs;
/** The current playback state. One of the {@link Player}.STATE_ constants. */
@Player.State public final int playbackState;
public final @Player.State int playbackState;
/** The current playback error, or null if this is not an error state. */
@Nullable public final ExoPlaybackException playbackError;
/** Whether the player is currently loading. */
@ -71,7 +71,7 @@ import java.util.List;
/** Whether playback should proceed when {@link #playbackState} == {@link Player#STATE_READY}. */
public final boolean playWhenReady;
/** Reason why playback is suppressed even though {@link #playWhenReady} is {@code true}. */
@PlaybackSuppressionReason public final int playbackSuppressionReason;
public final @PlaybackSuppressionReason int playbackSuppressionReason;
/** The playback parameters. */
public final PlaybackParameters playbackParameters;
/** Whether offload scheduling is enabled for the main player loop. */

View File

@ -191,8 +191,7 @@ public interface RendererCapabilities {
* @return The combined {@link Capabilities} of the given {@link C.FormatSupport}, {@link
* #ADAPTIVE_NOT_SUPPORTED} and {@link #TUNNELING_NOT_SUPPORTED}.
*/
@Capabilities
static int create(@C.FormatSupport int formatSupport) {
static @Capabilities int create(@C.FormatSupport int formatSupport) {
return create(formatSupport, ADAPTIVE_NOT_SUPPORTED, TUNNELING_NOT_SUPPORTED);
}
@ -208,8 +207,7 @@ public interface RendererCapabilities {
* @param tunnelingSupport The {@link TunnelingSupport}.
* @return The combined {@link Capabilities}.
*/
@Capabilities
static int create(
static @Capabilities int create(
@C.FormatSupport int formatSupport,
@AdaptiveSupport int adaptiveSupport,
@TunnelingSupport int tunnelingSupport) {
@ -235,8 +233,7 @@ public interface RendererCapabilities {
*/
// Suppression needed for IntDef casting.
@SuppressLint("WrongConstant")
@Capabilities
static int create(
static @Capabilities int create(
@C.FormatSupport int formatSupport,
@AdaptiveSupport int adaptiveSupport,
@TunnelingSupport int tunnelingSupport,
@ -257,8 +254,7 @@ public interface RendererCapabilities {
*/
// Suppression needed for IntDef casting.
@SuppressLint("WrongConstant")
@C.FormatSupport
static int getFormatSupport(@Capabilities int supportFlags) {
static @C.FormatSupport int getFormatSupport(@Capabilities int supportFlags) {
return supportFlags & FORMAT_SUPPORT_MASK;
}
@ -270,8 +266,7 @@ public interface RendererCapabilities {
*/
// Suppression needed for IntDef casting.
@SuppressLint("WrongConstant")
@AdaptiveSupport
static int getAdaptiveSupport(@Capabilities int supportFlags) {
static @AdaptiveSupport int getAdaptiveSupport(@Capabilities int supportFlags) {
return supportFlags & ADAPTIVE_SUPPORT_MASK;
}
@ -283,8 +278,7 @@ public interface RendererCapabilities {
*/
// Suppression needed for IntDef casting.
@SuppressLint("WrongConstant")
@TunnelingSupport
static int getTunnelingSupport(@Capabilities int supportFlags) {
static @TunnelingSupport int getTunnelingSupport(@Capabilities int supportFlags) {
return supportFlags & TUNNELING_SUPPORT_MASK;
}
@ -296,8 +290,8 @@ public interface RendererCapabilities {
*/
// Suppression needed for IntDef casting.
@SuppressLint("WrongConstant")
@HardwareAccelerationSupport
static int getHardwareAccelerationSupport(@Capabilities int supportFlags) {
static @HardwareAccelerationSupport int getHardwareAccelerationSupport(
@Capabilities int supportFlags) {
return supportFlags & HARDWARE_ACCELERATION_SUPPORT_MASK;
}
@ -309,8 +303,7 @@ public interface RendererCapabilities {
*/
// Suppression needed for IntDef casting.
@SuppressLint("WrongConstant")
@DecoderSupport
static int getDecoderSupport(@Capabilities int supportFlags) {
static @DecoderSupport int getDecoderSupport(@Capabilities int supportFlags) {
return supportFlags & MODE_SUPPORT_MASK;
}

View File

@ -408,8 +408,7 @@ public class SimpleExoPlayer extends BasePlayer
}
@Override
@C.VideoScalingMode
public int getVideoScalingMode() {
public @C.VideoScalingMode int getVideoScalingMode() {
blockUntilConstructorFinished();
return player.getVideoScalingMode();
}
@ -422,8 +421,7 @@ public class SimpleExoPlayer extends BasePlayer
}
@Override
@C.VideoChangeFrameRateStrategy
public int getVideoChangeFrameRateStrategy() {
public @C.VideoChangeFrameRateStrategy int getVideoChangeFrameRateStrategy() {
blockUntilConstructorFinished();
return player.getVideoChangeFrameRateStrategy();
}
@ -695,15 +693,13 @@ public class SimpleExoPlayer extends BasePlayer
}
@Override
@State
public int getPlaybackState() {
public @State int getPlaybackState() {
blockUntilConstructorFinished();
return player.getPlaybackState();
}
@Override
@PlaybackSuppressionReason
public int getPlaybackSuppressionReason() {
public @PlaybackSuppressionReason int getPlaybackSuppressionReason() {
blockUntilConstructorFinished();
return player.getPlaybackSuppressionReason();
}

View File

@ -55,7 +55,7 @@ import androidx.media3.common.util.Util;
private final AudioManager audioManager;
@Nullable private VolumeChangeReceiver receiver;
@C.StreamType private int streamType;
private @C.StreamType int streamType;
private int volume;
private boolean muted;

View File

@ -150,8 +150,7 @@ public interface AnalyticsListener {
* @param index The index. Must be between 0 (inclusive) and {@link #size()} (exclusive).
* @return The {@link EventFlags event} at the given index.
*/
@EventFlags
public int get(int index) {
public @EventFlags int get(int index) {
return flags.get(index);
}
}

View File

@ -120,7 +120,7 @@ public final class MediaMetricsListener
@Nullable private String activeSessionId;
@Nullable private PlaybackMetrics.Builder metricsBuilder;
@Player.DiscontinuityReason private int discontinuityReason;
private @Player.DiscontinuityReason int discontinuityReason;
private int currentPlaybackState;
private int currentNetworkType;
@Nullable private PlaybackException pendingPlayerError;
@ -887,7 +887,7 @@ public final class MediaMetricsListener
private static final class PendingFormatUpdate {
public final Format format;
@C.SelectionReason public final int selectionReason;
public final @C.SelectionReason int selectionReason;
public final String sessionId;
public PendingFormatUpdate(

View File

@ -84,7 +84,7 @@ public final class PlaybackStatsListener
@Nullable private String discontinuityFromSession;
private long discontinuityFromPositionMs;
@Player.DiscontinuityReason private int discontinuityReason;
private @Player.DiscontinuityReason int discontinuityReason;
private int droppedFrames;
@Nullable private Exception nonFatalException;
private long bandwidthTimeMs;

View File

@ -45,7 +45,7 @@ public interface AudioProcessor {
/** The number of interleaved channels. */
public final int channelCount;
/** The type of linear PCM encoding. */
@C.PcmEncoding public final int encoding;
public final @C.PcmEncoding int encoding;
/** The number of bytes used to represent one audio frame. */
public final int bytesPerFrame;

View File

@ -138,7 +138,7 @@ public abstract class DecoderAudioRenderer<
@Nullable private DrmSession decoderDrmSession;
@Nullable private DrmSession sourceDrmSession;
@ReinitializationState private int decoderReinitializationState;
private @ReinitializationState int decoderReinitializationState;
private boolean decoderReceivedBuffers;
private boolean audioTrackNeedsConfigure;
@ -228,8 +228,7 @@ public abstract class DecoderAudioRenderer<
}
@Override
@Capabilities
public final int supportsFormat(Format format) {
public final @Capabilities int supportsFormat(Format format) {
if (!MimeTypes.isAudio(format.sampleMimeType)) {
return RendererCapabilities.create(C.FORMAT_UNSUPPORTED_TYPE);
}
@ -248,8 +247,7 @@ public abstract class DecoderAudioRenderer<
* @param format The format, which has an audio {@link Format#sampleMimeType}.
* @return The {@link C.FormatSupport} for this {@link Format}.
*/
@C.FormatSupport
protected abstract int supportsFormatInternal(Format format);
protected abstract @C.FormatSupport int supportsFormatInternal(Format format);
/**
* Returns whether the renderer's {@link AudioSink} supports a given {@link Format}.
@ -266,8 +264,7 @@ public abstract class DecoderAudioRenderer<
*
* @see AudioSink#getFormatSupport(Format) (Format)
*/
@SinkFormatSupport
protected final int getSinkFormatSupport(Format format) {
protected final @SinkFormatSupport int getSinkFormatSupport(Format format) {
return audioSink.getFormatSupport(format);
}

View File

@ -482,8 +482,8 @@ public final class DefaultAudioSink implements AudioSink {
private final AudioTrackPositionTracker audioTrackPositionTracker;
private final ArrayDeque<MediaPositionParameters> mediaPositionParametersCheckpoints;
private final boolean enableAudioTrackPlaybackParams;
@OffloadMode private final int offloadMode;
@MonotonicNonNull private StreamEventCallbackV29 offloadStreamEventCallbackV29;
private final @OffloadMode int offloadMode;
private @MonotonicNonNull StreamEventCallbackV29 offloadStreamEventCallbackV29;
private final PendingExceptionHolder<InitializationException>
initializationExceptionPendingExceptionHolder;
private final PendingExceptionHolder<WriteException> writeExceptionPendingExceptionHolder;
@ -492,7 +492,7 @@ public final class DefaultAudioSink implements AudioSink {
@Nullable private PlayerId playerId;
@Nullable private Listener listener;
@Nullable private Configuration pendingConfiguration;
@MonotonicNonNull private Configuration configuration;
private @MonotonicNonNull Configuration configuration;
@Nullable private AudioTrack audioTrack;
private AudioAttributes audioAttributes;
@ -518,7 +518,7 @@ public final class DefaultAudioSink implements AudioSink {
@Nullable private ByteBuffer inputBuffer;
private int inputBufferAccessUnitCount;
@Nullable private ByteBuffer outputBuffer;
@MonotonicNonNull private byte[] preV21OutputBuffer;
private @MonotonicNonNull byte[] preV21OutputBuffer;
private int preV21OutputBufferOffset;
private int drainingAudioProcessorIndex;
private boolean handledEndOfStream;
@ -661,8 +661,7 @@ public final class DefaultAudioSink implements AudioSink {
}
@Override
@SinkFormatSupport
public int getFormatSupport(Format format) {
public @SinkFormatSupport int getFormatSupport(Format format) {
if (MimeTypes.AUDIO_RAW.equals(format.sampleMimeType)) {
if (!Util.isEncodingLinearPcm(format.pcmEncoding)) {
Log.w(TAG, "Invalid PCM encoding: " + format.pcmEncoding);
@ -2136,11 +2135,11 @@ public final class DefaultAudioSink implements AudioSink {
public final Format inputFormat;
public final int inputPcmFrameSize;
@OutputMode public final int outputMode;
public final @OutputMode int outputMode;
public final int outputPcmFrameSize;
public final int outputSampleRate;
public final int outputChannelConfig;
@C.Encoding public final int outputEncoding;
public final @C.Encoding int outputEncoding;
public final int bufferSize;
public final AudioProcessor[] availableAudioProcessors;

View File

@ -50,8 +50,7 @@ public class ForwardingAudioSink implements AudioSink {
}
@Override
@SinkFormatSupport
public int getFormatSupport(Format format) {
public @SinkFormatSupport int getFormatSupport(Format format) {
return sink.getFormatSupport(format);
}

View File

@ -286,8 +286,7 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
}
@Override
@Capabilities
protected int supportsFormat(MediaCodecSelector mediaCodecSelector, Format format)
protected @Capabilities int supportsFormat(MediaCodecSelector mediaCodecSelector, Format format)
throws DecoderQueryException {
if (!MimeTypes.isAudio(format.sampleMimeType)) {
return RendererCapabilities.create(C.FORMAT_UNSUPPORTED_TYPE);

View File

@ -88,7 +88,7 @@ public final class SilenceSkippingAudioProcessor extends BaseAudioProcessor {
*/
private byte[] paddingBuffer;
@State private int state;
private @State int state;
private int maybeSilenceBufferSize;
private int paddingSize;
private boolean hasOutputNoise;

View File

@ -129,8 +129,7 @@ import java.util.concurrent.Executor;
}
/** Delegates to Spatializer.getImmersiveAudioLevel() */
@ImmersiveAudioLevel
public int getImmersiveAudioLevel() {
public @ImmersiveAudioLevel int getImmersiveAudioLevel() {
try {
return (int) Util.castNonNull(getImmersiveAudioLevel.invoke(spatializer));
} catch (IllegalAccessException | InvocationTargetException e) {

View File

@ -128,7 +128,7 @@ public final class TeeAudioProcessor extends BaseAudioProcessor {
private int sampleRateHz;
private int channelCount;
@C.PcmEncoding private int encoding;
private @C.PcmEncoding int encoding;
@Nullable private RandomAccessFile randomAccessFile;
private int counter;
private int bytesWritten;

View File

@ -25,7 +25,7 @@ import java.nio.ByteBuffer;
/** Audio processor for trimming samples from the start/end of data. */
/* package */ final class TrimmingAudioProcessor extends BaseAudioProcessor {
@C.PcmEncoding private static final int OUTPUT_ENCODING = C.ENCODING_PCM_16BIT;
private static final @C.PcmEncoding int OUTPUT_ENCODING = C.ENCODING_PCM_16BIT;
private int trimStartFrames;
private int trimEndFrames;

View File

@ -254,8 +254,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
// DrmSession implementation.
@Override
@DrmSession.State
public final int getState() {
public final @DrmSession.State int getState() {
return state;
}

View File

@ -312,7 +312,7 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
@Nullable private byte[] offlineLicenseKeySetId;
private @MonotonicNonNull PlayerId playerId;
/* package */ volatile @Nullable MediaDrmHandler mediaDrmHandler;
/* package */ @Nullable volatile MediaDrmHandler mediaDrmHandler;
/**
* @param uuid The UUID of the drm scheme.
@ -590,8 +590,7 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
}
@Override
@C.CryptoType
public int getCryptoType(Format format) {
public @C.CryptoType int getCryptoType(Format format) {
@C.CryptoType int cryptoType = checkNotNull(exoMediaDrm).getCryptoType();
if (format.drmInitData == null) {
int trackType = MimeTypes.getTrackType(format.sampleMimeType);

View File

@ -65,7 +65,7 @@ public interface DrmSession {
class DrmSessionException extends IOException {
/** The {@link PlaybackException.ErrorCode} that corresponds to the failure. */
@PlaybackException.ErrorCode public final int errorCode;
public final @PlaybackException.ErrorCode int errorCode;
public DrmSessionException(Throwable cause, @PlaybackException.ErrorCode int errorCode) {
super(cause);

View File

@ -66,8 +66,7 @@ public interface DrmSessionManager {
}
@Override
@C.CryptoType
public int getCryptoType(Format format) {
public @C.CryptoType int getCryptoType(Format format) {
return format.drmInitData != null ? C.CRYPTO_TYPE_UNSUPPORTED : C.CRYPTO_TYPE_NONE;
}
};

View File

@ -72,8 +72,7 @@ public final class DrmUtil {
* @return The {@link PlaybackException.ErrorCode} that corresponds to the given DRM-related
* exception.
*/
@PlaybackException.ErrorCode
public static int getErrorCodeForMediaDrmException(
public static @PlaybackException.ErrorCode int getErrorCodeForMediaDrmException(
Exception exception, @ErrorSource int errorSource) {
if (Util.SDK_INT >= 21 && Api21.isMediaDrmStateException(exception)) {
return Api21.mediaDrmStateExceptionToErrorCode(exception);
@ -128,8 +127,8 @@ public final class DrmUtil {
}
@DoNotInline
@PlaybackException.ErrorCode
public static int mediaDrmStateExceptionToErrorCode(Throwable throwable) {
public static @PlaybackException.ErrorCode int mediaDrmStateExceptionToErrorCode(
Throwable throwable) {
@Nullable
String diagnosticsInfo = ((MediaDrm.MediaDrmStateException) throwable).getDiagnosticInfo();
int drmErrorCode = Util.getErrorCodeFromPlatformDiagnosticsInfo(diagnosticsInfo);

View File

@ -153,8 +153,7 @@ public final class DummyExoMediaDrm implements ExoMediaDrm {
}
@Override
@C.CryptoType
public int getCryptoType() {
public @C.CryptoType int getCryptoType() {
return C.CRYPTO_TYPE_UNSUPPORTED;
}
}

View File

@ -267,7 +267,7 @@ public interface ExoMediaDrm {
private final byte[] data;
private final String licenseServerUrl;
@RequestType private final int requestType;
private final @RequestType int requestType;
/**
* Creates an instance with {@link #REQUEST_TYPE_UNKNOWN}.
@ -307,8 +307,7 @@ public interface ExoMediaDrm {
* request does not specify a type. Note that when using a platform {@link MediaDrm} instance,
* key requests only specify a type on API levels 23 and above.
*/
@RequestType
public int getRequestType() {
public @RequestType int getRequestType() {
return requestType;
}
}

View File

@ -342,8 +342,7 @@ public final class FrameworkMediaDrm implements ExoMediaDrm {
}
@Override
@C.CryptoType
public int getCryptoType() {
public @C.CryptoType int getCryptoType() {
return C.CRYPTO_TYPE_FRAMEWORK;
}

View File

@ -49,7 +49,7 @@ public final class UnsupportedDrmException extends Exception {
public static final int REASON_INSTANTIATION_ERROR = 2;
/** Either {@link #REASON_UNSUPPORTED_SCHEME} or {@link #REASON_INSTANTIATION_ERROR}. */
@Reason public final int reason;
public final @Reason int reason;
/** @param reason {@link #REASON_UNSUPPORTED_SCHEME} or {@link #REASON_INSTANTIATION_ERROR}. */
public UnsupportedDrmException(@Reason int reason) {

View File

@ -39,7 +39,8 @@ public final class WidevineUtil {
* @return A {@link Pair} consisting of the remaining license and playback durations in seconds,
* or null if called before the session has been opened or after it's been released.
*/
public static @Nullable Pair<Long, Long> getLicenseDurationRemainingSec(DrmSession drmSession) {
@Nullable
public static Pair<Long, Long> getLicenseDurationRemainingSec(DrmSession drmSession) {
Map<String, String> keyStatus = drmSession.queryKeyStatus();
if (keyStatus == null) {
return null;

View File

@ -141,7 +141,7 @@ import java.nio.ByteBuffer;
private final boolean synchronizeCodecInteractionsWithQueueing;
private final boolean enableImmediateCodecStartAfterFlush;
private boolean codecReleased;
@State private int state;
private @State int state;
private AsynchronousMediaCodecAdapter(
MediaCodec codec,

View File

@ -53,7 +53,7 @@ public final class DefaultMediaCodecAdapterFactory implements MediaCodecAdapter.
private static final String TAG = "DMCodecAdapterFactory";
@Mode private int asynchronousMode;
private @Mode int asynchronousMode;
private boolean enableSynchronizeCodecInteractionsWithQueueing;
private boolean enableImmediateCodecStartAfterFlush;

View File

@ -327,7 +327,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
@Nullable private ArrayDeque<MediaCodecInfo> availableCodecInfos;
@Nullable private DecoderInitializationException preferredDecoderInitializationException;
@Nullable private MediaCodecInfo codecInfo;
@AdaptationWorkaroundMode private int codecAdaptationWorkaroundMode;
private @AdaptationWorkaroundMode int codecAdaptationWorkaroundMode;
private boolean codecNeedsDiscardToSpsWorkaround;
private boolean codecNeedsFlushWorkaround;
private boolean codecNeedsSosFlushWorkaround;
@ -349,9 +349,9 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
private boolean bypassSampleBufferPending;
private boolean bypassDrainAndReinitialize;
private boolean codecReconfigured;
@ReconfigurationState private int codecReconfigurationState;
@DrainState private int codecDrainState;
@DrainAction private int codecDrainAction;
private @ReconfigurationState int codecReconfigurationState;
private @DrainState int codecDrainState;
private @DrainAction int codecDrainAction;
private boolean codecReceivedBuffers;
private boolean codecReceivedEos;
private boolean codecHasOutputMediaFormat;
@ -437,14 +437,12 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
}
@Override
@AdaptiveSupport
public final int supportsMixedMimeTypeAdaptation() {
public final @AdaptiveSupport int supportsMixedMimeTypeAdaptation() {
return ADAPTIVE_NOT_SEAMLESS;
}
@Override
@Capabilities
public final int supportsFormat(Format format) throws ExoPlaybackException {
public final @Capabilities int supportsFormat(Format format) throws ExoPlaybackException {
try {
return supportsFormat(mediaCodecSelector, format);
} catch (DecoderQueryException e) {
@ -460,9 +458,8 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
* @return The {@link Capabilities} for this {@link Format}.
* @throws DecoderQueryException If there was an error querying decoders.
*/
@Capabilities
protected abstract int supportsFormat(MediaCodecSelector mediaCodecSelector, Format format)
throws DecoderQueryException;
protected abstract @Capabilities int supportsFormat(
MediaCodecSelector mediaCodecSelector, Format format) throws DecoderQueryException;
/**
* Returns a list of decoders that can decode media in the specified format, in priority order.

View File

@ -94,8 +94,7 @@ public final class MetadataRenderer extends BaseRenderer implements Callback {
}
@Override
@Capabilities
public int supportsFormat(Format format) {
public @Capabilities int supportsFormat(Format format) {
if (decoderFactory.supportsFormat(format)) {
return RendererCapabilities.create(
format.cryptoType == C.CRYPTO_TYPE_NONE ? C.FORMAT_HANDLED : C.FORMAT_UNSUPPORTED_DRM);

View File

@ -99,7 +99,7 @@ public final class Download {
/** The download request. */
public final DownloadRequest request;
/** The state of the download. */
@State public final int state;
public final @State int state;
/** The first time when download entry is created. */
public final long startTimeMs;
/** The last update time. */
@ -112,7 +112,7 @@ public final class Download {
* If {@link #state} is {@link #STATE_FAILED} then this is the cause, otherwise {@link
* #FAILURE_REASON_NONE}.
*/
@FailureReason public final int failureReason;
public final @FailureReason int failureReason;
/* package */ final DownloadProgress progress;

View File

@ -1100,8 +1100,7 @@ public final class DownloadHelper {
}
@Override
@C.SelectionReason
public int getSelectionReason() {
public @C.SelectionReason int getSelectionReason() {
return C.SELECTION_REASON_UNKNOWN;
}

View File

@ -351,8 +351,7 @@ public final class DownloadManager {
*
* @return The not met {@link Requirements.RequirementFlags}, or 0 if all requirements are met.
*/
@Requirements.RequirementFlags
public int getNotMetRequirements() {
public @Requirements.RequirementFlags int getNotMetRequirements() {
return notMetRequirements;
}
@ -705,7 +704,7 @@ public final class DownloadManager {
private final ArrayList<Download> downloads;
private final HashMap<String, Task> activeTasks;
@Requirements.RequirementFlags private int notMetRequirements;
private @Requirements.RequirementFlags int notMetRequirements;
private boolean downloadsPaused;
private int maxParallelDownloads;
private int minRetryCount;

View File

@ -74,7 +74,7 @@ public final class Requirements implements Parcelable {
*/
public static final int DEVICE_STORAGE_NOT_LOW = 1 << 4;
@RequirementFlags private final int requirements;
private final @RequirementFlags int requirements;
/** @param requirements A combination of requirement flags. */
public Requirements(@RequirementFlags int requirements) {
@ -86,8 +86,7 @@ public final class Requirements implements Parcelable {
}
/** Returns the requirements. */
@RequirementFlags
public int getRequirements() {
public @RequirementFlags int getRequirements() {
return requirements;
}
@ -144,8 +143,7 @@ public final class Requirements implements Parcelable {
* @param context Any context.
* @return The requirements that are not met, or 0.
*/
@RequirementFlags
public int getNotMetRequirements(Context context) {
public @RequirementFlags int getNotMetRequirements(Context context) {
@RequirementFlags int notMetRequirements = getNotMetNetworkRequirements(context);
if (isChargingRequired() && !isDeviceCharging(context)) {
notMetRequirements |= DEVICE_CHARGING;
@ -159,8 +157,7 @@ public final class Requirements implements Parcelable {
return notMetRequirements;
}
@RequirementFlags
private int getNotMetNetworkRequirements(Context context) {
private @RequirementFlags int getNotMetNetworkRequirements(Context context) {
if (!isNetworkRequired()) {
return 0;
}

View File

@ -62,7 +62,7 @@ public final class RequirementsWatcher {
@Nullable private DeviceStatusChangeReceiver receiver;
@Requirements.RequirementFlags private int notMetRequirements;
private @Requirements.RequirementFlags int notMetRequirements;
@Nullable private NetworkCallback networkCallback;
/**
@ -83,8 +83,7 @@ public final class RequirementsWatcher {
*
* @return Initial {@link Requirements.RequirementFlags RequirementFlags} that are not met, or 0.
*/
@Requirements.RequirementFlags
public int start() {
public @Requirements.RequirementFlags int start() {
notMetRequirements = requirements.getNotMetRequirements(context);
IntentFilter filter = new IntentFilter();

View File

@ -63,7 +63,7 @@ public final class ClippingMediaSource extends CompositeMediaSource<Void> {
public static final int REASON_START_EXCEEDS_END = 2;
/** The reason clipping failed. */
@Reason public final int reason;
public final @Reason int reason;
/** @param reason The reason clipping failed. */
public IllegalClippingException(@Reason int reason) {

View File

@ -472,8 +472,7 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory {
mediaSourceFactories = new HashMap<>();
}
@C.ContentType
public int[] getSupportedTypes() {
public @C.ContentType int[] getSupportedTypes() {
ensureAllSuppliersAreLoaded();
return Ints.toArray(supportedTypes);
}

View File

@ -28,7 +28,7 @@ import androidx.media3.common.util.UnstableApi;
public final class MediaLoadData {
/** The {@link DataType data type}. */
@DataType public final int dataType;
public final @DataType int dataType;
/**
* One of the {@link TrackType track types}, which is a media track type if the data corresponds
* to media of a specific type, or {@link C#TRACK_TYPE_UNKNOWN} otherwise.

View File

@ -47,8 +47,7 @@ public interface MediaSourceFactory extends MediaSource.Factory {
}
@Override
@C.ContentType
public int[] getSupportedTypes() {
public @C.ContentType int[] getSupportedTypes() {
throw new UnsupportedOperationException();
}

View File

@ -61,7 +61,7 @@ public final class MergingMediaSource extends CompositeMediaSource<Integer> {
public static final int REASON_PERIOD_COUNT_MISMATCH = 0;
/** The reason the merge failed. */
@Reason public final int reason;
public final @Reason int reason;
/** @param reason The reason the merge failed. */
public IllegalMergeException(@Reason int reason) {

View File

@ -131,7 +131,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
private @MonotonicNonNull SeekMap seekMap;
private long durationUs;
private boolean isLive;
@DataType private int dataType;
private @DataType int dataType;
private boolean seenFirstTrackSelection;
private boolean notifyDiscontinuity;

View File

@ -87,7 +87,7 @@ public final class SilenceMediaSource extends BaseMediaSource {
public static final String MEDIA_ID = "SilenceMediaSource";
private static final int SAMPLE_RATE_HZ = 44100;
@C.PcmEncoding private static final int PCM_ENCODING = C.ENCODING_PCM_16BIT;
private static final @C.PcmEncoding int PCM_ENCODING = C.ENCODING_PCM_16BIT;
private static final int CHANNEL_COUNT = 2;
private static final Format FORMAT =
new Format.Builder()

View File

@ -847,8 +847,7 @@ public final class ServerSideAdInsertionMediaSource extends BaseMediaSource
return positionUs;
}
@SampleStream.ReadDataResult
public int readData(
public @SampleStream.ReadDataResult int readData(
MediaPeriodImpl mediaPeriod,
int streamIndex,
FormatHolder formatHolder,
@ -1204,8 +1203,7 @@ public final class ServerSideAdInsertionMediaSource extends BaseMediaSource
}
@Override
@ReadDataResult
public int readData(
public @ReadDataResult int readData(
FormatHolder formatHolder, DecoderInputBuffer buffer, @ReadFlags int readFlags) {
return mediaPeriod.sharedPeriod.readData(
mediaPeriod, streamIndex, formatHolder, buffer, readFlags);

View File

@ -42,7 +42,7 @@ public abstract class Chunk implements Loadable {
/** The {@link DataSpec} that defines the data to be loaded. */
public final DataSpec dataSpec;
/** The {@link DataType data type} of the chunk. For reporting only. */
@DataType public final int type;
public final @DataType int type;
/** The format of the track to which this chunk belongs. */
public final Format trackFormat;
/**
@ -50,7 +50,7 @@ public abstract class Chunk implements Loadable {
* C#SELECTION_REASON_UNKNOWN} if the chunk does not belong to a track, or if the selection reason
* is unknown.
*/
@C.SelectionReason public final int trackSelectionReason;
public final @C.SelectionReason int trackSelectionReason;
/**
* Optional data associated with the selection of the track to which this chunk belongs. Null if
* the chunk does not belong to a track, or if there is no associated track selection data.

View File

@ -540,8 +540,7 @@ public final class OutputConsumerAdapterV30 implements MediaParser.OutputConsume
return new DrmInitData(schemeType, schemeDatas);
}
@SelectionFlags
private static int getSelectionFlags(MediaFormat mediaFormat) {
private static @SelectionFlags int getSelectionFlags(MediaFormat mediaFormat) {
int selectionFlags = 0;
selectionFlags |=
getFlag(

View File

@ -63,7 +63,7 @@ public final class ExoplayerCuesDecoder implements SubtitleDecoder {
private final SubtitleInputBuffer inputBuffer;
private final Deque<SubtitleOutputBuffer> availableOutputBuffers;
@InputBufferState private int inputBufferState;
private @InputBufferState int inputBufferState;
private boolean released;
public ExoplayerCuesDecoder() {

View File

@ -94,7 +94,7 @@ public final class TextRenderer extends BaseRenderer implements Callback {
private boolean inputStreamEnded;
private boolean outputStreamEnded;
private boolean waitingForKeyFrame;
@ReplacementState private int decoderReplacementState;
private @ReplacementState int decoderReplacementState;
@Nullable private Format streamFormat;
@Nullable private SubtitleDecoder decoder;
@Nullable private SubtitleInputBuffer nextInputBuffer;
@ -141,8 +141,7 @@ public final class TextRenderer extends BaseRenderer implements Callback {
}
@Override
@Capabilities
public int supportsFormat(Format format) {
public @Capabilities int supportsFormat(Format format) {
if (decoderFactory.supportsFormat(format)) {
return RendererCapabilities.create(
format.cryptoType == C.CRYPTO_TYPE_NONE ? C.FORMAT_HANDLED : C.FORMAT_UNSUPPORTED_DRM);

View File

@ -123,7 +123,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
private boolean allowAudioMixedChannelCountAdaptiveness;
private boolean allowAudioMixedDecoderSupportAdaptiveness;
// Text
@C.SelectionFlags private int disabledTextTrackSelectionFlags;
private @C.SelectionFlags int disabledTextTrackSelectionFlags;
// General
private boolean exceedRendererCapabilitiesIfNecessary;
private boolean tunnelingEnabled;
@ -894,7 +894,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
* Bitmask of selection flags that are disabled for text track selections. See {@link
* C.SelectionFlags}. The default value is {@code 0} (i.e. no flags).
*/
@C.SelectionFlags public final int disabledTextTrackSelectionFlags;
public final @C.SelectionFlags int disabledTextTrackSelectionFlags;
/** Returns an instance configured with default values. */
public static Parameters getDefaults(Context context) {
@ -2255,8 +2255,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
}
/** Returns to what extent the track is {@link SelectionEligibility eligible for selection}. */
@SelectionEligibility
public abstract int getSelectionEligibility();
public abstract @SelectionEligibility int getSelectionEligibility();
/**
* Returns whether this track is compatible for an adaptive selection with the specified other
@ -2308,7 +2307,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
private final int preferredRoleFlagsScore;
private final boolean hasMainOrNoRoleFlag;
private final boolean allowMixedMimeTypes;
@SelectionEligibility private final int selectionEligibility;
private final @SelectionEligibility int selectionEligibility;
private final boolean usesPrimaryDecoder;
private final boolean usesHardwareAcceleration;
private final int codecPreferenceScore;
@ -2375,8 +2374,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
}
@Override
@SelectionEligibility
public int getSelectionEligibility() {
public @SelectionEligibility int getSelectionEligibility() {
return selectionEligibility;
}
@ -2389,8 +2387,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
&& this.usesHardwareAcceleration == otherTrack.usesHardwareAcceleration));
}
@SelectionEligibility
private int evaluateSelectionEligibility(
private @SelectionEligibility int evaluateSelectionEligibility(
@Capabilities int rendererSupport, @AdaptiveSupport int requiredAdaptiveSupport) {
if ((format.roleFlags & C.ROLE_FLAG_TRICK_PLAY) != 0) {
// Ignore trick-play tracks for now.
@ -2502,7 +2499,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
return listBuilder.build();
}
@SelectionEligibility private final int selectionEligibility;
private final @SelectionEligibility int selectionEligibility;
private final boolean isWithinConstraints;
@Nullable private final String language;
private final Parameters parameters;
@ -2594,8 +2591,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
}
@Override
@SelectionEligibility
public int getSelectionEligibility() {
public @SelectionEligibility int getSelectionEligibility() {
return selectionEligibility;
}
@ -2664,8 +2660,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
.result();
}
@SelectionEligibility
private int evaluateSelectionEligibility(
private @SelectionEligibility int evaluateSelectionEligibility(
@Capabilities int rendererSupport, boolean hasMappedVideoTracks) {
if (!isSupported(rendererSupport, parameters.exceedRendererCapabilitiesIfNecessary)) {
return SELECTION_ELIGIBILITY_NO;
@ -2712,7 +2707,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
return listBuilder.build();
}
@SelectionEligibility private final int selectionEligibility;
private final @SelectionEligibility int selectionEligibility;
private final boolean isWithinRendererCapabilities;
private final boolean isDefault;
private final boolean isForced;
@ -2777,8 +2772,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
}
@Override
@SelectionEligibility
public int getSelectionEligibility() {
public @SelectionEligibility int getSelectionEligibility() {
return selectionEligibility;
}

View File

@ -107,8 +107,8 @@ public abstract class MappingTrackSelector extends TrackSelector {
private final String[] rendererNames;
private final @C.TrackType int[] rendererTrackTypes;
private final TrackGroupArray[] rendererTrackGroups;
@AdaptiveSupport private final int[] rendererMixedMimeTypeAdaptiveSupports;
@Capabilities private final int[][][] rendererFormatSupports;
private final @AdaptiveSupport int[] rendererMixedMimeTypeAdaptiveSupports;
private final @Capabilities int[][][] rendererFormatSupports;
private final TrackGroupArray unmappedTrackGroups;
/**
@ -181,8 +181,7 @@ public abstract class MappingTrackSelector extends TrackSelector {
* @param rendererIndex The renderer index.
* @return The {@link RendererSupport}.
*/
@RendererSupport
public int getRendererSupport(int rendererIndex) {
public @RendererSupport int getRendererSupport(int rendererIndex) {
@RendererSupport int bestRendererSupport = RENDERER_SUPPORT_NO_TRACKS;
@Capabilities int[][] rendererFormatSupport = rendererFormatSupports[rendererIndex];
for (@Capabilities int[] trackGroupFormatSupport : rendererFormatSupport) {
@ -217,8 +216,7 @@ public abstract class MappingTrackSelector extends TrackSelector {
* @param trackType The {@link C.TrackType track type}.
* @return The {@link RendererSupport}.
*/
@RendererSupport
public int getTypeSupport(@C.TrackType int trackType) {
public @RendererSupport int getTypeSupport(@C.TrackType int trackType) {
@RendererSupport int bestRendererSupport = RENDERER_SUPPORT_NO_TRACKS;
for (int i = 0; i < rendererCount; i++) {
if (rendererTrackTypes[i] == trackType) {
@ -236,8 +234,7 @@ public abstract class MappingTrackSelector extends TrackSelector {
* @param trackIndex The index of the track within the track group.
* @return The {@link Capabilities}.
*/
@Capabilities
public int getCapabilities(int rendererIndex, int groupIndex, int trackIndex) {
public @Capabilities int getCapabilities(int rendererIndex, int groupIndex, int trackIndex) {
return rendererFormatSupports[rendererIndex][groupIndex][trackIndex];
}
@ -249,8 +246,7 @@ public abstract class MappingTrackSelector extends TrackSelector {
* @param trackIndex The index of the track within the track group.
* @return The {@link FormatSupport}.
*/
@FormatSupport
public int getTrackSupport(int rendererIndex, int groupIndex, int trackIndex) {
public @FormatSupport int getTrackSupport(int rendererIndex, int groupIndex, int trackIndex) {
return RendererCapabilities.getFormatSupport(
getCapabilities(rendererIndex, groupIndex, trackIndex));
}
@ -272,8 +268,7 @@ public abstract class MappingTrackSelector extends TrackSelector {
* renderer are included when determining support.
* @return The {@link AdaptiveSupport}.
*/
@AdaptiveSupport
public int getAdaptiveSupport(
public @AdaptiveSupport int getAdaptiveSupport(
int rendererIndex, int groupIndex, boolean includeCapabilitiesExceededTracks) {
int trackCount = rendererTrackGroups[rendererIndex].get(groupIndex).length;
// Iterate over the tracks in the group, recording the indices of those to consider.
@ -299,8 +294,8 @@ public abstract class MappingTrackSelector extends TrackSelector {
* @param groupIndex The index of the track group.
* @return The {@link AdaptiveSupport}.
*/
@AdaptiveSupport
public int getAdaptiveSupport(int rendererIndex, int groupIndex, int[] trackIndices) {
public @AdaptiveSupport int getAdaptiveSupport(
int rendererIndex, int groupIndex, int[] trackIndices) {
int handledTrackCount = 0;
@AdaptiveSupport int adaptiveSupport = RendererCapabilities.ADAPTIVE_SEAMLESS;
boolean multipleMimeTypes = false;
@ -540,9 +535,8 @@ public abstract class MappingTrackSelector extends TrackSelector {
* @return An array containing {@link Capabilities} for each track in the group.
* @throws ExoPlaybackException If an error occurs determining the format support.
*/
@Capabilities
private static int[] getFormatSupport(RendererCapabilities rendererCapabilities, TrackGroup group)
throws ExoPlaybackException {
private static @Capabilities int[] getFormatSupport(
RendererCapabilities rendererCapabilities, TrackGroup group) throws ExoPlaybackException {
@Capabilities int[] formatSupport = new int[group.length];
for (int i = 0; i < group.length; i++) {
formatSupport[i] = rendererCapabilities.supportsFormat(group.getFormat(i));
@ -559,8 +553,7 @@ public abstract class MappingTrackSelector extends TrackSelector {
* renderer.
* @throws ExoPlaybackException If an error occurs determining the adaptation support.
*/
@AdaptiveSupport
private static int[] getMixedMimeTypeAdaptationSupports(
private static @AdaptiveSupport int[] getMixedMimeTypeAdaptationSupports(
RendererCapabilities[] rendererCapabilities) throws ExoPlaybackException {
@AdaptiveSupport int[] mixedMimeTypeAdaptationSupport = new int[rendererCapabilities.length];
for (int i = 0; i < mixedMimeTypeAdaptationSupport.length; i++) {

View File

@ -281,14 +281,14 @@ public final class DefaultBandwidthMeter implements BandwidthMeter, TransferList
private long sampleStartTimeMs;
private long sampleBytesTransferred;
@C.NetworkType private int networkType;
private @C.NetworkType int networkType;
private long totalElapsedTimeMs;
private long totalBytesTransferred;
private long bitrateEstimate;
private long lastReportedBitrateEstimate;
private boolean networkTypeOverrideSet;
@C.NetworkType private int networkTypeOverride;
private @C.NetworkType int networkTypeOverride;
/** @deprecated Use {@link Builder} instead. */
@Deprecated

Some files were not shown because too many files have changed in this diff Show More