Fix the position of IntDefs to match TYPE_USE
#minor-release PiperOrigin-RevId: 426855255
This commit is contained in:
parent
2522815d7b
commit
87420e5f9b
@ -150,7 +150,7 @@ public final class CastPlayer extends BasePlayer {
|
|||||||
private TrackSelectionArray currentTrackSelection;
|
private TrackSelectionArray currentTrackSelection;
|
||||||
private TracksInfo currentTracksInfo;
|
private TracksInfo currentTracksInfo;
|
||||||
private Commands availableCommands;
|
private Commands availableCommands;
|
||||||
@Player.State private int playbackState;
|
private @Player.State int playbackState;
|
||||||
private int currentWindowIndex;
|
private int currentWindowIndex;
|
||||||
private long lastReportedPositionMs;
|
private long lastReportedPositionMs;
|
||||||
private int pendingSeekCount;
|
private int pendingSeekCount;
|
||||||
@ -387,14 +387,12 @@ public final class CastPlayer extends BasePlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Player.State
|
public @Player.State int getPlaybackState() {
|
||||||
public int getPlaybackState() {
|
|
||||||
return playbackState;
|
return playbackState;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@PlaybackSuppressionReason
|
public @PlaybackSuppressionReason int getPlaybackSuppressionReason() {
|
||||||
public int getPlaybackSuppressionReason() {
|
|
||||||
return Player.PLAYBACK_SUPPRESSION_REASON_NONE;
|
return Player.PLAYBACK_SUPPRESSION_REASON_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -574,8 +572,7 @@ public final class CastPlayer extends BasePlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@RepeatMode
|
public @RepeatMode int getRepeatMode() {
|
||||||
public int getRepeatMode() {
|
|
||||||
return repeatMode.value;
|
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
|
* Retrieves the repeat mode from {@code remoteMediaClient} and maps it into a {@link
|
||||||
* Player.RepeatMode}.
|
* Player.RepeatMode}.
|
||||||
*/
|
*/
|
||||||
@RepeatMode
|
private static @RepeatMode int fetchRepeatMode(RemoteMediaClient remoteMediaClient) {
|
||||||
private static int fetchRepeatMode(RemoteMediaClient remoteMediaClient) {
|
|
||||||
MediaStatus mediaStatus = remoteMediaClient.getMediaStatus();
|
MediaStatus mediaStatus = remoteMediaClient.getMediaStatus();
|
||||||
if (mediaStatus == null) {
|
if (mediaStatus == null) {
|
||||||
// No media session active, yet.
|
// No media session active, yet.
|
||||||
|
@ -67,7 +67,7 @@ public final class AdPlaybackState implements Bundleable {
|
|||||||
/** The URI of each ad in the ad group. */
|
/** The URI of each ad in the ad group. */
|
||||||
public final @NullableType Uri[] uris;
|
public final @NullableType Uri[] uris;
|
||||||
/** The state of each ad in the ad group. */
|
/** 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. */
|
/** The durations of each ad in the ad group, in microseconds. */
|
||||||
public final long[] durationsUs;
|
public final long[] durationsUs;
|
||||||
/**
|
/**
|
||||||
|
@ -384,8 +384,7 @@ public abstract class BasePlayer implements Player {
|
|||||||
: timeline.getWindow(getCurrentMediaItemIndex(), window).getDurationMs();
|
: timeline.getWindow(getCurrentMediaItemIndex(), window).getDurationMs();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RepeatMode
|
private @RepeatMode int getRepeatModeForNavigation() {
|
||||||
private int getRepeatModeForNavigation() {
|
|
||||||
@RepeatMode int repeatMode = getRepeatMode();
|
@RepeatMode int repeatMode = getRepeatMode();
|
||||||
return repeatMode == REPEAT_MODE_ONE ? REPEAT_MODE_OFF : repeatMode;
|
return repeatMode == REPEAT_MODE_ONE ? REPEAT_MODE_OFF : repeatMode;
|
||||||
}
|
}
|
||||||
|
@ -1247,8 +1247,8 @@ public final class C {
|
|||||||
replacement = "Util.getErrorCodeForMediaDrmErrorCode(mediaDrmErrorCode)",
|
replacement = "Util.getErrorCodeForMediaDrmErrorCode(mediaDrmErrorCode)",
|
||||||
imports = {"androidx.media3.common.util.Util"})
|
imports = {"androidx.media3.common.util.Util"})
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@PlaybackException.ErrorCode
|
public static @PlaybackException.ErrorCode int getErrorCodeForMediaDrmErrorCode(
|
||||||
public static int getErrorCodeForMediaDrmErrorCode(int mediaDrmErrorCode) {
|
int mediaDrmErrorCode) {
|
||||||
return Util.getErrorCodeForMediaDrmErrorCode(mediaDrmErrorCode);
|
return Util.getErrorCodeForMediaDrmErrorCode(mediaDrmErrorCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,8 +38,7 @@ public final class ColorInfo implements Bundleable {
|
|||||||
* made.
|
* made.
|
||||||
*/
|
*/
|
||||||
@Pure
|
@Pure
|
||||||
@C.ColorSpace
|
public static @C.ColorSpace int isoColorPrimariesToColorSpace(int isoColorPrimaries) {
|
||||||
public static int isoColorPrimariesToColorSpace(int isoColorPrimaries) {
|
|
||||||
switch (isoColorPrimaries) {
|
switch (isoColorPrimaries) {
|
||||||
case 1:
|
case 1:
|
||||||
return C.COLOR_SPACE_BT709;
|
return C.COLOR_SPACE_BT709;
|
||||||
@ -61,8 +60,8 @@ public final class ColorInfo implements Bundleable {
|
|||||||
* mapping can be made.
|
* mapping can be made.
|
||||||
*/
|
*/
|
||||||
@Pure
|
@Pure
|
||||||
@C.ColorTransfer
|
public static @C.ColorTransfer int isoTransferCharacteristicsToColorTransfer(
|
||||||
public static int isoTransferCharacteristicsToColorTransfer(int isoTransferCharacteristics) {
|
int isoTransferCharacteristics) {
|
||||||
switch (isoTransferCharacteristics) {
|
switch (isoTransferCharacteristics) {
|
||||||
case 1: // BT.709.
|
case 1: // BT.709.
|
||||||
case 6: // SMPTE 170M.
|
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
|
* 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#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
|
* 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#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},
|
* 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
|
* {@link C#COLOR_TRANSFER_ST2084}, {@link C#COLOR_TRANSFER_SDR} or {@link Format#NO_VALUE} if
|
||||||
* unknown.
|
* 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. */
|
/** HdrStaticInfo as defined in CTA-861.3, or null if none specified. */
|
||||||
@Nullable public final byte[] hdrStaticInfo;
|
@Nullable public final byte[] hdrStaticInfo;
|
||||||
|
@ -52,7 +52,8 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable {
|
|||||||
* @param mediaData DRM session acquisition data obtained from the media.
|
* @param mediaData DRM session acquisition data obtained from the media.
|
||||||
* @return A {@link DrmInitData} obtained from merging a media manifest and a media stream.
|
* @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) {
|
@Nullable DrmInitData manifestData, @Nullable DrmInitData mediaData) {
|
||||||
ArrayList<SchemeData> result = new ArrayList<>();
|
ArrayList<SchemeData> result = new ArrayList<>();
|
||||||
String schemeType = null;
|
String schemeType = null;
|
||||||
|
@ -114,8 +114,8 @@ public final class FileTypes {
|
|||||||
private FileTypes() {}
|
private FileTypes() {}
|
||||||
|
|
||||||
/** Returns the {@link Type} corresponding to the response headers provided. */
|
/** Returns the {@link Type} corresponding to the response headers provided. */
|
||||||
@FileTypes.Type
|
public static @FileTypes.Type int inferFileTypeFromResponseHeaders(
|
||||||
public static int inferFileTypeFromResponseHeaders(Map<String, List<String>> responseHeaders) {
|
Map<String, List<String>> responseHeaders) {
|
||||||
@Nullable List<String> contentTypes = responseHeaders.get(HEADER_CONTENT_TYPE);
|
@Nullable List<String> contentTypes = responseHeaders.get(HEADER_CONTENT_TYPE);
|
||||||
@Nullable
|
@Nullable
|
||||||
String mimeType = contentTypes == null || contentTypes.isEmpty() ? null : contentTypes.get(0);
|
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}.
|
* <p>Returns {@link #UNKNOWN} if the mime type is {@code null}.
|
||||||
*/
|
*/
|
||||||
@FileTypes.Type
|
public static @FileTypes.Type int inferFileTypeFromMimeType(@Nullable String mimeType) {
|
||||||
public static int inferFileTypeFromMimeType(@Nullable String mimeType) {
|
|
||||||
if (mimeType == null) {
|
if (mimeType == null) {
|
||||||
return FileTypes.UNKNOWN;
|
return FileTypes.UNKNOWN;
|
||||||
}
|
}
|
||||||
@ -178,8 +177,7 @@ public final class FileTypes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Returns the {@link Type} corresponding to the {@link Uri} provided. */
|
/** Returns the {@link Type} corresponding to the {@link Uri} provided. */
|
||||||
@FileTypes.Type
|
public static @FileTypes.Type int inferFileTypeFromUri(Uri uri) {
|
||||||
public static int inferFileTypeFromUri(Uri uri) {
|
|
||||||
@Nullable String filename = uri.getLastPathSegment();
|
@Nullable String filename = uri.getLastPathSegment();
|
||||||
if (filename == null) {
|
if (filename == null) {
|
||||||
return FileTypes.UNKNOWN;
|
return FileTypes.UNKNOWN;
|
||||||
|
@ -156,14 +156,14 @@ public final class Format implements Bundleable {
|
|||||||
private int rotationDegrees;
|
private int rotationDegrees;
|
||||||
private float pixelWidthHeightRatio;
|
private float pixelWidthHeightRatio;
|
||||||
@Nullable private byte[] projectionData;
|
@Nullable private byte[] projectionData;
|
||||||
@C.StereoMode private int stereoMode;
|
private @C.StereoMode int stereoMode;
|
||||||
@Nullable private ColorInfo colorInfo;
|
@Nullable private ColorInfo colorInfo;
|
||||||
|
|
||||||
// Audio specific.
|
// Audio specific.
|
||||||
|
|
||||||
private int channelCount;
|
private int channelCount;
|
||||||
private int sampleRate;
|
private int sampleRate;
|
||||||
@C.PcmEncoding private int pcmEncoding;
|
private @C.PcmEncoding int pcmEncoding;
|
||||||
private int encoderDelay;
|
private int encoderDelay;
|
||||||
private int encoderPadding;
|
private int encoderPadding;
|
||||||
|
|
||||||
@ -173,7 +173,7 @@ public final class Format implements Bundleable {
|
|||||||
|
|
||||||
// Provided by the source.
|
// Provided by the source.
|
||||||
|
|
||||||
@C.CryptoType private int cryptoType;
|
private @C.CryptoType int cryptoType;
|
||||||
|
|
||||||
/** Creates a new instance with default values. */
|
/** Creates a new instance with default values. */
|
||||||
public Builder() {
|
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
|
* 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}.
|
* 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. */
|
/** The color metadata associated with the video, or null if not applicable. */
|
||||||
@UnstableApi @Nullable public final ColorInfo colorInfo;
|
@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. */
|
/** The audio sampling rate in Hz, or {@link #NO_VALUE} if unknown or not applicable. */
|
||||||
public final int sampleRate;
|
public final int sampleRate;
|
||||||
/** The {@link C.PcmEncoding} for PCM audio. Set to {@link #NO_VALUE} for other media types. */
|
/** 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
|
* The number of frames to trim from the start of the decoded audio stream, or 0 if not
|
||||||
* applicable.
|
* 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
|
* {@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.
|
* 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.
|
// Lazily initialized hashcode.
|
||||||
private int hashCode;
|
private int hashCode;
|
||||||
|
@ -79,7 +79,7 @@ public final class HeartRating extends Rating {
|
|||||||
|
|
||||||
// Bundleable implementation.
|
// Bundleable implementation.
|
||||||
|
|
||||||
@RatingType private static final int TYPE = RATING_TYPE_HEART;
|
private static final @RatingType int TYPE = RATING_TYPE_HEART;
|
||||||
|
|
||||||
@Documented
|
@Documented
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
|
@ -56,11 +56,11 @@ public final class MediaMetadata implements Bundleable {
|
|||||||
@Nullable private Rating userRating;
|
@Nullable private Rating userRating;
|
||||||
@Nullable private Rating overallRating;
|
@Nullable private Rating overallRating;
|
||||||
@Nullable private byte[] artworkData;
|
@Nullable private byte[] artworkData;
|
||||||
@Nullable @PictureType private Integer artworkDataType;
|
@Nullable private @PictureType Integer artworkDataType;
|
||||||
@Nullable private Uri artworkUri;
|
@Nullable private Uri artworkUri;
|
||||||
@Nullable private Integer trackNumber;
|
@Nullable private Integer trackNumber;
|
||||||
@Nullable private Integer totalTrackCount;
|
@Nullable private Integer totalTrackCount;
|
||||||
@Nullable @FolderType private Integer folderType;
|
@Nullable private @FolderType Integer folderType;
|
||||||
@Nullable private Boolean isPlayable;
|
@Nullable private Boolean isPlayable;
|
||||||
@Nullable private Integer recordingYear;
|
@Nullable private Integer recordingYear;
|
||||||
@Nullable private Integer recordingMonth;
|
@Nullable private Integer recordingMonth;
|
||||||
|
@ -552,8 +552,7 @@ public final class MimeTypes {
|
|||||||
* @return The corresponding {@link C.Encoding}, or {@link C#ENCODING_INVALID}.
|
* @return The corresponding {@link C.Encoding}, or {@link C#ENCODING_INVALID}.
|
||||||
*/
|
*/
|
||||||
@UnstableApi
|
@UnstableApi
|
||||||
@C.Encoding
|
public static @C.Encoding int getEncoding(String mimeType, @Nullable String codec) {
|
||||||
public static int getEncoding(String mimeType, @Nullable String codec) {
|
|
||||||
switch (mimeType) {
|
switch (mimeType) {
|
||||||
case MimeTypes.AUDIO_MPEG:
|
case MimeTypes.AUDIO_MPEG:
|
||||||
return C.ENCODING_MP3;
|
return C.ENCODING_MP3;
|
||||||
@ -728,8 +727,7 @@ public final class MimeTypes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Returns the encoding for {@link #audioObjectTypeIndication}. */
|
/** Returns the encoding for {@link #audioObjectTypeIndication}. */
|
||||||
@C.Encoding
|
public @C.Encoding int getEncoding() {
|
||||||
public int getEncoding() {
|
|
||||||
// See AUDIO_OBJECT_TYPE_AAC_* constants in AacUtil.
|
// See AUDIO_OBJECT_TYPE_AAC_* constants in AacUtil.
|
||||||
switch (audioObjectTypeIndication) {
|
switch (audioObjectTypeIndication) {
|
||||||
case 2:
|
case 2:
|
||||||
|
@ -77,7 +77,7 @@ public final class PercentageRating extends Rating {
|
|||||||
|
|
||||||
// Bundleable implementation.
|
// Bundleable implementation.
|
||||||
|
|
||||||
@RatingType private static final int TYPE = RATING_TYPE_PERCENTAGE;
|
private static final @RatingType int TYPE = RATING_TYPE_PERCENTAGE;
|
||||||
|
|
||||||
@Documented
|
@Documented
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
|
@ -686,8 +686,7 @@ public interface Player {
|
|||||||
@UnstableApi
|
@UnstableApi
|
||||||
public static final class Builder {
|
public static final class Builder {
|
||||||
|
|
||||||
@Command
|
private static final @Command int[] SUPPORTED_COMMANDS = {
|
||||||
private static final int[] SUPPORTED_COMMANDS = {
|
|
||||||
COMMAND_PLAY_PAUSE,
|
COMMAND_PLAY_PAUSE,
|
||||||
COMMAND_PREPARE,
|
COMMAND_PREPARE,
|
||||||
COMMAND_STOP,
|
COMMAND_STOP,
|
||||||
|
@ -103,7 +103,7 @@ public final class StarRating extends Rating {
|
|||||||
|
|
||||||
// Bundleable implementation.
|
// 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;
|
private static final int MAX_STARS_DEFAULT = 5;
|
||||||
|
|
||||||
@Documented
|
@Documented
|
||||||
|
@ -76,7 +76,7 @@ public final class ThumbRating extends Rating {
|
|||||||
|
|
||||||
// Bundleable implementation.
|
// Bundleable implementation.
|
||||||
|
|
||||||
@RatingType private static final int TYPE = RATING_TYPE_THUMB;
|
private static final @RatingType int TYPE = RATING_TYPE_THUMB;
|
||||||
|
|
||||||
@Documented
|
@Documented
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
|
@ -207,8 +207,7 @@ public final class TrackGroup implements Bundleable {
|
|||||||
return language == null || language.equals(C.LANGUAGE_UNDETERMINED) ? "" : language;
|
return language == null || language.equals(C.LANGUAGE_UNDETERMINED) ? "" : language;
|
||||||
}
|
}
|
||||||
|
|
||||||
@C.RoleFlags
|
private static @C.RoleFlags int normalizeRoleFlags(@C.RoleFlags int roleFlags) {
|
||||||
private static int normalizeRoleFlags(@C.RoleFlags int roleFlags) {
|
|
||||||
// Treat trick-play and non-trick-play formats as compatible.
|
// Treat trick-play and non-trick-play formats as compatible.
|
||||||
return roleFlags | C.ROLE_FLAG_TRICK_PLAY;
|
return roleFlags | C.ROLE_FLAG_TRICK_PLAY;
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ public final class TracksInfo implements Bundleable {
|
|||||||
*/
|
*/
|
||||||
public static final class TrackGroupInfo implements Bundleable {
|
public static final class TrackGroupInfo implements Bundleable {
|
||||||
private final TrackGroup trackGroup;
|
private final TrackGroup trackGroup;
|
||||||
@C.FormatSupport private final int[] trackSupport;
|
private final @C.FormatSupport int[] trackSupport;
|
||||||
private final @C.TrackType int trackType;
|
private final @C.TrackType int trackType;
|
||||||
private final boolean[] trackSelected;
|
private final boolean[] trackSelected;
|
||||||
|
|
||||||
@ -83,8 +83,7 @@ public final class TracksInfo implements Bundleable {
|
|||||||
* @return The {@link C.FormatSupport} of the track.
|
* @return The {@link C.FormatSupport} of the track.
|
||||||
*/
|
*/
|
||||||
@UnstableApi
|
@UnstableApi
|
||||||
@C.FormatSupport
|
public @C.FormatSupport int getTrackSupport(int trackIndex) {
|
||||||
public int getTrackSupport(int trackIndex) {
|
|
||||||
return trackSupport[trackIndex];
|
return trackSupport[trackIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,8 +228,7 @@ public final class TracksInfo implements Bundleable {
|
|||||||
fromNullableBundle(
|
fromNullableBundle(
|
||||||
TrackGroup.CREATOR, bundle.getBundle(keyForField(FIELD_TRACK_GROUP)));
|
TrackGroup.CREATOR, bundle.getBundle(keyForField(FIELD_TRACK_GROUP)));
|
||||||
checkNotNull(trackGroup); // Can't create a trackGroup info without a trackGroup
|
checkNotNull(trackGroup); // Can't create a trackGroup info without a trackGroup
|
||||||
@C.FormatSupport
|
final @C.FormatSupport int[] trackSupport =
|
||||||
final int[] trackSupport =
|
|
||||||
MoreObjects.firstNonNull(
|
MoreObjects.firstNonNull(
|
||||||
bundle.getIntArray(keyForField(FIELD_TRACK_SUPPORT)), new int[trackGroup.length]);
|
bundle.getIntArray(keyForField(FIELD_TRACK_SUPPORT)), new int[trackGroup.length]);
|
||||||
@C.TrackType
|
@C.TrackType
|
||||||
|
@ -569,7 +569,7 @@ public final class Cue implements Bundleable {
|
|||||||
@Nullable private Alignment textAlignment;
|
@Nullable private Alignment textAlignment;
|
||||||
@Nullable private Alignment multiRowAlignment;
|
@Nullable private Alignment multiRowAlignment;
|
||||||
private float line;
|
private float line;
|
||||||
@LineType private int lineType;
|
private @LineType int lineType;
|
||||||
private @AnchorType int lineAnchor;
|
private @AnchorType int lineAnchor;
|
||||||
private float position;
|
private float position;
|
||||||
private @AnchorType int positionAnchor;
|
private @AnchorType int positionAnchor;
|
||||||
@ -730,8 +730,7 @@ public final class Cue implements Bundleable {
|
|||||||
* @see Cue#lineType
|
* @see Cue#lineType
|
||||||
*/
|
*/
|
||||||
@Pure
|
@Pure
|
||||||
@LineType
|
public @LineType int getLineType() {
|
||||||
public int getLineType() {
|
|
||||||
return lineType;
|
return lineType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -751,8 +750,7 @@ public final class Cue implements Bundleable {
|
|||||||
* @see Cue#lineAnchor
|
* @see Cue#lineAnchor
|
||||||
*/
|
*/
|
||||||
@Pure
|
@Pure
|
||||||
@AnchorType
|
public @AnchorType int getLineAnchor() {
|
||||||
public int getLineAnchor() {
|
|
||||||
return lineAnchor;
|
return lineAnchor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -794,8 +792,7 @@ public final class Cue implements Bundleable {
|
|||||||
* @see Cue#positionAnchor
|
* @see Cue#positionAnchor
|
||||||
*/
|
*/
|
||||||
@Pure
|
@Pure
|
||||||
@AnchorType
|
public @AnchorType int getPositionAnchor() {
|
||||||
public int getPositionAnchor() {
|
|
||||||
return positionAnchor;
|
return positionAnchor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -817,8 +814,7 @@ public final class Cue implements Bundleable {
|
|||||||
* @see Cue#textSizeType
|
* @see Cue#textSizeType
|
||||||
*/
|
*/
|
||||||
@Pure
|
@Pure
|
||||||
@TextSizeType
|
public @TextSizeType int getTextSizeType() {
|
||||||
public int getTextSizeType() {
|
|
||||||
return textSizeType;
|
return textSizeType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -936,8 +932,7 @@ public final class Cue implements Bundleable {
|
|||||||
* @see Cue#verticalType
|
* @see Cue#verticalType
|
||||||
*/
|
*/
|
||||||
@Pure
|
@Pure
|
||||||
@VerticalType
|
public @VerticalType int getVerticalType() {
|
||||||
public int getVerticalType() {
|
|
||||||
return verticalType;
|
return verticalType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ public final class RubySpan implements LanguageFeatureSpan {
|
|||||||
public final String rubyText;
|
public final String rubyText;
|
||||||
|
|
||||||
/** The position of the ruby text relative to the base text. */
|
/** 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) {
|
public RubySpan(String rubyText, @TextAnnotation.Position int position) {
|
||||||
this.rubyText = rubyText;
|
this.rubyText = rubyText;
|
||||||
|
@ -83,13 +83,13 @@ public final class TextEmphasisSpan implements LanguageFeatureSpan {
|
|||||||
public static final int MARK_FILL_OPEN = 2;
|
public static final int MARK_FILL_OPEN = 2;
|
||||||
|
|
||||||
/** The mark shape used for text emphasis. */
|
/** The mark shape used for text emphasis. */
|
||||||
@MarkShape public int markShape;
|
public @MarkShape int markShape;
|
||||||
|
|
||||||
/** The mark fill for the text emphasis mark. */
|
/** 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. */
|
/** 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(
|
public TextEmphasisSpan(
|
||||||
@MarkShape int shape, @MarkFill int fill, @TextAnnotation.Position int position) {
|
@MarkShape int shape, @MarkFill int fill, @TextAnnotation.Position int position) {
|
||||||
|
@ -85,8 +85,7 @@ public final class NetworkTypeObserver {
|
|||||||
private final Object networkTypeLock;
|
private final Object networkTypeLock;
|
||||||
|
|
||||||
@GuardedBy("networkTypeLock")
|
@GuardedBy("networkTypeLock")
|
||||||
@C.NetworkType
|
private @C.NetworkType int networkType;
|
||||||
private int networkType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a network type observer instance.
|
* Returns a network type observer instance.
|
||||||
@ -132,8 +131,7 @@ public final class NetworkTypeObserver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Returns the current network type. */
|
/** Returns the current network type. */
|
||||||
@C.NetworkType
|
public @C.NetworkType int getNetworkType() {
|
||||||
public int getNetworkType() {
|
|
||||||
synchronized (networkTypeLock) {
|
synchronized (networkTypeLock) {
|
||||||
return networkType;
|
return networkType;
|
||||||
}
|
}
|
||||||
@ -164,8 +162,7 @@ public final class NetworkTypeObserver {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@C.NetworkType
|
private static @C.NetworkType int getNetworkTypeFromConnectivityManager(Context context) {
|
||||||
private static int getNetworkTypeFromConnectivityManager(Context context) {
|
|
||||||
NetworkInfo networkInfo;
|
NetworkInfo networkInfo;
|
||||||
@Nullable
|
@Nullable
|
||||||
ConnectivityManager connectivityManager =
|
ConnectivityManager connectivityManager =
|
||||||
@ -198,8 +195,7 @@ public final class NetworkTypeObserver {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@C.NetworkType
|
private static @C.NetworkType int getMobileNetworkType(NetworkInfo networkInfo) {
|
||||||
private static int getMobileNetworkType(NetworkInfo networkInfo) {
|
|
||||||
switch (networkInfo.getSubtype()) {
|
switch (networkInfo.getSubtype()) {
|
||||||
case TelephonyManager.NETWORK_TYPE_EDGE:
|
case TelephonyManager.NETWORK_TYPE_EDGE:
|
||||||
case TelephonyManager.NETWORK_TYPE_GPRS:
|
case TelephonyManager.NETWORK_TYPE_GPRS:
|
||||||
|
@ -1560,8 +1560,7 @@ public final class Util {
|
|||||||
* C#ENCODING_PCM_16BIT}, {@link C#ENCODING_PCM_24BIT} and {@link C#ENCODING_PCM_32BIT}. If
|
* 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.
|
* the bit depth is unsupported then {@link C#ENCODING_INVALID} is returned.
|
||||||
*/
|
*/
|
||||||
@C.PcmEncoding
|
public static @C.PcmEncoding int getPcmEncoding(int bitDepth) {
|
||||||
public static int getPcmEncoding(int bitDepth) {
|
|
||||||
switch (bitDepth) {
|
switch (bitDepth) {
|
||||||
case 8:
|
case 8:
|
||||||
return C.ENCODING_PCM_8BIT;
|
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}. */
|
/** Returns the {@link C.AudioUsage} corresponding to the specified {@link C.StreamType}. */
|
||||||
@C.AudioUsage
|
public static @C.AudioUsage int getAudioUsageForStreamType(@C.StreamType int streamType) {
|
||||||
public static int getAudioUsageForStreamType(@C.StreamType int streamType) {
|
|
||||||
switch (streamType) {
|
switch (streamType) {
|
||||||
case C.STREAM_TYPE_ALARM:
|
case C.STREAM_TYPE_ALARM:
|
||||||
return C.USAGE_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}. */
|
/** Returns the {@link C.AudioContentType} corresponding to the specified {@link C.StreamType}. */
|
||||||
@C.AudioContentType
|
public static @C.AudioContentType int getAudioContentTypeForStreamType(
|
||||||
public static int getAudioContentTypeForStreamType(@C.StreamType int streamType) {
|
@C.StreamType int streamType) {
|
||||||
switch (streamType) {
|
switch (streamType) {
|
||||||
case C.STREAM_TYPE_ALARM:
|
case C.STREAM_TYPE_ALARM:
|
||||||
case C.STREAM_TYPE_DTMF:
|
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}. */
|
/** Returns the {@link C.StreamType} corresponding to the specified {@link C.AudioUsage}. */
|
||||||
@C.StreamType
|
public static @C.StreamType int getStreamTypeForAudioUsage(@C.AudioUsage int usage) {
|
||||||
public static int getStreamTypeForAudioUsage(@C.AudioUsage int usage) {
|
|
||||||
switch (usage) {
|
switch (usage) {
|
||||||
case C.USAGE_MEDIA:
|
case C.USAGE_MEDIA:
|
||||||
case C.USAGE_GAME:
|
case C.USAGE_GAME:
|
||||||
@ -1762,7 +1759,8 @@ public final class Util {
|
|||||||
* "clearkey"}.
|
* "clearkey"}.
|
||||||
* @return The derived {@link UUID}, or {@code null} if one could not be derived.
|
* @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)) {
|
switch (Ascii.toLowerCase(drmScheme)) {
|
||||||
case "widevine":
|
case "widevine":
|
||||||
return C.WIDEVINE_UUID;
|
return C.WIDEVINE_UUID;
|
||||||
@ -1784,8 +1782,8 @@ public final class Util {
|
|||||||
* MediaDrm.ErrorCodes} value. Returns {@link PlaybackException#ERROR_CODE_DRM_SYSTEM_ERROR} if
|
* MediaDrm.ErrorCodes} value. Returns {@link PlaybackException#ERROR_CODE_DRM_SYSTEM_ERROR} if
|
||||||
* the provided error code isn't recognised.
|
* the provided error code isn't recognised.
|
||||||
*/
|
*/
|
||||||
@PlaybackException.ErrorCode
|
public static @PlaybackException.ErrorCode int getErrorCodeForMediaDrmErrorCode(
|
||||||
public static int getErrorCodeForMediaDrmErrorCode(int mediaDrmErrorCode) {
|
int mediaDrmErrorCode) {
|
||||||
switch (mediaDrmErrorCode) {
|
switch (mediaDrmErrorCode) {
|
||||||
case MediaDrm.ErrorCodes.ERROR_PROVISIONING_CONFIG:
|
case MediaDrm.ErrorCodes.ERROR_PROVISIONING_CONFIG:
|
||||||
case MediaDrm.ErrorCodes.ERROR_PROVISIONING_PARSE:
|
case MediaDrm.ErrorCodes.ERROR_PROVISIONING_PARSE:
|
||||||
@ -1821,8 +1819,7 @@ public final class Util {
|
|||||||
* @param overrideExtension If not null, used to infer the type.
|
* @param overrideExtension If not null, used to infer the type.
|
||||||
* @return The content type.
|
* @return The content type.
|
||||||
*/
|
*/
|
||||||
@ContentType
|
public static @ContentType int inferContentType(Uri uri, @Nullable String overrideExtension) {
|
||||||
public static int inferContentType(Uri uri, @Nullable String overrideExtension) {
|
|
||||||
return TextUtils.isEmpty(overrideExtension)
|
return TextUtils.isEmpty(overrideExtension)
|
||||||
? inferContentType(uri)
|
? inferContentType(uri)
|
||||||
: inferContentType("." + overrideExtension);
|
: inferContentType("." + overrideExtension);
|
||||||
@ -1834,8 +1831,7 @@ public final class Util {
|
|||||||
* @param uri The {@link Uri}.
|
* @param uri The {@link Uri}.
|
||||||
* @return The content type.
|
* @return The content type.
|
||||||
*/
|
*/
|
||||||
@ContentType
|
public static @ContentType int inferContentType(Uri uri) {
|
||||||
public static int inferContentType(Uri uri) {
|
|
||||||
@Nullable String scheme = uri.getScheme();
|
@Nullable String scheme = uri.getScheme();
|
||||||
if (scheme != null && Ascii.equalsIgnoreCase("rtsp", scheme)) {
|
if (scheme != null && Ascii.equalsIgnoreCase("rtsp", scheme)) {
|
||||||
return C.TYPE_RTSP;
|
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.
|
* @param fileName Name of the file. It can include the path of the file.
|
||||||
* @return The content type.
|
* @return The content type.
|
||||||
*/
|
*/
|
||||||
@ContentType
|
public static @ContentType int inferContentType(String fileName) {
|
||||||
public static int inferContentType(String fileName) {
|
|
||||||
fileName = Ascii.toLowerCase(fileName);
|
fileName = Ascii.toLowerCase(fileName);
|
||||||
if (fileName.endsWith(".mpd")) {
|
if (fileName.endsWith(".mpd")) {
|
||||||
return C.TYPE_DASH;
|
return C.TYPE_DASH;
|
||||||
@ -1881,8 +1876,8 @@ public final class Util {
|
|||||||
* @param mimeType If MIME type, or {@code null}.
|
* @param mimeType If MIME type, or {@code null}.
|
||||||
* @return The content type.
|
* @return The content type.
|
||||||
*/
|
*/
|
||||||
@ContentType
|
public static @ContentType int inferContentTypeForUriAndMimeType(
|
||||||
public static int inferContentTypeForUriAndMimeType(Uri uri, @Nullable String mimeType) {
|
Uri uri, @Nullable String mimeType) {
|
||||||
if (mimeType == null) {
|
if (mimeType == null) {
|
||||||
return Util.inferContentType(uri);
|
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
|
* @return The original value of the file name before it was escaped, or null if the escaped
|
||||||
* fileName seems invalid.
|
* fileName seems invalid.
|
||||||
*/
|
*/
|
||||||
public static @Nullable String unescapeFileName(String fileName) {
|
@Nullable
|
||||||
|
public static String unescapeFileName(String fileName) {
|
||||||
int length = fileName.length();
|
int length = fileName.length();
|
||||||
int percentCharacterCount = 0;
|
int percentCharacterCount = 0;
|
||||||
for (int i = 0; i < length; i++) {
|
for (int i = 0; i < length; i++) {
|
||||||
|
@ -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
|
* @return The value of the attribute, or null if the current event is not a start tag or if no
|
||||||
* such attribute was found.
|
* 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();
|
int attributeCount = xpp.getAttributeCount();
|
||||||
for (int i = 0; i < attributeCount; i++) {
|
for (int i = 0; i < attributeCount; i++) {
|
||||||
if (xpp.getAttributeName(i).equals(attributeName)) {
|
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
|
* @return The value of the attribute, or null if the current event is not a start tag or if no
|
||||||
* such attribute was found.
|
* such attribute was found.
|
||||||
*/
|
*/
|
||||||
public static @Nullable String getAttributeValueIgnorePrefix(
|
@Nullable
|
||||||
XmlPullParser xpp, String attributeName) {
|
public static String getAttributeValueIgnorePrefix(XmlPullParser xpp, String attributeName) {
|
||||||
int attributeCount = xpp.getAttributeCount();
|
int attributeCount = xpp.getAttributeCount();
|
||||||
for (int i = 0; i < attributeCount; i++) {
|
for (int i = 0; i < attributeCount; i++) {
|
||||||
if (stripPrefix(xpp.getAttributeName(i)).equals(attributeName)) {
|
if (stripPrefix(xpp.getAttributeName(i)).equals(attributeName)) {
|
||||||
|
@ -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
|
* The reason of this {@link DataSourceException}, should be one of the {@code ERROR_CODE_IO_*} in
|
||||||
* {@link PlaybackException.ErrorCode}.
|
* {@link PlaybackException.ErrorCode}.
|
||||||
*/
|
*/
|
||||||
@PlaybackException.ErrorCode public final int reason;
|
public final @PlaybackException.ErrorCode int reason;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a DataSourceException.
|
* Constructs a DataSourceException.
|
||||||
|
@ -49,13 +49,13 @@ public final class DataSpec {
|
|||||||
|
|
||||||
@Nullable private Uri uri;
|
@Nullable private Uri uri;
|
||||||
private long uriPositionOffset;
|
private long uriPositionOffset;
|
||||||
@HttpMethod private int httpMethod;
|
private @HttpMethod int httpMethod;
|
||||||
@Nullable private byte[] httpBody;
|
@Nullable private byte[] httpBody;
|
||||||
private Map<String, String> httpRequestHeaders;
|
private Map<String, String> httpRequestHeaders;
|
||||||
private long position;
|
private long position;
|
||||||
private long length;
|
private long length;
|
||||||
@Nullable private String key;
|
@Nullable private String key;
|
||||||
@Flags private int flags;
|
private @Flags int flags;
|
||||||
@Nullable private Object customData;
|
@Nullable private Object customData;
|
||||||
|
|
||||||
/** Creates a new instance with default values. */
|
/** 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
|
* The HTTP method to use when requesting the data. This value will be ignored by non-HTTP {@link
|
||||||
* DataSource} implementations.
|
* 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}
|
* 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;
|
@Nullable public final String key;
|
||||||
|
|
||||||
/** Request {@link Flags flags}. */
|
/** Request {@link Flags flags}. */
|
||||||
@Flags public final int flags;
|
public final @Flags int flags;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Application specific data.
|
* Application specific data.
|
||||||
|
@ -233,7 +233,7 @@ public interface HttpDataSource extends DataSource {
|
|||||||
/** The {@link DataSpec} associated with the current connection. */
|
/** The {@link DataSpec} associated with the current connection. */
|
||||||
public final DataSpec dataSpec;
|
public final DataSpec dataSpec;
|
||||||
|
|
||||||
@Type public final int type;
|
public final @Type int type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Use {@link #HttpDataSourceException(DataSpec, int, int)
|
* @deprecated Use {@link #HttpDataSourceException(DataSpec, int, int)
|
||||||
@ -349,8 +349,8 @@ public interface HttpDataSource extends DataSource {
|
|||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@PlaybackException.ErrorCode
|
private static @PlaybackException.ErrorCode int assignErrorCode(
|
||||||
private static int assignErrorCode(@PlaybackException.ErrorCode int errorCode, @Type int type) {
|
@PlaybackException.ErrorCode int errorCode, @Type int type) {
|
||||||
return errorCode == PlaybackException.ERROR_CODE_IO_UNSPECIFIED && type == TYPE_OPEN
|
return errorCode == PlaybackException.ERROR_CODE_IO_UNSPECIFIED && type == TYPE_OPEN
|
||||||
? PlaybackException.ERROR_CODE_IO_NETWORK_CONNECTION_FAILED
|
? PlaybackException.ERROR_CODE_IO_NETWORK_CONNECTION_FAILED
|
||||||
: errorCode;
|
: errorCode;
|
||||||
|
@ -72,7 +72,7 @@ public final class CacheDataSource implements DataSource {
|
|||||||
@Nullable private DataSource.Factory upstreamDataSourceFactory;
|
@Nullable private DataSource.Factory upstreamDataSourceFactory;
|
||||||
@Nullable private PriorityTaskManager upstreamPriorityTaskManager;
|
@Nullable private PriorityTaskManager upstreamPriorityTaskManager;
|
||||||
private int upstreamPriority;
|
private int upstreamPriority;
|
||||||
@CacheDataSource.Flags private int flags;
|
private @CacheDataSource.Flags int flags;
|
||||||
@Nullable private CacheDataSource.EventListener eventListener;
|
@Nullable private CacheDataSource.EventListener eventListener;
|
||||||
|
|
||||||
public Factory() {
|
public Factory() {
|
||||||
|
@ -22,7 +22,7 @@ import androidx.media3.common.util.UnstableApi;
|
|||||||
@UnstableApi
|
@UnstableApi
|
||||||
public abstract class Buffer {
|
public abstract class Buffer {
|
||||||
|
|
||||||
@C.BufferFlags private int flags;
|
private @C.BufferFlags int flags;
|
||||||
|
|
||||||
/** Clears the buffer. */
|
/** Clears the buffer. */
|
||||||
public void clear() {
|
public void clear() {
|
||||||
|
@ -48,7 +48,7 @@ public final class CryptoInfo {
|
|||||||
*
|
*
|
||||||
* @see android.media.MediaCodec.CryptoInfo#mode
|
* @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
|
* The number of leading unencrypted bytes in each sub-sample. If null, all bytes are treated as
|
||||||
* encrypted and {@link #numBytesOfEncryptedData} must be specified.
|
* encrypted and {@link #numBytesOfEncryptedData} must be specified.
|
||||||
|
@ -111,7 +111,7 @@ public class DecoderInputBuffer extends Buffer {
|
|||||||
*/
|
*/
|
||||||
@Nullable public ByteBuffer supplementalData;
|
@Nullable public ByteBuffer supplementalData;
|
||||||
|
|
||||||
@BufferReplacementMode private final int bufferReplacementMode;
|
private final @BufferReplacementMode int bufferReplacementMode;
|
||||||
private final int paddingSize;
|
private final int paddingSize;
|
||||||
|
|
||||||
/** Returns a new instance that's not able to hold any data. */
|
/** Returns a new instance that's not able to hold any data. */
|
||||||
|
@ -34,7 +34,7 @@ public class VideoDecoderOutputBuffer extends DecoderOutputBuffer {
|
|||||||
public int decoderPrivate;
|
public int decoderPrivate;
|
||||||
|
|
||||||
/** Output mode. */
|
/** Output mode. */
|
||||||
@C.VideoOutputMode public int mode;
|
public @C.VideoOutputMode int mode;
|
||||||
/** RGB buffer for RGB mode. */
|
/** RGB buffer for RGB mode. */
|
||||||
@Nullable public ByteBuffer data;
|
@Nullable public ByteBuffer data;
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ public final class Gav1Decoder
|
|||||||
|
|
||||||
private final long gav1DecoderContext;
|
private final long gav1DecoderContext;
|
||||||
|
|
||||||
@C.VideoOutputMode private volatile int outputMode;
|
private volatile @C.VideoOutputMode int outputMode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a Gav1Decoder.
|
* Creates a Gav1Decoder.
|
||||||
|
@ -128,8 +128,7 @@ public class Libgav1VideoRenderer extends DecoderVideoRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Capabilities
|
public final @Capabilities int supportsFormat(Format format) {
|
||||||
public final int supportsFormat(Format format) {
|
|
||||||
if (!MimeTypes.VIDEO_AV1.equalsIgnoreCase(format.sampleMimeType)
|
if (!MimeTypes.VIDEO_AV1.equalsIgnoreCase(format.sampleMimeType)
|
||||||
|| !Gav1Library.isAvailable()) {
|
|| !Gav1Library.isAvailable()) {
|
||||||
return RendererCapabilities.create(C.FORMAT_UNSUPPORTED_TYPE);
|
return RendererCapabilities.create(C.FORMAT_UNSUPPORTED_TYPE);
|
||||||
|
@ -41,7 +41,7 @@ import java.util.List;
|
|||||||
|
|
||||||
private final String codecName;
|
private final String codecName;
|
||||||
@Nullable private final byte[] extraData;
|
@Nullable private final byte[] extraData;
|
||||||
@C.PcmEncoding private final int encoding;
|
private final @C.PcmEncoding int encoding;
|
||||||
private final int outputBufferSize;
|
private final int outputBufferSize;
|
||||||
|
|
||||||
private long nativeContext; // May be reassigned on resetting the codec.
|
private long nativeContext; // May be reassigned on resetting the codec.
|
||||||
@ -158,8 +158,7 @@ import java.util.List;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Returns the encoding of output audio. */
|
/** Returns the encoding of output audio. */
|
||||||
@C.PcmEncoding
|
public @C.PcmEncoding int getEncoding() {
|
||||||
public int getEncoding() {
|
|
||||||
return encoding;
|
return encoding;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,8 +90,7 @@ public final class FfmpegAudioRenderer extends DecoderAudioRenderer<FfmpegAudioD
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@C.FormatSupport
|
protected @C.FormatSupport int supportsFormatInternal(Format format) {
|
||||||
protected int supportsFormatInternal(Format format) {
|
|
||||||
String mimeType = Assertions.checkNotNull(format.sampleMimeType);
|
String mimeType = Assertions.checkNotNull(format.sampleMimeType);
|
||||||
if (!FfmpegLibrary.isAvailable() || !MimeTypes.isAudio(mimeType)) {
|
if (!FfmpegLibrary.isAvailable() || !MimeTypes.isAudio(mimeType)) {
|
||||||
return C.FORMAT_UNSUPPORTED_TYPE;
|
return C.FORMAT_UNSUPPORTED_TYPE;
|
||||||
@ -107,8 +106,7 @@ public final class FfmpegAudioRenderer extends DecoderAudioRenderer<FfmpegAudioD
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@AdaptiveSupport
|
public final @AdaptiveSupport int supportsMixedMimeTypeAdaptation() {
|
||||||
public final int supportsMixedMimeTypeAdaptation() {
|
|
||||||
return ADAPTIVE_NOT_SEAMLESS;
|
return ADAPTIVE_NOT_SEAMLESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,8 +73,7 @@ public final class FfmpegVideoRenderer extends DecoderVideoRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@RendererCapabilities.Capabilities
|
public final @RendererCapabilities.Capabilities int supportsFormat(Format format) {
|
||||||
public final int supportsFormat(Format format) {
|
|
||||||
// TODO: Remove this line and uncomment the implementation below.
|
// TODO: Remove this line and uncomment the implementation below.
|
||||||
return C.FORMAT_UNSUPPORTED_TYPE;
|
return C.FORMAT_UNSUPPORTED_TYPE;
|
||||||
/*
|
/*
|
||||||
|
@ -79,8 +79,7 @@ public final class LibflacAudioRenderer extends DecoderAudioRenderer<FlacDecoder
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@C.FormatSupport
|
protected @C.FormatSupport int supportsFormatInternal(Format format) {
|
||||||
protected int supportsFormatInternal(Format format) {
|
|
||||||
if (!FlacLibrary.isAvailable()
|
if (!FlacLibrary.isAvailable()
|
||||||
|| !MimeTypes.AUDIO_FLAC.equalsIgnoreCase(format.sampleMimeType)) {
|
|| !MimeTypes.AUDIO_FLAC.equalsIgnoreCase(format.sampleMimeType)) {
|
||||||
return C.FORMAT_UNSUPPORTED_TYPE;
|
return C.FORMAT_UNSUPPORTED_TYPE;
|
||||||
|
@ -80,8 +80,7 @@ public class LibopusAudioRenderer extends DecoderAudioRenderer<OpusDecoder> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@C.FormatSupport
|
protected @C.FormatSupport int supportsFormatInternal(Format format) {
|
||||||
protected int supportsFormatInternal(Format format) {
|
|
||||||
boolean drmIsSupported = OpusLibrary.supportsCryptoType(format.cryptoType);
|
boolean drmIsSupported = OpusLibrary.supportsCryptoType(format.cryptoType);
|
||||||
if (!OpusLibrary.isAvailable()
|
if (!OpusLibrary.isAvailable()
|
||||||
|| !MimeTypes.AUDIO_OPUS.equalsIgnoreCase(format.sampleMimeType)) {
|
|| !MimeTypes.AUDIO_OPUS.equalsIgnoreCase(format.sampleMimeType)) {
|
||||||
|
@ -126,8 +126,7 @@ public class LibvpxVideoRenderer extends DecoderVideoRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Capabilities
|
public final @Capabilities int supportsFormat(Format format) {
|
||||||
public final int supportsFormat(Format format) {
|
|
||||||
if (!VpxLibrary.isAvailable() || !MimeTypes.VIDEO_VP9.equalsIgnoreCase(format.sampleMimeType)) {
|
if (!VpxLibrary.isAvailable() || !MimeTypes.VIDEO_VP9.equalsIgnoreCase(format.sampleMimeType)) {
|
||||||
return RendererCapabilities.create(C.FORMAT_UNSUPPORTED_TYPE);
|
return RendererCapabilities.create(C.FORMAT_UNSUPPORTED_TYPE);
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ public final class VpxDecoder
|
|||||||
|
|
||||||
@Nullable private ByteBuffer lastSupplementalData;
|
@Nullable private ByteBuffer lastSupplementalData;
|
||||||
|
|
||||||
@C.VideoOutputMode private volatile int outputMode;
|
private volatile @C.VideoOutputMode int outputMode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a VP9 decoder.
|
* Creates a VP9 decoder.
|
||||||
|
@ -273,7 +273,7 @@ public class StreamVolumeManagerTest {
|
|||||||
|
|
||||||
private static class TestListener implements StreamVolumeManager.Listener {
|
private static class TestListener implements StreamVolumeManager.Listener {
|
||||||
|
|
||||||
@C.StreamType private int lastStreamType;
|
private @C.StreamType int lastStreamType;
|
||||||
private int lastStreamVolume;
|
private int lastStreamVolume;
|
||||||
private boolean lastStreamVolumeMuted;
|
private boolean lastStreamVolumeMuted;
|
||||||
public final CountDownLatch onStreamVolumeChangedLatch;
|
public final CountDownLatch onStreamVolumeChangedLatch;
|
||||||
|
@ -139,7 +139,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
|||||||
@Nullable private PlayerControl playerControl;
|
@Nullable private PlayerControl playerControl;
|
||||||
@Nullable private AudioAttributes audioAttributes;
|
@Nullable private AudioAttributes audioAttributes;
|
||||||
|
|
||||||
@AudioFocusState private int audioFocusState;
|
private @AudioFocusState int audioFocusState;
|
||||||
private @AudioFocusGain int focusGainToRequest;
|
private @AudioFocusGain int focusGainToRequest;
|
||||||
private float volumeMultiplier = VOLUME_MULTIPLIER_DEFAULT;
|
private float volumeMultiplier = VOLUME_MULTIPLIER_DEFAULT;
|
||||||
|
|
||||||
@ -193,8 +193,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
|||||||
* @param playbackState The desired playback state.
|
* @param playbackState The desired playback state.
|
||||||
* @return A {@link PlayerCommand} to execute on the player.
|
* @return A {@link PlayerCommand} to execute on the player.
|
||||||
*/
|
*/
|
||||||
@PlayerCommand
|
public @PlayerCommand int updateAudioFocus(
|
||||||
public int updateAudioFocus(boolean playWhenReady, @Player.State int playbackState) {
|
boolean playWhenReady, @Player.State int playbackState) {
|
||||||
if (shouldAbandonAudioFocusIfHeld(playbackState)) {
|
if (shouldAbandonAudioFocusIfHeld(playbackState)) {
|
||||||
abandonAudioFocusIfHeld();
|
abandonAudioFocusIfHeld();
|
||||||
return playWhenReady ? PLAYER_COMMAND_PLAY_WHEN_READY : PLAYER_COMMAND_DO_NOT_PLAY;
|
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;
|
return playbackState == Player.STATE_IDLE || focusGainToRequest != AUDIOFOCUS_GAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@PlayerCommand
|
private @PlayerCommand int requestAudioFocus() {
|
||||||
private int requestAudioFocus() {
|
|
||||||
if (audioFocusState == AUDIO_FOCUS_STATE_HAVE_FOCUS) {
|
if (audioFocusState == AUDIO_FOCUS_STATE_HAVE_FOCUS) {
|
||||||
return PLAYER_COMMAND_PLAY_WHEN_READY;
|
return PLAYER_COMMAND_PLAY_WHEN_READY;
|
||||||
}
|
}
|
||||||
|
@ -200,8 +200,7 @@ public abstract class BaseRenderer implements Renderer, RendererCapabilities {
|
|||||||
// RendererCapabilities implementation.
|
// RendererCapabilities implementation.
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@AdaptiveSupport
|
public @AdaptiveSupport int supportsMixedMimeTypeAdaptation() throws ExoPlaybackException {
|
||||||
public int supportsMixedMimeTypeAdaptation() throws ExoPlaybackException {
|
|
||||||
return ADAPTIVE_NOT_SUPPORTED;
|
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
|
* 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.
|
* flags are populated if this exception is thrown, but the read position is not advanced.
|
||||||
*/
|
*/
|
||||||
@ReadDataResult
|
protected final @ReadDataResult int readSource(
|
||||||
protected final int readSource(
|
|
||||||
FormatHolder formatHolder, DecoderInputBuffer buffer, @ReadFlags int readFlags) {
|
FormatHolder formatHolder, DecoderInputBuffer buffer, @ReadFlags int readFlags) {
|
||||||
@ReadDataResult
|
@ReadDataResult
|
||||||
int result = Assertions.checkNotNull(stream).readData(formatHolder, buffer, readFlags);
|
int result = Assertions.checkNotNull(stream).readData(formatHolder, buffer, readFlags);
|
||||||
|
@ -125,13 +125,13 @@ public final class DecoderReuseEvaluation {
|
|||||||
public final Format newFormat;
|
public final Format newFormat;
|
||||||
|
|
||||||
/** The {@link DecoderReuseResult result} of the evaluation. */
|
/** 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
|
* {@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.
|
* 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.
|
* @param decoderName The name of the decoder.
|
||||||
|
@ -95,7 +95,7 @@ public class DefaultRenderersFactory implements RenderersFactory {
|
|||||||
|
|
||||||
private final Context context;
|
private final Context context;
|
||||||
private final DefaultMediaCodecAdapterFactory codecAdapterFactory;
|
private final DefaultMediaCodecAdapterFactory codecAdapterFactory;
|
||||||
@ExtensionRendererMode private int extensionRendererMode;
|
private @ExtensionRendererMode int extensionRendererMode;
|
||||||
private long allowedVideoJoiningTimeMs;
|
private long allowedVideoJoiningTimeMs;
|
||||||
private boolean enableDecoderFallback;
|
private boolean enableDecoderFallback;
|
||||||
private MediaCodecSelector mediaCodecSelector;
|
private MediaCodecSelector mediaCodecSelector;
|
||||||
|
@ -85,7 +85,7 @@ public final class ExoPlaybackException extends PlaybackException {
|
|||||||
@UnstableApi public static final int TYPE_REMOTE = 3;
|
@UnstableApi public static final int TYPE_REMOTE = 3;
|
||||||
|
|
||||||
/** The {@link Type} of the playback failure. */
|
/** 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. */
|
/** If {@link #type} is {@link #TYPE_RENDERER}, this is the name of the renderer. */
|
||||||
@UnstableApi @Nullable public final String rendererName;
|
@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
|
* renderer for {@link #rendererFormat}. If {@link #rendererFormat} is null, this is {@link
|
||||||
* C#FORMAT_HANDLED}.
|
* 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. */
|
/** The {@link MediaPeriodId} of the media associated with this error, or null if undetermined. */
|
||||||
@UnstableApi @Nullable public final MediaPeriodId mediaPeriodId;
|
@UnstableApi @Nullable public final MediaPeriodId mediaPeriodId;
|
||||||
|
@ -216,12 +216,12 @@ import java.util.concurrent.TimeoutException;
|
|||||||
private final WifiLockManager wifiLockManager;
|
private final WifiLockManager wifiLockManager;
|
||||||
private final long detachSurfaceTimeoutMs;
|
private final long detachSurfaceTimeoutMs;
|
||||||
|
|
||||||
@RepeatMode private int repeatMode;
|
private @RepeatMode int repeatMode;
|
||||||
private boolean shuffleModeEnabled;
|
private boolean shuffleModeEnabled;
|
||||||
private int pendingOperationAcks;
|
private int pendingOperationAcks;
|
||||||
@DiscontinuityReason private int pendingDiscontinuityReason;
|
private @DiscontinuityReason int pendingDiscontinuityReason;
|
||||||
private boolean pendingDiscontinuity;
|
private boolean pendingDiscontinuity;
|
||||||
@PlayWhenReadyChangeReason private int pendingPlayWhenReadyChangeReason;
|
private @PlayWhenReadyChangeReason int pendingPlayWhenReadyChangeReason;
|
||||||
private boolean foregroundMode;
|
private boolean foregroundMode;
|
||||||
private SeekParameters seekParameters;
|
private SeekParameters seekParameters;
|
||||||
private ShuffleOrder shuffleOrder;
|
private ShuffleOrder shuffleOrder;
|
||||||
@ -238,8 +238,8 @@ import java.util.concurrent.TimeoutException;
|
|||||||
@Nullable private SphericalGLSurfaceView sphericalGLSurfaceView;
|
@Nullable private SphericalGLSurfaceView sphericalGLSurfaceView;
|
||||||
private boolean surfaceHolderSurfaceIsVideoOutput;
|
private boolean surfaceHolderSurfaceIsVideoOutput;
|
||||||
@Nullable private TextureView textureView;
|
@Nullable private TextureView textureView;
|
||||||
@C.VideoScalingMode private int videoScalingMode;
|
private @C.VideoScalingMode int videoScalingMode;
|
||||||
@C.VideoChangeFrameRateStrategy private int videoChangeFrameRateStrategy;
|
private @C.VideoChangeFrameRateStrategy int videoChangeFrameRateStrategy;
|
||||||
private int surfaceWidth;
|
private int surfaceWidth;
|
||||||
private int surfaceHeight;
|
private int surfaceHeight;
|
||||||
@Nullable private DecoderCounters videoDecoderCounters;
|
@Nullable private DecoderCounters videoDecoderCounters;
|
||||||
@ -515,14 +515,12 @@ import java.util.concurrent.TimeoutException;
|
|||||||
return availableCommands;
|
return availableCommands;
|
||||||
}
|
}
|
||||||
|
|
||||||
@State
|
public @State int getPlaybackState() {
|
||||||
public int getPlaybackState() {
|
|
||||||
verifyApplicationThread();
|
verifyApplicationThread();
|
||||||
return playbackInfo.playbackState;
|
return playbackInfo.playbackState;
|
||||||
}
|
}
|
||||||
|
|
||||||
@PlaybackSuppressionReason
|
public @PlaybackSuppressionReason int getPlaybackSuppressionReason() {
|
||||||
public int getPlaybackSuppressionReason() {
|
|
||||||
verifyApplicationThread();
|
verifyApplicationThread();
|
||||||
return playbackInfo.playbackSuppressionReason;
|
return playbackInfo.playbackSuppressionReason;
|
||||||
}
|
}
|
||||||
@ -814,8 +812,7 @@ import java.util.concurrent.TimeoutException;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@RepeatMode
|
public @RepeatMode int getRepeatMode() {
|
||||||
public int getRepeatMode() {
|
|
||||||
verifyApplicationThread();
|
verifyApplicationThread();
|
||||||
return repeatMode;
|
return repeatMode;
|
||||||
}
|
}
|
||||||
@ -1271,8 +1268,7 @@ import java.util.concurrent.TimeoutException;
|
|||||||
sendRendererMessage(TRACK_TYPE_VIDEO, MSG_SET_SCALING_MODE, videoScalingMode);
|
sendRendererMessage(TRACK_TYPE_VIDEO, MSG_SET_SCALING_MODE, videoScalingMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@C.VideoScalingMode
|
public @C.VideoScalingMode int getVideoScalingMode() {
|
||||||
public int getVideoScalingMode() {
|
|
||||||
return videoScalingMode;
|
return videoScalingMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1287,8 +1283,7 @@ import java.util.concurrent.TimeoutException;
|
|||||||
TRACK_TYPE_VIDEO, MSG_SET_CHANGE_FRAME_RATE_STRATEGY, videoChangeFrameRateStrategy);
|
TRACK_TYPE_VIDEO, MSG_SET_CHANGE_FRAME_RATE_STRATEGY, videoChangeFrameRateStrategy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@C.VideoChangeFrameRateStrategy
|
public @C.VideoChangeFrameRateStrategy int getVideoChangeFrameRateStrategy() {
|
||||||
public int getVideoChangeFrameRateStrategy() {
|
|
||||||
return videoChangeFrameRateStrategy;
|
return videoChangeFrameRateStrategy;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2968,15 +2963,13 @@ import java.util.concurrent.TimeoutException;
|
|||||||
private static final class FrameMetadataListener
|
private static final class FrameMetadataListener
|
||||||
implements VideoFrameMetadataListener, CameraMotionListener, PlayerMessage.Target {
|
implements VideoFrameMetadataListener, CameraMotionListener, PlayerMessage.Target {
|
||||||
|
|
||||||
@MessageType
|
public static final @MessageType int MSG_SET_VIDEO_FRAME_METADATA_LISTENER =
|
||||||
public static final int MSG_SET_VIDEO_FRAME_METADATA_LISTENER =
|
|
||||||
Renderer.MSG_SET_VIDEO_FRAME_METADATA_LISTENER;
|
Renderer.MSG_SET_VIDEO_FRAME_METADATA_LISTENER;
|
||||||
|
|
||||||
@MessageType
|
public static final @MessageType int MSG_SET_CAMERA_MOTION_LISTENER =
|
||||||
public static final int MSG_SET_CAMERA_MOTION_LISTENER =
|
|
||||||
Renderer.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 VideoFrameMetadataListener videoFrameMetadataListener;
|
||||||
@Nullable private CameraMotionListener cameraMotionListener;
|
@Nullable private CameraMotionListener cameraMotionListener;
|
||||||
|
@ -93,9 +93,9 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||||||
public PlaybackInfo playbackInfo;
|
public PlaybackInfo playbackInfo;
|
||||||
public int operationAcks;
|
public int operationAcks;
|
||||||
public boolean positionDiscontinuity;
|
public boolean positionDiscontinuity;
|
||||||
@DiscontinuityReason public int discontinuityReason;
|
public @DiscontinuityReason int discontinuityReason;
|
||||||
public boolean hasPlayWhenReadyChangeReason;
|
public boolean hasPlayWhenReadyChangeReason;
|
||||||
@PlayWhenReadyChangeReason public int playWhenReadyChangeReason;
|
public @PlayWhenReadyChangeReason int playWhenReadyChangeReason;
|
||||||
|
|
||||||
public PlaybackInfoUpdate(PlaybackInfo playbackInfo) {
|
public PlaybackInfoUpdate(PlaybackInfo playbackInfo) {
|
||||||
this.playbackInfo = playbackInfo;
|
this.playbackInfo = playbackInfo;
|
||||||
@ -216,7 +216,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||||||
private boolean pendingPauseAtEndOfPeriod;
|
private boolean pendingPauseAtEndOfPeriod;
|
||||||
private boolean isRebuffering;
|
private boolean isRebuffering;
|
||||||
private boolean shouldContinueLoading;
|
private boolean shouldContinueLoading;
|
||||||
@Player.RepeatMode private int repeatMode;
|
private @Player.RepeatMode int repeatMode;
|
||||||
private boolean shuffleModeEnabled;
|
private boolean shuffleModeEnabled;
|
||||||
private boolean foregroundMode;
|
private boolean foregroundMode;
|
||||||
private boolean requestForRendererSleep;
|
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
|
* @return The uid in the new timeline of the first subsequent period, or null if no such period
|
||||||
* was found.
|
* was found.
|
||||||
*/
|
*/
|
||||||
/* package */ static @Nullable Object resolveSubsequentPeriod(
|
/* package */ @Nullable
|
||||||
|
static Object resolveSubsequentPeriod(
|
||||||
Timeline.Window window,
|
Timeline.Window window,
|
||||||
Timeline.Period period,
|
Timeline.Period period,
|
||||||
@Player.RepeatMode int repeatMode,
|
@Player.RepeatMode int repeatMode,
|
||||||
|
@ -62,7 +62,7 @@ public final class ExoTimeoutException extends RuntimeException {
|
|||||||
public static final int TIMEOUT_OPERATION_DETACH_SURFACE = 3;
|
public static final int TIMEOUT_OPERATION_DETACH_SURFACE = 3;
|
||||||
|
|
||||||
/** The operation on the ExoPlayer playback thread that timed out. */
|
/** The operation on the ExoPlayer playback thread that timed out. */
|
||||||
@TimeoutOperation public final int timeoutOperation;
|
public final @TimeoutOperation int timeoutOperation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates the timeout exception.
|
* Creates the timeout exception.
|
||||||
|
@ -169,14 +169,12 @@ public abstract class NoSampleRenderer implements Renderer, RendererCapabilities
|
|||||||
// RendererCapabilities implementation.
|
// RendererCapabilities implementation.
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Capabilities
|
public @Capabilities int supportsFormat(Format format) throws ExoPlaybackException {
|
||||||
public int supportsFormat(Format format) throws ExoPlaybackException {
|
|
||||||
return RendererCapabilities.create(C.FORMAT_UNSUPPORTED_TYPE);
|
return RendererCapabilities.create(C.FORMAT_UNSUPPORTED_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@AdaptiveSupport
|
public @AdaptiveSupport int supportsMixedMimeTypeAdaptation() throws ExoPlaybackException {
|
||||||
public int supportsMixedMimeTypeAdaptation() throws ExoPlaybackException {
|
|
||||||
return ADAPTIVE_NOT_SUPPORTED;
|
return ADAPTIVE_NOT_SUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ import java.util.List;
|
|||||||
/** The start position after a reported position discontinuity, in microseconds. */
|
/** The start position after a reported position discontinuity, in microseconds. */
|
||||||
public final long discontinuityStartPositionUs;
|
public final long discontinuityStartPositionUs;
|
||||||
/** The current playback state. One of the {@link Player}.STATE_ constants. */
|
/** 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. */
|
/** The current playback error, or null if this is not an error state. */
|
||||||
@Nullable public final ExoPlaybackException playbackError;
|
@Nullable public final ExoPlaybackException playbackError;
|
||||||
/** Whether the player is currently loading. */
|
/** 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}. */
|
/** Whether playback should proceed when {@link #playbackState} == {@link Player#STATE_READY}. */
|
||||||
public final boolean playWhenReady;
|
public final boolean playWhenReady;
|
||||||
/** Reason why playback is suppressed even though {@link #playWhenReady} is {@code true}. */
|
/** 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. */
|
/** The playback parameters. */
|
||||||
public final PlaybackParameters playbackParameters;
|
public final PlaybackParameters playbackParameters;
|
||||||
/** Whether offload scheduling is enabled for the main player loop. */
|
/** Whether offload scheduling is enabled for the main player loop. */
|
||||||
|
@ -191,8 +191,7 @@ public interface RendererCapabilities {
|
|||||||
* @return The combined {@link Capabilities} of the given {@link C.FormatSupport}, {@link
|
* @return The combined {@link Capabilities} of the given {@link C.FormatSupport}, {@link
|
||||||
* #ADAPTIVE_NOT_SUPPORTED} and {@link #TUNNELING_NOT_SUPPORTED}.
|
* #ADAPTIVE_NOT_SUPPORTED} and {@link #TUNNELING_NOT_SUPPORTED}.
|
||||||
*/
|
*/
|
||||||
@Capabilities
|
static @Capabilities int create(@C.FormatSupport int formatSupport) {
|
||||||
static int create(@C.FormatSupport int formatSupport) {
|
|
||||||
return create(formatSupport, ADAPTIVE_NOT_SUPPORTED, TUNNELING_NOT_SUPPORTED);
|
return create(formatSupport, ADAPTIVE_NOT_SUPPORTED, TUNNELING_NOT_SUPPORTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,8 +207,7 @@ public interface RendererCapabilities {
|
|||||||
* @param tunnelingSupport The {@link TunnelingSupport}.
|
* @param tunnelingSupport The {@link TunnelingSupport}.
|
||||||
* @return The combined {@link Capabilities}.
|
* @return The combined {@link Capabilities}.
|
||||||
*/
|
*/
|
||||||
@Capabilities
|
static @Capabilities int create(
|
||||||
static int create(
|
|
||||||
@C.FormatSupport int formatSupport,
|
@C.FormatSupport int formatSupport,
|
||||||
@AdaptiveSupport int adaptiveSupport,
|
@AdaptiveSupport int adaptiveSupport,
|
||||||
@TunnelingSupport int tunnelingSupport) {
|
@TunnelingSupport int tunnelingSupport) {
|
||||||
@ -235,8 +233,7 @@ public interface RendererCapabilities {
|
|||||||
*/
|
*/
|
||||||
// Suppression needed for IntDef casting.
|
// Suppression needed for IntDef casting.
|
||||||
@SuppressLint("WrongConstant")
|
@SuppressLint("WrongConstant")
|
||||||
@Capabilities
|
static @Capabilities int create(
|
||||||
static int create(
|
|
||||||
@C.FormatSupport int formatSupport,
|
@C.FormatSupport int formatSupport,
|
||||||
@AdaptiveSupport int adaptiveSupport,
|
@AdaptiveSupport int adaptiveSupport,
|
||||||
@TunnelingSupport int tunnelingSupport,
|
@TunnelingSupport int tunnelingSupport,
|
||||||
@ -257,8 +254,7 @@ public interface RendererCapabilities {
|
|||||||
*/
|
*/
|
||||||
// Suppression needed for IntDef casting.
|
// Suppression needed for IntDef casting.
|
||||||
@SuppressLint("WrongConstant")
|
@SuppressLint("WrongConstant")
|
||||||
@C.FormatSupport
|
static @C.FormatSupport int getFormatSupport(@Capabilities int supportFlags) {
|
||||||
static int getFormatSupport(@Capabilities int supportFlags) {
|
|
||||||
return supportFlags & FORMAT_SUPPORT_MASK;
|
return supportFlags & FORMAT_SUPPORT_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -270,8 +266,7 @@ public interface RendererCapabilities {
|
|||||||
*/
|
*/
|
||||||
// Suppression needed for IntDef casting.
|
// Suppression needed for IntDef casting.
|
||||||
@SuppressLint("WrongConstant")
|
@SuppressLint("WrongConstant")
|
||||||
@AdaptiveSupport
|
static @AdaptiveSupport int getAdaptiveSupport(@Capabilities int supportFlags) {
|
||||||
static int getAdaptiveSupport(@Capabilities int supportFlags) {
|
|
||||||
return supportFlags & ADAPTIVE_SUPPORT_MASK;
|
return supportFlags & ADAPTIVE_SUPPORT_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -283,8 +278,7 @@ public interface RendererCapabilities {
|
|||||||
*/
|
*/
|
||||||
// Suppression needed for IntDef casting.
|
// Suppression needed for IntDef casting.
|
||||||
@SuppressLint("WrongConstant")
|
@SuppressLint("WrongConstant")
|
||||||
@TunnelingSupport
|
static @TunnelingSupport int getTunnelingSupport(@Capabilities int supportFlags) {
|
||||||
static int getTunnelingSupport(@Capabilities int supportFlags) {
|
|
||||||
return supportFlags & TUNNELING_SUPPORT_MASK;
|
return supportFlags & TUNNELING_SUPPORT_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -296,8 +290,8 @@ public interface RendererCapabilities {
|
|||||||
*/
|
*/
|
||||||
// Suppression needed for IntDef casting.
|
// Suppression needed for IntDef casting.
|
||||||
@SuppressLint("WrongConstant")
|
@SuppressLint("WrongConstant")
|
||||||
@HardwareAccelerationSupport
|
static @HardwareAccelerationSupport int getHardwareAccelerationSupport(
|
||||||
static int getHardwareAccelerationSupport(@Capabilities int supportFlags) {
|
@Capabilities int supportFlags) {
|
||||||
return supportFlags & HARDWARE_ACCELERATION_SUPPORT_MASK;
|
return supportFlags & HARDWARE_ACCELERATION_SUPPORT_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -309,8 +303,7 @@ public interface RendererCapabilities {
|
|||||||
*/
|
*/
|
||||||
// Suppression needed for IntDef casting.
|
// Suppression needed for IntDef casting.
|
||||||
@SuppressLint("WrongConstant")
|
@SuppressLint("WrongConstant")
|
||||||
@DecoderSupport
|
static @DecoderSupport int getDecoderSupport(@Capabilities int supportFlags) {
|
||||||
static int getDecoderSupport(@Capabilities int supportFlags) {
|
|
||||||
return supportFlags & MODE_SUPPORT_MASK;
|
return supportFlags & MODE_SUPPORT_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -398,8 +398,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@C.VideoScalingMode
|
public @C.VideoScalingMode int getVideoScalingMode() {
|
||||||
public int getVideoScalingMode() {
|
|
||||||
return player.getVideoScalingMode();
|
return player.getVideoScalingMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -410,8 +409,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@C.VideoChangeFrameRateStrategy
|
public @C.VideoChangeFrameRateStrategy int getVideoChangeFrameRateStrategy() {
|
||||||
public int getVideoChangeFrameRateStrategy() {
|
|
||||||
return player.getVideoChangeFrameRateStrategy();
|
return player.getVideoChangeFrameRateStrategy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -639,14 +637,12 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@State
|
public @State int getPlaybackState() {
|
||||||
public int getPlaybackState() {
|
|
||||||
return player.getPlaybackState();
|
return player.getPlaybackState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@PlaybackSuppressionReason
|
public @PlaybackSuppressionReason int getPlaybackSuppressionReason() {
|
||||||
public int getPlaybackSuppressionReason() {
|
|
||||||
return player.getPlaybackSuppressionReason();
|
return player.getPlaybackSuppressionReason();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ import androidx.media3.common.util.Util;
|
|||||||
private final AudioManager audioManager;
|
private final AudioManager audioManager;
|
||||||
|
|
||||||
@Nullable private VolumeChangeReceiver receiver;
|
@Nullable private VolumeChangeReceiver receiver;
|
||||||
@C.StreamType private int streamType;
|
private @C.StreamType int streamType;
|
||||||
private int volume;
|
private int volume;
|
||||||
private boolean muted;
|
private boolean muted;
|
||||||
|
|
||||||
|
@ -150,8 +150,7 @@ public interface AnalyticsListener {
|
|||||||
* @param index The index. Must be between 0 (inclusive) and {@link #size()} (exclusive).
|
* @param index The index. Must be between 0 (inclusive) and {@link #size()} (exclusive).
|
||||||
* @return The {@link EventFlags event} at the given index.
|
* @return The {@link EventFlags event} at the given index.
|
||||||
*/
|
*/
|
||||||
@EventFlags
|
public @EventFlags int get(int index) {
|
||||||
public int get(int index) {
|
|
||||||
return flags.get(index);
|
return flags.get(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ public final class MediaMetricsListener
|
|||||||
|
|
||||||
@Nullable private String activeSessionId;
|
@Nullable private String activeSessionId;
|
||||||
@Nullable private PlaybackMetrics.Builder metricsBuilder;
|
@Nullable private PlaybackMetrics.Builder metricsBuilder;
|
||||||
@Player.DiscontinuityReason private int discontinuityReason;
|
private @Player.DiscontinuityReason int discontinuityReason;
|
||||||
private int currentPlaybackState;
|
private int currentPlaybackState;
|
||||||
private int currentNetworkType;
|
private int currentNetworkType;
|
||||||
@Nullable private PlaybackException pendingPlayerError;
|
@Nullable private PlaybackException pendingPlayerError;
|
||||||
@ -887,7 +887,7 @@ public final class MediaMetricsListener
|
|||||||
private static final class PendingFormatUpdate {
|
private static final class PendingFormatUpdate {
|
||||||
|
|
||||||
public final Format format;
|
public final Format format;
|
||||||
@C.SelectionReason public final int selectionReason;
|
public final @C.SelectionReason int selectionReason;
|
||||||
public final String sessionId;
|
public final String sessionId;
|
||||||
|
|
||||||
public PendingFormatUpdate(
|
public PendingFormatUpdate(
|
||||||
|
@ -84,7 +84,7 @@ public final class PlaybackStatsListener
|
|||||||
|
|
||||||
@Nullable private String discontinuityFromSession;
|
@Nullable private String discontinuityFromSession;
|
||||||
private long discontinuityFromPositionMs;
|
private long discontinuityFromPositionMs;
|
||||||
@Player.DiscontinuityReason private int discontinuityReason;
|
private @Player.DiscontinuityReason int discontinuityReason;
|
||||||
private int droppedFrames;
|
private int droppedFrames;
|
||||||
@Nullable private Exception nonFatalException;
|
@Nullable private Exception nonFatalException;
|
||||||
private long bandwidthTimeMs;
|
private long bandwidthTimeMs;
|
||||||
|
@ -45,7 +45,7 @@ public interface AudioProcessor {
|
|||||||
/** The number of interleaved channels. */
|
/** The number of interleaved channels. */
|
||||||
public final int channelCount;
|
public final int channelCount;
|
||||||
/** The type of linear PCM encoding. */
|
/** 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. */
|
/** The number of bytes used to represent one audio frame. */
|
||||||
public final int bytesPerFrame;
|
public final int bytesPerFrame;
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ public abstract class DecoderAudioRenderer<
|
|||||||
@Nullable private DrmSession decoderDrmSession;
|
@Nullable private DrmSession decoderDrmSession;
|
||||||
@Nullable private DrmSession sourceDrmSession;
|
@Nullable private DrmSession sourceDrmSession;
|
||||||
|
|
||||||
@ReinitializationState private int decoderReinitializationState;
|
private @ReinitializationState int decoderReinitializationState;
|
||||||
private boolean decoderReceivedBuffers;
|
private boolean decoderReceivedBuffers;
|
||||||
private boolean audioTrackNeedsConfigure;
|
private boolean audioTrackNeedsConfigure;
|
||||||
|
|
||||||
@ -228,8 +228,7 @@ public abstract class DecoderAudioRenderer<
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Capabilities
|
public final @Capabilities int supportsFormat(Format format) {
|
||||||
public final int supportsFormat(Format format) {
|
|
||||||
if (!MimeTypes.isAudio(format.sampleMimeType)) {
|
if (!MimeTypes.isAudio(format.sampleMimeType)) {
|
||||||
return RendererCapabilities.create(C.FORMAT_UNSUPPORTED_TYPE);
|
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}.
|
* @param format The format, which has an audio {@link Format#sampleMimeType}.
|
||||||
* @return The {@link C.FormatSupport} for this {@link Format}.
|
* @return The {@link C.FormatSupport} for this {@link Format}.
|
||||||
*/
|
*/
|
||||||
@C.FormatSupport
|
protected abstract @C.FormatSupport int supportsFormatInternal(Format format);
|
||||||
protected abstract int supportsFormatInternal(Format format);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether the renderer's {@link AudioSink} supports a given {@link 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)
|
* @see AudioSink#getFormatSupport(Format) (Format)
|
||||||
*/
|
*/
|
||||||
@SinkFormatSupport
|
protected final @SinkFormatSupport int getSinkFormatSupport(Format format) {
|
||||||
protected final int getSinkFormatSupport(Format format) {
|
|
||||||
return audioSink.getFormatSupport(format);
|
return audioSink.getFormatSupport(format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -482,8 +482,8 @@ public final class DefaultAudioSink implements AudioSink {
|
|||||||
private final AudioTrackPositionTracker audioTrackPositionTracker;
|
private final AudioTrackPositionTracker audioTrackPositionTracker;
|
||||||
private final ArrayDeque<MediaPositionParameters> mediaPositionParametersCheckpoints;
|
private final ArrayDeque<MediaPositionParameters> mediaPositionParametersCheckpoints;
|
||||||
private final boolean enableAudioTrackPlaybackParams;
|
private final boolean enableAudioTrackPlaybackParams;
|
||||||
@OffloadMode private final int offloadMode;
|
private final @OffloadMode int offloadMode;
|
||||||
@MonotonicNonNull private StreamEventCallbackV29 offloadStreamEventCallbackV29;
|
private @MonotonicNonNull StreamEventCallbackV29 offloadStreamEventCallbackV29;
|
||||||
private final PendingExceptionHolder<InitializationException>
|
private final PendingExceptionHolder<InitializationException>
|
||||||
initializationExceptionPendingExceptionHolder;
|
initializationExceptionPendingExceptionHolder;
|
||||||
private final PendingExceptionHolder<WriteException> writeExceptionPendingExceptionHolder;
|
private final PendingExceptionHolder<WriteException> writeExceptionPendingExceptionHolder;
|
||||||
@ -492,7 +492,7 @@ public final class DefaultAudioSink implements AudioSink {
|
|||||||
@Nullable private PlayerId playerId;
|
@Nullable private PlayerId playerId;
|
||||||
@Nullable private Listener listener;
|
@Nullable private Listener listener;
|
||||||
@Nullable private Configuration pendingConfiguration;
|
@Nullable private Configuration pendingConfiguration;
|
||||||
@MonotonicNonNull private Configuration configuration;
|
private @MonotonicNonNull Configuration configuration;
|
||||||
@Nullable private AudioTrack audioTrack;
|
@Nullable private AudioTrack audioTrack;
|
||||||
|
|
||||||
private AudioAttributes audioAttributes;
|
private AudioAttributes audioAttributes;
|
||||||
@ -518,7 +518,7 @@ public final class DefaultAudioSink implements AudioSink {
|
|||||||
@Nullable private ByteBuffer inputBuffer;
|
@Nullable private ByteBuffer inputBuffer;
|
||||||
private int inputBufferAccessUnitCount;
|
private int inputBufferAccessUnitCount;
|
||||||
@Nullable private ByteBuffer outputBuffer;
|
@Nullable private ByteBuffer outputBuffer;
|
||||||
@MonotonicNonNull private byte[] preV21OutputBuffer;
|
private @MonotonicNonNull byte[] preV21OutputBuffer;
|
||||||
private int preV21OutputBufferOffset;
|
private int preV21OutputBufferOffset;
|
||||||
private int drainingAudioProcessorIndex;
|
private int drainingAudioProcessorIndex;
|
||||||
private boolean handledEndOfStream;
|
private boolean handledEndOfStream;
|
||||||
@ -661,8 +661,7 @@ public final class DefaultAudioSink implements AudioSink {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SinkFormatSupport
|
public @SinkFormatSupport int getFormatSupport(Format format) {
|
||||||
public int getFormatSupport(Format format) {
|
|
||||||
if (MimeTypes.AUDIO_RAW.equals(format.sampleMimeType)) {
|
if (MimeTypes.AUDIO_RAW.equals(format.sampleMimeType)) {
|
||||||
if (!Util.isEncodingLinearPcm(format.pcmEncoding)) {
|
if (!Util.isEncodingLinearPcm(format.pcmEncoding)) {
|
||||||
Log.w(TAG, "Invalid PCM encoding: " + 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 Format inputFormat;
|
||||||
public final int inputPcmFrameSize;
|
public final int inputPcmFrameSize;
|
||||||
@OutputMode public final int outputMode;
|
public final @OutputMode int outputMode;
|
||||||
public final int outputPcmFrameSize;
|
public final int outputPcmFrameSize;
|
||||||
public final int outputSampleRate;
|
public final int outputSampleRate;
|
||||||
public final int outputChannelConfig;
|
public final int outputChannelConfig;
|
||||||
@C.Encoding public final int outputEncoding;
|
public final @C.Encoding int outputEncoding;
|
||||||
public final int bufferSize;
|
public final int bufferSize;
|
||||||
public final AudioProcessor[] availableAudioProcessors;
|
public final AudioProcessor[] availableAudioProcessors;
|
||||||
|
|
||||||
|
@ -50,8 +50,7 @@ public class ForwardingAudioSink implements AudioSink {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SinkFormatSupport
|
public @SinkFormatSupport int getFormatSupport(Format format) {
|
||||||
public int getFormatSupport(Format format) {
|
|
||||||
return sink.getFormatSupport(format);
|
return sink.getFormatSupport(format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -286,8 +286,7 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Capabilities
|
protected @Capabilities int supportsFormat(MediaCodecSelector mediaCodecSelector, Format format)
|
||||||
protected int supportsFormat(MediaCodecSelector mediaCodecSelector, Format format)
|
|
||||||
throws DecoderQueryException {
|
throws DecoderQueryException {
|
||||||
if (!MimeTypes.isAudio(format.sampleMimeType)) {
|
if (!MimeTypes.isAudio(format.sampleMimeType)) {
|
||||||
return RendererCapabilities.create(C.FORMAT_UNSUPPORTED_TYPE);
|
return RendererCapabilities.create(C.FORMAT_UNSUPPORTED_TYPE);
|
||||||
|
@ -88,7 +88,7 @@ public final class SilenceSkippingAudioProcessor extends BaseAudioProcessor {
|
|||||||
*/
|
*/
|
||||||
private byte[] paddingBuffer;
|
private byte[] paddingBuffer;
|
||||||
|
|
||||||
@State private int state;
|
private @State int state;
|
||||||
private int maybeSilenceBufferSize;
|
private int maybeSilenceBufferSize;
|
||||||
private int paddingSize;
|
private int paddingSize;
|
||||||
private boolean hasOutputNoise;
|
private boolean hasOutputNoise;
|
||||||
|
@ -129,8 +129,7 @@ import java.util.concurrent.Executor;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Delegates to Spatializer.getImmersiveAudioLevel() */
|
/** Delegates to Spatializer.getImmersiveAudioLevel() */
|
||||||
@ImmersiveAudioLevel
|
public @ImmersiveAudioLevel int getImmersiveAudioLevel() {
|
||||||
public int getImmersiveAudioLevel() {
|
|
||||||
try {
|
try {
|
||||||
return (int) Util.castNonNull(getImmersiveAudioLevel.invoke(spatializer));
|
return (int) Util.castNonNull(getImmersiveAudioLevel.invoke(spatializer));
|
||||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||||
|
@ -128,7 +128,7 @@ public final class TeeAudioProcessor extends BaseAudioProcessor {
|
|||||||
|
|
||||||
private int sampleRateHz;
|
private int sampleRateHz;
|
||||||
private int channelCount;
|
private int channelCount;
|
||||||
@C.PcmEncoding private int encoding;
|
private @C.PcmEncoding int encoding;
|
||||||
@Nullable private RandomAccessFile randomAccessFile;
|
@Nullable private RandomAccessFile randomAccessFile;
|
||||||
private int counter;
|
private int counter;
|
||||||
private int bytesWritten;
|
private int bytesWritten;
|
||||||
|
@ -25,7 +25,7 @@ import java.nio.ByteBuffer;
|
|||||||
/** Audio processor for trimming samples from the start/end of data. */
|
/** Audio processor for trimming samples from the start/end of data. */
|
||||||
/* package */ final class TrimmingAudioProcessor extends BaseAudioProcessor {
|
/* 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 trimStartFrames;
|
||||||
private int trimEndFrames;
|
private int trimEndFrames;
|
||||||
|
@ -254,8 +254,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|||||||
// DrmSession implementation.
|
// DrmSession implementation.
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@DrmSession.State
|
public final @DrmSession.State int getState() {
|
||||||
public final int getState() {
|
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -312,7 +312,7 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
|
|||||||
@Nullable private byte[] offlineLicenseKeySetId;
|
@Nullable private byte[] offlineLicenseKeySetId;
|
||||||
private @MonotonicNonNull PlayerId playerId;
|
private @MonotonicNonNull PlayerId playerId;
|
||||||
|
|
||||||
/* package */ volatile @Nullable MediaDrmHandler mediaDrmHandler;
|
/* package */ @Nullable volatile MediaDrmHandler mediaDrmHandler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param uuid The UUID of the drm scheme.
|
* @param uuid The UUID of the drm scheme.
|
||||||
@ -590,8 +590,7 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@C.CryptoType
|
public @C.CryptoType int getCryptoType(Format format) {
|
||||||
public int getCryptoType(Format format) {
|
|
||||||
@C.CryptoType int cryptoType = checkNotNull(exoMediaDrm).getCryptoType();
|
@C.CryptoType int cryptoType = checkNotNull(exoMediaDrm).getCryptoType();
|
||||||
if (format.drmInitData == null) {
|
if (format.drmInitData == null) {
|
||||||
int trackType = MimeTypes.getTrackType(format.sampleMimeType);
|
int trackType = MimeTypes.getTrackType(format.sampleMimeType);
|
||||||
|
@ -65,7 +65,7 @@ public interface DrmSession {
|
|||||||
class DrmSessionException extends IOException {
|
class DrmSessionException extends IOException {
|
||||||
|
|
||||||
/** The {@link PlaybackException.ErrorCode} that corresponds to the failure. */
|
/** 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) {
|
public DrmSessionException(Throwable cause, @PlaybackException.ErrorCode int errorCode) {
|
||||||
super(cause);
|
super(cause);
|
||||||
|
@ -66,8 +66,7 @@ public interface DrmSessionManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@C.CryptoType
|
public @C.CryptoType int getCryptoType(Format format) {
|
||||||
public int getCryptoType(Format format) {
|
|
||||||
return format.drmInitData != null ? C.CRYPTO_TYPE_UNSUPPORTED : C.CRYPTO_TYPE_NONE;
|
return format.drmInitData != null ? C.CRYPTO_TYPE_UNSUPPORTED : C.CRYPTO_TYPE_NONE;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -72,8 +72,7 @@ public final class DrmUtil {
|
|||||||
* @return The {@link PlaybackException.ErrorCode} that corresponds to the given DRM-related
|
* @return The {@link PlaybackException.ErrorCode} that corresponds to the given DRM-related
|
||||||
* exception.
|
* exception.
|
||||||
*/
|
*/
|
||||||
@PlaybackException.ErrorCode
|
public static @PlaybackException.ErrorCode int getErrorCodeForMediaDrmException(
|
||||||
public static int getErrorCodeForMediaDrmException(
|
|
||||||
Exception exception, @ErrorSource int errorSource) {
|
Exception exception, @ErrorSource int errorSource) {
|
||||||
if (Util.SDK_INT >= 21 && Api21.isMediaDrmStateException(exception)) {
|
if (Util.SDK_INT >= 21 && Api21.isMediaDrmStateException(exception)) {
|
||||||
return Api21.mediaDrmStateExceptionToErrorCode(exception);
|
return Api21.mediaDrmStateExceptionToErrorCode(exception);
|
||||||
@ -128,8 +127,8 @@ public final class DrmUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DoNotInline
|
@DoNotInline
|
||||||
@PlaybackException.ErrorCode
|
public static @PlaybackException.ErrorCode int mediaDrmStateExceptionToErrorCode(
|
||||||
public static int mediaDrmStateExceptionToErrorCode(Throwable throwable) {
|
Throwable throwable) {
|
||||||
@Nullable
|
@Nullable
|
||||||
String diagnosticsInfo = ((MediaDrm.MediaDrmStateException) throwable).getDiagnosticInfo();
|
String diagnosticsInfo = ((MediaDrm.MediaDrmStateException) throwable).getDiagnosticInfo();
|
||||||
int drmErrorCode = Util.getErrorCodeFromPlatformDiagnosticsInfo(diagnosticsInfo);
|
int drmErrorCode = Util.getErrorCodeFromPlatformDiagnosticsInfo(diagnosticsInfo);
|
||||||
|
@ -153,8 +153,7 @@ public final class DummyExoMediaDrm implements ExoMediaDrm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@C.CryptoType
|
public @C.CryptoType int getCryptoType() {
|
||||||
public int getCryptoType() {
|
|
||||||
return C.CRYPTO_TYPE_UNSUPPORTED;
|
return C.CRYPTO_TYPE_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -267,7 +267,7 @@ public interface ExoMediaDrm {
|
|||||||
|
|
||||||
private final byte[] data;
|
private final byte[] data;
|
||||||
private final String licenseServerUrl;
|
private final String licenseServerUrl;
|
||||||
@RequestType private final int requestType;
|
private final @RequestType int requestType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an instance with {@link #REQUEST_TYPE_UNKNOWN}.
|
* 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,
|
* 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.
|
* key requests only specify a type on API levels 23 and above.
|
||||||
*/
|
*/
|
||||||
@RequestType
|
public @RequestType int getRequestType() {
|
||||||
public int getRequestType() {
|
|
||||||
return requestType;
|
return requestType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -342,8 +342,7 @@ public final class FrameworkMediaDrm implements ExoMediaDrm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@C.CryptoType
|
public @C.CryptoType int getCryptoType() {
|
||||||
public int getCryptoType() {
|
|
||||||
return C.CRYPTO_TYPE_FRAMEWORK;
|
return C.CRYPTO_TYPE_FRAMEWORK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ public final class UnsupportedDrmException extends Exception {
|
|||||||
public static final int REASON_INSTANTIATION_ERROR = 2;
|
public static final int REASON_INSTANTIATION_ERROR = 2;
|
||||||
|
|
||||||
/** Either {@link #REASON_UNSUPPORTED_SCHEME} or {@link #REASON_INSTANTIATION_ERROR}. */
|
/** 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}. */
|
/** @param reason {@link #REASON_UNSUPPORTED_SCHEME} or {@link #REASON_INSTANTIATION_ERROR}. */
|
||||||
public UnsupportedDrmException(@Reason int reason) {
|
public UnsupportedDrmException(@Reason int reason) {
|
||||||
|
@ -39,7 +39,8 @@ public final class WidevineUtil {
|
|||||||
* @return A {@link Pair} consisting of the remaining license and playback durations in seconds,
|
* @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.
|
* 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();
|
Map<String, String> keyStatus = drmSession.queryKeyStatus();
|
||||||
if (keyStatus == null) {
|
if (keyStatus == null) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -141,7 +141,7 @@ import java.nio.ByteBuffer;
|
|||||||
private final boolean synchronizeCodecInteractionsWithQueueing;
|
private final boolean synchronizeCodecInteractionsWithQueueing;
|
||||||
private final boolean enableImmediateCodecStartAfterFlush;
|
private final boolean enableImmediateCodecStartAfterFlush;
|
||||||
private boolean codecReleased;
|
private boolean codecReleased;
|
||||||
@State private int state;
|
private @State int state;
|
||||||
|
|
||||||
private AsynchronousMediaCodecAdapter(
|
private AsynchronousMediaCodecAdapter(
|
||||||
MediaCodec codec,
|
MediaCodec codec,
|
||||||
|
@ -53,7 +53,7 @@ public final class DefaultMediaCodecAdapterFactory implements MediaCodecAdapter.
|
|||||||
|
|
||||||
private static final String TAG = "DMCodecAdapterFactory";
|
private static final String TAG = "DMCodecAdapterFactory";
|
||||||
|
|
||||||
@Mode private int asynchronousMode;
|
private @Mode int asynchronousMode;
|
||||||
private boolean enableSynchronizeCodecInteractionsWithQueueing;
|
private boolean enableSynchronizeCodecInteractionsWithQueueing;
|
||||||
private boolean enableImmediateCodecStartAfterFlush;
|
private boolean enableImmediateCodecStartAfterFlush;
|
||||||
|
|
||||||
|
@ -327,7 +327,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
|
|||||||
@Nullable private ArrayDeque<MediaCodecInfo> availableCodecInfos;
|
@Nullable private ArrayDeque<MediaCodecInfo> availableCodecInfos;
|
||||||
@Nullable private DecoderInitializationException preferredDecoderInitializationException;
|
@Nullable private DecoderInitializationException preferredDecoderInitializationException;
|
||||||
@Nullable private MediaCodecInfo codecInfo;
|
@Nullable private MediaCodecInfo codecInfo;
|
||||||
@AdaptationWorkaroundMode private int codecAdaptationWorkaroundMode;
|
private @AdaptationWorkaroundMode int codecAdaptationWorkaroundMode;
|
||||||
private boolean codecNeedsDiscardToSpsWorkaround;
|
private boolean codecNeedsDiscardToSpsWorkaround;
|
||||||
private boolean codecNeedsFlushWorkaround;
|
private boolean codecNeedsFlushWorkaround;
|
||||||
private boolean codecNeedsSosFlushWorkaround;
|
private boolean codecNeedsSosFlushWorkaround;
|
||||||
@ -349,9 +349,9 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
|
|||||||
private boolean bypassSampleBufferPending;
|
private boolean bypassSampleBufferPending;
|
||||||
private boolean bypassDrainAndReinitialize;
|
private boolean bypassDrainAndReinitialize;
|
||||||
private boolean codecReconfigured;
|
private boolean codecReconfigured;
|
||||||
@ReconfigurationState private int codecReconfigurationState;
|
private @ReconfigurationState int codecReconfigurationState;
|
||||||
@DrainState private int codecDrainState;
|
private @DrainState int codecDrainState;
|
||||||
@DrainAction private int codecDrainAction;
|
private @DrainAction int codecDrainAction;
|
||||||
private boolean codecReceivedBuffers;
|
private boolean codecReceivedBuffers;
|
||||||
private boolean codecReceivedEos;
|
private boolean codecReceivedEos;
|
||||||
private boolean codecHasOutputMediaFormat;
|
private boolean codecHasOutputMediaFormat;
|
||||||
@ -437,14 +437,12 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@AdaptiveSupport
|
public final @AdaptiveSupport int supportsMixedMimeTypeAdaptation() {
|
||||||
public final int supportsMixedMimeTypeAdaptation() {
|
|
||||||
return ADAPTIVE_NOT_SEAMLESS;
|
return ADAPTIVE_NOT_SEAMLESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Capabilities
|
public final @Capabilities int supportsFormat(Format format) throws ExoPlaybackException {
|
||||||
public final int supportsFormat(Format format) throws ExoPlaybackException {
|
|
||||||
try {
|
try {
|
||||||
return supportsFormat(mediaCodecSelector, format);
|
return supportsFormat(mediaCodecSelector, format);
|
||||||
} catch (DecoderQueryException e) {
|
} catch (DecoderQueryException e) {
|
||||||
@ -460,9 +458,8 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
|
|||||||
* @return The {@link Capabilities} for this {@link Format}.
|
* @return The {@link Capabilities} for this {@link Format}.
|
||||||
* @throws DecoderQueryException If there was an error querying decoders.
|
* @throws DecoderQueryException If there was an error querying decoders.
|
||||||
*/
|
*/
|
||||||
@Capabilities
|
protected abstract @Capabilities int supportsFormat(
|
||||||
protected abstract int supportsFormat(MediaCodecSelector mediaCodecSelector, Format format)
|
MediaCodecSelector mediaCodecSelector, Format format) throws DecoderQueryException;
|
||||||
throws DecoderQueryException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of decoders that can decode media in the specified format, in priority order.
|
* Returns a list of decoders that can decode media in the specified format, in priority order.
|
||||||
|
@ -94,8 +94,7 @@ public final class MetadataRenderer extends BaseRenderer implements Callback {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Capabilities
|
public @Capabilities int supportsFormat(Format format) {
|
||||||
public int supportsFormat(Format format) {
|
|
||||||
if (decoderFactory.supportsFormat(format)) {
|
if (decoderFactory.supportsFormat(format)) {
|
||||||
return RendererCapabilities.create(
|
return RendererCapabilities.create(
|
||||||
format.cryptoType == C.CRYPTO_TYPE_NONE ? C.FORMAT_HANDLED : C.FORMAT_UNSUPPORTED_DRM);
|
format.cryptoType == C.CRYPTO_TYPE_NONE ? C.FORMAT_HANDLED : C.FORMAT_UNSUPPORTED_DRM);
|
||||||
|
@ -99,7 +99,7 @@ public final class Download {
|
|||||||
/** The download request. */
|
/** The download request. */
|
||||||
public final DownloadRequest request;
|
public final DownloadRequest request;
|
||||||
/** The state of the download. */
|
/** The state of the download. */
|
||||||
@State public final int state;
|
public final @State int state;
|
||||||
/** The first time when download entry is created. */
|
/** The first time when download entry is created. */
|
||||||
public final long startTimeMs;
|
public final long startTimeMs;
|
||||||
/** The last update time. */
|
/** 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
|
* If {@link #state} is {@link #STATE_FAILED} then this is the cause, otherwise {@link
|
||||||
* #FAILURE_REASON_NONE}.
|
* #FAILURE_REASON_NONE}.
|
||||||
*/
|
*/
|
||||||
@FailureReason public final int failureReason;
|
public final @FailureReason int failureReason;
|
||||||
|
|
||||||
/* package */ final DownloadProgress progress;
|
/* package */ final DownloadProgress progress;
|
||||||
|
|
||||||
|
@ -1100,8 +1100,7 @@ public final class DownloadHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@C.SelectionReason
|
public @C.SelectionReason int getSelectionReason() {
|
||||||
public int getSelectionReason() {
|
|
||||||
return C.SELECTION_REASON_UNKNOWN;
|
return C.SELECTION_REASON_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -351,8 +351,7 @@ public final class DownloadManager {
|
|||||||
*
|
*
|
||||||
* @return The not met {@link Requirements.RequirementFlags}, or 0 if all requirements are met.
|
* @return The not met {@link Requirements.RequirementFlags}, or 0 if all requirements are met.
|
||||||
*/
|
*/
|
||||||
@Requirements.RequirementFlags
|
public @Requirements.RequirementFlags int getNotMetRequirements() {
|
||||||
public int getNotMetRequirements() {
|
|
||||||
return notMetRequirements;
|
return notMetRequirements;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -705,7 +704,7 @@ public final class DownloadManager {
|
|||||||
private final ArrayList<Download> downloads;
|
private final ArrayList<Download> downloads;
|
||||||
private final HashMap<String, Task> activeTasks;
|
private final HashMap<String, Task> activeTasks;
|
||||||
|
|
||||||
@Requirements.RequirementFlags private int notMetRequirements;
|
private @Requirements.RequirementFlags int notMetRequirements;
|
||||||
private boolean downloadsPaused;
|
private boolean downloadsPaused;
|
||||||
private int maxParallelDownloads;
|
private int maxParallelDownloads;
|
||||||
private int minRetryCount;
|
private int minRetryCount;
|
||||||
|
@ -74,7 +74,7 @@ public final class Requirements implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
public static final int DEVICE_STORAGE_NOT_LOW = 1 << 4;
|
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. */
|
/** @param requirements A combination of requirement flags. */
|
||||||
public Requirements(@RequirementFlags int requirements) {
|
public Requirements(@RequirementFlags int requirements) {
|
||||||
@ -86,8 +86,7 @@ public final class Requirements implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Returns the requirements. */
|
/** Returns the requirements. */
|
||||||
@RequirementFlags
|
public @RequirementFlags int getRequirements() {
|
||||||
public int getRequirements() {
|
|
||||||
return requirements;
|
return requirements;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,8 +143,7 @@ public final class Requirements implements Parcelable {
|
|||||||
* @param context Any context.
|
* @param context Any context.
|
||||||
* @return The requirements that are not met, or 0.
|
* @return The requirements that are not met, or 0.
|
||||||
*/
|
*/
|
||||||
@RequirementFlags
|
public @RequirementFlags int getNotMetRequirements(Context context) {
|
||||||
public int getNotMetRequirements(Context context) {
|
|
||||||
@RequirementFlags int notMetRequirements = getNotMetNetworkRequirements(context);
|
@RequirementFlags int notMetRequirements = getNotMetNetworkRequirements(context);
|
||||||
if (isChargingRequired() && !isDeviceCharging(context)) {
|
if (isChargingRequired() && !isDeviceCharging(context)) {
|
||||||
notMetRequirements |= DEVICE_CHARGING;
|
notMetRequirements |= DEVICE_CHARGING;
|
||||||
@ -159,8 +157,7 @@ public final class Requirements implements Parcelable {
|
|||||||
return notMetRequirements;
|
return notMetRequirements;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequirementFlags
|
private @RequirementFlags int getNotMetNetworkRequirements(Context context) {
|
||||||
private int getNotMetNetworkRequirements(Context context) {
|
|
||||||
if (!isNetworkRequired()) {
|
if (!isNetworkRequired()) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ public final class RequirementsWatcher {
|
|||||||
|
|
||||||
@Nullable private DeviceStatusChangeReceiver receiver;
|
@Nullable private DeviceStatusChangeReceiver receiver;
|
||||||
|
|
||||||
@Requirements.RequirementFlags private int notMetRequirements;
|
private @Requirements.RequirementFlags int notMetRequirements;
|
||||||
@Nullable private NetworkCallback networkCallback;
|
@Nullable private NetworkCallback networkCallback;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -83,8 +83,7 @@ public final class RequirementsWatcher {
|
|||||||
*
|
*
|
||||||
* @return Initial {@link Requirements.RequirementFlags RequirementFlags} that are not met, or 0.
|
* @return Initial {@link Requirements.RequirementFlags RequirementFlags} that are not met, or 0.
|
||||||
*/
|
*/
|
||||||
@Requirements.RequirementFlags
|
public @Requirements.RequirementFlags int start() {
|
||||||
public int start() {
|
|
||||||
notMetRequirements = requirements.getNotMetRequirements(context);
|
notMetRequirements = requirements.getNotMetRequirements(context);
|
||||||
|
|
||||||
IntentFilter filter = new IntentFilter();
|
IntentFilter filter = new IntentFilter();
|
||||||
|
@ -63,7 +63,7 @@ public final class ClippingMediaSource extends CompositeMediaSource<Void> {
|
|||||||
public static final int REASON_START_EXCEEDS_END = 2;
|
public static final int REASON_START_EXCEEDS_END = 2;
|
||||||
|
|
||||||
/** The reason clipping failed. */
|
/** The reason clipping failed. */
|
||||||
@Reason public final int reason;
|
public final @Reason int reason;
|
||||||
|
|
||||||
/** @param reason The reason clipping failed. */
|
/** @param reason The reason clipping failed. */
|
||||||
public IllegalClippingException(@Reason int reason) {
|
public IllegalClippingException(@Reason int reason) {
|
||||||
|
@ -472,8 +472,7 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory {
|
|||||||
mediaSourceFactories = new HashMap<>();
|
mediaSourceFactories = new HashMap<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@C.ContentType
|
public @C.ContentType int[] getSupportedTypes() {
|
||||||
public int[] getSupportedTypes() {
|
|
||||||
ensureAllSuppliersAreLoaded();
|
ensureAllSuppliersAreLoaded();
|
||||||
return Ints.toArray(supportedTypes);
|
return Ints.toArray(supportedTypes);
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ import androidx.media3.common.util.UnstableApi;
|
|||||||
public final class MediaLoadData {
|
public final class MediaLoadData {
|
||||||
|
|
||||||
/** The {@link DataType data type}. */
|
/** 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
|
* 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.
|
* to media of a specific type, or {@link C#TRACK_TYPE_UNKNOWN} otherwise.
|
||||||
|
@ -47,8 +47,7 @@ public interface MediaSourceFactory extends MediaSource.Factory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@C.ContentType
|
public @C.ContentType int[] getSupportedTypes() {
|
||||||
public int[] getSupportedTypes() {
|
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ public final class MergingMediaSource extends CompositeMediaSource<Integer> {
|
|||||||
public static final int REASON_PERIOD_COUNT_MISMATCH = 0;
|
public static final int REASON_PERIOD_COUNT_MISMATCH = 0;
|
||||||
|
|
||||||
/** The reason the merge failed. */
|
/** The reason the merge failed. */
|
||||||
@Reason public final int reason;
|
public final @Reason int reason;
|
||||||
|
|
||||||
/** @param reason The reason the merge failed. */
|
/** @param reason The reason the merge failed. */
|
||||||
public IllegalMergeException(@Reason int reason) {
|
public IllegalMergeException(@Reason int reason) {
|
||||||
|
@ -131,7 +131,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
|||||||
private @MonotonicNonNull SeekMap seekMap;
|
private @MonotonicNonNull SeekMap seekMap;
|
||||||
private long durationUs;
|
private long durationUs;
|
||||||
private boolean isLive;
|
private boolean isLive;
|
||||||
@DataType private int dataType;
|
private @DataType int dataType;
|
||||||
|
|
||||||
private boolean seenFirstTrackSelection;
|
private boolean seenFirstTrackSelection;
|
||||||
private boolean notifyDiscontinuity;
|
private boolean notifyDiscontinuity;
|
||||||
|
@ -87,7 +87,7 @@ public final class SilenceMediaSource extends BaseMediaSource {
|
|||||||
public static final String MEDIA_ID = "SilenceMediaSource";
|
public static final String MEDIA_ID = "SilenceMediaSource";
|
||||||
|
|
||||||
private static final int SAMPLE_RATE_HZ = 44100;
|
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 int CHANNEL_COUNT = 2;
|
||||||
private static final Format FORMAT =
|
private static final Format FORMAT =
|
||||||
new Format.Builder()
|
new Format.Builder()
|
||||||
|
@ -847,8 +847,7 @@ public final class ServerSideAdInsertionMediaSource extends BaseMediaSource
|
|||||||
return positionUs;
|
return positionUs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SampleStream.ReadDataResult
|
public @SampleStream.ReadDataResult int readData(
|
||||||
public int readData(
|
|
||||||
MediaPeriodImpl mediaPeriod,
|
MediaPeriodImpl mediaPeriod,
|
||||||
int streamIndex,
|
int streamIndex,
|
||||||
FormatHolder formatHolder,
|
FormatHolder formatHolder,
|
||||||
@ -1204,8 +1203,7 @@ public final class ServerSideAdInsertionMediaSource extends BaseMediaSource
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ReadDataResult
|
public @ReadDataResult int readData(
|
||||||
public int readData(
|
|
||||||
FormatHolder formatHolder, DecoderInputBuffer buffer, @ReadFlags int readFlags) {
|
FormatHolder formatHolder, DecoderInputBuffer buffer, @ReadFlags int readFlags) {
|
||||||
return mediaPeriod.sharedPeriod.readData(
|
return mediaPeriod.sharedPeriod.readData(
|
||||||
mediaPeriod, streamIndex, formatHolder, buffer, readFlags);
|
mediaPeriod, streamIndex, formatHolder, buffer, readFlags);
|
||||||
|
@ -42,7 +42,7 @@ public abstract class Chunk implements Loadable {
|
|||||||
/** The {@link DataSpec} that defines the data to be loaded. */
|
/** The {@link DataSpec} that defines the data to be loaded. */
|
||||||
public final DataSpec dataSpec;
|
public final DataSpec dataSpec;
|
||||||
/** The {@link DataType data type} of the chunk. For reporting only. */
|
/** 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. */
|
/** The format of the track to which this chunk belongs. */
|
||||||
public final Format trackFormat;
|
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
|
* C#SELECTION_REASON_UNKNOWN} if the chunk does not belong to a track, or if the selection reason
|
||||||
* is unknown.
|
* 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
|
* 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.
|
* the chunk does not belong to a track, or if there is no associated track selection data.
|
||||||
|
@ -540,8 +540,7 @@ public final class OutputConsumerAdapterV30 implements MediaParser.OutputConsume
|
|||||||
return new DrmInitData(schemeType, schemeDatas);
|
return new DrmInitData(schemeType, schemeDatas);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SelectionFlags
|
private static @SelectionFlags int getSelectionFlags(MediaFormat mediaFormat) {
|
||||||
private static int getSelectionFlags(MediaFormat mediaFormat) {
|
|
||||||
int selectionFlags = 0;
|
int selectionFlags = 0;
|
||||||
selectionFlags |=
|
selectionFlags |=
|
||||||
getFlag(
|
getFlag(
|
||||||
|
@ -63,7 +63,7 @@ public final class ExoplayerCuesDecoder implements SubtitleDecoder {
|
|||||||
private final SubtitleInputBuffer inputBuffer;
|
private final SubtitleInputBuffer inputBuffer;
|
||||||
private final Deque<SubtitleOutputBuffer> availableOutputBuffers;
|
private final Deque<SubtitleOutputBuffer> availableOutputBuffers;
|
||||||
|
|
||||||
@InputBufferState private int inputBufferState;
|
private @InputBufferState int inputBufferState;
|
||||||
private boolean released;
|
private boolean released;
|
||||||
|
|
||||||
public ExoplayerCuesDecoder() {
|
public ExoplayerCuesDecoder() {
|
||||||
|
@ -94,7 +94,7 @@ public final class TextRenderer extends BaseRenderer implements Callback {
|
|||||||
private boolean inputStreamEnded;
|
private boolean inputStreamEnded;
|
||||||
private boolean outputStreamEnded;
|
private boolean outputStreamEnded;
|
||||||
private boolean waitingForKeyFrame;
|
private boolean waitingForKeyFrame;
|
||||||
@ReplacementState private int decoderReplacementState;
|
private @ReplacementState int decoderReplacementState;
|
||||||
@Nullable private Format streamFormat;
|
@Nullable private Format streamFormat;
|
||||||
@Nullable private SubtitleDecoder decoder;
|
@Nullable private SubtitleDecoder decoder;
|
||||||
@Nullable private SubtitleInputBuffer nextInputBuffer;
|
@Nullable private SubtitleInputBuffer nextInputBuffer;
|
||||||
@ -141,8 +141,7 @@ public final class TextRenderer extends BaseRenderer implements Callback {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Capabilities
|
public @Capabilities int supportsFormat(Format format) {
|
||||||
public int supportsFormat(Format format) {
|
|
||||||
if (decoderFactory.supportsFormat(format)) {
|
if (decoderFactory.supportsFormat(format)) {
|
||||||
return RendererCapabilities.create(
|
return RendererCapabilities.create(
|
||||||
format.cryptoType == C.CRYPTO_TYPE_NONE ? C.FORMAT_HANDLED : C.FORMAT_UNSUPPORTED_DRM);
|
format.cryptoType == C.CRYPTO_TYPE_NONE ? C.FORMAT_HANDLED : C.FORMAT_UNSUPPORTED_DRM);
|
||||||
|
@ -123,7 +123,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
private boolean allowAudioMixedChannelCountAdaptiveness;
|
private boolean allowAudioMixedChannelCountAdaptiveness;
|
||||||
private boolean allowAudioMixedDecoderSupportAdaptiveness;
|
private boolean allowAudioMixedDecoderSupportAdaptiveness;
|
||||||
// Text
|
// Text
|
||||||
@C.SelectionFlags private int disabledTextTrackSelectionFlags;
|
private @C.SelectionFlags int disabledTextTrackSelectionFlags;
|
||||||
// General
|
// General
|
||||||
private boolean exceedRendererCapabilitiesIfNecessary;
|
private boolean exceedRendererCapabilitiesIfNecessary;
|
||||||
private boolean tunnelingEnabled;
|
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
|
* 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}. 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. */
|
/** Returns an instance configured with default values. */
|
||||||
public static Parameters getDefaults(Context context) {
|
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}. */
|
/** Returns to what extent the track is {@link SelectionEligibility eligible for selection}. */
|
||||||
@SelectionEligibility
|
public abstract @SelectionEligibility int getSelectionEligibility();
|
||||||
public abstract int getSelectionEligibility();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether this track is compatible for an adaptive selection with the specified other
|
* 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 int preferredRoleFlagsScore;
|
||||||
private final boolean hasMainOrNoRoleFlag;
|
private final boolean hasMainOrNoRoleFlag;
|
||||||
private final boolean allowMixedMimeTypes;
|
private final boolean allowMixedMimeTypes;
|
||||||
@SelectionEligibility private final int selectionEligibility;
|
private final @SelectionEligibility int selectionEligibility;
|
||||||
private final boolean usesPrimaryDecoder;
|
private final boolean usesPrimaryDecoder;
|
||||||
private final boolean usesHardwareAcceleration;
|
private final boolean usesHardwareAcceleration;
|
||||||
private final int codecPreferenceScore;
|
private final int codecPreferenceScore;
|
||||||
@ -2375,8 +2374,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SelectionEligibility
|
public @SelectionEligibility int getSelectionEligibility() {
|
||||||
public int getSelectionEligibility() {
|
|
||||||
return selectionEligibility;
|
return selectionEligibility;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2389,8 +2387,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
&& this.usesHardwareAcceleration == otherTrack.usesHardwareAcceleration));
|
&& this.usesHardwareAcceleration == otherTrack.usesHardwareAcceleration));
|
||||||
}
|
}
|
||||||
|
|
||||||
@SelectionEligibility
|
private @SelectionEligibility int evaluateSelectionEligibility(
|
||||||
private int evaluateSelectionEligibility(
|
|
||||||
@Capabilities int rendererSupport, @AdaptiveSupport int requiredAdaptiveSupport) {
|
@Capabilities int rendererSupport, @AdaptiveSupport int requiredAdaptiveSupport) {
|
||||||
if ((format.roleFlags & C.ROLE_FLAG_TRICK_PLAY) != 0) {
|
if ((format.roleFlags & C.ROLE_FLAG_TRICK_PLAY) != 0) {
|
||||||
// Ignore trick-play tracks for now.
|
// Ignore trick-play tracks for now.
|
||||||
@ -2502,7 +2499,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
return listBuilder.build();
|
return listBuilder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SelectionEligibility private final int selectionEligibility;
|
private final @SelectionEligibility int selectionEligibility;
|
||||||
private final boolean isWithinConstraints;
|
private final boolean isWithinConstraints;
|
||||||
@Nullable private final String language;
|
@Nullable private final String language;
|
||||||
private final Parameters parameters;
|
private final Parameters parameters;
|
||||||
@ -2594,8 +2591,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SelectionEligibility
|
public @SelectionEligibility int getSelectionEligibility() {
|
||||||
public int getSelectionEligibility() {
|
|
||||||
return selectionEligibility;
|
return selectionEligibility;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2664,8 +2660,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
.result();
|
.result();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SelectionEligibility
|
private @SelectionEligibility int evaluateSelectionEligibility(
|
||||||
private int evaluateSelectionEligibility(
|
|
||||||
@Capabilities int rendererSupport, boolean hasMappedVideoTracks) {
|
@Capabilities int rendererSupport, boolean hasMappedVideoTracks) {
|
||||||
if (!isSupported(rendererSupport, parameters.exceedRendererCapabilitiesIfNecessary)) {
|
if (!isSupported(rendererSupport, parameters.exceedRendererCapabilitiesIfNecessary)) {
|
||||||
return SELECTION_ELIGIBILITY_NO;
|
return SELECTION_ELIGIBILITY_NO;
|
||||||
@ -2712,7 +2707,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
return listBuilder.build();
|
return listBuilder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SelectionEligibility private final int selectionEligibility;
|
private final @SelectionEligibility int selectionEligibility;
|
||||||
private final boolean isWithinRendererCapabilities;
|
private final boolean isWithinRendererCapabilities;
|
||||||
private final boolean isDefault;
|
private final boolean isDefault;
|
||||||
private final boolean isForced;
|
private final boolean isForced;
|
||||||
@ -2777,8 +2772,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SelectionEligibility
|
public @SelectionEligibility int getSelectionEligibility() {
|
||||||
public int getSelectionEligibility() {
|
|
||||||
return selectionEligibility;
|
return selectionEligibility;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,8 +107,8 @@ public abstract class MappingTrackSelector extends TrackSelector {
|
|||||||
private final String[] rendererNames;
|
private final String[] rendererNames;
|
||||||
private final @C.TrackType int[] rendererTrackTypes;
|
private final @C.TrackType int[] rendererTrackTypes;
|
||||||
private final TrackGroupArray[] rendererTrackGroups;
|
private final TrackGroupArray[] rendererTrackGroups;
|
||||||
@AdaptiveSupport private final int[] rendererMixedMimeTypeAdaptiveSupports;
|
private final @AdaptiveSupport int[] rendererMixedMimeTypeAdaptiveSupports;
|
||||||
@Capabilities private final int[][][] rendererFormatSupports;
|
private final @Capabilities int[][][] rendererFormatSupports;
|
||||||
private final TrackGroupArray unmappedTrackGroups;
|
private final TrackGroupArray unmappedTrackGroups;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -181,8 +181,7 @@ public abstract class MappingTrackSelector extends TrackSelector {
|
|||||||
* @param rendererIndex The renderer index.
|
* @param rendererIndex The renderer index.
|
||||||
* @return The {@link RendererSupport}.
|
* @return The {@link RendererSupport}.
|
||||||
*/
|
*/
|
||||||
@RendererSupport
|
public @RendererSupport int getRendererSupport(int rendererIndex) {
|
||||||
public int getRendererSupport(int rendererIndex) {
|
|
||||||
@RendererSupport int bestRendererSupport = RENDERER_SUPPORT_NO_TRACKS;
|
@RendererSupport int bestRendererSupport = RENDERER_SUPPORT_NO_TRACKS;
|
||||||
@Capabilities int[][] rendererFormatSupport = rendererFormatSupports[rendererIndex];
|
@Capabilities int[][] rendererFormatSupport = rendererFormatSupports[rendererIndex];
|
||||||
for (@Capabilities int[] trackGroupFormatSupport : rendererFormatSupport) {
|
for (@Capabilities int[] trackGroupFormatSupport : rendererFormatSupport) {
|
||||||
@ -217,8 +216,7 @@ public abstract class MappingTrackSelector extends TrackSelector {
|
|||||||
* @param trackType The {@link C.TrackType track type}.
|
* @param trackType The {@link C.TrackType track type}.
|
||||||
* @return The {@link RendererSupport}.
|
* @return The {@link RendererSupport}.
|
||||||
*/
|
*/
|
||||||
@RendererSupport
|
public @RendererSupport int getTypeSupport(@C.TrackType int trackType) {
|
||||||
public int getTypeSupport(@C.TrackType int trackType) {
|
|
||||||
@RendererSupport int bestRendererSupport = RENDERER_SUPPORT_NO_TRACKS;
|
@RendererSupport int bestRendererSupport = RENDERER_SUPPORT_NO_TRACKS;
|
||||||
for (int i = 0; i < rendererCount; i++) {
|
for (int i = 0; i < rendererCount; i++) {
|
||||||
if (rendererTrackTypes[i] == trackType) {
|
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.
|
* @param trackIndex The index of the track within the track group.
|
||||||
* @return The {@link Capabilities}.
|
* @return The {@link Capabilities}.
|
||||||
*/
|
*/
|
||||||
@Capabilities
|
public @Capabilities int getCapabilities(int rendererIndex, int groupIndex, int trackIndex) {
|
||||||
public int getCapabilities(int rendererIndex, int groupIndex, int trackIndex) {
|
|
||||||
return rendererFormatSupports[rendererIndex][groupIndex][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.
|
* @param trackIndex The index of the track within the track group.
|
||||||
* @return The {@link FormatSupport}.
|
* @return The {@link FormatSupport}.
|
||||||
*/
|
*/
|
||||||
@FormatSupport
|
public @FormatSupport int getTrackSupport(int rendererIndex, int groupIndex, int trackIndex) {
|
||||||
public int getTrackSupport(int rendererIndex, int groupIndex, int trackIndex) {
|
|
||||||
return RendererCapabilities.getFormatSupport(
|
return RendererCapabilities.getFormatSupport(
|
||||||
getCapabilities(rendererIndex, groupIndex, trackIndex));
|
getCapabilities(rendererIndex, groupIndex, trackIndex));
|
||||||
}
|
}
|
||||||
@ -272,8 +268,7 @@ public abstract class MappingTrackSelector extends TrackSelector {
|
|||||||
* renderer are included when determining support.
|
* renderer are included when determining support.
|
||||||
* @return The {@link AdaptiveSupport}.
|
* @return The {@link AdaptiveSupport}.
|
||||||
*/
|
*/
|
||||||
@AdaptiveSupport
|
public @AdaptiveSupport int getAdaptiveSupport(
|
||||||
public int getAdaptiveSupport(
|
|
||||||
int rendererIndex, int groupIndex, boolean includeCapabilitiesExceededTracks) {
|
int rendererIndex, int groupIndex, boolean includeCapabilitiesExceededTracks) {
|
||||||
int trackCount = rendererTrackGroups[rendererIndex].get(groupIndex).length;
|
int trackCount = rendererTrackGroups[rendererIndex].get(groupIndex).length;
|
||||||
// Iterate over the tracks in the group, recording the indices of those to consider.
|
// 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.
|
* @param groupIndex The index of the track group.
|
||||||
* @return The {@link AdaptiveSupport}.
|
* @return The {@link AdaptiveSupport}.
|
||||||
*/
|
*/
|
||||||
@AdaptiveSupport
|
public @AdaptiveSupport int getAdaptiveSupport(
|
||||||
public int getAdaptiveSupport(int rendererIndex, int groupIndex, int[] trackIndices) {
|
int rendererIndex, int groupIndex, int[] trackIndices) {
|
||||||
int handledTrackCount = 0;
|
int handledTrackCount = 0;
|
||||||
@AdaptiveSupport int adaptiveSupport = RendererCapabilities.ADAPTIVE_SEAMLESS;
|
@AdaptiveSupport int adaptiveSupport = RendererCapabilities.ADAPTIVE_SEAMLESS;
|
||||||
boolean multipleMimeTypes = false;
|
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.
|
* @return An array containing {@link Capabilities} for each track in the group.
|
||||||
* @throws ExoPlaybackException If an error occurs determining the format support.
|
* @throws ExoPlaybackException If an error occurs determining the format support.
|
||||||
*/
|
*/
|
||||||
@Capabilities
|
private static @Capabilities int[] getFormatSupport(
|
||||||
private static int[] getFormatSupport(RendererCapabilities rendererCapabilities, TrackGroup group)
|
RendererCapabilities rendererCapabilities, TrackGroup group) throws ExoPlaybackException {
|
||||||
throws ExoPlaybackException {
|
|
||||||
@Capabilities int[] formatSupport = new int[group.length];
|
@Capabilities int[] formatSupport = new int[group.length];
|
||||||
for (int i = 0; i < group.length; i++) {
|
for (int i = 0; i < group.length; i++) {
|
||||||
formatSupport[i] = rendererCapabilities.supportsFormat(group.getFormat(i));
|
formatSupport[i] = rendererCapabilities.supportsFormat(group.getFormat(i));
|
||||||
@ -559,8 +553,7 @@ public abstract class MappingTrackSelector extends TrackSelector {
|
|||||||
* renderer.
|
* renderer.
|
||||||
* @throws ExoPlaybackException If an error occurs determining the adaptation support.
|
* @throws ExoPlaybackException If an error occurs determining the adaptation support.
|
||||||
*/
|
*/
|
||||||
@AdaptiveSupport
|
private static @AdaptiveSupport int[] getMixedMimeTypeAdaptationSupports(
|
||||||
private static int[] getMixedMimeTypeAdaptationSupports(
|
|
||||||
RendererCapabilities[] rendererCapabilities) throws ExoPlaybackException {
|
RendererCapabilities[] rendererCapabilities) throws ExoPlaybackException {
|
||||||
@AdaptiveSupport int[] mixedMimeTypeAdaptationSupport = new int[rendererCapabilities.length];
|
@AdaptiveSupport int[] mixedMimeTypeAdaptationSupport = new int[rendererCapabilities.length];
|
||||||
for (int i = 0; i < mixedMimeTypeAdaptationSupport.length; i++) {
|
for (int i = 0; i < mixedMimeTypeAdaptationSupport.length; i++) {
|
||||||
|
@ -281,14 +281,14 @@ public final class DefaultBandwidthMeter implements BandwidthMeter, TransferList
|
|||||||
private long sampleStartTimeMs;
|
private long sampleStartTimeMs;
|
||||||
private long sampleBytesTransferred;
|
private long sampleBytesTransferred;
|
||||||
|
|
||||||
@C.NetworkType private int networkType;
|
private @C.NetworkType int networkType;
|
||||||
private long totalElapsedTimeMs;
|
private long totalElapsedTimeMs;
|
||||||
private long totalBytesTransferred;
|
private long totalBytesTransferred;
|
||||||
private long bitrateEstimate;
|
private long bitrateEstimate;
|
||||||
private long lastReportedBitrateEstimate;
|
private long lastReportedBitrateEstimate;
|
||||||
|
|
||||||
private boolean networkTypeOverrideSet;
|
private boolean networkTypeOverrideSet;
|
||||||
@C.NetworkType private int networkTypeOverride;
|
private @C.NetworkType int networkTypeOverride;
|
||||||
|
|
||||||
/** @deprecated Use {@link Builder} instead. */
|
/** @deprecated Use {@link Builder} instead. */
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user