Do not trim audio samples by changing their timestamp

MP4 edit lists sometimes ask to start playback between two samples.
If this happens, we currently change the timestamp of the first
sample to zero to trim it (e.g. to display the first frame for a
slightly shorter period of time). However, we can't do this to audio
samples are they have an inherent duration and trimming them this
way is not possible.

#minor-release

PiperOrigin-RevId: 543420218
This commit is contained in:
tonihei 2023-06-26 13:26:35 +00:00 committed by Tianyi Feng
parent 7996766b22
commit 2322462404
308 changed files with 1920 additions and 3 deletions

View File

@ -726,6 +726,7 @@ public final class CastPlayer extends BasePlayer {
/** This method is not supported and does nothing. */ /** This method is not supported and does nothing. */
@Override @Override
public void setVideoTextureView(@Nullable TextureView textureView) {} public void setVideoTextureView(@Nullable TextureView textureView) {}
/** This method is not supported and does nothing. */ /** This method is not supported and does nothing. */
@Override @Override
public void clearVideoTextureView(@Nullable TextureView textureView) {} public void clearVideoTextureView(@Nullable TextureView textureView) {}

View File

@ -43,14 +43,18 @@ import java.util.Arrays;
/** The duration of the item in microseconds, or {@link C#TIME_UNSET} if unknown. */ /** The duration of the item in microseconds, or {@link C#TIME_UNSET} if unknown. */
public final long durationUs; public final long durationUs;
/** /**
* The default start position of the item in microseconds, or {@link C#TIME_UNSET} if unknown. * The default start position of the item in microseconds, or {@link C#TIME_UNSET} if unknown.
*/ */
public final long defaultPositionUs; public final long defaultPositionUs;
/** Whether the item is live content, or {@code false} if unknown. */ /** Whether the item is live content, or {@code false} if unknown. */
public final boolean isLive; public final boolean isLive;
/** The original media item that has been set or added to the playlist. */ /** The original media item that has been set or added to the playlist. */
public final MediaItem mediaItem; public final MediaItem mediaItem;
/** The {@linkplain MediaInfo#getContentId() content ID} of the cast media queue item. */ /** The {@linkplain MediaInfo#getContentId() content ID} of the cast media queue item. */
public final String contentId; public final String contentId;

View File

@ -45,12 +45,16 @@ public final class AdOverlayInfo {
@Target({FIELD, METHOD, PARAMETER, LOCAL_VARIABLE, TYPE_USE}) @Target({FIELD, METHOD, PARAMETER, LOCAL_VARIABLE, TYPE_USE})
@IntDef({PURPOSE_CONTROLS, PURPOSE_CLOSE_AD, PURPOSE_OTHER, PURPOSE_NOT_VISIBLE}) @IntDef({PURPOSE_CONTROLS, PURPOSE_CLOSE_AD, PURPOSE_OTHER, PURPOSE_NOT_VISIBLE})
public @interface Purpose {} public @interface Purpose {}
/** Purpose for playback controls overlaying the player. */ /** Purpose for playback controls overlaying the player. */
public static final int PURPOSE_CONTROLS = 1; public static final int PURPOSE_CONTROLS = 1;
/** Purpose for ad close buttons overlaying the player. */ /** Purpose for ad close buttons overlaying the player. */
public static final int PURPOSE_CLOSE_AD = 2; public static final int PURPOSE_CLOSE_AD = 2;
/** Purpose for other overlays. */ /** Purpose for other overlays. */
public static final int PURPOSE_OTHER = 3; public static final int PURPOSE_OTHER = 3;
/** Purpose for overlays that are not visible. */ /** Purpose for overlays that are not visible. */
public static final int PURPOSE_NOT_VISIBLE = 4; public static final int PURPOSE_NOT_VISIBLE = 4;
@ -94,8 +98,10 @@ public final class AdOverlayInfo {
/** The overlay view. */ /** The overlay view. */
public final View view; public final View view;
/** The purpose of the overlay view. */ /** The purpose of the overlay view. */
public final @Purpose int purpose; public final @Purpose int purpose;
/** An optional, detailed reason that the overlay view is needed. */ /** An optional, detailed reason that the overlay view is needed. */
@Nullable public final String reasonDetail; @Nullable public final String reasonDetail;

View File

@ -62,8 +62,10 @@ public final class AdPlaybackState implements Bundleable {
* C#TIME_END_OF_SOURCE} to indicate a postroll ad. * C#TIME_END_OF_SOURCE} to indicate a postroll ad.
*/ */
public final long timeUs; public final long timeUs;
/** The number of ads in the ad group, or {@link C#LENGTH_UNSET} if unknown. */ /** The number of ads in the ad group, or {@link C#LENGTH_UNSET} if unknown. */
public final int count; public final int count;
/** /**
* The original number of ads in the ad group in case the ad group is only partially available, * The original number of ads in the ad group in case the ad group is only partially available,
* or {@link C#LENGTH_UNSET} if unknown. An ad can be partially available when a server side * or {@link C#LENGTH_UNSET} if unknown. An ad can be partially available when a server side
@ -71,17 +73,22 @@ public final class AdPlaybackState implements Bundleable {
* missing. * missing.
*/ */
public final int originalCount; public final int originalCount;
/** 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. */
public final @AdState 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;
/** /**
* The offset in microseconds which should be added to the content stream when resuming playback * The offset in microseconds which should be added to the content stream when resuming playback
* after the ad group. * after the ad group.
*/ */
public final long contentResumeOffsetUs; public final long contentResumeOffsetUs;
/** Whether this ad group is server-side inserted and part of the content stream. */ /** Whether this ad group is server-side inserted and part of the content stream. */
public final boolean isServerSideInserted; public final boolean isServerSideInserted;
@ -535,14 +542,19 @@ public final class AdPlaybackState implements Bundleable {
AD_STATE_ERROR, AD_STATE_ERROR,
}) })
public @interface AdState {} public @interface AdState {}
/** State for an ad that does not yet have a URL. */ /** State for an ad that does not yet have a URL. */
public static final int AD_STATE_UNAVAILABLE = 0; public static final int AD_STATE_UNAVAILABLE = 0;
/** State for an ad that has a URL but has not yet been played. */ /** State for an ad that has a URL but has not yet been played. */
public static final int AD_STATE_AVAILABLE = 1; public static final int AD_STATE_AVAILABLE = 1;
/** State for an ad that was skipped. */ /** State for an ad that was skipped. */
public static final int AD_STATE_SKIPPED = 2; public static final int AD_STATE_SKIPPED = 2;
/** State for an ad that was played in full. */ /** State for an ad that was played in full. */
public static final int AD_STATE_PLAYED = 3; public static final int AD_STATE_PLAYED = 3;
/** State for an ad that could not be loaded. */ /** State for an ad that could not be loaded. */
public static final int AD_STATE_ERROR = 4; public static final int AD_STATE_ERROR = 4;
@ -564,12 +576,15 @@ public final class AdPlaybackState implements Bundleable {
/** The number of ad groups. */ /** The number of ad groups. */
public final int adGroupCount; public final int adGroupCount;
/** The position offset in the first unplayed ad at which to begin playback, in microseconds. */ /** The position offset in the first unplayed ad at which to begin playback, in microseconds. */
public final long adResumePositionUs; public final long adResumePositionUs;
/** /**
* The duration of the content period in microseconds, if known. {@link C#TIME_UNSET} otherwise. * The duration of the content period in microseconds, if known. {@link C#TIME_UNSET} otherwise.
*/ */
public final long contentDurationUs; public final long contentDurationUs;
/** /**
* The number of ad groups that have been removed. Ad groups with indices between {@code 0} * The number of ad groups that have been removed. Ad groups with indices between {@code 0}
* (inclusive) and {@code removedAdGroupCount} (exclusive) will be empty and must not be modified * (inclusive) and {@code removedAdGroupCount} (exclusive) will be empty and must not be modified

View File

@ -131,12 +131,16 @@ public final class AudioAttributes implements Bundleable {
/** The {@link C.AudioContentType}. */ /** The {@link C.AudioContentType}. */
public final @C.AudioContentType int contentType; public final @C.AudioContentType int contentType;
/** The {@link C.AudioFlags}. */ /** The {@link C.AudioFlags}. */
public final @C.AudioFlags int flags; public final @C.AudioFlags int flags;
/** The {@link C.AudioUsage}. */ /** The {@link C.AudioUsage}. */
public final @C.AudioUsage int usage; public final @C.AudioUsage int usage;
/** The {@link C.AudioAllowedCapturePolicy}. */ /** The {@link C.AudioAllowedCapturePolicy}. */
public final @C.AudioAllowedCapturePolicy int allowedCapturePolicy; public final @C.AudioAllowedCapturePolicy int allowedCapturePolicy;
/** The {@link C.SpatializationBehavior}. */ /** The {@link C.SpatializationBehavior}. */
public final @C.SpatializationBehavior int spatializationBehavior; public final @C.SpatializationBehavior int spatializationBehavior;

View File

@ -41,6 +41,7 @@ public final class AuxEffectInfo {
* @see android.media.AudioTrack#attachAuxEffect(int) * @see android.media.AudioTrack#attachAuxEffect(int)
*/ */
public final int effectId; public final int effectId;
/** /**
* The send level for the effect. * The send level for the effect.
* *

View File

@ -120,12 +120,16 @@ public final class C {
CRYPTO_TYPE_FRAMEWORK, CRYPTO_TYPE_FRAMEWORK,
}) })
public @interface CryptoType {} public @interface CryptoType {}
/** No crypto. */ /** No crypto. */
public static final int CRYPTO_TYPE_NONE = 0; public static final int CRYPTO_TYPE_NONE = 0;
/** An unsupported crypto type. */ /** An unsupported crypto type. */
public static final int CRYPTO_TYPE_UNSUPPORTED = 1; public static final int CRYPTO_TYPE_UNSUPPORTED = 1;
/** Framework crypto in which a {@link MediaCodec} is configured with a {@link MediaCrypto}. */ /** Framework crypto in which a {@link MediaCodec} is configured with a {@link MediaCrypto}. */
public static final int CRYPTO_TYPE_FRAMEWORK = 2; public static final int CRYPTO_TYPE_FRAMEWORK = 2;
/** /**
* Applications or extensions may define custom {@code CRYPTO_TYPE_*} constants greater than or * Applications or extensions may define custom {@code CRYPTO_TYPE_*} constants greater than or
* equal to this value. * equal to this value.
@ -142,10 +146,13 @@ public final class C {
@IntDef({CRYPTO_MODE_UNENCRYPTED, CRYPTO_MODE_AES_CTR, CRYPTO_MODE_AES_CBC}) @IntDef({CRYPTO_MODE_UNENCRYPTED, CRYPTO_MODE_AES_CTR, CRYPTO_MODE_AES_CBC})
@UnstableApi @UnstableApi
public @interface CryptoMode {} public @interface CryptoMode {}
/** See {@link MediaCodec#CRYPTO_MODE_UNENCRYPTED}. */ /** See {@link MediaCodec#CRYPTO_MODE_UNENCRYPTED}. */
@UnstableApi public static final int CRYPTO_MODE_UNENCRYPTED = MediaCodec.CRYPTO_MODE_UNENCRYPTED; @UnstableApi public static final int CRYPTO_MODE_UNENCRYPTED = MediaCodec.CRYPTO_MODE_UNENCRYPTED;
/** See {@link MediaCodec#CRYPTO_MODE_AES_CTR}. */ /** See {@link MediaCodec#CRYPTO_MODE_AES_CTR}. */
@UnstableApi public static final int CRYPTO_MODE_AES_CTR = MediaCodec.CRYPTO_MODE_AES_CTR; @UnstableApi public static final int CRYPTO_MODE_AES_CTR = MediaCodec.CRYPTO_MODE_AES_CTR;
/** See {@link MediaCodec#CRYPTO_MODE_AES_CBC}. */ /** See {@link MediaCodec#CRYPTO_MODE_AES_CBC}. */
@UnstableApi public static final int CRYPTO_MODE_AES_CBC = MediaCodec.CRYPTO_MODE_AES_CBC; @UnstableApi public static final int CRYPTO_MODE_AES_CBC = MediaCodec.CRYPTO_MODE_AES_CBC;
@ -217,50 +224,73 @@ public final class C {
ENCODING_PCM_FLOAT ENCODING_PCM_FLOAT
}) })
public @interface PcmEncoding {} public @interface PcmEncoding {}
/** See {@link AudioFormat#ENCODING_INVALID}. */ /** See {@link AudioFormat#ENCODING_INVALID}. */
@UnstableApi public static final int ENCODING_INVALID = AudioFormat.ENCODING_INVALID; @UnstableApi public static final int ENCODING_INVALID = AudioFormat.ENCODING_INVALID;
/** See {@link AudioFormat#ENCODING_PCM_8BIT}. */ /** See {@link AudioFormat#ENCODING_PCM_8BIT}. */
@UnstableApi public static final int ENCODING_PCM_8BIT = AudioFormat.ENCODING_PCM_8BIT; @UnstableApi public static final int ENCODING_PCM_8BIT = AudioFormat.ENCODING_PCM_8BIT;
/** See {@link AudioFormat#ENCODING_PCM_16BIT}. */ /** See {@link AudioFormat#ENCODING_PCM_16BIT}. */
@UnstableApi public static final int ENCODING_PCM_16BIT = AudioFormat.ENCODING_PCM_16BIT; @UnstableApi public static final int ENCODING_PCM_16BIT = AudioFormat.ENCODING_PCM_16BIT;
/** Like {@link #ENCODING_PCM_16BIT}, but with the bytes in big endian order. */ /** Like {@link #ENCODING_PCM_16BIT}, but with the bytes in big endian order. */
@UnstableApi public static final int ENCODING_PCM_16BIT_BIG_ENDIAN = 0x10000000; @UnstableApi public static final int ENCODING_PCM_16BIT_BIG_ENDIAN = 0x10000000;
/** PCM encoding with 24 bits per sample. */ /** PCM encoding with 24 bits per sample. */
@UnstableApi public static final int ENCODING_PCM_24BIT = 0x20000000; @UnstableApi public static final int ENCODING_PCM_24BIT = 0x20000000;
/** PCM encoding with 32 bits per sample. */ /** PCM encoding with 32 bits per sample. */
@UnstableApi public static final int ENCODING_PCM_32BIT = 0x30000000; @UnstableApi public static final int ENCODING_PCM_32BIT = 0x30000000;
/** See {@link AudioFormat#ENCODING_PCM_FLOAT}. */ /** See {@link AudioFormat#ENCODING_PCM_FLOAT}. */
@UnstableApi public static final int ENCODING_PCM_FLOAT = AudioFormat.ENCODING_PCM_FLOAT; @UnstableApi public static final int ENCODING_PCM_FLOAT = AudioFormat.ENCODING_PCM_FLOAT;
/** See {@link AudioFormat#ENCODING_MP3}. */ /** See {@link AudioFormat#ENCODING_MP3}. */
@UnstableApi public static final int ENCODING_MP3 = AudioFormat.ENCODING_MP3; @UnstableApi public static final int ENCODING_MP3 = AudioFormat.ENCODING_MP3;
/** See {@link AudioFormat#ENCODING_AAC_LC}. */ /** See {@link AudioFormat#ENCODING_AAC_LC}. */
@UnstableApi public static final int ENCODING_AAC_LC = AudioFormat.ENCODING_AAC_LC; @UnstableApi public static final int ENCODING_AAC_LC = AudioFormat.ENCODING_AAC_LC;
/** See {@link AudioFormat#ENCODING_AAC_HE_V1}. */ /** See {@link AudioFormat#ENCODING_AAC_HE_V1}. */
@UnstableApi public static final int ENCODING_AAC_HE_V1 = AudioFormat.ENCODING_AAC_HE_V1; @UnstableApi public static final int ENCODING_AAC_HE_V1 = AudioFormat.ENCODING_AAC_HE_V1;
/** See {@link AudioFormat#ENCODING_AAC_HE_V2}. */ /** See {@link AudioFormat#ENCODING_AAC_HE_V2}. */
@UnstableApi public static final int ENCODING_AAC_HE_V2 = AudioFormat.ENCODING_AAC_HE_V2; @UnstableApi public static final int ENCODING_AAC_HE_V2 = AudioFormat.ENCODING_AAC_HE_V2;
/** See {@link AudioFormat#ENCODING_AAC_XHE}. */ /** See {@link AudioFormat#ENCODING_AAC_XHE}. */
@UnstableApi public static final int ENCODING_AAC_XHE = AudioFormat.ENCODING_AAC_XHE; @UnstableApi public static final int ENCODING_AAC_XHE = AudioFormat.ENCODING_AAC_XHE;
/** See {@link AudioFormat#ENCODING_AAC_ELD}. */ /** See {@link AudioFormat#ENCODING_AAC_ELD}. */
@UnstableApi public static final int ENCODING_AAC_ELD = AudioFormat.ENCODING_AAC_ELD; @UnstableApi public static final int ENCODING_AAC_ELD = AudioFormat.ENCODING_AAC_ELD;
/** AAC Error Resilient Bit-Sliced Arithmetic Coding. */ /** AAC Error Resilient Bit-Sliced Arithmetic Coding. */
@UnstableApi public static final int ENCODING_AAC_ER_BSAC = 0x40000000; @UnstableApi public static final int ENCODING_AAC_ER_BSAC = 0x40000000;
/** See {@link AudioFormat#ENCODING_AC3}. */ /** See {@link AudioFormat#ENCODING_AC3}. */
@UnstableApi public static final int ENCODING_AC3 = AudioFormat.ENCODING_AC3; @UnstableApi public static final int ENCODING_AC3 = AudioFormat.ENCODING_AC3;
/** See {@link AudioFormat#ENCODING_E_AC3}. */ /** See {@link AudioFormat#ENCODING_E_AC3}. */
@UnstableApi public static final int ENCODING_E_AC3 = AudioFormat.ENCODING_E_AC3; @UnstableApi public static final int ENCODING_E_AC3 = AudioFormat.ENCODING_E_AC3;
/** See {@link AudioFormat#ENCODING_E_AC3_JOC}. */ /** See {@link AudioFormat#ENCODING_E_AC3_JOC}. */
@UnstableApi public static final int ENCODING_E_AC3_JOC = AudioFormat.ENCODING_E_AC3_JOC; @UnstableApi public static final int ENCODING_E_AC3_JOC = AudioFormat.ENCODING_E_AC3_JOC;
/** See {@link AudioFormat#ENCODING_AC4}. */ /** See {@link AudioFormat#ENCODING_AC4}. */
@UnstableApi public static final int ENCODING_AC4 = AudioFormat.ENCODING_AC4; @UnstableApi public static final int ENCODING_AC4 = AudioFormat.ENCODING_AC4;
/** See {@link AudioFormat#ENCODING_DTS}. */ /** See {@link AudioFormat#ENCODING_DTS}. */
@UnstableApi public static final int ENCODING_DTS = AudioFormat.ENCODING_DTS; @UnstableApi public static final int ENCODING_DTS = AudioFormat.ENCODING_DTS;
/** See {@link AudioFormat#ENCODING_DTS_HD}. */ /** See {@link AudioFormat#ENCODING_DTS_HD}. */
@UnstableApi public static final int ENCODING_DTS_HD = AudioFormat.ENCODING_DTS_HD; @UnstableApi public static final int ENCODING_DTS_HD = AudioFormat.ENCODING_DTS_HD;
// TODO(internal b/283949283): Use AudioFormat.ENCODING_DTS_UHD_P2 when Android 14 is released. // TODO(internal b/283949283): Use AudioFormat.ENCODING_DTS_UHD_P2 when Android 14 is released.
@UnstableApi public static final int ENCODING_DTS_UHD_P2 = 0x0000001e; @UnstableApi public static final int ENCODING_DTS_UHD_P2 = 0x0000001e;
/** See {@link AudioFormat#ENCODING_DOLBY_TRUEHD}. */ /** See {@link AudioFormat#ENCODING_DOLBY_TRUEHD}. */
@UnstableApi public static final int ENCODING_DOLBY_TRUEHD = AudioFormat.ENCODING_DOLBY_TRUEHD; @UnstableApi public static final int ENCODING_DOLBY_TRUEHD = AudioFormat.ENCODING_DOLBY_TRUEHD;
/** See {@link AudioFormat#ENCODING_OPUS}. */ /** See {@link AudioFormat#ENCODING_OPUS}. */
@UnstableApi public static final int ENCODING_OPUS = AudioFormat.ENCODING_OPUS; @UnstableApi public static final int ENCODING_OPUS = AudioFormat.ENCODING_OPUS;
@ -277,6 +307,7 @@ public final class C {
/** See {@link AudioAttributes#SPATIALIZATION_BEHAVIOR_AUTO}. */ /** See {@link AudioAttributes#SPATIALIZATION_BEHAVIOR_AUTO}. */
public static final int SPATIALIZATION_BEHAVIOR_AUTO = public static final int SPATIALIZATION_BEHAVIOR_AUTO =
AudioAttributes.SPATIALIZATION_BEHAVIOR_AUTO; AudioAttributes.SPATIALIZATION_BEHAVIOR_AUTO;
/** See {@link AudioAttributes#SPATIALIZATION_BEHAVIOR_NEVER}. */ /** See {@link AudioAttributes#SPATIALIZATION_BEHAVIOR_NEVER}. */
public static final int SPATIALIZATION_BEHAVIOR_NEVER = public static final int SPATIALIZATION_BEHAVIOR_NEVER =
AudioAttributes.SPATIALIZATION_BEHAVIOR_NEVER; AudioAttributes.SPATIALIZATION_BEHAVIOR_NEVER;
@ -305,20 +336,28 @@ public final class C {
STREAM_TYPE_DEFAULT STREAM_TYPE_DEFAULT
}) })
public @interface StreamType {} public @interface StreamType {}
/** See {@link AudioManager#STREAM_ALARM}. */ /** See {@link AudioManager#STREAM_ALARM}. */
@UnstableApi public static final int STREAM_TYPE_ALARM = AudioManager.STREAM_ALARM; @UnstableApi public static final int STREAM_TYPE_ALARM = AudioManager.STREAM_ALARM;
/** See {@link AudioManager#STREAM_DTMF}. */ /** See {@link AudioManager#STREAM_DTMF}. */
@UnstableApi public static final int STREAM_TYPE_DTMF = AudioManager.STREAM_DTMF; @UnstableApi public static final int STREAM_TYPE_DTMF = AudioManager.STREAM_DTMF;
/** See {@link AudioManager#STREAM_MUSIC}. */ /** See {@link AudioManager#STREAM_MUSIC}. */
@UnstableApi public static final int STREAM_TYPE_MUSIC = AudioManager.STREAM_MUSIC; @UnstableApi public static final int STREAM_TYPE_MUSIC = AudioManager.STREAM_MUSIC;
/** See {@link AudioManager#STREAM_NOTIFICATION}. */ /** See {@link AudioManager#STREAM_NOTIFICATION}. */
@UnstableApi public static final int STREAM_TYPE_NOTIFICATION = AudioManager.STREAM_NOTIFICATION; @UnstableApi public static final int STREAM_TYPE_NOTIFICATION = AudioManager.STREAM_NOTIFICATION;
/** See {@link AudioManager#STREAM_RING}. */ /** See {@link AudioManager#STREAM_RING}. */
@UnstableApi public static final int STREAM_TYPE_RING = AudioManager.STREAM_RING; @UnstableApi public static final int STREAM_TYPE_RING = AudioManager.STREAM_RING;
/** See {@link AudioManager#STREAM_SYSTEM}. */ /** See {@link AudioManager#STREAM_SYSTEM}. */
@UnstableApi public static final int STREAM_TYPE_SYSTEM = AudioManager.STREAM_SYSTEM; @UnstableApi public static final int STREAM_TYPE_SYSTEM = AudioManager.STREAM_SYSTEM;
/** See {@link AudioManager#STREAM_VOICE_CALL}. */ /** See {@link AudioManager#STREAM_VOICE_CALL}. */
@UnstableApi public static final int STREAM_TYPE_VOICE_CALL = AudioManager.STREAM_VOICE_CALL; @UnstableApi public static final int STREAM_TYPE_VOICE_CALL = AudioManager.STREAM_VOICE_CALL;
/** The default stream type used by audio renderers. Equal to {@link #STREAM_TYPE_MUSIC}. */ /** The default stream type used by audio renderers. Equal to {@link #STREAM_TYPE_MUSIC}. */
@UnstableApi public static final int STREAM_TYPE_DEFAULT = STREAM_TYPE_MUSIC; @UnstableApi public static final int STREAM_TYPE_DEFAULT = STREAM_TYPE_MUSIC;
@ -341,15 +380,20 @@ public final class C {
VOLUME_FLAG_VIBRATE, VOLUME_FLAG_VIBRATE,
}) })
public @interface VolumeFlags {} public @interface VolumeFlags {}
/** See {@link AudioManager#FLAG_SHOW_UI}. */ /** See {@link AudioManager#FLAG_SHOW_UI}. */
public static final int VOLUME_FLAG_SHOW_UI = AudioManager.FLAG_SHOW_UI; public static final int VOLUME_FLAG_SHOW_UI = AudioManager.FLAG_SHOW_UI;
/** See {@link AudioManager#FLAG_ALLOW_RINGER_MODES}. */ /** See {@link AudioManager#FLAG_ALLOW_RINGER_MODES}. */
public static final int VOLUME_FLAG_ALLOW_RINGER_MODES = AudioManager.FLAG_ALLOW_RINGER_MODES; public static final int VOLUME_FLAG_ALLOW_RINGER_MODES = AudioManager.FLAG_ALLOW_RINGER_MODES;
/** See {@link AudioManager#FLAG_PLAY_SOUND}. */ /** See {@link AudioManager#FLAG_PLAY_SOUND}. */
public static final int VOLUME_FLAG_PLAY_SOUND = AudioManager.FLAG_PLAY_SOUND; public static final int VOLUME_FLAG_PLAY_SOUND = AudioManager.FLAG_PLAY_SOUND;
/** See {@link AudioManager#FLAG_REMOVE_SOUND_AND_VIBRATE}. */ /** See {@link AudioManager#FLAG_REMOVE_SOUND_AND_VIBRATE}. */
public static final int VOLUME_FLAG_REMOVE_SOUND_AND_VIBRATE = public static final int VOLUME_FLAG_REMOVE_SOUND_AND_VIBRATE =
AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE; AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE;
/** See {@link AudioManager#FLAG_VIBRATE}. */ /** See {@link AudioManager#FLAG_VIBRATE}. */
public static final int VOLUME_FLAG_VIBRATE = AudioManager.FLAG_VIBRATE; public static final int VOLUME_FLAG_VIBRATE = AudioManager.FLAG_VIBRATE;
@ -377,34 +421,44 @@ public final class C {
AUDIO_CONTENT_TYPE_UNKNOWN AUDIO_CONTENT_TYPE_UNKNOWN
}) })
public @interface AudioContentType {} public @interface AudioContentType {}
/** See {@link AudioAttributes#CONTENT_TYPE_MOVIE}. */ /** See {@link AudioAttributes#CONTENT_TYPE_MOVIE}. */
public static final int AUDIO_CONTENT_TYPE_MOVIE = AudioAttributes.CONTENT_TYPE_MOVIE; public static final int AUDIO_CONTENT_TYPE_MOVIE = AudioAttributes.CONTENT_TYPE_MOVIE;
/** /**
* @deprecated Use {@link #AUDIO_CONTENT_TYPE_MOVIE} instead. * @deprecated Use {@link #AUDIO_CONTENT_TYPE_MOVIE} instead.
*/ */
@UnstableApi @Deprecated public static final int CONTENT_TYPE_MOVIE = AUDIO_CONTENT_TYPE_MOVIE; @UnstableApi @Deprecated public static final int CONTENT_TYPE_MOVIE = AUDIO_CONTENT_TYPE_MOVIE;
/** See {@link AudioAttributes#CONTENT_TYPE_MUSIC}. */ /** See {@link AudioAttributes#CONTENT_TYPE_MUSIC}. */
public static final int AUDIO_CONTENT_TYPE_MUSIC = AudioAttributes.CONTENT_TYPE_MUSIC; public static final int AUDIO_CONTENT_TYPE_MUSIC = AudioAttributes.CONTENT_TYPE_MUSIC;
/** /**
* @deprecated Use {@link #AUDIO_CONTENT_TYPE_MUSIC} instead. * @deprecated Use {@link #AUDIO_CONTENT_TYPE_MUSIC} instead.
*/ */
@UnstableApi @Deprecated public static final int CONTENT_TYPE_MUSIC = AUDIO_CONTENT_TYPE_MUSIC; @UnstableApi @Deprecated public static final int CONTENT_TYPE_MUSIC = AUDIO_CONTENT_TYPE_MUSIC;
/** See {@link AudioAttributes#CONTENT_TYPE_SONIFICATION}. */ /** See {@link AudioAttributes#CONTENT_TYPE_SONIFICATION}. */
public static final int AUDIO_CONTENT_TYPE_SONIFICATION = public static final int AUDIO_CONTENT_TYPE_SONIFICATION =
AudioAttributes.CONTENT_TYPE_SONIFICATION; AudioAttributes.CONTENT_TYPE_SONIFICATION;
/** /**
* @deprecated Use {@link #AUDIO_CONTENT_TYPE_SONIFICATION} instead. * @deprecated Use {@link #AUDIO_CONTENT_TYPE_SONIFICATION} instead.
*/ */
@UnstableApi @Deprecated @UnstableApi @Deprecated
public static final int CONTENT_TYPE_SONIFICATION = AUDIO_CONTENT_TYPE_SONIFICATION; public static final int CONTENT_TYPE_SONIFICATION = AUDIO_CONTENT_TYPE_SONIFICATION;
/** See {@link AudioAttributes#CONTENT_TYPE_SPEECH}. */ /** See {@link AudioAttributes#CONTENT_TYPE_SPEECH}. */
public static final int AUDIO_CONTENT_TYPE_SPEECH = AudioAttributes.CONTENT_TYPE_SPEECH; public static final int AUDIO_CONTENT_TYPE_SPEECH = AudioAttributes.CONTENT_TYPE_SPEECH;
/** /**
* @deprecated Use {@link #AUDIO_CONTENT_TYPE_SPEECH} instead. * @deprecated Use {@link #AUDIO_CONTENT_TYPE_SPEECH} instead.
*/ */
@UnstableApi @Deprecated public static final int CONTENT_TYPE_SPEECH = AUDIO_CONTENT_TYPE_SPEECH; @UnstableApi @Deprecated public static final int CONTENT_TYPE_SPEECH = AUDIO_CONTENT_TYPE_SPEECH;
/** See {@link AudioAttributes#CONTENT_TYPE_UNKNOWN}. */ /** See {@link AudioAttributes#CONTENT_TYPE_UNKNOWN}. */
public static final int AUDIO_CONTENT_TYPE_UNKNOWN = AudioAttributes.CONTENT_TYPE_UNKNOWN; public static final int AUDIO_CONTENT_TYPE_UNKNOWN = AudioAttributes.CONTENT_TYPE_UNKNOWN;
/** /**
* @deprecated Use {@link #AUDIO_CONTENT_TYPE_UNKNOWN} instead. * @deprecated Use {@link #AUDIO_CONTENT_TYPE_UNKNOWN} instead.
*/ */
@ -426,6 +480,7 @@ public final class C {
flag = true, flag = true,
value = {FLAG_AUDIBILITY_ENFORCED}) value = {FLAG_AUDIBILITY_ENFORCED})
public @interface AudioFlags {} public @interface AudioFlags {}
/** See {@link android.media.AudioAttributes#FLAG_AUDIBILITY_ENFORCED}. */ /** See {@link android.media.AudioAttributes#FLAG_AUDIBILITY_ENFORCED}. */
public static final int FLAG_AUDIBILITY_ENFORCED = public static final int FLAG_AUDIBILITY_ENFORCED =
android.media.AudioAttributes.FLAG_AUDIBILITY_ENFORCED; android.media.AudioAttributes.FLAG_AUDIBILITY_ENFORCED;
@ -464,45 +519,61 @@ public final class C {
USAGE_VOICE_COMMUNICATION_SIGNALLING USAGE_VOICE_COMMUNICATION_SIGNALLING
}) })
public @interface AudioUsage {} public @interface AudioUsage {}
/** See {@link android.media.AudioAttributes#USAGE_ALARM}. */ /** See {@link android.media.AudioAttributes#USAGE_ALARM}. */
public static final int USAGE_ALARM = android.media.AudioAttributes.USAGE_ALARM; public static final int USAGE_ALARM = android.media.AudioAttributes.USAGE_ALARM;
/** See {@link android.media.AudioAttributes#USAGE_ASSISTANCE_ACCESSIBILITY}. */ /** See {@link android.media.AudioAttributes#USAGE_ASSISTANCE_ACCESSIBILITY}. */
public static final int USAGE_ASSISTANCE_ACCESSIBILITY = public static final int USAGE_ASSISTANCE_ACCESSIBILITY =
android.media.AudioAttributes.USAGE_ASSISTANCE_ACCESSIBILITY; android.media.AudioAttributes.USAGE_ASSISTANCE_ACCESSIBILITY;
/** See {@link android.media.AudioAttributes#USAGE_ASSISTANCE_NAVIGATION_GUIDANCE}. */ /** See {@link android.media.AudioAttributes#USAGE_ASSISTANCE_NAVIGATION_GUIDANCE}. */
public static final int USAGE_ASSISTANCE_NAVIGATION_GUIDANCE = public static final int USAGE_ASSISTANCE_NAVIGATION_GUIDANCE =
android.media.AudioAttributes.USAGE_ASSISTANCE_NAVIGATION_GUIDANCE; android.media.AudioAttributes.USAGE_ASSISTANCE_NAVIGATION_GUIDANCE;
/** See {@link android.media.AudioAttributes#USAGE_ASSISTANCE_SONIFICATION}. */ /** See {@link android.media.AudioAttributes#USAGE_ASSISTANCE_SONIFICATION}. */
public static final int USAGE_ASSISTANCE_SONIFICATION = public static final int USAGE_ASSISTANCE_SONIFICATION =
android.media.AudioAttributes.USAGE_ASSISTANCE_SONIFICATION; android.media.AudioAttributes.USAGE_ASSISTANCE_SONIFICATION;
/** See {@link android.media.AudioAttributes#USAGE_ASSISTANT}. */ /** See {@link android.media.AudioAttributes#USAGE_ASSISTANT}. */
public static final int USAGE_ASSISTANT = android.media.AudioAttributes.USAGE_ASSISTANT; public static final int USAGE_ASSISTANT = android.media.AudioAttributes.USAGE_ASSISTANT;
/** See {@link android.media.AudioAttributes#USAGE_GAME}. */ /** See {@link android.media.AudioAttributes#USAGE_GAME}. */
public static final int USAGE_GAME = android.media.AudioAttributes.USAGE_GAME; public static final int USAGE_GAME = android.media.AudioAttributes.USAGE_GAME;
/** See {@link android.media.AudioAttributes#USAGE_MEDIA}. */ /** See {@link android.media.AudioAttributes#USAGE_MEDIA}. */
public static final int USAGE_MEDIA = android.media.AudioAttributes.USAGE_MEDIA; public static final int USAGE_MEDIA = android.media.AudioAttributes.USAGE_MEDIA;
/** See {@link android.media.AudioAttributes#USAGE_NOTIFICATION}. */ /** See {@link android.media.AudioAttributes#USAGE_NOTIFICATION}. */
public static final int USAGE_NOTIFICATION = android.media.AudioAttributes.USAGE_NOTIFICATION; public static final int USAGE_NOTIFICATION = android.media.AudioAttributes.USAGE_NOTIFICATION;
/** See {@link android.media.AudioAttributes#USAGE_NOTIFICATION_COMMUNICATION_DELAYED}. */ /** See {@link android.media.AudioAttributes#USAGE_NOTIFICATION_COMMUNICATION_DELAYED}. */
public static final int USAGE_NOTIFICATION_COMMUNICATION_DELAYED = public static final int USAGE_NOTIFICATION_COMMUNICATION_DELAYED =
android.media.AudioAttributes.USAGE_NOTIFICATION_COMMUNICATION_DELAYED; android.media.AudioAttributes.USAGE_NOTIFICATION_COMMUNICATION_DELAYED;
/** See {@link android.media.AudioAttributes#USAGE_NOTIFICATION_COMMUNICATION_INSTANT}. */ /** See {@link android.media.AudioAttributes#USAGE_NOTIFICATION_COMMUNICATION_INSTANT}. */
public static final int USAGE_NOTIFICATION_COMMUNICATION_INSTANT = public static final int USAGE_NOTIFICATION_COMMUNICATION_INSTANT =
android.media.AudioAttributes.USAGE_NOTIFICATION_COMMUNICATION_INSTANT; android.media.AudioAttributes.USAGE_NOTIFICATION_COMMUNICATION_INSTANT;
/** See {@link android.media.AudioAttributes#USAGE_NOTIFICATION_COMMUNICATION_REQUEST}. */ /** See {@link android.media.AudioAttributes#USAGE_NOTIFICATION_COMMUNICATION_REQUEST}. */
public static final int USAGE_NOTIFICATION_COMMUNICATION_REQUEST = public static final int USAGE_NOTIFICATION_COMMUNICATION_REQUEST =
android.media.AudioAttributes.USAGE_NOTIFICATION_COMMUNICATION_REQUEST; android.media.AudioAttributes.USAGE_NOTIFICATION_COMMUNICATION_REQUEST;
/** See {@link android.media.AudioAttributes#USAGE_NOTIFICATION_EVENT}. */ /** See {@link android.media.AudioAttributes#USAGE_NOTIFICATION_EVENT}. */
public static final int USAGE_NOTIFICATION_EVENT = public static final int USAGE_NOTIFICATION_EVENT =
android.media.AudioAttributes.USAGE_NOTIFICATION_EVENT; android.media.AudioAttributes.USAGE_NOTIFICATION_EVENT;
/** See {@link android.media.AudioAttributes#USAGE_NOTIFICATION_RINGTONE}. */ /** See {@link android.media.AudioAttributes#USAGE_NOTIFICATION_RINGTONE}. */
public static final int USAGE_NOTIFICATION_RINGTONE = public static final int USAGE_NOTIFICATION_RINGTONE =
android.media.AudioAttributes.USAGE_NOTIFICATION_RINGTONE; android.media.AudioAttributes.USAGE_NOTIFICATION_RINGTONE;
/** See {@link android.media.AudioAttributes#USAGE_UNKNOWN}. */ /** See {@link android.media.AudioAttributes#USAGE_UNKNOWN}. */
public static final int USAGE_UNKNOWN = android.media.AudioAttributes.USAGE_UNKNOWN; public static final int USAGE_UNKNOWN = android.media.AudioAttributes.USAGE_UNKNOWN;
/** See {@link android.media.AudioAttributes#USAGE_VOICE_COMMUNICATION}. */ /** See {@link android.media.AudioAttributes#USAGE_VOICE_COMMUNICATION}. */
public static final int USAGE_VOICE_COMMUNICATION = public static final int USAGE_VOICE_COMMUNICATION =
android.media.AudioAttributes.USAGE_VOICE_COMMUNICATION; android.media.AudioAttributes.USAGE_VOICE_COMMUNICATION;
/** See {@link android.media.AudioAttributes#USAGE_VOICE_COMMUNICATION_SIGNALLING}. */ /** See {@link android.media.AudioAttributes#USAGE_VOICE_COMMUNICATION_SIGNALLING}. */
public static final int USAGE_VOICE_COMMUNICATION_SIGNALLING = public static final int USAGE_VOICE_COMMUNICATION_SIGNALLING =
android.media.AudioAttributes.USAGE_VOICE_COMMUNICATION_SIGNALLING; android.media.AudioAttributes.USAGE_VOICE_COMMUNICATION_SIGNALLING;
@ -518,10 +589,13 @@ public final class C {
@Target({FIELD, METHOD, PARAMETER, LOCAL_VARIABLE, TYPE_USE}) @Target({FIELD, METHOD, PARAMETER, LOCAL_VARIABLE, TYPE_USE})
@IntDef({ALLOW_CAPTURE_BY_ALL, ALLOW_CAPTURE_BY_NONE, ALLOW_CAPTURE_BY_SYSTEM}) @IntDef({ALLOW_CAPTURE_BY_ALL, ALLOW_CAPTURE_BY_NONE, ALLOW_CAPTURE_BY_SYSTEM})
public @interface AudioAllowedCapturePolicy {} public @interface AudioAllowedCapturePolicy {}
/** See {@link android.media.AudioAttributes#ALLOW_CAPTURE_BY_ALL}. */ /** See {@link android.media.AudioAttributes#ALLOW_CAPTURE_BY_ALL}. */
public static final int ALLOW_CAPTURE_BY_ALL = AudioAttributes.ALLOW_CAPTURE_BY_ALL; public static final int ALLOW_CAPTURE_BY_ALL = AudioAttributes.ALLOW_CAPTURE_BY_ALL;
/** See {@link android.media.AudioAttributes#ALLOW_CAPTURE_BY_NONE}. */ /** See {@link android.media.AudioAttributes#ALLOW_CAPTURE_BY_NONE}. */
public static final int ALLOW_CAPTURE_BY_NONE = AudioAttributes.ALLOW_CAPTURE_BY_NONE; public static final int ALLOW_CAPTURE_BY_NONE = AudioAttributes.ALLOW_CAPTURE_BY_NONE;
/** See {@link android.media.AudioAttributes#ALLOW_CAPTURE_BY_SYSTEM}. */ /** See {@link android.media.AudioAttributes#ALLOW_CAPTURE_BY_SYSTEM}. */
public static final int ALLOW_CAPTURE_BY_SYSTEM = AudioAttributes.ALLOW_CAPTURE_BY_SYSTEM; public static final int ALLOW_CAPTURE_BY_SYSTEM = AudioAttributes.ALLOW_CAPTURE_BY_SYSTEM;
@ -547,19 +621,26 @@ public final class C {
BUFFER_FLAG_DECODE_ONLY BUFFER_FLAG_DECODE_ONLY
}) })
public @interface BufferFlags {} public @interface BufferFlags {}
/** Indicates that a buffer holds a synchronization sample. */ /** Indicates that a buffer holds a synchronization sample. */
@UnstableApi public static final int BUFFER_FLAG_KEY_FRAME = MediaCodec.BUFFER_FLAG_KEY_FRAME; @UnstableApi public static final int BUFFER_FLAG_KEY_FRAME = MediaCodec.BUFFER_FLAG_KEY_FRAME;
/** Flag for empty buffers that signal that the end of the stream was reached. */ /** Flag for empty buffers that signal that the end of the stream was reached. */
@UnstableApi @UnstableApi
public static final int BUFFER_FLAG_END_OF_STREAM = MediaCodec.BUFFER_FLAG_END_OF_STREAM; public static final int BUFFER_FLAG_END_OF_STREAM = MediaCodec.BUFFER_FLAG_END_OF_STREAM;
/** Indicates that a buffer is known to contain the first media sample of the stream. */ /** Indicates that a buffer is known to contain the first media sample of the stream. */
@UnstableApi public static final int BUFFER_FLAG_FIRST_SAMPLE = 1 << 27; // 0x08000000 @UnstableApi public static final int BUFFER_FLAG_FIRST_SAMPLE = 1 << 27; // 0x08000000
/** Indicates that a buffer has supplemental data. */ /** Indicates that a buffer has supplemental data. */
@UnstableApi public static final int BUFFER_FLAG_HAS_SUPPLEMENTAL_DATA = 1 << 28; // 0x10000000 @UnstableApi public static final int BUFFER_FLAG_HAS_SUPPLEMENTAL_DATA = 1 << 28; // 0x10000000
/** Indicates that a buffer is known to contain the last media sample of the stream. */ /** Indicates that a buffer is known to contain the last media sample of the stream. */
@UnstableApi public static final int BUFFER_FLAG_LAST_SAMPLE = 1 << 29; // 0x20000000 @UnstableApi public static final int BUFFER_FLAG_LAST_SAMPLE = 1 << 29; // 0x20000000
/** Indicates that a buffer is (at least partially) encrypted. */ /** Indicates that a buffer is (at least partially) encrypted. */
@UnstableApi public static final int BUFFER_FLAG_ENCRYPTED = 1 << 30; // 0x40000000 @UnstableApi public static final int BUFFER_FLAG_ENCRYPTED = 1 << 30; // 0x40000000
/** Indicates that a buffer should be decoded but not rendered. */ /** Indicates that a buffer should be decoded but not rendered. */
@UnstableApi public static final int BUFFER_FLAG_DECODE_ONLY = 1 << 31; // 0x80000000 @UnstableApi public static final int BUFFER_FLAG_DECODE_ONLY = 1 << 31; // 0x80000000
@ -573,10 +654,13 @@ public final class C {
@Target(TYPE_USE) @Target(TYPE_USE)
@IntDef(value = {VIDEO_OUTPUT_MODE_NONE, VIDEO_OUTPUT_MODE_YUV, VIDEO_OUTPUT_MODE_SURFACE_YUV}) @IntDef(value = {VIDEO_OUTPUT_MODE_NONE, VIDEO_OUTPUT_MODE_YUV, VIDEO_OUTPUT_MODE_SURFACE_YUV})
public @interface VideoOutputMode {} public @interface VideoOutputMode {}
/** Video decoder output mode is not set. */ /** Video decoder output mode is not set. */
@UnstableApi public static final int VIDEO_OUTPUT_MODE_NONE = -1; @UnstableApi public static final int VIDEO_OUTPUT_MODE_NONE = -1;
/** Video decoder output mode that outputs raw 4:2:0 YUV planes. */ /** Video decoder output mode that outputs raw 4:2:0 YUV planes. */
@UnstableApi public static final int VIDEO_OUTPUT_MODE_YUV = 0; @UnstableApi public static final int VIDEO_OUTPUT_MODE_YUV = 0;
/** Video decoder output mode that renders 4:2:0 YUV planes directly to a surface. */ /** Video decoder output mode that renders 4:2:0 YUV planes directly to a surface. */
@UnstableApi public static final int VIDEO_OUTPUT_MODE_SURFACE_YUV = 1; @UnstableApi public static final int VIDEO_OUTPUT_MODE_SURFACE_YUV = 1;
@ -598,14 +682,17 @@ public final class C {
VIDEO_SCALING_MODE_DEFAULT VIDEO_SCALING_MODE_DEFAULT
}) })
public @interface VideoScalingMode {} public @interface VideoScalingMode {}
/** See {@link MediaCodec#VIDEO_SCALING_MODE_SCALE_TO_FIT}. */ /** See {@link MediaCodec#VIDEO_SCALING_MODE_SCALE_TO_FIT}. */
@UnstableApi @UnstableApi
public static final int VIDEO_SCALING_MODE_SCALE_TO_FIT = public static final int VIDEO_SCALING_MODE_SCALE_TO_FIT =
MediaCodec.VIDEO_SCALING_MODE_SCALE_TO_FIT; MediaCodec.VIDEO_SCALING_MODE_SCALE_TO_FIT;
/** See {@link MediaCodec#VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING}. */ /** See {@link MediaCodec#VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING}. */
@UnstableApi @UnstableApi
public static final int VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING = public static final int VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING =
MediaCodec.VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING; MediaCodec.VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING;
/** A default video scaling mode for {@link MediaCodec}-based renderers. */ /** A default video scaling mode for {@link MediaCodec}-based renderers. */
@UnstableApi public static final int VIDEO_SCALING_MODE_DEFAULT = VIDEO_SCALING_MODE_SCALE_TO_FIT; @UnstableApi public static final int VIDEO_SCALING_MODE_DEFAULT = VIDEO_SCALING_MODE_SCALE_TO_FIT;
@ -618,11 +705,13 @@ public final class C {
@Target({FIELD, METHOD, PARAMETER, LOCAL_VARIABLE, TYPE_USE}) @Target({FIELD, METHOD, PARAMETER, LOCAL_VARIABLE, TYPE_USE})
@IntDef({VIDEO_CHANGE_FRAME_RATE_STRATEGY_OFF, VIDEO_CHANGE_FRAME_RATE_STRATEGY_ONLY_IF_SEAMLESS}) @IntDef({VIDEO_CHANGE_FRAME_RATE_STRATEGY_OFF, VIDEO_CHANGE_FRAME_RATE_STRATEGY_ONLY_IF_SEAMLESS})
public @interface VideoChangeFrameRateStrategy {} public @interface VideoChangeFrameRateStrategy {}
/** /**
* Strategy to never call {@link Surface#setFrameRate}. Use this strategy if you prefer to call * Strategy to never call {@link Surface#setFrameRate}. Use this strategy if you prefer to call
* {@link Surface#setFrameRate} directly from application code. * {@link Surface#setFrameRate} directly from application code.
*/ */
@UnstableApi public static final int VIDEO_CHANGE_FRAME_RATE_STRATEGY_OFF = Integer.MIN_VALUE; @UnstableApi public static final int VIDEO_CHANGE_FRAME_RATE_STRATEGY_OFF = Integer.MIN_VALUE;
/** /**
* Strategy to call {@link Surface#setFrameRate} with {@link * Strategy to call {@link Surface#setFrameRate} with {@link
* Surface#CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS} when the output frame rate is known. * Surface#CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS} when the output frame rate is known.
@ -644,9 +733,11 @@ public final class C {
flag = true, flag = true,
value = {SELECTION_FLAG_DEFAULT, SELECTION_FLAG_FORCED, SELECTION_FLAG_AUTOSELECT}) value = {SELECTION_FLAG_DEFAULT, SELECTION_FLAG_FORCED, SELECTION_FLAG_AUTOSELECT})
public @interface SelectionFlags {} public @interface SelectionFlags {}
// LINT.IfChange(selection_flags) // LINT.IfChange(selection_flags)
/** Indicates that the track should be selected if user preferences do not state otherwise. */ /** Indicates that the track should be selected if user preferences do not state otherwise. */
public static final int SELECTION_FLAG_DEFAULT = 1; public static final int SELECTION_FLAG_DEFAULT = 1;
/** /**
* Indicates that the track should be selected if its language matches the language of the * Indicates that the track should be selected if its language matches the language of the
* selected audio track and user preferences do not state otherwise. Only applies to text tracks. * selected audio track and user preferences do not state otherwise. Only applies to text tracks.
@ -657,6 +748,7 @@ public final class C {
* for more info. * for more info.
*/ */
public static final int SELECTION_FLAG_FORCED = 1 << 1; // 2 public static final int SELECTION_FLAG_FORCED = 1 << 1; // 2
/** /**
* Indicates that the player may choose to play the track in absence of an explicit user * Indicates that the player may choose to play the track in absence of an explicit user
* preference. * preference.
@ -690,32 +782,42 @@ public final class C {
CONTENT_TYPE_OTHER CONTENT_TYPE_OTHER
}) })
public @interface ContentType {} public @interface ContentType {}
/** Value representing a DASH manifest. */ /** Value representing a DASH manifest. */
public static final int CONTENT_TYPE_DASH = 0; public static final int CONTENT_TYPE_DASH = 0;
/** /**
* @deprecated Use {@link #CONTENT_TYPE_DASH} instead. * @deprecated Use {@link #CONTENT_TYPE_DASH} instead.
*/ */
@Deprecated @UnstableApi public static final int TYPE_DASH = CONTENT_TYPE_DASH; @Deprecated @UnstableApi public static final int TYPE_DASH = CONTENT_TYPE_DASH;
/** Value representing a Smooth Streaming manifest. */ /** Value representing a Smooth Streaming manifest. */
public static final int CONTENT_TYPE_SS = 1; public static final int CONTENT_TYPE_SS = 1;
/** /**
* @deprecated Use {@link #CONTENT_TYPE_SS} instead. * @deprecated Use {@link #CONTENT_TYPE_SS} instead.
*/ */
@Deprecated @UnstableApi public static final int TYPE_SS = CONTENT_TYPE_SS; @Deprecated @UnstableApi public static final int TYPE_SS = CONTENT_TYPE_SS;
/** Value representing an HLS manifest. */ /** Value representing an HLS manifest. */
public static final int CONTENT_TYPE_HLS = 2; public static final int CONTENT_TYPE_HLS = 2;
/** /**
* @deprecated Use {@link #CONTENT_TYPE_HLS} instead. * @deprecated Use {@link #CONTENT_TYPE_HLS} instead.
*/ */
@Deprecated @UnstableApi public static final int TYPE_HLS = CONTENT_TYPE_HLS; @Deprecated @UnstableApi public static final int TYPE_HLS = CONTENT_TYPE_HLS;
/** Value representing an RTSP stream. */ /** Value representing an RTSP stream. */
public static final int CONTENT_TYPE_RTSP = 3; public static final int CONTENT_TYPE_RTSP = 3;
/** /**
* @deprecated Use {@link #CONTENT_TYPE_RTSP} instead. * @deprecated Use {@link #CONTENT_TYPE_RTSP} instead.
*/ */
@Deprecated @UnstableApi public static final int TYPE_RTSP = CONTENT_TYPE_RTSP; @Deprecated @UnstableApi public static final int TYPE_RTSP = CONTENT_TYPE_RTSP;
/** Value representing files other than DASH, HLS or Smooth Streaming manifests, or RTSP URIs. */ /** Value representing files other than DASH, HLS or Smooth Streaming manifests, or RTSP URIs. */
public static final int CONTENT_TYPE_OTHER = 4; public static final int CONTENT_TYPE_OTHER = 4;
/** /**
* @deprecated Use {@link #CONTENT_TYPE_OTHER} instead. * @deprecated Use {@link #CONTENT_TYPE_OTHER} instead.
*/ */
@ -723,14 +825,18 @@ public final class C {
/** A return value for methods where the end of an input was encountered. */ /** A return value for methods where the end of an input was encountered. */
@UnstableApi public static final int RESULT_END_OF_INPUT = -1; @UnstableApi public static final int RESULT_END_OF_INPUT = -1;
/** /**
* A return value for methods where the length of parsed data exceeds the maximum length allowed. * A return value for methods where the length of parsed data exceeds the maximum length allowed.
*/ */
@UnstableApi public static final int RESULT_MAX_LENGTH_EXCEEDED = -2; @UnstableApi public static final int RESULT_MAX_LENGTH_EXCEEDED = -2;
/** A return value for methods where nothing was read. */ /** A return value for methods where nothing was read. */
@UnstableApi public static final int RESULT_NOTHING_READ = -3; @UnstableApi public static final int RESULT_NOTHING_READ = -3;
/** A return value for methods where a buffer was read. */ /** A return value for methods where a buffer was read. */
@UnstableApi public static final int RESULT_BUFFER_READ = -4; @UnstableApi public static final int RESULT_BUFFER_READ = -4;
/** A return value for methods where a format was read. */ /** A return value for methods where a format was read. */
@UnstableApi public static final int RESULT_FORMAT_READ = -5; @UnstableApi public static final int RESULT_FORMAT_READ = -5;
@ -758,24 +864,33 @@ public final class C {
DATA_TYPE_MEDIA_PROGRESSIVE_LIVE DATA_TYPE_MEDIA_PROGRESSIVE_LIVE
}) })
public @interface DataType {} public @interface DataType {}
/** A data type constant for data of unknown or unspecified type. */ /** A data type constant for data of unknown or unspecified type. */
@UnstableApi public static final int DATA_TYPE_UNKNOWN = 0; @UnstableApi public static final int DATA_TYPE_UNKNOWN = 0;
/** A data type constant for media, typically containing media samples. */ /** A data type constant for media, typically containing media samples. */
@UnstableApi public static final int DATA_TYPE_MEDIA = 1; @UnstableApi public static final int DATA_TYPE_MEDIA = 1;
/** A data type constant for media, typically containing only initialization data. */ /** A data type constant for media, typically containing only initialization data. */
@UnstableApi public static final int DATA_TYPE_MEDIA_INITIALIZATION = 2; @UnstableApi public static final int DATA_TYPE_MEDIA_INITIALIZATION = 2;
/** A data type constant for drm or encryption data. */ /** A data type constant for drm or encryption data. */
@UnstableApi public static final int DATA_TYPE_DRM = 3; @UnstableApi public static final int DATA_TYPE_DRM = 3;
/** A data type constant for a manifest file. */ /** A data type constant for a manifest file. */
@UnstableApi public static final int DATA_TYPE_MANIFEST = 4; @UnstableApi public static final int DATA_TYPE_MANIFEST = 4;
/** A data type constant for time synchronization data. */ /** A data type constant for time synchronization data. */
@UnstableApi public static final int DATA_TYPE_TIME_SYNCHRONIZATION = 5; @UnstableApi public static final int DATA_TYPE_TIME_SYNCHRONIZATION = 5;
/** A data type constant for ads loader data. */ /** A data type constant for ads loader data. */
@UnstableApi public static final int DATA_TYPE_AD = 6; @UnstableApi public static final int DATA_TYPE_AD = 6;
/** /**
* A data type constant for live progressive media streams, typically containing media samples. * A data type constant for live progressive media streams, typically containing media samples.
*/ */
@UnstableApi public static final int DATA_TYPE_MEDIA_PROGRESSIVE_LIVE = 7; @UnstableApi public static final int DATA_TYPE_MEDIA_PROGRESSIVE_LIVE = 7;
/** /**
* Applications or extensions may define custom {@code DATA_TYPE_*} constants greater than or * Applications or extensions may define custom {@code DATA_TYPE_*} constants greater than or
* equal to this value. * equal to this value.
@ -806,24 +921,34 @@ public final class C {
TRACK_TYPE_NONE, TRACK_TYPE_NONE,
}) })
public @interface TrackType {} public @interface TrackType {}
/** A type constant for a fake or empty track. */ /** A type constant for a fake or empty track. */
public static final int TRACK_TYPE_NONE = -2; public static final int TRACK_TYPE_NONE = -2;
/** A type constant for tracks of unknown type. */ /** A type constant for tracks of unknown type. */
public static final int TRACK_TYPE_UNKNOWN = -1; public static final int TRACK_TYPE_UNKNOWN = -1;
/** A type constant for tracks of some default type, where the type itself is unknown. */ /** A type constant for tracks of some default type, where the type itself is unknown. */
public static final int TRACK_TYPE_DEFAULT = 0; public static final int TRACK_TYPE_DEFAULT = 0;
/** A type constant for audio tracks. */ /** A type constant for audio tracks. */
public static final int TRACK_TYPE_AUDIO = 1; public static final int TRACK_TYPE_AUDIO = 1;
/** A type constant for video tracks. */ /** A type constant for video tracks. */
public static final int TRACK_TYPE_VIDEO = 2; public static final int TRACK_TYPE_VIDEO = 2;
/** A type constant for text tracks. */ /** A type constant for text tracks. */
public static final int TRACK_TYPE_TEXT = 3; public static final int TRACK_TYPE_TEXT = 3;
/** A type constant for image tracks. */ /** A type constant for image tracks. */
public static final int TRACK_TYPE_IMAGE = 4; public static final int TRACK_TYPE_IMAGE = 4;
/** A type constant for metadata tracks. */ /** A type constant for metadata tracks. */
public static final int TRACK_TYPE_METADATA = 5; public static final int TRACK_TYPE_METADATA = 5;
/** A type constant for camera motion tracks. */ /** A type constant for camera motion tracks. */
public static final int TRACK_TYPE_CAMERA_MOTION = 6; public static final int TRACK_TYPE_CAMERA_MOTION = 6;
/** /**
* Applications or extensions may define custom {@code TRACK_TYPE_*} constants greater than or * Applications or extensions may define custom {@code TRACK_TYPE_*} constants greater than or
* equal to this value. * equal to this value.
@ -850,16 +975,22 @@ public final class C {
SELECTION_REASON_TRICK_PLAY SELECTION_REASON_TRICK_PLAY
}) })
public @interface SelectionReason {} public @interface SelectionReason {}
/** A selection reason constant for selections whose reasons are unknown or unspecified. */ /** A selection reason constant for selections whose reasons are unknown or unspecified. */
@UnstableApi public static final int SELECTION_REASON_UNKNOWN = 0; @UnstableApi public static final int SELECTION_REASON_UNKNOWN = 0;
/** A selection reason constant for an initial track selection. */ /** A selection reason constant for an initial track selection. */
@UnstableApi public static final int SELECTION_REASON_INITIAL = 1; @UnstableApi public static final int SELECTION_REASON_INITIAL = 1;
/** A selection reason constant for an manual (i.e. user initiated) track selection. */ /** A selection reason constant for an manual (i.e. user initiated) track selection. */
@UnstableApi public static final int SELECTION_REASON_MANUAL = 2; @UnstableApi public static final int SELECTION_REASON_MANUAL = 2;
/** A selection reason constant for an adaptive track selection. */ /** A selection reason constant for an adaptive track selection. */
@UnstableApi public static final int SELECTION_REASON_ADAPTIVE = 3; @UnstableApi public static final int SELECTION_REASON_ADAPTIVE = 3;
/** A selection reason constant for a trick play track selection. */ /** A selection reason constant for a trick play track selection. */
@UnstableApi public static final int SELECTION_REASON_TRICK_PLAY = 4; @UnstableApi public static final int SELECTION_REASON_TRICK_PLAY = 4;
/** /**
* Applications or extensions may define custom {@code SELECTION_REASON_*} constants greater than * Applications or extensions may define custom {@code SELECTION_REASON_*} constants greater than
* or equal to this value. * or equal to this value.
@ -871,6 +1002,7 @@ public final class C {
/** A default seek back increment, in milliseconds. */ /** A default seek back increment, in milliseconds. */
public static final long DEFAULT_SEEK_BACK_INCREMENT_MS = 5_000; public static final long DEFAULT_SEEK_BACK_INCREMENT_MS = 5_000;
/** A default seek forward increment, in milliseconds. */ /** A default seek forward increment, in milliseconds. */
public static final long DEFAULT_SEEK_FORWARD_INCREMENT_MS = 15_000; public static final long DEFAULT_SEEK_FORWARD_INCREMENT_MS = 15_000;
@ -952,12 +1084,16 @@ public final class C {
STEREO_MODE_STEREO_MESH STEREO_MODE_STEREO_MESH
}) })
public @interface StereoMode {} public @interface StereoMode {}
/** Indicates Monoscopic stereo layout, used with 360/3D/VR videos. */ /** Indicates Monoscopic stereo layout, used with 360/3D/VR videos. */
@UnstableApi public static final int STEREO_MODE_MONO = 0; @UnstableApi public static final int STEREO_MODE_MONO = 0;
/** Indicates Top-Bottom stereo layout, used with 360/3D/VR videos. */ /** Indicates Top-Bottom stereo layout, used with 360/3D/VR videos. */
@UnstableApi public static final int STEREO_MODE_TOP_BOTTOM = 1; @UnstableApi public static final int STEREO_MODE_TOP_BOTTOM = 1;
/** Indicates Left-Right stereo layout, used with 360/3D/VR videos. */ /** Indicates Left-Right stereo layout, used with 360/3D/VR videos. */
@UnstableApi public static final int STEREO_MODE_LEFT_RIGHT = 2; @UnstableApi public static final int STEREO_MODE_LEFT_RIGHT = 2;
/** /**
* Indicates a stereo layout where the left and right eyes have separate meshes, used with * Indicates a stereo layout where the left and right eyes have separate meshes, used with
* 360/3D/VR videos. * 360/3D/VR videos.
@ -975,10 +1111,13 @@ public final class C {
@Target(TYPE_USE) @Target(TYPE_USE)
@IntDef({Format.NO_VALUE, COLOR_SPACE_BT601, COLOR_SPACE_BT709, COLOR_SPACE_BT2020}) @IntDef({Format.NO_VALUE, COLOR_SPACE_BT601, COLOR_SPACE_BT709, COLOR_SPACE_BT2020})
public @interface ColorSpace {} public @interface ColorSpace {}
/** See {@link MediaFormat#COLOR_STANDARD_BT601_PAL}. */ /** See {@link MediaFormat#COLOR_STANDARD_BT601_PAL}. */
@UnstableApi public static final int COLOR_SPACE_BT601 = MediaFormat.COLOR_STANDARD_BT601_PAL; @UnstableApi public static final int COLOR_SPACE_BT601 = MediaFormat.COLOR_STANDARD_BT601_PAL;
/** See {@link MediaFormat#COLOR_STANDARD_BT709}. */ /** See {@link MediaFormat#COLOR_STANDARD_BT709}. */
@UnstableApi public static final int COLOR_SPACE_BT709 = MediaFormat.COLOR_STANDARD_BT709; @UnstableApi public static final int COLOR_SPACE_BT709 = MediaFormat.COLOR_STANDARD_BT709;
/** See {@link MediaFormat#COLOR_STANDARD_BT2020}. */ /** See {@link MediaFormat#COLOR_STANDARD_BT2020}. */
@UnstableApi public static final int COLOR_SPACE_BT2020 = MediaFormat.COLOR_STANDARD_BT2020; @UnstableApi public static final int COLOR_SPACE_BT2020 = MediaFormat.COLOR_STANDARD_BT2020;
@ -1002,10 +1141,13 @@ public final class C {
COLOR_TRANSFER_HLG COLOR_TRANSFER_HLG
}) })
public @interface ColorTransfer {} public @interface ColorTransfer {}
/** See {@link MediaFormat#COLOR_TRANSFER_LINEAR}. */ /** See {@link MediaFormat#COLOR_TRANSFER_LINEAR}. */
@UnstableApi public static final int COLOR_TRANSFER_LINEAR = MediaFormat.COLOR_TRANSFER_LINEAR; @UnstableApi public static final int COLOR_TRANSFER_LINEAR = MediaFormat.COLOR_TRANSFER_LINEAR;
/** See {@link MediaFormat#COLOR_TRANSFER_SDR_VIDEO}. The SMPTE 170M transfer function. */ /** See {@link MediaFormat#COLOR_TRANSFER_SDR_VIDEO}. The SMPTE 170M transfer function. */
@UnstableApi public static final int COLOR_TRANSFER_SDR = MediaFormat.COLOR_TRANSFER_SDR_VIDEO; @UnstableApi public static final int COLOR_TRANSFER_SDR = MediaFormat.COLOR_TRANSFER_SDR_VIDEO;
/** /**
* See {@link android.hardware.DataSpace#TRANSFER_SRGB}. The standard RGB transfer function, used * See {@link android.hardware.DataSpace#TRANSFER_SRGB}. The standard RGB transfer function, used
* for some SDR use-cases like image input. * for some SDR use-cases like image input.
@ -1013,13 +1155,16 @@ public final class C {
// Value sourced from ordering here: // Value sourced from ordering here:
// https://cs.android.com/android/platform/superproject/+/master:frameworks/native/headers/media_plugin/media/hardware/VideoAPI.h;drc=55e9bd7c487ee235631f302ab8626776547ac913;l=138. // https://cs.android.com/android/platform/superproject/+/master:frameworks/native/headers/media_plugin/media/hardware/VideoAPI.h;drc=55e9bd7c487ee235631f302ab8626776547ac913;l=138.
@UnstableApi public static final int COLOR_TRANSFER_SRGB = 2; @UnstableApi public static final int COLOR_TRANSFER_SRGB = 2;
/** /**
* See {@link android.hardware.DataSpace#TRANSFER_GAMMA2_2}. The Gamma 2.2 transfer function, used * See {@link android.hardware.DataSpace#TRANSFER_GAMMA2_2}. The Gamma 2.2 transfer function, used
* for some SDR use-cases like tone-mapping. * for some SDR use-cases like tone-mapping.
*/ */
@UnstableApi public static final int COLOR_TRANSFER_GAMMA_2_2 = 10; @UnstableApi public static final int COLOR_TRANSFER_GAMMA_2_2 = 10;
/** See {@link MediaFormat#COLOR_TRANSFER_ST2084}. */ /** See {@link MediaFormat#COLOR_TRANSFER_ST2084}. */
@UnstableApi public static final int COLOR_TRANSFER_ST2084 = MediaFormat.COLOR_TRANSFER_ST2084; @UnstableApi public static final int COLOR_TRANSFER_ST2084 = MediaFormat.COLOR_TRANSFER_ST2084;
/** See {@link MediaFormat#COLOR_TRANSFER_HLG}. */ /** See {@link MediaFormat#COLOR_TRANSFER_HLG}. */
@UnstableApi public static final int COLOR_TRANSFER_HLG = MediaFormat.COLOR_TRANSFER_HLG; @UnstableApi public static final int COLOR_TRANSFER_HLG = MediaFormat.COLOR_TRANSFER_HLG;
@ -1034,8 +1179,10 @@ public final class C {
@Target(TYPE_USE) @Target(TYPE_USE)
@IntDef({Format.NO_VALUE, COLOR_RANGE_LIMITED, COLOR_RANGE_FULL}) @IntDef({Format.NO_VALUE, COLOR_RANGE_LIMITED, COLOR_RANGE_FULL})
public @interface ColorRange {} public @interface ColorRange {}
/** See {@link MediaFormat#COLOR_RANGE_LIMITED}. */ /** See {@link MediaFormat#COLOR_RANGE_LIMITED}. */
@UnstableApi public static final int COLOR_RANGE_LIMITED = MediaFormat.COLOR_RANGE_LIMITED; @UnstableApi public static final int COLOR_RANGE_LIMITED = MediaFormat.COLOR_RANGE_LIMITED;
/** See {@link MediaFormat#COLOR_RANGE_FULL}. */ /** See {@link MediaFormat#COLOR_RANGE_FULL}. */
@UnstableApi public static final int COLOR_RANGE_FULL = MediaFormat.COLOR_RANGE_FULL; @UnstableApi public static final int COLOR_RANGE_FULL = MediaFormat.COLOR_RANGE_FULL;
@ -1052,12 +1199,16 @@ public final class C {
PROJECTION_MESH PROJECTION_MESH
}) })
public @interface Projection {} public @interface Projection {}
/** Conventional rectangular projection. */ /** Conventional rectangular projection. */
@UnstableApi public static final int PROJECTION_RECTANGULAR = 0; @UnstableApi public static final int PROJECTION_RECTANGULAR = 0;
/** Equirectangular spherical projection. */ /** Equirectangular spherical projection. */
@UnstableApi public static final int PROJECTION_EQUIRECTANGULAR = 1; @UnstableApi public static final int PROJECTION_EQUIRECTANGULAR = 1;
/** Cube map projection. */ /** Cube map projection. */
@UnstableApi public static final int PROJECTION_CUBEMAP = 2; @UnstableApi public static final int PROJECTION_CUBEMAP = 2;
/** 3-D mesh projection. */ /** 3-D mesh projection. */
@UnstableApi public static final int PROJECTION_MESH = 3; @UnstableApi public static final int PROJECTION_MESH = 3;
@ -1101,29 +1252,40 @@ public final class C {
NETWORK_TYPE_OTHER NETWORK_TYPE_OTHER
}) })
public @interface NetworkType {} public @interface NetworkType {}
/** Unknown network type. */ /** Unknown network type. */
@UnstableApi public static final int NETWORK_TYPE_UNKNOWN = 0; @UnstableApi public static final int NETWORK_TYPE_UNKNOWN = 0;
/** No network connection. */ /** No network connection. */
@UnstableApi public static final int NETWORK_TYPE_OFFLINE = 1; @UnstableApi public static final int NETWORK_TYPE_OFFLINE = 1;
/** Network type for a Wifi connection. */ /** Network type for a Wifi connection. */
@UnstableApi public static final int NETWORK_TYPE_WIFI = 2; @UnstableApi public static final int NETWORK_TYPE_WIFI = 2;
/** Network type for a 2G cellular connection. */ /** Network type for a 2G cellular connection. */
@UnstableApi public static final int NETWORK_TYPE_2G = 3; @UnstableApi public static final int NETWORK_TYPE_2G = 3;
/** Network type for a 3G cellular connection. */ /** Network type for a 3G cellular connection. */
@UnstableApi public static final int NETWORK_TYPE_3G = 4; @UnstableApi public static final int NETWORK_TYPE_3G = 4;
/** Network type for a 4G cellular connection. */ /** Network type for a 4G cellular connection. */
@UnstableApi public static final int NETWORK_TYPE_4G = 5; @UnstableApi public static final int NETWORK_TYPE_4G = 5;
/** Network type for a 5G stand-alone (SA) cellular connection. */ /** Network type for a 5G stand-alone (SA) cellular connection. */
@UnstableApi public static final int NETWORK_TYPE_5G_SA = 9; @UnstableApi public static final int NETWORK_TYPE_5G_SA = 9;
/** Network type for a 5G non-stand-alone (NSA) cellular connection. */ /** Network type for a 5G non-stand-alone (NSA) cellular connection. */
@UnstableApi public static final int NETWORK_TYPE_5G_NSA = 10; @UnstableApi public static final int NETWORK_TYPE_5G_NSA = 10;
/** /**
* Network type for cellular connections which cannot be mapped to one of {@link * Network type for cellular connections which cannot be mapped to one of {@link
* #NETWORK_TYPE_2G}, {@link #NETWORK_TYPE_3G}, or {@link #NETWORK_TYPE_4G}. * #NETWORK_TYPE_2G}, {@link #NETWORK_TYPE_3G}, or {@link #NETWORK_TYPE_4G}.
*/ */
@UnstableApi public static final int NETWORK_TYPE_CELLULAR_UNKNOWN = 6; @UnstableApi public static final int NETWORK_TYPE_CELLULAR_UNKNOWN = 6;
/** Network type for an Ethernet connection. */ /** Network type for an Ethernet connection. */
@UnstableApi public static final int NETWORK_TYPE_ETHERNET = 7; @UnstableApi public static final int NETWORK_TYPE_ETHERNET = 7;
/** Network type for other connections which are not Wifi or cellular (e.g. VPN, Bluetooth). */ /** Network type for other connections which are not Wifi or cellular (e.g. VPN, Bluetooth). */
@UnstableApi public static final int NETWORK_TYPE_OTHER = 8; @UnstableApi public static final int NETWORK_TYPE_OTHER = 8;
@ -1138,12 +1300,14 @@ public final class C {
@Target({FIELD, METHOD, PARAMETER, LOCAL_VARIABLE, TYPE_USE}) @Target({FIELD, METHOD, PARAMETER, LOCAL_VARIABLE, TYPE_USE})
@IntDef({WAKE_MODE_NONE, WAKE_MODE_LOCAL, WAKE_MODE_NETWORK}) @IntDef({WAKE_MODE_NONE, WAKE_MODE_LOCAL, WAKE_MODE_NETWORK})
public @interface WakeMode {} public @interface WakeMode {}
/** /**
* A wake mode that will not cause the player to hold any locks. * A wake mode that will not cause the player to hold any locks.
* *
* <p>This is suitable for applications that do not play media with the screen off. * <p>This is suitable for applications that do not play media with the screen off.
*/ */
public static final int WAKE_MODE_NONE = 0; public static final int WAKE_MODE_NONE = 0;
/** /**
* A wake mode that will cause the player to hold a {@link android.os.PowerManager.WakeLock} * A wake mode that will cause the player to hold a {@link android.os.PowerManager.WakeLock}
* during playback. * during playback.
@ -1152,6 +1316,7 @@ public final class C {
* over wifi. * over wifi.
*/ */
public static final int WAKE_MODE_LOCAL = 1; public static final int WAKE_MODE_LOCAL = 1;
/** /**
* A wake mode that will cause the player to hold a {@link android.os.PowerManager.WakeLock} and a * A wake mode that will cause the player to hold a {@link android.os.PowerManager.WakeLock} and a
* {@link android.net.wifi.WifiManager.WifiLock} during playback. * {@link android.net.wifi.WifiManager.WifiLock} during playback.
@ -1195,50 +1360,65 @@ public final class C {
ROLE_FLAG_TRICK_PLAY ROLE_FLAG_TRICK_PLAY
}) })
public @interface RoleFlags {} public @interface RoleFlags {}
// LINT.IfChange(role_flags) // LINT.IfChange(role_flags)
/** Indicates a main track. */ /** Indicates a main track. */
public static final int ROLE_FLAG_MAIN = 1; public static final int ROLE_FLAG_MAIN = 1;
/** /**
* Indicates an alternate track. For example a video track recorded from an different view point * Indicates an alternate track. For example a video track recorded from an different view point
* than the main track(s). * than the main track(s).
*/ */
public static final int ROLE_FLAG_ALTERNATE = 1 << 1; public static final int ROLE_FLAG_ALTERNATE = 1 << 1;
/** /**
* Indicates a supplementary track, meaning the track has lower importance than the main track(s). * Indicates a supplementary track, meaning the track has lower importance than the main track(s).
* For example a video track that provides a visual accompaniment to a main audio track. * For example a video track that provides a visual accompaniment to a main audio track.
*/ */
public static final int ROLE_FLAG_SUPPLEMENTARY = 1 << 2; public static final int ROLE_FLAG_SUPPLEMENTARY = 1 << 2;
/** Indicates the track contains commentary, for example from the director. */ /** Indicates the track contains commentary, for example from the director. */
public static final int ROLE_FLAG_COMMENTARY = 1 << 3; public static final int ROLE_FLAG_COMMENTARY = 1 << 3;
/** /**
* Indicates the track is in a different language from the original, for example dubbed audio or * Indicates the track is in a different language from the original, for example dubbed audio or
* translated captions. * translated captions.
*/ */
public static final int ROLE_FLAG_DUB = 1 << 4; public static final int ROLE_FLAG_DUB = 1 << 4;
/** Indicates the track contains information about a current emergency. */ /** Indicates the track contains information about a current emergency. */
public static final int ROLE_FLAG_EMERGENCY = 1 << 5; public static final int ROLE_FLAG_EMERGENCY = 1 << 5;
/** /**
* Indicates the track contains captions. This flag may be set on video tracks to indicate the * Indicates the track contains captions. This flag may be set on video tracks to indicate the
* presence of burned in captions. * presence of burned in captions.
*/ */
public static final int ROLE_FLAG_CAPTION = 1 << 6; public static final int ROLE_FLAG_CAPTION = 1 << 6;
/** /**
* Indicates the track contains subtitles. This flag may be set on video tracks to indicate the * Indicates the track contains subtitles. This flag may be set on video tracks to indicate the
* presence of burned in subtitles. * presence of burned in subtitles.
*/ */
public static final int ROLE_FLAG_SUBTITLE = 1 << 7; public static final int ROLE_FLAG_SUBTITLE = 1 << 7;
/** Indicates the track contains a visual sign-language interpretation of an audio track. */ /** Indicates the track contains a visual sign-language interpretation of an audio track. */
public static final int ROLE_FLAG_SIGN = 1 << 8; public static final int ROLE_FLAG_SIGN = 1 << 8;
/** Indicates the track contains an audio or textual description of a video track. */ /** Indicates the track contains an audio or textual description of a video track. */
public static final int ROLE_FLAG_DESCRIBES_VIDEO = 1 << 9; public static final int ROLE_FLAG_DESCRIBES_VIDEO = 1 << 9;
/** Indicates the track contains a textual description of music and sound. */ /** Indicates the track contains a textual description of music and sound. */
public static final int ROLE_FLAG_DESCRIBES_MUSIC_AND_SOUND = 1 << 10; public static final int ROLE_FLAG_DESCRIBES_MUSIC_AND_SOUND = 1 << 10;
/** Indicates the track is designed for improved intelligibility of dialogue. */ /** Indicates the track is designed for improved intelligibility of dialogue. */
public static final int ROLE_FLAG_ENHANCED_DIALOG_INTELLIGIBILITY = 1 << 11; public static final int ROLE_FLAG_ENHANCED_DIALOG_INTELLIGIBILITY = 1 << 11;
/** Indicates the track contains a transcription of spoken dialog. */ /** Indicates the track contains a transcription of spoken dialog. */
public static final int ROLE_FLAG_TRANSCRIBES_DIALOG = 1 << 12; public static final int ROLE_FLAG_TRANSCRIBES_DIALOG = 1 << 12;
/** Indicates the track contains a text that has been edited for ease of reading. */ /** Indicates the track contains a text that has been edited for ease of reading. */
public static final int ROLE_FLAG_EASY_TO_READ = 1 << 13; public static final int ROLE_FLAG_EASY_TO_READ = 1 << 13;
/** Indicates the track is intended for trick play. */ /** Indicates the track is intended for trick play. */
public static final int ROLE_FLAG_TRICK_PLAY = 1 << 14; public static final int ROLE_FLAG_TRICK_PLAY = 1 << 14;
@ -1261,9 +1441,11 @@ public final class C {
FORMAT_UNSUPPORTED_TYPE FORMAT_UNSUPPORTED_TYPE
}) })
public @interface FormatSupport {} public @interface FormatSupport {}
// TODO(b/172315872) Renderer was a link. Link to equivalent concept or remove @code. // TODO(b/172315872) Renderer was a link. Link to equivalent concept or remove @code.
/** The {@code Renderer} is capable of rendering the format. */ /** The {@code Renderer} is capable of rendering the format. */
@UnstableApi public static final int FORMAT_HANDLED = 0b100; @UnstableApi public static final int FORMAT_HANDLED = 0b100;
/** /**
* The {@code Renderer} is capable of rendering formats with the same MIME type, but the * The {@code Renderer} is capable of rendering formats with the same MIME type, but the
* properties of the format exceed the renderer's capabilities. There is a chance the renderer * properties of the format exceed the renderer's capabilities. There is a chance the renderer
@ -1275,6 +1457,7 @@ public final class C {
* by the underlying H264 decoder. * by the underlying H264 decoder.
*/ */
@UnstableApi public static final int FORMAT_EXCEEDS_CAPABILITIES = 0b011; @UnstableApi public static final int FORMAT_EXCEEDS_CAPABILITIES = 0b011;
/** /**
* The {@code Renderer} is capable of rendering formats with the same MIME type, but is not * The {@code Renderer} is capable of rendering formats with the same MIME type, but is not
* capable of rendering the format because the format's drm protection is not supported. * capable of rendering the format because the format's drm protection is not supported.
@ -1284,6 +1467,7 @@ public final class C {
* renderer only supports Widevine. * renderer only supports Widevine.
*/ */
@UnstableApi public static final int FORMAT_UNSUPPORTED_DRM = 0b010; @UnstableApi public static final int FORMAT_UNSUPPORTED_DRM = 0b010;
/** /**
* The {@code Renderer} is a general purpose renderer for formats of the same top-level type, but * The {@code Renderer} is a general purpose renderer for formats of the same top-level type, but
* is not capable of rendering the format or any other format with the same MIME type because the * is not capable of rendering the format or any other format with the same MIME type because the
@ -1293,6 +1477,7 @@ public final class C {
* matches audio/[subtype], but there does not exist a suitable decoder for [subtype]. * matches audio/[subtype], but there does not exist a suitable decoder for [subtype].
*/ */
@UnstableApi public static final int FORMAT_UNSUPPORTED_SUBTYPE = 0b001; @UnstableApi public static final int FORMAT_UNSUPPORTED_SUBTYPE = 0b001;
/** /**
* The {@code Renderer} is not capable of rendering the format, either because it does not support * The {@code Renderer} is not capable of rendering the format, either because it does not support
* the format's top-level type, or because it's a specialized renderer for a different MIME type. * the format's top-level type, or because it's a specialized renderer for a different MIME type.

View File

@ -43,8 +43,10 @@ public final class DeviceInfo implements Bundleable {
PLAYBACK_TYPE_REMOTE, PLAYBACK_TYPE_REMOTE,
}) })
public @interface PlaybackType {} public @interface PlaybackType {}
/** Playback happens on the local device (e.g. phone). */ /** Playback happens on the local device (e.g. phone). */
public static final int PLAYBACK_TYPE_LOCAL = 0; public static final int PLAYBACK_TYPE_LOCAL = 0;
/** Playback happens outside of the device (e.g. a cast device). */ /** Playback happens outside of the device (e.g. a cast device). */
public static final int PLAYBACK_TYPE_REMOTE = 1; public static final int PLAYBACK_TYPE_REMOTE = 1;
@ -126,12 +128,15 @@ public final class DeviceInfo implements Bundleable {
/** The type of playback. */ /** The type of playback. */
public final @PlaybackType int playbackType; public final @PlaybackType int playbackType;
/** The minimum volume that the device supports. */ /** The minimum volume that the device supports. */
@IntRange(from = 0) @IntRange(from = 0)
public final int minVolume; public final int minVolume;
/** The maximum volume that the device supports, or {@code 0} if unspecified. */ /** The maximum volume that the device supports, or {@code 0} if unspecified. */
@IntRange(from = 0) @IntRange(from = 0)
public final int maxVolume; public final int maxVolume;
/** /**
* The {@linkplain MediaRouter2.RoutingController#getId() routing controller id} of the associated * The {@linkplain MediaRouter2.RoutingController#getId() routing controller id} of the associated
* {@link MediaRouter2.RoutingController}, or null if unset or {@link #playbackType} is {@link * {@link MediaRouter2.RoutingController}, or null if unset or {@link #playbackType} is {@link

View File

@ -265,10 +265,13 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable {
* applies to all schemes). * applies to all schemes).
*/ */
public final UUID uuid; public final UUID uuid;
/** The URL of the server to which license requests should be made. May be null if unknown. */ /** The URL of the server to which license requests should be made. May be null if unknown. */
@Nullable public final String licenseServerUrl; @Nullable public final String licenseServerUrl;
/** The mimeType of {@link #data}. */ /** The mimeType of {@link #data}. */
public final String mimeType; public final String mimeType;
/** The initialization data. May be null for scheme support checks only. */ /** The initialization data. May be null for scheme support checks only. */
@Nullable public final byte[] data; @Nullable public final byte[] data;

View File

@ -47,40 +47,58 @@ public final class FileTypes {
MIDI, AVI MIDI, AVI
}) })
public @interface Type {} public @interface Type {}
/** Unknown file type. */ /** Unknown file type. */
public static final int UNKNOWN = -1; public static final int UNKNOWN = -1;
/** File type for the AC-3 and E-AC-3 formats. */ /** File type for the AC-3 and E-AC-3 formats. */
public static final int AC3 = 0; public static final int AC3 = 0;
/** File type for the AC-4 format. */ /** File type for the AC-4 format. */
public static final int AC4 = 1; public static final int AC4 = 1;
/** File type for the ADTS format. */ /** File type for the ADTS format. */
public static final int ADTS = 2; public static final int ADTS = 2;
/** File type for the AMR format. */ /** File type for the AMR format. */
public static final int AMR = 3; public static final int AMR = 3;
/** File type for the FLAC format. */ /** File type for the FLAC format. */
public static final int FLAC = 4; public static final int FLAC = 4;
/** File type for the FLV format. */ /** File type for the FLV format. */
public static final int FLV = 5; public static final int FLV = 5;
/** File type for the Matroska and WebM formats. */ /** File type for the Matroska and WebM formats. */
public static final int MATROSKA = 6; public static final int MATROSKA = 6;
/** File type for the MP3 format. */ /** File type for the MP3 format. */
public static final int MP3 = 7; public static final int MP3 = 7;
/** File type for the MP4 format. */ /** File type for the MP4 format. */
public static final int MP4 = 8; public static final int MP4 = 8;
/** File type for the Ogg format. */ /** File type for the Ogg format. */
public static final int OGG = 9; public static final int OGG = 9;
/** File type for the MPEG-PS format. */ /** File type for the MPEG-PS format. */
public static final int PS = 10; public static final int PS = 10;
/** File type for the MPEG-TS format. */ /** File type for the MPEG-TS format. */
public static final int TS = 11; public static final int TS = 11;
/** File type for the WAV format. */ /** File type for the WAV format. */
public static final int WAV = 12; public static final int WAV = 12;
/** File type for the WebVTT format. */ /** File type for the WebVTT format. */
public static final int WEBVTT = 13; public static final int WEBVTT = 13;
/** File type for the JPEG format. */ /** File type for the JPEG format. */
public static final int JPEG = 14; public static final int JPEG = 14;
/** File type for the MIDI format. */ /** File type for the MIDI format. */
public static final int MIDI = 15; public static final int MIDI = 15;
/** File type for the AVI format. */ /** File type for the AVI format. */
public static final int AVI = 16; public static final int AVI = 16;

View File

@ -686,14 +686,19 @@ public final class Format implements Bundleable {
/** An identifier for the format, or null if unknown or not applicable. */ /** An identifier for the format, or null if unknown or not applicable. */
@Nullable public final String id; @Nullable public final String id;
/** The human readable label, or null if unknown or not applicable. */ /** The human readable label, or null if unknown or not applicable. */
@Nullable public final String label; @Nullable public final String label;
/** The language as an IETF BCP 47 conformant tag, or null if unknown or not applicable. */ /** The language as an IETF BCP 47 conformant tag, or null if unknown or not applicable. */
@Nullable public final String language; @Nullable public final String language;
/** Track selection flags. */ /** Track selection flags. */
public final @C.SelectionFlags int selectionFlags; public final @C.SelectionFlags int selectionFlags;
/** Track role flags. */ /** Track role flags. */
public final @C.RoleFlags int roleFlags; public final @C.RoleFlags int roleFlags;
/** /**
* The average bitrate in bits per second, or {@link #NO_VALUE} if unknown or not applicable. The * The average bitrate in bits per second, or {@link #NO_VALUE} if unknown or not applicable. The
* way in which this field is populated depends on the type of media to which the format * way in which this field is populated depends on the type of media to which the format
@ -716,6 +721,7 @@ public final class Format implements Bundleable {
* </ul> * </ul>
*/ */
@UnstableApi public final int averageBitrate; @UnstableApi public final int averageBitrate;
/** /**
* The peak bitrate in bits per second, or {@link #NO_VALUE} if unknown or not applicable. The way * The peak bitrate in bits per second, or {@link #NO_VALUE} if unknown or not applicable. The way
* in which this field is populated depends on the type of media to which the format corresponds: * in which this field is populated depends on the type of media to which the format corresponds:
@ -735,14 +741,17 @@ public final class Format implements Bundleable {
* </ul> * </ul>
*/ */
@UnstableApi public final int peakBitrate; @UnstableApi public final int peakBitrate;
/** /**
* The bitrate in bits per second. This is the peak bitrate if known, or else the average bitrate * The bitrate in bits per second. This is the peak bitrate if known, or else the average bitrate
* if known, or else {@link Format#NO_VALUE}. Equivalent to: {@code peakBitrate != NO_VALUE ? * if known, or else {@link Format#NO_VALUE}. Equivalent to: {@code peakBitrate != NO_VALUE ?
* peakBitrate : averageBitrate}. * peakBitrate : averageBitrate}.
*/ */
@UnstableApi public final int bitrate; @UnstableApi public final int bitrate;
/** Codecs of the format as described in RFC 6381, or null if unknown or not applicable. */ /** Codecs of the format as described in RFC 6381, or null if unknown or not applicable. */
@Nullable public final String codecs; @Nullable public final String codecs;
/** Metadata, or null if unknown or not applicable. */ /** Metadata, or null if unknown or not applicable. */
@UnstableApi @Nullable public final Metadata metadata; @UnstableApi @Nullable public final Metadata metadata;
@ -755,16 +764,19 @@ public final class Format implements Bundleable {
/** The sample MIME type, or null if unknown or not applicable. */ /** The sample MIME type, or null if unknown or not applicable. */
@Nullable public final String sampleMimeType; @Nullable public final String sampleMimeType;
/** /**
* The maximum size of a buffer of data (typically one sample), or {@link #NO_VALUE} if unknown or * The maximum size of a buffer of data (typically one sample), or {@link #NO_VALUE} if unknown or
* not applicable. * not applicable.
*/ */
@UnstableApi public final int maxInputSize; @UnstableApi public final int maxInputSize;
/** /**
* Initialization data that must be provided to the decoder. Will not be null, but may be empty if * Initialization data that must be provided to the decoder. Will not be null, but may be empty if
* initialization data is not required. * initialization data is not required.
*/ */
@UnstableApi public final List<byte[]> initializationData; @UnstableApi public final List<byte[]> initializationData;
/** DRM initialization data if the stream is protected, or null otherwise. */ /** DRM initialization data if the stream is protected, or null otherwise. */
@UnstableApi @Nullable public final DrmInitData drmInitData; @UnstableApi @Nullable public final DrmInitData drmInitData;
@ -779,25 +791,32 @@ public final class Format implements Bundleable {
/** The width of the video in pixels, or {@link #NO_VALUE} if unknown or not applicable. */ /** The width of the video in pixels, or {@link #NO_VALUE} if unknown or not applicable. */
public final int width; public final int width;
/** The height of the video in pixels, or {@link #NO_VALUE} if unknown or not applicable. */ /** The height of the video in pixels, or {@link #NO_VALUE} if unknown or not applicable. */
public final int height; public final int height;
/** The frame rate in frames per second, or {@link #NO_VALUE} if unknown or not applicable. */ /** The frame rate in frames per second, or {@link #NO_VALUE} if unknown or not applicable. */
public final float frameRate; public final float frameRate;
/** /**
* The clockwise rotation that should be applied to the video for it to be rendered in the correct * The clockwise rotation that should be applied to the video for it to be rendered in the correct
* orientation, or 0 if unknown or not applicable. Only 0, 90, 180 and 270 are supported. * orientation, or 0 if unknown or not applicable. Only 0, 90, 180 and 270 are supported.
*/ */
@UnstableApi public final int rotationDegrees; @UnstableApi public final int rotationDegrees;
/** The width to height ratio of pixels in the video, or 1.0 if unknown or not applicable. */ /** The width to height ratio of pixels in the video, or 1.0 if unknown or not applicable. */
public final float pixelWidthHeightRatio; public final float pixelWidthHeightRatio;
/** The projection data for 360/VR video, or null if not applicable. */ /** The projection data for 360/VR video, or null if not applicable. */
@UnstableApi @Nullable public final byte[] projectionData; @UnstableApi @Nullable public final byte[] projectionData;
/** /**
* The stereo layout for 360/3D/VR video, or {@link #NO_VALUE} if not applicable. Valid stereo * The stereo layout for 360/3D/VR video, or {@link #NO_VALUE} if not applicable. Valid stereo
* 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 public final @C.StereoMode 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;
@ -805,15 +824,19 @@ public final class Format implements Bundleable {
/** The number of audio channels, or {@link #NO_VALUE} if unknown or not applicable. */ /** The number of audio channels, or {@link #NO_VALUE} if unknown or not applicable. */
public final int channelCount; public final int channelCount;
/** 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 public final @C.PcmEncoding 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.
*/ */
@UnstableApi public final int encoderDelay; @UnstableApi public final int encoderDelay;
/** /**
* The number of frames to trim from the end of the decoded audio stream, or 0 if not applicable. * The number of frames to trim from the end of the decoded audio stream, or 0 if not applicable.
*/ */
@ -830,6 +853,7 @@ public final class Format implements Bundleable {
* The number of horizontal tiles in an image, or {@link #NO_VALUE} if not known or applicable. * The number of horizontal tiles in an image, or {@link #NO_VALUE} if not known or applicable.
*/ */
@UnstableApi public final int tileCountHorizontal; @UnstableApi public final int tileCountHorizontal;
/** The number of vertical tiles in an image, or {@link #NO_VALUE} if not known or applicable. */ /** The number of vertical tiles in an image, or {@link #NO_VALUE} if not known or applicable. */
@UnstableApi public final int tileCountVertical; @UnstableApi public final int tileCountVertical;

View File

@ -97,10 +97,13 @@ public class FrameInfo {
/** The width of the frame, in pixels. */ /** The width of the frame, in pixels. */
public final int width; public final int width;
/** The height of the frame, in pixels. */ /** The height of the frame, in pixels. */
public final int height; public final int height;
/** The ratio of width over height for each pixel. */ /** The ratio of width over height for each pixel. */
public final float pixelWidthHeightRatio; public final float pixelWidthHeightRatio;
/** /**
* The offset that must be added to the frame presentation timestamp, in microseconds. * The offset that must be added to the frame presentation timestamp, in microseconds.
* *

View File

@ -26,8 +26,10 @@ public final class IllegalSeekPositionException extends IllegalStateException {
/** The {@link Timeline} in which the seek was attempted. */ /** The {@link Timeline} in which the seek was attempted. */
public final Timeline timeline; public final Timeline timeline;
/** The index of the window being seeked to. */ /** The index of the window being seeked to. */
public final int windowIndex; public final int windowIndex;
/** The seek position in the specified window. */ /** The seek position in the specified window. */
public final long positionMs; public final long positionMs;

View File

@ -818,6 +818,7 @@ public final class MediaItem implements Bundleable {
* @deprecated Use {@link #forcedSessionTrackTypes}. * @deprecated Use {@link #forcedSessionTrackTypes}.
*/ */
@UnstableApi @Deprecated public final ImmutableList<@C.TrackType Integer> sessionForClearTypes; @UnstableApi @Deprecated public final ImmutableList<@C.TrackType Integer> sessionForClearTypes;
/** /**
* The types of tracks for which to always use a DRM session even if the content is unencrypted. * The types of tracks for which to always use a DRM session even if the content is unencrypted.
*/ */
@ -1114,6 +1115,7 @@ public final class MediaItem implements Bundleable {
/** Optional subtitles to be sideloaded. */ /** Optional subtitles to be sideloaded. */
public final ImmutableList<SubtitleConfiguration> subtitleConfigurations; public final ImmutableList<SubtitleConfiguration> subtitleConfigurations;
/** /**
* @deprecated Use {@link #subtitleConfigurations} instead. * @deprecated Use {@link #subtitleConfigurations} instead.
*/ */
@ -1593,16 +1595,22 @@ public final class MediaItem implements Bundleable {
/** The {@link Uri} to the subtitle file. */ /** The {@link Uri} to the subtitle file. */
public final Uri uri; public final Uri uri;
/** The optional MIME type of the subtitle file, or {@code null} if unspecified. */ /** The optional MIME type of the subtitle file, or {@code null} if unspecified. */
@Nullable public final String mimeType; @Nullable public final String mimeType;
/** The language. */ /** The language. */
@Nullable public final String language; @Nullable public final String language;
/** The selection flags. */ /** The selection flags. */
public final @C.SelectionFlags int selectionFlags; public final @C.SelectionFlags int selectionFlags;
/** The role flags. */ /** The role flags. */
public final @C.RoleFlags int roleFlags; public final @C.RoleFlags int roleFlags;
/** The label. */ /** The label. */
@Nullable public final String label; @Nullable public final String label;
/** /**
* The ID of the subtitles. This will be propagated to the {@link Format#id} of the subtitle * The ID of the subtitles. This will be propagated to the {@link Format#id} of the subtitle
* track created from this configuration. * track created from this configuration.
@ -2165,6 +2173,7 @@ public final class MediaItem implements Bundleable {
* boundaries. * boundaries.
*/ */
@Nullable public final LocalConfiguration localConfiguration; @Nullable public final LocalConfiguration localConfiguration;
/** /**
* @deprecated Use {@link #localConfiguration} instead. * @deprecated Use {@link #localConfiguration} instead.
*/ */
@ -2178,6 +2187,7 @@ public final class MediaItem implements Bundleable {
/** The clipping properties. */ /** The clipping properties. */
public final ClippingConfiguration clippingConfiguration; public final ClippingConfiguration clippingConfiguration;
/** /**
* @deprecated Use {@link #clippingConfiguration} instead. * @deprecated Use {@link #clippingConfiguration} instead.
*/ */

View File

@ -643,108 +643,143 @@ public final class MediaMetadata implements Bundleable {
/** Media of undetermined type or a mix of multiple {@linkplain MediaType media types}. */ /** Media of undetermined type or a mix of multiple {@linkplain MediaType media types}. */
public static final int MEDIA_TYPE_MIXED = 0; public static final int MEDIA_TYPE_MIXED = 0;
/** {@link MediaType} for music. */ /** {@link MediaType} for music. */
public static final int MEDIA_TYPE_MUSIC = 1; public static final int MEDIA_TYPE_MUSIC = 1;
/** {@link MediaType} for an audio book chapter. */ /** {@link MediaType} for an audio book chapter. */
public static final int MEDIA_TYPE_AUDIO_BOOK_CHAPTER = 2; public static final int MEDIA_TYPE_AUDIO_BOOK_CHAPTER = 2;
/** {@link MediaType} for a podcast episode. */ /** {@link MediaType} for a podcast episode. */
public static final int MEDIA_TYPE_PODCAST_EPISODE = 3; public static final int MEDIA_TYPE_PODCAST_EPISODE = 3;
/** {@link MediaType} for a radio station. */ /** {@link MediaType} for a radio station. */
public static final int MEDIA_TYPE_RADIO_STATION = 4; public static final int MEDIA_TYPE_RADIO_STATION = 4;
/** {@link MediaType} for news. */ /** {@link MediaType} for news. */
public static final int MEDIA_TYPE_NEWS = 5; public static final int MEDIA_TYPE_NEWS = 5;
/** {@link MediaType} for a video. */ /** {@link MediaType} for a video. */
public static final int MEDIA_TYPE_VIDEO = 6; public static final int MEDIA_TYPE_VIDEO = 6;
/** {@link MediaType} for a movie trailer. */ /** {@link MediaType} for a movie trailer. */
public static final int MEDIA_TYPE_TRAILER = 7; public static final int MEDIA_TYPE_TRAILER = 7;
/** {@link MediaType} for a movie. */ /** {@link MediaType} for a movie. */
public static final int MEDIA_TYPE_MOVIE = 8; public static final int MEDIA_TYPE_MOVIE = 8;
/** {@link MediaType} for a TV show. */ /** {@link MediaType} for a TV show. */
public static final int MEDIA_TYPE_TV_SHOW = 9; public static final int MEDIA_TYPE_TV_SHOW = 9;
/** /**
* {@link MediaType} for a group of items (e.g., {@link #MEDIA_TYPE_MUSIC music}) belonging to an * {@link MediaType} for a group of items (e.g., {@link #MEDIA_TYPE_MUSIC music}) belonging to an
* album. * album.
*/ */
public static final int MEDIA_TYPE_ALBUM = 10; public static final int MEDIA_TYPE_ALBUM = 10;
/** /**
* {@link MediaType} for a group of items (e.g., {@link #MEDIA_TYPE_MUSIC music}) from the same * {@link MediaType} for a group of items (e.g., {@link #MEDIA_TYPE_MUSIC music}) from the same
* artist. * artist.
*/ */
public static final int MEDIA_TYPE_ARTIST = 11; public static final int MEDIA_TYPE_ARTIST = 11;
/** /**
* {@link MediaType} for a group of items (e.g., {@link #MEDIA_TYPE_MUSIC music}) of the same * {@link MediaType} for a group of items (e.g., {@link #MEDIA_TYPE_MUSIC music}) of the same
* genre. * genre.
*/ */
public static final int MEDIA_TYPE_GENRE = 12; public static final int MEDIA_TYPE_GENRE = 12;
/** /**
* {@link MediaType} for a group of items (e.g., {@link #MEDIA_TYPE_MUSIC music}) forming a * {@link MediaType} for a group of items (e.g., {@link #MEDIA_TYPE_MUSIC music}) forming a
* playlist. * playlist.
*/ */
public static final int MEDIA_TYPE_PLAYLIST = 13; public static final int MEDIA_TYPE_PLAYLIST = 13;
/** /**
* {@link MediaType} for a group of items (e.g., {@link #MEDIA_TYPE_MUSIC music}) from the same * {@link MediaType} for a group of items (e.g., {@link #MEDIA_TYPE_MUSIC music}) from the same
* year. * year.
*/ */
public static final int MEDIA_TYPE_YEAR = 14; public static final int MEDIA_TYPE_YEAR = 14;
/** /**
* {@link MediaType} for a group of items forming an audio book. Items in this group are typically * {@link MediaType} for a group of items forming an audio book. Items in this group are typically
* of type {@link #MEDIA_TYPE_AUDIO_BOOK_CHAPTER}. * of type {@link #MEDIA_TYPE_AUDIO_BOOK_CHAPTER}.
*/ */
public static final int MEDIA_TYPE_AUDIO_BOOK = 15; public static final int MEDIA_TYPE_AUDIO_BOOK = 15;
/** /**
* {@link MediaType} for a group of items belonging to a podcast. Items in this group are * {@link MediaType} for a group of items belonging to a podcast. Items in this group are
* typically of type {@link #MEDIA_TYPE_PODCAST_EPISODE}. * typically of type {@link #MEDIA_TYPE_PODCAST_EPISODE}.
*/ */
public static final int MEDIA_TYPE_PODCAST = 16; public static final int MEDIA_TYPE_PODCAST = 16;
/** /**
* {@link MediaType} for a group of items that are part of a TV channel. Items in this group are * {@link MediaType} for a group of items that are part of a TV channel. Items in this group are
* typically of type {@link #MEDIA_TYPE_TV_SHOW}, {@link #MEDIA_TYPE_TV_SERIES} or {@link * typically of type {@link #MEDIA_TYPE_TV_SHOW}, {@link #MEDIA_TYPE_TV_SERIES} or {@link
* #MEDIA_TYPE_MOVIE}. * #MEDIA_TYPE_MOVIE}.
*/ */
public static final int MEDIA_TYPE_TV_CHANNEL = 17; public static final int MEDIA_TYPE_TV_CHANNEL = 17;
/** /**
* {@link MediaType} for a group of items that are part of a TV series. Items in this group are * {@link MediaType} for a group of items that are part of a TV series. Items in this group are
* typically of type {@link #MEDIA_TYPE_TV_SHOW} or {@link #MEDIA_TYPE_TV_SEASON}. * typically of type {@link #MEDIA_TYPE_TV_SHOW} or {@link #MEDIA_TYPE_TV_SEASON}.
*/ */
public static final int MEDIA_TYPE_TV_SERIES = 18; public static final int MEDIA_TYPE_TV_SERIES = 18;
/** /**
* {@link MediaType} for a group of items that are part of a TV series. Items in this group are * {@link MediaType} for a group of items that are part of a TV series. Items in this group are
* typically of type {@link #MEDIA_TYPE_TV_SHOW}. * typically of type {@link #MEDIA_TYPE_TV_SHOW}.
*/ */
public static final int MEDIA_TYPE_TV_SEASON = 19; public static final int MEDIA_TYPE_TV_SEASON = 19;
/** {@link MediaType} for a folder with mixed or undetermined content. */ /** {@link MediaType} for a folder with mixed or undetermined content. */
public static final int MEDIA_TYPE_FOLDER_MIXED = 20; public static final int MEDIA_TYPE_FOLDER_MIXED = 20;
/** {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_ALBUM albums}. */ /** {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_ALBUM albums}. */
public static final int MEDIA_TYPE_FOLDER_ALBUMS = 21; public static final int MEDIA_TYPE_FOLDER_ALBUMS = 21;
/** {@link MediaType} for a folder containing {@linkplain #FIELD_ARTIST artists}. */ /** {@link MediaType} for a folder containing {@linkplain #FIELD_ARTIST artists}. */
public static final int MEDIA_TYPE_FOLDER_ARTISTS = 22; public static final int MEDIA_TYPE_FOLDER_ARTISTS = 22;
/** {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_GENRE genres}. */ /** {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_GENRE genres}. */
public static final int MEDIA_TYPE_FOLDER_GENRES = 23; public static final int MEDIA_TYPE_FOLDER_GENRES = 23;
/** {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_PLAYLIST playlists}. */ /** {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_PLAYLIST playlists}. */
public static final int MEDIA_TYPE_FOLDER_PLAYLISTS = 24; public static final int MEDIA_TYPE_FOLDER_PLAYLISTS = 24;
/** {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_YEAR years}. */ /** {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_YEAR years}. */
public static final int MEDIA_TYPE_FOLDER_YEARS = 25; public static final int MEDIA_TYPE_FOLDER_YEARS = 25;
/** {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_AUDIO_BOOK audio books}. */ /** {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_AUDIO_BOOK audio books}. */
public static final int MEDIA_TYPE_FOLDER_AUDIO_BOOKS = 26; public static final int MEDIA_TYPE_FOLDER_AUDIO_BOOKS = 26;
/** {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_PODCAST podcasts}. */ /** {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_PODCAST podcasts}. */
public static final int MEDIA_TYPE_FOLDER_PODCASTS = 27; public static final int MEDIA_TYPE_FOLDER_PODCASTS = 27;
/** {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_TV_CHANNEL TV channels}. */ /** {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_TV_CHANNEL TV channels}. */
public static final int MEDIA_TYPE_FOLDER_TV_CHANNELS = 28; public static final int MEDIA_TYPE_FOLDER_TV_CHANNELS = 28;
/** {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_TV_SERIES TV series}. */ /** {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_TV_SERIES TV series}. */
public static final int MEDIA_TYPE_FOLDER_TV_SERIES = 29; public static final int MEDIA_TYPE_FOLDER_TV_SERIES = 29;
/** {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_TV_SHOW TV shows}. */ /** {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_TV_SHOW TV shows}. */
public static final int MEDIA_TYPE_FOLDER_TV_SHOWS = 30; public static final int MEDIA_TYPE_FOLDER_TV_SHOWS = 30;
/** /**
* {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_RADIO_STATION radio * {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_RADIO_STATION radio
* stations}. * stations}.
*/ */
public static final int MEDIA_TYPE_FOLDER_RADIO_STATIONS = 31; public static final int MEDIA_TYPE_FOLDER_RADIO_STATIONS = 31;
/** {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_NEWS news}. */ /** {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_NEWS news}. */
public static final int MEDIA_TYPE_FOLDER_NEWS = 32; public static final int MEDIA_TYPE_FOLDER_NEWS = 32;
/** {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_VIDEO videos}. */ /** {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_VIDEO videos}. */
public static final int MEDIA_TYPE_FOLDER_VIDEOS = 33; public static final int MEDIA_TYPE_FOLDER_VIDEOS = 33;
/** {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_TRAILER movie trailers}. */ /** {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_TRAILER movie trailers}. */
public static final int MEDIA_TYPE_FOLDER_TRAILERS = 34; public static final int MEDIA_TYPE_FOLDER_TRAILERS = 34;
/** {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_MOVIE movies}. */ /** {@link MediaType} for a folder containing {@linkplain #MEDIA_TYPE_MOVIE movies}. */
public static final int MEDIA_TYPE_FOLDER_MOVIES = 35; public static final int MEDIA_TYPE_FOLDER_MOVIES = 35;
@ -787,6 +822,7 @@ public final class MediaMetadata implements Bundleable {
* @deprecated Use {@link #isBrowsable} set to false instead. * @deprecated Use {@link #isBrowsable} set to false instead.
*/ */
@Deprecated public static final int FOLDER_TYPE_NONE = -1; @Deprecated public static final int FOLDER_TYPE_NONE = -1;
/** /**
* Type for a folder containing media of mixed types. * Type for a folder containing media of mixed types.
* *
@ -794,12 +830,14 @@ public final class MediaMetadata implements Bundleable {
* #MEDIA_TYPE_FOLDER_MIXED} instead. * #MEDIA_TYPE_FOLDER_MIXED} instead.
*/ */
@Deprecated public static final int FOLDER_TYPE_MIXED = 0; @Deprecated public static final int FOLDER_TYPE_MIXED = 0;
/** /**
* Type for a folder containing only playable media. * Type for a folder containing only playable media.
* *
* @deprecated Use {@link #isBrowsable} set to true instead. * @deprecated Use {@link #isBrowsable} set to true instead.
*/ */
@Deprecated public static final int FOLDER_TYPE_TITLES = 1; @Deprecated public static final int FOLDER_TYPE_TITLES = 1;
/** /**
* Type for a folder containing media categorized by album. * Type for a folder containing media categorized by album.
* *
@ -807,6 +845,7 @@ public final class MediaMetadata implements Bundleable {
* #MEDIA_TYPE_FOLDER_ALBUMS} instead. * #MEDIA_TYPE_FOLDER_ALBUMS} instead.
*/ */
@Deprecated public static final int FOLDER_TYPE_ALBUMS = 2; @Deprecated public static final int FOLDER_TYPE_ALBUMS = 2;
/** /**
* Type for a folder containing media categorized by artist. * Type for a folder containing media categorized by artist.
* *
@ -814,6 +853,7 @@ public final class MediaMetadata implements Bundleable {
* #MEDIA_TYPE_FOLDER_ARTISTS} instead. * #MEDIA_TYPE_FOLDER_ARTISTS} instead.
*/ */
@Deprecated public static final int FOLDER_TYPE_ARTISTS = 3; @Deprecated public static final int FOLDER_TYPE_ARTISTS = 3;
/** /**
* Type for a folder containing media categorized by genre. * Type for a folder containing media categorized by genre.
* *
@ -821,6 +861,7 @@ public final class MediaMetadata implements Bundleable {
* #MEDIA_TYPE_FOLDER_GENRES} instead. * #MEDIA_TYPE_FOLDER_GENRES} instead.
*/ */
@Deprecated public static final int FOLDER_TYPE_GENRES = 4; @Deprecated public static final int FOLDER_TYPE_GENRES = 4;
/** /**
* Type for a folder containing a playlist. * Type for a folder containing a playlist.
* *
@ -828,6 +869,7 @@ public final class MediaMetadata implements Bundleable {
* #MEDIA_TYPE_FOLDER_PLAYLISTS} instead. * #MEDIA_TYPE_FOLDER_PLAYLISTS} instead.
*/ */
@Deprecated public static final int FOLDER_TYPE_PLAYLISTS = 5; @Deprecated public static final int FOLDER_TYPE_PLAYLISTS = 5;
/** /**
* Type for a folder containing media categorized by year. * Type for a folder containing media categorized by year.
* *
@ -910,36 +952,50 @@ public final class MediaMetadata implements Bundleable {
/** Optional title. */ /** Optional title. */
@Nullable public final CharSequence title; @Nullable public final CharSequence title;
/** Optional artist. */ /** Optional artist. */
@Nullable public final CharSequence artist; @Nullable public final CharSequence artist;
/** Optional album title. */ /** Optional album title. */
@Nullable public final CharSequence albumTitle; @Nullable public final CharSequence albumTitle;
/** Optional album artist. */ /** Optional album artist. */
@Nullable public final CharSequence albumArtist; @Nullable public final CharSequence albumArtist;
/** Optional display title. */ /** Optional display title. */
@Nullable public final CharSequence displayTitle; @Nullable public final CharSequence displayTitle;
/** /**
* Optional subtitle. * Optional subtitle.
* *
* <p>This is the secondary title of the media, unrelated to closed captions. * <p>This is the secondary title of the media, unrelated to closed captions.
*/ */
@Nullable public final CharSequence subtitle; @Nullable public final CharSequence subtitle;
/** Optional description. */ /** Optional description. */
@Nullable public final CharSequence description; @Nullable public final CharSequence description;
/** Optional user {@link Rating}. */ /** Optional user {@link Rating}. */
@Nullable public final Rating userRating; @Nullable public final Rating userRating;
/** Optional overall {@link Rating}. */ /** Optional overall {@link Rating}. */
@Nullable public final Rating overallRating; @Nullable public final Rating overallRating;
/** Optional artwork data as a compressed byte array. */ /** Optional artwork data as a compressed byte array. */
@Nullable public final byte[] artworkData; @Nullable public final byte[] artworkData;
/** Optional {@link PictureType} of the artwork data. */ /** Optional {@link PictureType} of the artwork data. */
@Nullable public final @PictureType Integer artworkDataType; @Nullable public final @PictureType Integer artworkDataType;
/** Optional artwork {@link Uri}. */ /** Optional artwork {@link Uri}. */
@Nullable public final Uri artworkUri; @Nullable public final Uri artworkUri;
/** Optional track number. */ /** Optional track number. */
@Nullable public final Integer trackNumber; @Nullable public final Integer trackNumber;
/** Optional total number of tracks. */ /** Optional total number of tracks. */
@Nullable public final Integer totalTrackCount; @Nullable public final Integer totalTrackCount;
/** /**
* Optional {@link FolderType}. * Optional {@link FolderType}.
* *
@ -950,22 +1006,28 @@ public final class MediaMetadata implements Bundleable {
@Deprecated @Deprecated
@Nullable @Nullable
public final @FolderType Integer folderType; public final @FolderType Integer folderType;
/** Optional boolean to indicate that the media is a browsable folder. */ /** Optional boolean to indicate that the media is a browsable folder. */
@Nullable public final Boolean isBrowsable; @Nullable public final Boolean isBrowsable;
/** Optional boolean to indicate that the media is playable. */ /** Optional boolean to indicate that the media is playable. */
@Nullable public final Boolean isPlayable; @Nullable public final Boolean isPlayable;
/** /**
* @deprecated Use {@link #recordingYear} instead. * @deprecated Use {@link #recordingYear} instead.
*/ */
@UnstableApi @Deprecated @Nullable public final Integer year; @UnstableApi @Deprecated @Nullable public final Integer year;
/** Optional year of the recording date. */ /** Optional year of the recording date. */
@Nullable public final Integer recordingYear; @Nullable public final Integer recordingYear;
/** /**
* Optional month of the recording date. * Optional month of the recording date.
* *
* <p>Note that there is no guarantee that the month and day are a valid combination. * <p>Note that there is no guarantee that the month and day are a valid combination.
*/ */
@Nullable public final Integer recordingMonth; @Nullable public final Integer recordingMonth;
/** /**
* Optional day of the recording date. * Optional day of the recording date.
* *
@ -975,34 +1037,45 @@ public final class MediaMetadata implements Bundleable {
/** Optional year of the release date. */ /** Optional year of the release date. */
@Nullable public final Integer releaseYear; @Nullable public final Integer releaseYear;
/** /**
* Optional month of the release date. * Optional month of the release date.
* *
* <p>Note that there is no guarantee that the month and day are a valid combination. * <p>Note that there is no guarantee that the month and day are a valid combination.
*/ */
@Nullable public final Integer releaseMonth; @Nullable public final Integer releaseMonth;
/** /**
* Optional day of the release date. * Optional day of the release date.
* *
* <p>Note that there is no guarantee that the month and day are a valid combination. * <p>Note that there is no guarantee that the month and day are a valid combination.
*/ */
@Nullable public final Integer releaseDay; @Nullable public final Integer releaseDay;
/** Optional writer. */ /** Optional writer. */
@Nullable public final CharSequence writer; @Nullable public final CharSequence writer;
/** Optional composer. */ /** Optional composer. */
@Nullable public final CharSequence composer; @Nullable public final CharSequence composer;
/** Optional conductor. */ /** Optional conductor. */
@Nullable public final CharSequence conductor; @Nullable public final CharSequence conductor;
/** Optional disc number. */ /** Optional disc number. */
@Nullable public final Integer discNumber; @Nullable public final Integer discNumber;
/** Optional total number of discs. */ /** Optional total number of discs. */
@Nullable public final Integer totalDiscCount; @Nullable public final Integer totalDiscCount;
/** Optional genre. */ /** Optional genre. */
@Nullable public final CharSequence genre; @Nullable public final CharSequence genre;
/** Optional compilation. */ /** Optional compilation. */
@Nullable public final CharSequence compilation; @Nullable public final CharSequence compilation;
/** Optional name of the station streaming the media. */ /** Optional name of the station streaming the media. */
@Nullable public final CharSequence station; @Nullable public final CharSequence station;
/** Optional {@link MediaType}. */ /** Optional {@link MediaType}. */
@Nullable public final @MediaType Integer mediaType; @Nullable public final @MediaType Integer mediaType;

View File

@ -59,6 +59,7 @@ public final class Metadata implements Parcelable {
} }
private final Entry[] entries; private final Entry[] entries;
/** /**
* The presentation time of the metadata, in microseconds. * The presentation time of the metadata, in microseconds.
* *

View File

@ -131,6 +131,7 @@ public final class MimeTypes {
public static final String APPLICATION_TX3G = BASE_TYPE_APPLICATION + "/x-quicktime-tx3g"; public static final String APPLICATION_TX3G = BASE_TYPE_APPLICATION + "/x-quicktime-tx3g";
public static final String APPLICATION_MP4VTT = BASE_TYPE_APPLICATION + "/x-mp4-vtt"; public static final String APPLICATION_MP4VTT = BASE_TYPE_APPLICATION + "/x-mp4-vtt";
public static final String APPLICATION_MP4CEA608 = BASE_TYPE_APPLICATION + "/x-mp4-cea-608"; public static final String APPLICATION_MP4CEA608 = BASE_TYPE_APPLICATION + "/x-mp4-cea-608";
/** /**
* @deprecated RawCC is a Google-internal subtitle format that isn't supported by this version of * @deprecated RawCC is a Google-internal subtitle format that isn't supported by this version of
* Media3. There is no replacement for this value. * Media3. There is no replacement for this value.
@ -738,6 +739,7 @@ public final class MimeTypes {
/* package */ static final class Mp4aObjectType { /* package */ static final class Mp4aObjectType {
/** The Object Type Indication of the MP4A codec. */ /** The Object Type Indication of the MP4A codec. */
public final int objectTypeIndication; public final int objectTypeIndication;
/** The Audio Object Type Indication of the MP4A codec, or 0 if it is absent. */ /** The Audio Object Type Indication of the MP4A codec, or 0 if it is absent. */
public final int audioObjectTypeIndication; public final int audioObjectTypeIndication;

View File

@ -95,6 +95,7 @@ public class ParserException extends IOException {
* false when a parser encounters a legal condition which it does not support. * false when a parser encounters a legal condition which it does not support.
*/ */
public final boolean contentIsMalformed; public final boolean contentIsMalformed;
/** The {@link DataType data type} of the parsed bitstream. */ /** The {@link DataType data type} of the parsed bitstream. */
public final int dataType; public final int dataType;

View File

@ -95,15 +95,19 @@ public class PlaybackException extends Exception implements Bundleable {
/** Caused by an error whose cause could not be identified. */ /** Caused by an error whose cause could not be identified. */
public static final int ERROR_CODE_UNSPECIFIED = 1000; public static final int ERROR_CODE_UNSPECIFIED = 1000;
/** /**
* Caused by an unidentified error in a remote Player, which is a Player that runs on a different * Caused by an unidentified error in a remote Player, which is a Player that runs on a different
* host or process. * host or process.
*/ */
public static final int ERROR_CODE_REMOTE_ERROR = 1001; public static final int ERROR_CODE_REMOTE_ERROR = 1001;
/** Caused by the loading position falling behind the sliding window of available live content. */ /** Caused by the loading position falling behind the sliding window of available live content. */
public static final int ERROR_CODE_BEHIND_LIVE_WINDOW = 1002; public static final int ERROR_CODE_BEHIND_LIVE_WINDOW = 1002;
/** Caused by a generic timeout. */ /** Caused by a generic timeout. */
public static final int ERROR_CODE_TIMEOUT = 1003; public static final int ERROR_CODE_TIMEOUT = 1003;
/** /**
* Caused by a failed runtime check. * Caused by a failed runtime check.
* *
@ -116,6 +120,7 @@ public class PlaybackException extends Exception implements Bundleable {
/** Caused by an Input/Output error which could not be identified. */ /** Caused by an Input/Output error which could not be identified. */
public static final int ERROR_CODE_IO_UNSPECIFIED = 2000; public static final int ERROR_CODE_IO_UNSPECIFIED = 2000;
/** /**
* Caused by a network connection failure. * Caused by a network connection failure.
* *
@ -130,8 +135,10 @@ public class PlaybackException extends Exception implements Bundleable {
* </ul> * </ul>
*/ */
public static final int ERROR_CODE_IO_NETWORK_CONNECTION_FAILED = 2001; public static final int ERROR_CODE_IO_NETWORK_CONNECTION_FAILED = 2001;
/** Caused by a network timeout, meaning the server is taking too long to fulfill a request. */ /** Caused by a network timeout, meaning the server is taking too long to fulfill a request. */
public static final int ERROR_CODE_IO_NETWORK_CONNECTION_TIMEOUT = 2002; public static final int ERROR_CODE_IO_NETWORK_CONNECTION_TIMEOUT = 2002;
/** /**
* Caused by a server returning a resource with an invalid "Content-Type" HTTP header value. * Caused by a server returning a resource with an invalid "Content-Type" HTTP header value.
* *
@ -139,15 +146,19 @@ public class PlaybackException extends Exception implements Bundleable {
* returns a paywall HTML page, with content type "text/html". * returns a paywall HTML page, with content type "text/html".
*/ */
public static final int ERROR_CODE_IO_INVALID_HTTP_CONTENT_TYPE = 2003; public static final int ERROR_CODE_IO_INVALID_HTTP_CONTENT_TYPE = 2003;
/** Caused by an HTTP server returning an unexpected HTTP response status code. */ /** Caused by an HTTP server returning an unexpected HTTP response status code. */
public static final int ERROR_CODE_IO_BAD_HTTP_STATUS = 2004; public static final int ERROR_CODE_IO_BAD_HTTP_STATUS = 2004;
/** Caused by a non-existent file. */ /** Caused by a non-existent file. */
public static final int ERROR_CODE_IO_FILE_NOT_FOUND = 2005; public static final int ERROR_CODE_IO_FILE_NOT_FOUND = 2005;
/** /**
* Caused by lack of permission to perform an IO operation. For example, lack of permission to * Caused by lack of permission to perform an IO operation. For example, lack of permission to
* access internet or external storage. * access internet or external storage.
*/ */
public static final int ERROR_CODE_IO_NO_PERMISSION = 2006; public static final int ERROR_CODE_IO_NO_PERMISSION = 2006;
/** /**
* Caused by the player trying to access cleartext HTTP traffic (meaning http:// rather than * Caused by the player trying to access cleartext HTTP traffic (meaning http:// rather than
* https://) when the app's Network Security Configuration does not permit it. * https://) when the app's Network Security Configuration does not permit it.
@ -157,6 +168,7 @@ public class PlaybackException extends Exception implements Bundleable {
* corresponding troubleshooting topic</a>. * corresponding troubleshooting topic</a>.
*/ */
public static final int ERROR_CODE_IO_CLEARTEXT_NOT_PERMITTED = 2007; public static final int ERROR_CODE_IO_CLEARTEXT_NOT_PERMITTED = 2007;
/** Caused by reading data out of the data bound. */ /** Caused by reading data out of the data bound. */
public static final int ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE = 2008; public static final int ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE = 2008;
@ -164,16 +176,19 @@ public class PlaybackException extends Exception implements Bundleable {
/** Caused by a parsing error associated with a media container format bitstream. */ /** Caused by a parsing error associated with a media container format bitstream. */
public static final int ERROR_CODE_PARSING_CONTAINER_MALFORMED = 3001; public static final int ERROR_CODE_PARSING_CONTAINER_MALFORMED = 3001;
/** /**
* Caused by a parsing error associated with a media manifest. Examples of a media manifest are a * Caused by a parsing error associated with a media manifest. Examples of a media manifest are a
* DASH or a SmoothStreaming manifest, or an HLS playlist. * DASH or a SmoothStreaming manifest, or an HLS playlist.
*/ */
public static final int ERROR_CODE_PARSING_MANIFEST_MALFORMED = 3002; public static final int ERROR_CODE_PARSING_MANIFEST_MALFORMED = 3002;
/** /**
* Caused by attempting to extract a file with an unsupported media container format, or an * Caused by attempting to extract a file with an unsupported media container format, or an
* unsupported media container feature. * unsupported media container feature.
*/ */
public static final int ERROR_CODE_PARSING_CONTAINER_UNSUPPORTED = 3003; public static final int ERROR_CODE_PARSING_CONTAINER_UNSUPPORTED = 3003;
/** /**
* Caused by an unsupported feature in a media manifest. Examples of a media manifest are a DASH * Caused by an unsupported feature in a media manifest. Examples of a media manifest are a DASH
* or a SmoothStreaming manifest, or an HLS playlist. * or a SmoothStreaming manifest, or an HLS playlist.
@ -184,12 +199,16 @@ public class PlaybackException extends Exception implements Bundleable {
/** Caused by a decoder initialization failure. */ /** Caused by a decoder initialization failure. */
public static final int ERROR_CODE_DECODER_INIT_FAILED = 4001; public static final int ERROR_CODE_DECODER_INIT_FAILED = 4001;
/** Caused by a decoder query failure. */ /** Caused by a decoder query failure. */
public static final int ERROR_CODE_DECODER_QUERY_FAILED = 4002; public static final int ERROR_CODE_DECODER_QUERY_FAILED = 4002;
/** Caused by a failure while trying to decode media samples. */ /** Caused by a failure while trying to decode media samples. */
public static final int ERROR_CODE_DECODING_FAILED = 4003; public static final int ERROR_CODE_DECODING_FAILED = 4003;
/** Caused by trying to decode content whose format exceeds the capabilities of the device. */ /** Caused by trying to decode content whose format exceeds the capabilities of the device. */
public static final int ERROR_CODE_DECODING_FORMAT_EXCEEDS_CAPABILITIES = 4004; public static final int ERROR_CODE_DECODING_FORMAT_EXCEEDS_CAPABILITIES = 4004;
/** Caused by trying to decode content whose format is not supported. */ /** Caused by trying to decode content whose format is not supported. */
public static final int ERROR_CODE_DECODING_FORMAT_UNSUPPORTED = 4005; public static final int ERROR_CODE_DECODING_FORMAT_UNSUPPORTED = 4005;
@ -197,6 +216,7 @@ public class PlaybackException extends Exception implements Bundleable {
/** Caused by an AudioTrack initialization failure. */ /** Caused by an AudioTrack initialization failure. */
public static final int ERROR_CODE_AUDIO_TRACK_INIT_FAILED = 5001; public static final int ERROR_CODE_AUDIO_TRACK_INIT_FAILED = 5001;
/** Caused by an AudioTrack write operation failure. */ /** Caused by an AudioTrack write operation failure. */
public static final int ERROR_CODE_AUDIO_TRACK_WRITE_FAILED = 5002; public static final int ERROR_CODE_AUDIO_TRACK_WRITE_FAILED = 5002;
@ -204,13 +224,16 @@ public class PlaybackException extends Exception implements Bundleable {
/** Caused by an unspecified error related to DRM protection. */ /** Caused by an unspecified error related to DRM protection. */
public static final int ERROR_CODE_DRM_UNSPECIFIED = 6000; public static final int ERROR_CODE_DRM_UNSPECIFIED = 6000;
/** /**
* Caused by a chosen DRM protection scheme not being supported by the device. Examples of DRM * Caused by a chosen DRM protection scheme not being supported by the device. Examples of DRM
* protection schemes are ClearKey and Widevine. * protection schemes are ClearKey and Widevine.
*/ */
public static final int ERROR_CODE_DRM_SCHEME_UNSUPPORTED = 6001; public static final int ERROR_CODE_DRM_SCHEME_UNSUPPORTED = 6001;
/** Caused by a failure while provisioning the device. */ /** Caused by a failure while provisioning the device. */
public static final int ERROR_CODE_DRM_PROVISIONING_FAILED = 6002; public static final int ERROR_CODE_DRM_PROVISIONING_FAILED = 6002;
/** /**
* Caused by attempting to play incompatible DRM-protected content. * Caused by attempting to play incompatible DRM-protected content.
* *
@ -218,14 +241,19 @@ public class PlaybackException extends Exception implements Bundleable {
* (like Widevine) for which there is no corresponding license acquisition data (like a pssh box). * (like Widevine) for which there is no corresponding license acquisition data (like a pssh box).
*/ */
public static final int ERROR_CODE_DRM_CONTENT_ERROR = 6003; public static final int ERROR_CODE_DRM_CONTENT_ERROR = 6003;
/** Caused by a failure while trying to obtain a license. */ /** Caused by a failure while trying to obtain a license. */
public static final int ERROR_CODE_DRM_LICENSE_ACQUISITION_FAILED = 6004; public static final int ERROR_CODE_DRM_LICENSE_ACQUISITION_FAILED = 6004;
/** Caused by an operation being disallowed by a license policy. */ /** Caused by an operation being disallowed by a license policy. */
public static final int ERROR_CODE_DRM_DISALLOWED_OPERATION = 6005; public static final int ERROR_CODE_DRM_DISALLOWED_OPERATION = 6005;
/** Caused by an error in the DRM system. */ /** Caused by an error in the DRM system. */
public static final int ERROR_CODE_DRM_SYSTEM_ERROR = 6006; public static final int ERROR_CODE_DRM_SYSTEM_ERROR = 6006;
/** Caused by the device having revoked DRM privileges. */ /** Caused by the device having revoked DRM privileges. */
public static final int ERROR_CODE_DRM_DEVICE_REVOKED = 6007; public static final int ERROR_CODE_DRM_DEVICE_REVOKED = 6007;
/** Caused by an expired DRM license being loaded into an open DRM session. */ /** Caused by an expired DRM license being loaded into an open DRM session. */
public static final int ERROR_CODE_DRM_LICENSE_EXPIRED = 6008; public static final int ERROR_CODE_DRM_LICENSE_EXPIRED = 6008;
@ -233,6 +261,7 @@ public class PlaybackException extends Exception implements Bundleable {
/** Caused by a failure when initializing a {@link VideoFrameProcessor}. */ /** Caused by a failure when initializing a {@link VideoFrameProcessor}. */
@UnstableApi public static final int ERROR_CODE_VIDEO_FRAME_PROCESSOR_INIT_FAILED = 7000; @UnstableApi public static final int ERROR_CODE_VIDEO_FRAME_PROCESSOR_INIT_FAILED = 7000;
/** Caused by a failure when processing a video frame. */ /** Caused by a failure when processing a video frame. */
@UnstableApi public static final int ERROR_CODE_VIDEO_FRAME_PROCESSING_FAILED = 7001; @UnstableApi public static final int ERROR_CODE_VIDEO_FRAME_PROCESSING_FAILED = 7001;

View File

@ -247,22 +247,29 @@ public interface Player {
* The UID of the window, or {@code null} if the timeline is {@link Timeline#isEmpty() empty}. * The UID of the window, or {@code null} if the timeline is {@link Timeline#isEmpty() empty}.
*/ */
@Nullable public final Object windowUid; @Nullable public final Object windowUid;
/** /**
* @deprecated Use {@link #mediaItemIndex} instead. * @deprecated Use {@link #mediaItemIndex} instead.
*/ */
@UnstableApi @Deprecated public final int windowIndex; @UnstableApi @Deprecated public final int windowIndex;
/** The media item index. */ /** The media item index. */
public final int mediaItemIndex; public final int mediaItemIndex;
/** The media item, or {@code null} if the timeline is {@link Timeline#isEmpty() empty}. */ /** The media item, or {@code null} if the timeline is {@link Timeline#isEmpty() empty}. */
@UnstableApi @Nullable public final MediaItem mediaItem; @UnstableApi @Nullable public final MediaItem mediaItem;
/** /**
* The UID of the period, or {@code null} if the timeline is {@link Timeline#isEmpty() empty}. * The UID of the period, or {@code null} if the timeline is {@link Timeline#isEmpty() empty}.
*/ */
@Nullable public final Object periodUid; @Nullable public final Object periodUid;
/** The period index. */ /** The period index. */
public final int periodIndex; public final int periodIndex;
/** The playback position, in milliseconds. */ /** The playback position, in milliseconds. */
public final long positionMs; public final long positionMs;
/** /**
* The content position, in milliseconds. * The content position, in milliseconds.
* *
@ -270,10 +277,12 @@ public interface Player {
* #positionMs}. * #positionMs}.
*/ */
public final long contentPositionMs; public final long contentPositionMs;
/** /**
* The ad group index if the playback position is within an ad, {@link C#INDEX_UNSET} otherwise. * The ad group index if the playback position is within an ad, {@link C#INDEX_UNSET} otherwise.
*/ */
public final int adGroupIndex; public final int adGroupIndex;
/** /**
* The index of the ad within the ad group if the playback position is within an ad, {@link * The index of the ad within the ad group if the playback position is within an ad, {@link
* C#INDEX_UNSET} otherwise. * C#INDEX_UNSET} otherwise.
@ -1160,22 +1169,26 @@ public interface Player {
@Target({FIELD, METHOD, PARAMETER, LOCAL_VARIABLE, TYPE_USE}) @Target({FIELD, METHOD, PARAMETER, LOCAL_VARIABLE, TYPE_USE})
@IntDef({STATE_IDLE, STATE_BUFFERING, STATE_READY, STATE_ENDED}) @IntDef({STATE_IDLE, STATE_BUFFERING, STATE_READY, STATE_ENDED})
@interface State {} @interface State {}
/** /**
* The player is idle, meaning it holds only limited resources. The player must be {@link * The player is idle, meaning it holds only limited resources. The player must be {@link
* #prepare() prepared} before it will play the media. * #prepare() prepared} before it will play the media.
*/ */
int STATE_IDLE = 1; int STATE_IDLE = 1;
/** /**
* The player is not able to immediately play the media, but is doing work toward being able to do * The player is not able to immediately play the media, but is doing work toward being able to do
* so. This state typically occurs when the player needs to buffer more data before playback can * so. This state typically occurs when the player needs to buffer more data before playback can
* start. * start.
*/ */
int STATE_BUFFERING = 2; int STATE_BUFFERING = 2;
/** /**
* The player is able to immediately play from its current position. The player will be playing if * The player is able to immediately play from its current position. The player will be playing if
* {@link #getPlayWhenReady()} is true, and paused otherwise. * {@link #getPlayWhenReady()} is true, and paused otherwise.
*/ */
int STATE_READY = 3; int STATE_READY = 3;
/** The player has finished playing the media. */ /** The player has finished playing the media. */
int STATE_ENDED = 4; int STATE_ENDED = 4;
@ -1202,16 +1215,22 @@ public interface Player {
PLAY_WHEN_READY_CHANGE_REASON_SUPPRESSED_TOO_LONG PLAY_WHEN_READY_CHANGE_REASON_SUPPRESSED_TOO_LONG
}) })
@interface PlayWhenReadyChangeReason {} @interface PlayWhenReadyChangeReason {}
/** Playback has been started or paused by a call to {@link #setPlayWhenReady(boolean)}. */ /** Playback has been started or paused by a call to {@link #setPlayWhenReady(boolean)}. */
int PLAY_WHEN_READY_CHANGE_REASON_USER_REQUEST = 1; int PLAY_WHEN_READY_CHANGE_REASON_USER_REQUEST = 1;
/** Playback has been paused because of a loss of audio focus. */ /** Playback has been paused because of a loss of audio focus. */
int PLAY_WHEN_READY_CHANGE_REASON_AUDIO_FOCUS_LOSS = 2; int PLAY_WHEN_READY_CHANGE_REASON_AUDIO_FOCUS_LOSS = 2;
/** Playback has been paused to avoid becoming noisy. */ /** Playback has been paused to avoid becoming noisy. */
int PLAY_WHEN_READY_CHANGE_REASON_AUDIO_BECOMING_NOISY = 3; int PLAY_WHEN_READY_CHANGE_REASON_AUDIO_BECOMING_NOISY = 3;
/** Playback has been started or paused because of a remote change. */ /** Playback has been started or paused because of a remote change. */
int PLAY_WHEN_READY_CHANGE_REASON_REMOTE = 4; int PLAY_WHEN_READY_CHANGE_REASON_REMOTE = 4;
/** Playback has been paused at the end of a media item. */ /** Playback has been paused at the end of a media item. */
int PLAY_WHEN_READY_CHANGE_REASON_END_OF_MEDIA_ITEM = 5; int PLAY_WHEN_READY_CHANGE_REASON_END_OF_MEDIA_ITEM = 5;
/** /**
* Playback has been paused because playback has been {@linkplain #getPlaybackSuppressionReason() * Playback has been paused because playback has been {@linkplain #getPlaybackSuppressionReason()
* suppressed} too long. * suppressed} too long.
@ -1237,14 +1256,18 @@ public interface Player {
PLAYBACK_SUPPRESSION_REASON_UNSUITABLE_AUDIO_OUTPUT PLAYBACK_SUPPRESSION_REASON_UNSUITABLE_AUDIO_OUTPUT
}) })
@interface PlaybackSuppressionReason {} @interface PlaybackSuppressionReason {}
/** Playback is not suppressed. */ /** Playback is not suppressed. */
int PLAYBACK_SUPPRESSION_REASON_NONE = 0; int PLAYBACK_SUPPRESSION_REASON_NONE = 0;
/** Playback is suppressed due to transient audio focus loss. */ /** Playback is suppressed due to transient audio focus loss. */
int PLAYBACK_SUPPRESSION_REASON_TRANSIENT_AUDIO_FOCUS_LOSS = 1; int PLAYBACK_SUPPRESSION_REASON_TRANSIENT_AUDIO_FOCUS_LOSS = 1;
/** /**
* @deprecated Use {@link #PLAYBACK_SUPPRESSION_REASON_UNSUITABLE_AUDIO_OUTPUT} instead. * @deprecated Use {@link #PLAYBACK_SUPPRESSION_REASON_UNSUITABLE_AUDIO_OUTPUT} instead.
*/ */
@Deprecated int PLAYBACK_SUPPRESSION_REASON_UNSUITABLE_AUDIO_ROUTE = 2; @Deprecated int PLAYBACK_SUPPRESSION_REASON_UNSUITABLE_AUDIO_ROUTE = 2;
/** /**
* Playback is suppressed due to attempt to play on an unsuitable audio output (e.g. attempt to * Playback is suppressed due to attempt to play on an unsuitable audio output (e.g. attempt to
* play on built-in speaker on a Wear OS device). * play on built-in speaker on a Wear OS device).
@ -1262,12 +1285,14 @@ public interface Player {
@Target({FIELD, METHOD, PARAMETER, LOCAL_VARIABLE, TYPE_USE}) @Target({FIELD, METHOD, PARAMETER, LOCAL_VARIABLE, TYPE_USE})
@IntDef({REPEAT_MODE_OFF, REPEAT_MODE_ONE, REPEAT_MODE_ALL}) @IntDef({REPEAT_MODE_OFF, REPEAT_MODE_ONE, REPEAT_MODE_ALL})
@interface RepeatMode {} @interface RepeatMode {}
/** /**
* Normal playback without repetition. "Previous" and "Next" actions move to the previous and next * Normal playback without repetition. "Previous" and "Next" actions move to the previous and next
* {@link MediaItem} respectively, and do nothing when there is no previous or next {@link * {@link MediaItem} respectively, and do nothing when there is no previous or next {@link
* MediaItem} to move to. * MediaItem} to move to.
*/ */
int REPEAT_MODE_OFF = 0; int REPEAT_MODE_OFF = 0;
/** /**
* Repeats the currently playing {@link MediaItem} infinitely during ongoing playback. "Previous" * Repeats the currently playing {@link MediaItem} infinitely during ongoing playback. "Previous"
* and "Next" actions behave as they do in {@link #REPEAT_MODE_OFF}, moving to the previous and * and "Next" actions behave as they do in {@link #REPEAT_MODE_OFF}, moving to the previous and
@ -1275,6 +1300,7 @@ public interface Player {
* MediaItem} to move to. * MediaItem} to move to.
*/ */
int REPEAT_MODE_ONE = 1; int REPEAT_MODE_ONE = 1;
/** /**
* Repeats the entire timeline infinitely. "Previous" and "Next" actions behave as they do in * Repeats the entire timeline infinitely. "Previous" and "Next" actions behave as they do in
* {@link #REPEAT_MODE_OFF}, but with looping at the ends so that "Previous" when playing the * {@link #REPEAT_MODE_OFF}, but with looping at the ends so that "Previous" when playing the
@ -1303,6 +1329,7 @@ public interface Player {
DISCONTINUITY_REASON_INTERNAL DISCONTINUITY_REASON_INTERNAL
}) })
@interface DiscontinuityReason {} @interface DiscontinuityReason {}
/** /**
* Automatic playback transition from one period in the timeline to the next. The period index may * Automatic playback transition from one period in the timeline to the next. The period index may
* be the same as it was before the discontinuity in case the current period is repeated. * be the same as it was before the discontinuity in case the current period is repeated.
@ -1312,17 +1339,22 @@ public interface Player {
* control the same playback on a remote device). * control the same playback on a remote device).
*/ */
int DISCONTINUITY_REASON_AUTO_TRANSITION = 0; int DISCONTINUITY_REASON_AUTO_TRANSITION = 0;
/** Seek within the current period or to another period. */ /** Seek within the current period or to another period. */
int DISCONTINUITY_REASON_SEEK = 1; int DISCONTINUITY_REASON_SEEK = 1;
/** /**
* Seek adjustment due to being unable to seek to the requested position or because the seek was * Seek adjustment due to being unable to seek to the requested position or because the seek was
* permitted to be inexact. * permitted to be inexact.
*/ */
int DISCONTINUITY_REASON_SEEK_ADJUSTMENT = 2; int DISCONTINUITY_REASON_SEEK_ADJUSTMENT = 2;
/** Discontinuity introduced by a skipped period (for instance a skipped ad). */ /** Discontinuity introduced by a skipped period (for instance a skipped ad). */
int DISCONTINUITY_REASON_SKIP = 3; int DISCONTINUITY_REASON_SKIP = 3;
/** Discontinuity caused by the removal of the current period from the {@link Timeline}. */ /** Discontinuity caused by the removal of the current period from the {@link Timeline}. */
int DISCONTINUITY_REASON_REMOVE = 4; int DISCONTINUITY_REASON_REMOVE = 4;
/** Discontinuity introduced internally (e.g. by the source). */ /** Discontinuity introduced internally (e.g. by the source). */
int DISCONTINUITY_REASON_INTERNAL = 5; int DISCONTINUITY_REASON_INTERNAL = 5;
@ -1337,8 +1369,10 @@ public interface Player {
@Target({FIELD, METHOD, PARAMETER, LOCAL_VARIABLE, TYPE_USE}) @Target({FIELD, METHOD, PARAMETER, LOCAL_VARIABLE, TYPE_USE})
@IntDef({TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED, TIMELINE_CHANGE_REASON_SOURCE_UPDATE}) @IntDef({TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED, TIMELINE_CHANGE_REASON_SOURCE_UPDATE})
@interface TimelineChangeReason {} @interface TimelineChangeReason {}
/** Timeline changed as a result of a change of the playlist items or the order of the items. */ /** Timeline changed as a result of a change of the playlist items or the order of the items. */
int TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED = 0; int TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED = 0;
/** /**
* Timeline changed as a result of a source update (e.g. result of a dynamic update by the played * Timeline changed as a result of a source update (e.g. result of a dynamic update by the played
* media). * media).
@ -1365,8 +1399,10 @@ public interface Player {
MEDIA_ITEM_TRANSITION_REASON_PLAYLIST_CHANGED MEDIA_ITEM_TRANSITION_REASON_PLAYLIST_CHANGED
}) })
@interface MediaItemTransitionReason {} @interface MediaItemTransitionReason {}
/** The media item has been repeated. */ /** The media item has been repeated. */
int MEDIA_ITEM_TRANSITION_REASON_REPEAT = 0; int MEDIA_ITEM_TRANSITION_REASON_REPEAT = 0;
/** /**
* Playback has automatically transitioned to the next media item. * Playback has automatically transitioned to the next media item.
* *
@ -1374,8 +1410,10 @@ public interface Player {
* can control the same playback on a remote device). * can control the same playback on a remote device).
*/ */
int MEDIA_ITEM_TRANSITION_REASON_AUTO = 1; int MEDIA_ITEM_TRANSITION_REASON_AUTO = 1;
/** A seek to another media item has occurred. */ /** A seek to another media item has occurred. */
int MEDIA_ITEM_TRANSITION_REASON_SEEK = 2; int MEDIA_ITEM_TRANSITION_REASON_SEEK = 2;
/** /**
* The current media item has changed because of a change in the playlist. This can either be if * The current media item has changed because of a change in the playlist. This can either be if
* the media item previously being played has been removed, or when the playlist becomes non-empty * the media item previously being played has been removed, or when the playlist becomes non-empty
@ -1427,72 +1465,103 @@ public interface Player {
EVENT_DEVICE_VOLUME_CHANGED EVENT_DEVICE_VOLUME_CHANGED
}) })
@interface Event {} @interface Event {}
/** {@link #getCurrentTimeline()} changed. */ /** {@link #getCurrentTimeline()} changed. */
int EVENT_TIMELINE_CHANGED = 0; int EVENT_TIMELINE_CHANGED = 0;
/** {@link #getCurrentMediaItem()} changed or the player started repeating the current item. */ /** {@link #getCurrentMediaItem()} changed or the player started repeating the current item. */
int EVENT_MEDIA_ITEM_TRANSITION = 1; int EVENT_MEDIA_ITEM_TRANSITION = 1;
/** {@link #getCurrentTracks()} changed. */ /** {@link #getCurrentTracks()} changed. */
int EVENT_TRACKS_CHANGED = 2; int EVENT_TRACKS_CHANGED = 2;
/** {@link #isLoading()} ()} changed. */ /** {@link #isLoading()} ()} changed. */
int EVENT_IS_LOADING_CHANGED = 3; int EVENT_IS_LOADING_CHANGED = 3;
/** {@link #getPlaybackState()} changed. */ /** {@link #getPlaybackState()} changed. */
int EVENT_PLAYBACK_STATE_CHANGED = 4; int EVENT_PLAYBACK_STATE_CHANGED = 4;
/** {@link #getPlayWhenReady()} changed. */ /** {@link #getPlayWhenReady()} changed. */
int EVENT_PLAY_WHEN_READY_CHANGED = 5; int EVENT_PLAY_WHEN_READY_CHANGED = 5;
/** {@link #getPlaybackSuppressionReason()} changed. */ /** {@link #getPlaybackSuppressionReason()} changed. */
int EVENT_PLAYBACK_SUPPRESSION_REASON_CHANGED = 6; int EVENT_PLAYBACK_SUPPRESSION_REASON_CHANGED = 6;
/** {@link #isPlaying()} changed. */ /** {@link #isPlaying()} changed. */
int EVENT_IS_PLAYING_CHANGED = 7; int EVENT_IS_PLAYING_CHANGED = 7;
/** {@link #getRepeatMode()} changed. */ /** {@link #getRepeatMode()} changed. */
int EVENT_REPEAT_MODE_CHANGED = 8; int EVENT_REPEAT_MODE_CHANGED = 8;
/** {@link #getShuffleModeEnabled()} changed. */ /** {@link #getShuffleModeEnabled()} changed. */
int EVENT_SHUFFLE_MODE_ENABLED_CHANGED = 9; int EVENT_SHUFFLE_MODE_ENABLED_CHANGED = 9;
/** {@link #getPlayerError()} changed. */ /** {@link #getPlayerError()} changed. */
int EVENT_PLAYER_ERROR = 10; int EVENT_PLAYER_ERROR = 10;
/** /**
* A position discontinuity occurred. See {@link Listener#onPositionDiscontinuity(PositionInfo, * A position discontinuity occurred. See {@link Listener#onPositionDiscontinuity(PositionInfo,
* PositionInfo, int)}. * PositionInfo, int)}.
*/ */
int EVENT_POSITION_DISCONTINUITY = 11; int EVENT_POSITION_DISCONTINUITY = 11;
/** {@link #getPlaybackParameters()} changed. */ /** {@link #getPlaybackParameters()} changed. */
int EVENT_PLAYBACK_PARAMETERS_CHANGED = 12; int EVENT_PLAYBACK_PARAMETERS_CHANGED = 12;
/** {@link #isCommandAvailable(int)} changed for at least one {@link Command}. */ /** {@link #isCommandAvailable(int)} changed for at least one {@link Command}. */
int EVENT_AVAILABLE_COMMANDS_CHANGED = 13; int EVENT_AVAILABLE_COMMANDS_CHANGED = 13;
/** {@link #getMediaMetadata()} changed. */ /** {@link #getMediaMetadata()} changed. */
int EVENT_MEDIA_METADATA_CHANGED = 14; int EVENT_MEDIA_METADATA_CHANGED = 14;
/** {@link #getPlaylistMetadata()} changed. */ /** {@link #getPlaylistMetadata()} changed. */
int EVENT_PLAYLIST_METADATA_CHANGED = 15; int EVENT_PLAYLIST_METADATA_CHANGED = 15;
/** {@link #getSeekBackIncrement()} changed. */ /** {@link #getSeekBackIncrement()} changed. */
int EVENT_SEEK_BACK_INCREMENT_CHANGED = 16; int EVENT_SEEK_BACK_INCREMENT_CHANGED = 16;
/** {@link #getSeekForwardIncrement()} changed. */ /** {@link #getSeekForwardIncrement()} changed. */
int EVENT_SEEK_FORWARD_INCREMENT_CHANGED = 17; int EVENT_SEEK_FORWARD_INCREMENT_CHANGED = 17;
/** {@link #getMaxSeekToPreviousPosition()} changed. */ /** {@link #getMaxSeekToPreviousPosition()} changed. */
int EVENT_MAX_SEEK_TO_PREVIOUS_POSITION_CHANGED = 18; int EVENT_MAX_SEEK_TO_PREVIOUS_POSITION_CHANGED = 18;
/** {@link #getTrackSelectionParameters()} changed. */ /** {@link #getTrackSelectionParameters()} changed. */
int EVENT_TRACK_SELECTION_PARAMETERS_CHANGED = 19; int EVENT_TRACK_SELECTION_PARAMETERS_CHANGED = 19;
/** {@link #getAudioAttributes()} changed. */ /** {@link #getAudioAttributes()} changed. */
int EVENT_AUDIO_ATTRIBUTES_CHANGED = 20; int EVENT_AUDIO_ATTRIBUTES_CHANGED = 20;
/** The audio session id was set. */ /** The audio session id was set. */
int EVENT_AUDIO_SESSION_ID = 21; int EVENT_AUDIO_SESSION_ID = 21;
/** {@link #getVolume()} changed. */ /** {@link #getVolume()} changed. */
int EVENT_VOLUME_CHANGED = 22; int EVENT_VOLUME_CHANGED = 22;
/** Skipping silences in the audio stream is enabled or disabled. */ /** Skipping silences in the audio stream is enabled or disabled. */
int EVENT_SKIP_SILENCE_ENABLED_CHANGED = 23; int EVENT_SKIP_SILENCE_ENABLED_CHANGED = 23;
/** The size of the surface onto which the video is being rendered changed. */ /** The size of the surface onto which the video is being rendered changed. */
int EVENT_SURFACE_SIZE_CHANGED = 24; int EVENT_SURFACE_SIZE_CHANGED = 24;
/** {@link #getVideoSize()} changed. */ /** {@link #getVideoSize()} changed. */
int EVENT_VIDEO_SIZE_CHANGED = 25; int EVENT_VIDEO_SIZE_CHANGED = 25;
/** /**
* A frame is rendered for the first time since setting the surface, or since the renderer was * A frame is rendered for the first time since setting the surface, or since the renderer was
* reset, or since the stream being rendered was changed. * reset, or since the stream being rendered was changed.
*/ */
int EVENT_RENDERED_FIRST_FRAME = 26; int EVENT_RENDERED_FIRST_FRAME = 26;
/** {@link #getCurrentCues()} changed. */ /** {@link #getCurrentCues()} changed. */
int EVENT_CUES = 27; int EVENT_CUES = 27;
/** Metadata associated with the current playback time changed. */ /** Metadata associated with the current playback time changed. */
int EVENT_METADATA = 28; int EVENT_METADATA = 28;
/** {@link #getDeviceInfo()} changed. */ /** {@link #getDeviceInfo()} changed. */
int EVENT_DEVICE_INFO_CHANGED = 29; int EVENT_DEVICE_INFO_CHANGED = 29;
/** {@link #getDeviceVolume()} changed. */ /** {@link #getDeviceVolume()} changed. */
int EVENT_DEVICE_VOLUME_CHANGED = 30; int EVENT_DEVICE_VOLUME_CHANGED = 30;
@ -1591,6 +1660,7 @@ public interface Player {
COMMAND_RELEASE, COMMAND_RELEASE,
}) })
@interface Command {} @interface Command {}
/** /**
* Command to start, pause or resume playback. * Command to start, pause or resume playback.
* *
@ -1636,6 +1706,7 @@ public interface Player {
* #isCommandAvailable(int) available}. * #isCommandAvailable(int) available}.
*/ */
int COMMAND_SEEK_IN_CURRENT_MEDIA_ITEM = 5; int COMMAND_SEEK_IN_CURRENT_MEDIA_ITEM = 5;
/** /**
* @deprecated Use {@link #COMMAND_SEEK_IN_CURRENT_MEDIA_ITEM} instead. * @deprecated Use {@link #COMMAND_SEEK_IN_CURRENT_MEDIA_ITEM} instead.
*/ */
@ -1648,11 +1719,13 @@ public interface Player {
* {@linkplain #isCommandAvailable(int) available}. * {@linkplain #isCommandAvailable(int) available}.
*/ */
int COMMAND_SEEK_TO_PREVIOUS_MEDIA_ITEM = 6; int COMMAND_SEEK_TO_PREVIOUS_MEDIA_ITEM = 6;
/** /**
* @deprecated Use {@link #COMMAND_SEEK_TO_PREVIOUS_MEDIA_ITEM} instead. * @deprecated Use {@link #COMMAND_SEEK_TO_PREVIOUS_MEDIA_ITEM} instead.
*/ */
@UnstableApi @Deprecated @UnstableApi @Deprecated
int COMMAND_SEEK_TO_PREVIOUS_WINDOW = COMMAND_SEEK_TO_PREVIOUS_MEDIA_ITEM; int COMMAND_SEEK_TO_PREVIOUS_WINDOW = COMMAND_SEEK_TO_PREVIOUS_MEDIA_ITEM;
/** /**
* Command to seek to an earlier position in the current {@link MediaItem} or the default position * Command to seek to an earlier position in the current {@link MediaItem} or the default position
* of the previous {@link MediaItem}. * of the previous {@link MediaItem}.
@ -1661,6 +1734,7 @@ public interface Player {
* #isCommandAvailable(int) available}. * #isCommandAvailable(int) available}.
*/ */
int COMMAND_SEEK_TO_PREVIOUS = 7; int COMMAND_SEEK_TO_PREVIOUS = 7;
/** /**
* Command to seek to the default position of the next {@link MediaItem}. * Command to seek to the default position of the next {@link MediaItem}.
* *
@ -1668,10 +1742,12 @@ public interface Player {
* #isCommandAvailable(int) available}. * #isCommandAvailable(int) available}.
*/ */
int COMMAND_SEEK_TO_NEXT_MEDIA_ITEM = 8; int COMMAND_SEEK_TO_NEXT_MEDIA_ITEM = 8;
/** /**
* @deprecated Use {@link #COMMAND_SEEK_TO_NEXT_MEDIA_ITEM} instead. * @deprecated Use {@link #COMMAND_SEEK_TO_NEXT_MEDIA_ITEM} instead.
*/ */
@UnstableApi @Deprecated int COMMAND_SEEK_TO_NEXT_WINDOW = COMMAND_SEEK_TO_NEXT_MEDIA_ITEM; @UnstableApi @Deprecated int COMMAND_SEEK_TO_NEXT_WINDOW = COMMAND_SEEK_TO_NEXT_MEDIA_ITEM;
/** /**
* Command to seek to a later position in the current {@link MediaItem} or the default position of * Command to seek to a later position in the current {@link MediaItem} or the default position of
* the next {@link MediaItem}. * the next {@link MediaItem}.
@ -1693,10 +1769,12 @@ public interface Player {
* </ul> * </ul>
*/ */
int COMMAND_SEEK_TO_MEDIA_ITEM = 10; int COMMAND_SEEK_TO_MEDIA_ITEM = 10;
/** /**
* @deprecated Use {@link #COMMAND_SEEK_TO_MEDIA_ITEM} instead. * @deprecated Use {@link #COMMAND_SEEK_TO_MEDIA_ITEM} instead.
*/ */
@UnstableApi @Deprecated int COMMAND_SEEK_TO_WINDOW = COMMAND_SEEK_TO_MEDIA_ITEM; @UnstableApi @Deprecated int COMMAND_SEEK_TO_WINDOW = COMMAND_SEEK_TO_MEDIA_ITEM;
/** /**
* Command to seek back by a fixed increment inside the current {@link MediaItem}. * Command to seek back by a fixed increment inside the current {@link MediaItem}.
* *
@ -1704,6 +1782,7 @@ public interface Player {
* #isCommandAvailable(int) available}. * #isCommandAvailable(int) available}.
*/ */
int COMMAND_SEEK_BACK = 11; int COMMAND_SEEK_BACK = 11;
/** /**
* Command to seek forward by a fixed increment inside the current {@link MediaItem}. * Command to seek forward by a fixed increment inside the current {@link MediaItem}.
* *
@ -1831,6 +1910,7 @@ public interface Player {
* </ul> * </ul>
*/ */
int COMMAND_SET_MEDIA_ITEM = 31; int COMMAND_SET_MEDIA_ITEM = 31;
/** /**
* Command to change the {@linkplain MediaItem media items} in the playlist. * Command to change the {@linkplain MediaItem media items} in the playlist.
* *
@ -1897,6 +1977,7 @@ public interface Player {
* @deprecated Use {@link #COMMAND_SET_DEVICE_VOLUME_WITH_FLAGS} instead. * @deprecated Use {@link #COMMAND_SET_DEVICE_VOLUME_WITH_FLAGS} instead.
*/ */
@Deprecated int COMMAND_SET_DEVICE_VOLUME = 25; @Deprecated int COMMAND_SET_DEVICE_VOLUME = 25;
/** /**
* Command to set the device volume with volume flags. * Command to set the device volume with volume flags.
* *
@ -1909,6 +1990,7 @@ public interface Player {
* @deprecated Use {@link #COMMAND_ADJUST_DEVICE_VOLUME_WITH_FLAGS} instead. * @deprecated Use {@link #COMMAND_ADJUST_DEVICE_VOLUME_WITH_FLAGS} instead.
*/ */
@Deprecated int COMMAND_ADJUST_DEVICE_VOLUME = 26; @Deprecated int COMMAND_ADJUST_DEVICE_VOLUME = 26;
/** /**
* Command to increase and decrease the device volume and mute it with volume flags. * Command to increase and decrease the device volume and mute it with volume flags.
* *
@ -1964,6 +2046,7 @@ public interface Player {
* #isCommandAvailable(int) available}. * #isCommandAvailable(int) available}.
*/ */
int COMMAND_GET_TRACKS = 30; int COMMAND_GET_TRACKS = 30;
/** /**
* Command to release the player. * Command to release the player.
* *

View File

@ -772,105 +772,142 @@ public abstract class SimpleBasePlayer extends BasePlayer {
/** The available {@link Commands}. */ /** The available {@link Commands}. */
public final Commands availableCommands; public final Commands availableCommands;
/** Whether playback should proceed when ready and not suppressed. */ /** Whether playback should proceed when ready and not suppressed. */
public final boolean playWhenReady; public final boolean playWhenReady;
/** The last reason for changing {@link #playWhenReady}. */ /** The last reason for changing {@link #playWhenReady}. */
public final @PlayWhenReadyChangeReason int playWhenReadyChangeReason; public final @PlayWhenReadyChangeReason int playWhenReadyChangeReason;
/** The {@linkplain Player.State state} of the player. */ /** The {@linkplain Player.State state} of the player. */
public final @Player.State int playbackState; public final @Player.State int playbackState;
/** The reason why playback is suppressed even if {@link #getPlayWhenReady()} is true. */ /** The reason why playback is suppressed even if {@link #getPlayWhenReady()} is true. */
public final @PlaybackSuppressionReason int playbackSuppressionReason; public final @PlaybackSuppressionReason int playbackSuppressionReason;
/** The last error that caused playback to fail, or null if there was no error. */ /** The last error that caused playback to fail, or null if there was no error. */
@Nullable public final PlaybackException playerError; @Nullable public final PlaybackException playerError;
/** The {@link RepeatMode} used for playback. */ /** The {@link RepeatMode} used for playback. */
public final @RepeatMode int repeatMode; public final @RepeatMode int repeatMode;
/** Whether shuffling of media items is enabled. */ /** Whether shuffling of media items is enabled. */
public final boolean shuffleModeEnabled; public final boolean shuffleModeEnabled;
/** Whether the player is currently loading its source. */ /** Whether the player is currently loading its source. */
public final boolean isLoading; public final boolean isLoading;
/** The {@link Player#seekBack()} increment in milliseconds. */ /** The {@link Player#seekBack()} increment in milliseconds. */
public final long seekBackIncrementMs; public final long seekBackIncrementMs;
/** The {@link Player#seekForward()} increment in milliseconds. */ /** The {@link Player#seekForward()} increment in milliseconds. */
public final long seekForwardIncrementMs; public final long seekForwardIncrementMs;
/** /**
* The maximum position for which {@link #seekToPrevious()} seeks to the previous item, in * The maximum position for which {@link #seekToPrevious()} seeks to the previous item, in
* milliseconds. * milliseconds.
*/ */
public final long maxSeekToPreviousPositionMs; public final long maxSeekToPreviousPositionMs;
/** The currently active {@link PlaybackParameters}. */ /** The currently active {@link PlaybackParameters}. */
public final PlaybackParameters playbackParameters; public final PlaybackParameters playbackParameters;
/** The currently active {@link TrackSelectionParameters}. */ /** The currently active {@link TrackSelectionParameters}. */
public final TrackSelectionParameters trackSelectionParameters; public final TrackSelectionParameters trackSelectionParameters;
/** The current {@link AudioAttributes}. */ /** The current {@link AudioAttributes}. */
public final AudioAttributes audioAttributes; public final AudioAttributes audioAttributes;
/** The current audio volume, with 0 being silence and 1 being unity gain (signal unchanged). */ /** The current audio volume, with 0 being silence and 1 being unity gain (signal unchanged). */
@FloatRange(from = 0, to = 1.0) @FloatRange(from = 0, to = 1.0)
public final float volume; public final float volume;
/** The current video size. */ /** The current video size. */
public final VideoSize videoSize; public final VideoSize videoSize;
/** The current {@linkplain CueGroup cues}. */ /** The current {@linkplain CueGroup cues}. */
public final CueGroup currentCues; public final CueGroup currentCues;
/** The {@link DeviceInfo}. */ /** The {@link DeviceInfo}. */
public final DeviceInfo deviceInfo; public final DeviceInfo deviceInfo;
/** The current device volume. */ /** The current device volume. */
@IntRange(from = 0) @IntRange(from = 0)
public final int deviceVolume; public final int deviceVolume;
/** Whether the device is muted. */ /** Whether the device is muted. */
public final boolean isDeviceMuted; public final boolean isDeviceMuted;
/** The size of the surface onto which the video is being rendered. */ /** The size of the surface onto which the video is being rendered. */
public final Size surfaceSize; public final Size surfaceSize;
/** /**
* Whether a frame has been rendered for the first time since setting the surface, a rendering * Whether a frame has been rendered for the first time since setting the surface, a rendering
* reset, or since the stream being rendered was changed. * reset, or since the stream being rendered was changed.
*/ */
public final boolean newlyRenderedFirstFrame; public final boolean newlyRenderedFirstFrame;
/** The most recent timed metadata. */ /** The most recent timed metadata. */
public final Metadata timedMetadata; public final Metadata timedMetadata;
/** The media items in the playlist. */ /** The media items in the playlist. */
public final ImmutableList<MediaItemData> playlist; public final ImmutableList<MediaItemData> playlist;
/** The {@link Timeline} derived from the {@link #playlist}. */ /** The {@link Timeline} derived from the {@link #playlist}. */
public final Timeline timeline; public final Timeline timeline;
/** The playlist {@link MediaMetadata}. */ /** The playlist {@link MediaMetadata}. */
public final MediaMetadata playlistMetadata; public final MediaMetadata playlistMetadata;
/** /**
* The current media item index, or {@link C#INDEX_UNSET} to assume the default first item of * The current media item index, or {@link C#INDEX_UNSET} to assume the default first item of
* the playlist is played. * the playlist is played.
*/ */
public final int currentMediaItemIndex; public final int currentMediaItemIndex;
/** The current ad group index, or {@link C#INDEX_UNSET} if no ad is playing. */ /** The current ad group index, or {@link C#INDEX_UNSET} if no ad is playing. */
public final int currentAdGroupIndex; public final int currentAdGroupIndex;
/** The current ad index in the ad group, or {@link C#INDEX_UNSET} if no ad is playing. */ /** The current ad index in the ad group, or {@link C#INDEX_UNSET} if no ad is playing. */
public final int currentAdIndexInAdGroup; public final int currentAdIndexInAdGroup;
/** /**
* The {@link PositionSupplier} for the current content playback position in milliseconds, or * The {@link PositionSupplier} for the current content playback position in milliseconds, or
* {@link C#TIME_UNSET} to indicate the default start position. * {@link C#TIME_UNSET} to indicate the default start position.
*/ */
public final PositionSupplier contentPositionMsSupplier; public final PositionSupplier contentPositionMsSupplier;
/** /**
* The {@link PositionSupplier} for the current ad playback position in milliseconds. The value * The {@link PositionSupplier} for the current ad playback position in milliseconds. The value
* is unused if no ad is playing. * is unused if no ad is playing.
*/ */
public final PositionSupplier adPositionMsSupplier; public final PositionSupplier adPositionMsSupplier;
/** /**
* The {@link PositionSupplier} for the estimated position up to which the currently playing * The {@link PositionSupplier} for the estimated position up to which the currently playing
* content is buffered, in milliseconds, or {@link C#TIME_UNSET} to indicate the default start * content is buffered, in milliseconds, or {@link C#TIME_UNSET} to indicate the default start
* position. * position.
*/ */
public final PositionSupplier contentBufferedPositionMsSupplier; public final PositionSupplier contentBufferedPositionMsSupplier;
/** /**
* The {@link PositionSupplier} for the estimated position up to which the currently playing ad * The {@link PositionSupplier} for the estimated position up to which the currently playing ad
* is buffered, in milliseconds. The value is unused if no ad is playing. * is buffered, in milliseconds. The value is unused if no ad is playing.
*/ */
public final PositionSupplier adBufferedPositionMsSupplier; public final PositionSupplier adBufferedPositionMsSupplier;
/** The {@link PositionSupplier} for the estimated total buffered duration in milliseconds. */ /** The {@link PositionSupplier} for the estimated total buffered duration in milliseconds. */
public final PositionSupplier totalBufferedDurationMsSupplier; public final PositionSupplier totalBufferedDurationMsSupplier;
/** Signals that a position discontinuity happened since the last update to the player. */ /** Signals that a position discontinuity happened since the last update to the player. */
public final boolean hasPositionDiscontinuity; public final boolean hasPositionDiscontinuity;
/** /**
* The {@linkplain Player.DiscontinuityReason reason} for the last position discontinuity. The * The {@linkplain Player.DiscontinuityReason reason} for the last position discontinuity. The
* value is unused if {@link #hasPositionDiscontinuity} is {@code false}. * value is unused if {@link #hasPositionDiscontinuity} is {@code false}.
*/ */
public final @Player.DiscontinuityReason int positionDiscontinuityReason; public final @Player.DiscontinuityReason int positionDiscontinuityReason;
/** /**
* The position, in milliseconds, in the current content or ad from which playback continued * The position, in milliseconds, in the current content or ad from which playback continued
* after the discontinuity. The value is unused if {@link #hasPositionDiscontinuity} is {@code * after the discontinuity. The value is unused if {@link #hasPositionDiscontinuity} is {@code
@ -1524,10 +1561,13 @@ public abstract class SimpleBasePlayer extends BasePlayer {
/** The unique identifier of this media item. */ /** The unique identifier of this media item. */
public final Object uid; public final Object uid;
/** The {@link Tracks} of this media item. */ /** The {@link Tracks} of this media item. */
public final Tracks tracks; public final Tracks tracks;
/** The {@link MediaItem}. */ /** The {@link MediaItem}. */
public final MediaItem mediaItem; public final MediaItem mediaItem;
/** /**
* The {@link MediaMetadata}, including static data from the {@link MediaItem#mediaMetadata * The {@link MediaMetadata}, including static data from the {@link MediaItem#mediaMetadata
* MediaItem} and the media's {@link Format#metadata Format}, as well any dynamic metadata that * MediaItem} and the media's {@link Format#metadata Format}, as well any dynamic metadata that
@ -1536,47 +1576,59 @@ public abstract class SimpleBasePlayer extends BasePlayer {
* {@link Format#metadata Formats}. * {@link Format#metadata Formats}.
*/ */
@Nullable public final MediaMetadata mediaMetadata; @Nullable public final MediaMetadata mediaMetadata;
/** The manifest of the media item, or null if not applicable. */ /** The manifest of the media item, or null if not applicable. */
@Nullable public final Object manifest; @Nullable public final Object manifest;
/** The active {@link MediaItem.LiveConfiguration}, or null if the media item is not live. */ /** The active {@link MediaItem.LiveConfiguration}, or null if the media item is not live. */
@Nullable public final MediaItem.LiveConfiguration liveConfiguration; @Nullable public final MediaItem.LiveConfiguration liveConfiguration;
/** /**
* The start time of the live presentation, in milliseconds since the Unix epoch, or {@link * The start time of the live presentation, in milliseconds since the Unix epoch, or {@link
* C#TIME_UNSET} if unknown or not applicable. * C#TIME_UNSET} if unknown or not applicable.
*/ */
public final long presentationStartTimeMs; public final long presentationStartTimeMs;
/** /**
* The start time of the live window, in milliseconds since the Unix epoch, or {@link * The start time of the live window, in milliseconds since the Unix epoch, or {@link
* C#TIME_UNSET} if unknown or not applicable. * C#TIME_UNSET} if unknown or not applicable.
*/ */
public final long windowStartTimeMs; public final long windowStartTimeMs;
/** /**
* The offset between {@link SystemClock#elapsedRealtime()} and the time since the Unix epoch * The offset between {@link SystemClock#elapsedRealtime()} and the time since the Unix epoch
* according to the clock of the media origin server, or {@link C#TIME_UNSET} if unknown or not * according to the clock of the media origin server, or {@link C#TIME_UNSET} if unknown or not
* applicable. * applicable.
*/ */
public final long elapsedRealtimeEpochOffsetMs; public final long elapsedRealtimeEpochOffsetMs;
/** Whether it's possible to seek within this media item. */ /** Whether it's possible to seek within this media item. */
public final boolean isSeekable; public final boolean isSeekable;
/** Whether this media item may change over time, for example a moving live window. */ /** Whether this media item may change over time, for example a moving live window. */
public final boolean isDynamic; public final boolean isDynamic;
/** /**
* The default position relative to the start of the media item at which to begin playback, in * The default position relative to the start of the media item at which to begin playback, in
* microseconds. * microseconds.
*/ */
public final long defaultPositionUs; public final long defaultPositionUs;
/** The duration of the media item, in microseconds, or {@link C#TIME_UNSET} if unknown. */ /** The duration of the media item, in microseconds, or {@link C#TIME_UNSET} if unknown. */
public final long durationUs; public final long durationUs;
/** /**
* The position of the start of this media item relative to the start of the first period * The position of the start of this media item relative to the start of the first period
* belonging to it, in microseconds. * belonging to it, in microseconds.
*/ */
public final long positionInFirstPeriodUs; public final long positionInFirstPeriodUs;
/** /**
* Whether this media item contains placeholder information because the real information has yet * Whether this media item contains placeholder information because the real information has yet
* to be loaded. * to be loaded.
*/ */
public final boolean isPlaceholder; public final boolean isPlaceholder;
/** /**
* The list of {@linkplain PeriodData periods} in this media item, or an empty list to assume a * The list of {@linkplain PeriodData periods} in this media item, or an empty list to assume a
* single period without ads and the same duration as the media item. * single period without ads and the same duration as the media item.
@ -1861,16 +1913,19 @@ public abstract class SimpleBasePlayer extends BasePlayer {
/** The unique identifier of the period within its media item. */ /** The unique identifier of the period within its media item. */
public final Object uid; public final Object uid;
/** /**
* The total duration of the period, in microseconds, or {@link C#TIME_UNSET} if unknown. Only * The total duration of the period, in microseconds, or {@link C#TIME_UNSET} if unknown. Only
* the last period in a media item can have an unknown duration. * the last period in a media item can have an unknown duration.
*/ */
public final long durationUs; public final long durationUs;
/** /**
* The {@link AdPlaybackState} of the period, or {@link AdPlaybackState#NONE} if there are no * The {@link AdPlaybackState} of the period, or {@link AdPlaybackState#NONE} if there are no
* ads. * ads.
*/ */
public final AdPlaybackState adPlaybackState; public final AdPlaybackState adPlaybackState;
/** /**
* Whether this period contains placeholder information because the real information has yet to * Whether this period contains placeholder information because the real information has yet to
* be loaded. * be loaded.

View File

@ -41,8 +41,10 @@ public final class StreamKey implements Comparable<StreamKey>, Parcelable, Bundl
/** The period index. */ /** The period index. */
public final int periodIndex; public final int periodIndex;
/** The group index. */ /** The group index. */
public final int groupIndex; public final int groupIndex;
/** The stream index. */ /** The stream index. */
public final int streamIndex; public final int streamIndex;

View File

@ -27,10 +27,13 @@ public final class SurfaceInfo {
/** The {@link Surface}. */ /** The {@link Surface}. */
public final Surface surface; public final Surface surface;
/** The width of frames rendered to the {@link #surface}, in pixels. */ /** The width of frames rendered to the {@link #surface}, in pixels. */
public final int width; public final int width;
/** The height of frames rendered to the {@link #surface}, in pixels. */ /** The height of frames rendered to the {@link #surface}, in pixels. */
public final int height; public final int height;
/** /**
* A counter-clockwise rotation to apply to frames before rendering them to the {@link #surface}. * A counter-clockwise rotation to apply to frames before rendering them to the {@link #surface}.
* *

View File

@ -1188,6 +1188,7 @@ public abstract class Timeline implements Bundleable {
Window window, Period period, int windowIndex, long windowPositionUs) { Window window, Period period, int windowIndex, long windowPositionUs) {
return getPeriodPositionUs(window, period, windowIndex, windowPositionUs); return getPeriodPositionUs(window, period, windowIndex, windowPositionUs);
} }
/** /**
* @deprecated Use {@link #getPeriodPositionUs(Window, Period, int, long, long)} instead. * @deprecated Use {@link #getPeriodPositionUs(Window, Period, int, long, long)} instead.
*/ */

View File

@ -54,8 +54,10 @@ public final class TrackGroup implements Bundleable {
/** The number of tracks in the group. */ /** The number of tracks in the group. */
@UnstableApi public final int length; @UnstableApi public final int length;
/** An identifier for the track group. */ /** An identifier for the track group. */
@UnstableApi public final String id; @UnstableApi public final String id;
/** The type of tracks in the group. */ /** The type of tracks in the group. */
@UnstableApi public final @C.TrackType int type; @UnstableApi public final @C.TrackType int type;

View File

@ -48,6 +48,7 @@ public final class TrackSelectionOverride implements Bundleable {
/** The media {@link TrackGroup} whose {@link #trackIndices} are forced to be selected. */ /** The media {@link TrackGroup} whose {@link #trackIndices} are forced to be selected. */
public final TrackGroup mediaTrackGroup; public final TrackGroup mediaTrackGroup;
/** The indices of tracks in a {@link TrackGroup} to be selected. */ /** The indices of tracks in a {@link TrackGroup} to be selected. */
public final ImmutableList<Integer> trackIndices; public final ImmutableList<Integer> trackIndices;

View File

@ -93,11 +93,13 @@ public class TrackSelectionParameters implements Bundleable {
* selection, then no tracks will be selected. * selection, then no tracks will be selected.
*/ */
@UnstableApi public static final int AUDIO_OFFLOAD_MODE_PREFERENCE_REQUIRED = 2; @UnstableApi public static final int AUDIO_OFFLOAD_MODE_PREFERENCE_REQUIRED = 2;
/** /**
* The track selector will enable audio offload if the selected tracks and renderer capabilities * The track selector will enable audio offload if the selected tracks and renderer capabilities
* are compatible. * are compatible.
*/ */
@UnstableApi public static final int AUDIO_OFFLOAD_MODE_PREFERENCE_ENABLED = 1; @UnstableApi public static final int AUDIO_OFFLOAD_MODE_PREFERENCE_ENABLED = 1;
/** /**
* The track selector will disable audio offload on the audio sink. Track selection will not take * The track selector will disable audio offload on the audio sink. Track selection will not take
* into consideration whether or not a track is offload compatible. * into consideration whether or not a track is offload compatible.
@ -887,6 +889,7 @@ public class TrackSelectionParameters implements Bundleable {
@UnstableApi @UnstableApi
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public static final TrackSelectionParameters DEFAULT_WITHOUT_CONTEXT = new Builder().build(); public static final TrackSelectionParameters DEFAULT_WITHOUT_CONTEXT = new Builder().build();
/** /**
* @deprecated This instance is not configured using {@link Context} constraints. Use {@link * @deprecated This instance is not configured using {@link Context} constraints. Use {@link
* #getDefaults(Context)} instead. * #getDefaults(Context)} instead.
@ -909,6 +912,7 @@ public class TrackSelectionParameters implements Bundleable {
* #viewportHeight} and {@link #viewportOrientationMayChange}) instead. * #viewportHeight} and {@link #viewportOrientationMayChange}) instead.
*/ */
public final int maxVideoWidth; public final int maxVideoWidth;
/** /**
* Maximum allowed video height in pixels. The default value is {@link Integer#MAX_VALUE} (i.e. no * Maximum allowed video height in pixels. The default value is {@link Integer#MAX_VALUE} (i.e. no
* constraint). * constraint).
@ -918,54 +922,66 @@ public class TrackSelectionParameters implements Bundleable {
* #viewportHeight} and {@link #viewportOrientationMayChange}) instead. * #viewportHeight} and {@link #viewportOrientationMayChange}) instead.
*/ */
public final int maxVideoHeight; public final int maxVideoHeight;
/** /**
* Maximum allowed video frame rate in hertz. The default value is {@link Integer#MAX_VALUE} (i.e. * Maximum allowed video frame rate in hertz. The default value is {@link Integer#MAX_VALUE} (i.e.
* no constraint). * no constraint).
*/ */
public final int maxVideoFrameRate; public final int maxVideoFrameRate;
/** /**
* Maximum allowed video bitrate in bits per second. The default value is {@link * Maximum allowed video bitrate in bits per second. The default value is {@link
* Integer#MAX_VALUE} (i.e. no constraint). * Integer#MAX_VALUE} (i.e. no constraint).
*/ */
public final int maxVideoBitrate; public final int maxVideoBitrate;
/** Minimum allowed video width in pixels. The default value is 0 (i.e. no constraint). */ /** Minimum allowed video width in pixels. The default value is 0 (i.e. no constraint). */
public final int minVideoWidth; public final int minVideoWidth;
/** Minimum allowed video height in pixels. The default value is 0 (i.e. no constraint). */ /** Minimum allowed video height in pixels. The default value is 0 (i.e. no constraint). */
public final int minVideoHeight; public final int minVideoHeight;
/** Minimum allowed video frame rate in hertz. The default value is 0 (i.e. no constraint). */ /** Minimum allowed video frame rate in hertz. The default value is 0 (i.e. no constraint). */
public final int minVideoFrameRate; public final int minVideoFrameRate;
/** /**
* Minimum allowed video bitrate in bits per second. The default value is 0 (i.e. no constraint). * Minimum allowed video bitrate in bits per second. The default value is 0 (i.e. no constraint).
*/ */
public final int minVideoBitrate; public final int minVideoBitrate;
/** /**
* Viewport width in pixels. Constrains video track selections for adaptive content so that only * Viewport width in pixels. Constrains video track selections for adaptive content so that only
* tracks suitable for the viewport are selected. The default value is the physical width of the * tracks suitable for the viewport are selected. The default value is the physical width of the
* primary display, in pixels. * primary display, in pixels.
*/ */
public final int viewportWidth; public final int viewportWidth;
/** /**
* Viewport height in pixels. Constrains video track selections for adaptive content so that only * Viewport height in pixels. Constrains video track selections for adaptive content so that only
* tracks suitable for the viewport are selected. The default value is the physical height of the * tracks suitable for the viewport are selected. The default value is the physical height of the
* primary display, in pixels. * primary display, in pixels.
*/ */
public final int viewportHeight; public final int viewportHeight;
/** /**
* Whether the viewport orientation may change during playback. Constrains video track selections * Whether the viewport orientation may change during playback. Constrains video track selections
* for adaptive content so that only tracks suitable for the viewport are selected. The default * for adaptive content so that only tracks suitable for the viewport are selected. The default
* value is {@code true}. * value is {@code true}.
*/ */
public final boolean viewportOrientationMayChange; public final boolean viewportOrientationMayChange;
/** /**
* The preferred sample MIME types for video tracks in order of preference, or an empty list for * The preferred sample MIME types for video tracks in order of preference, or an empty list for
* no preference. The default is an empty list. * no preference. The default is an empty list.
*/ */
public final ImmutableList<String> preferredVideoMimeTypes; public final ImmutableList<String> preferredVideoMimeTypes;
/** /**
* The preferred {@link C.RoleFlags} for video tracks. {@code 0} selects the default track if * The preferred {@link C.RoleFlags} for video tracks. {@code 0} selects the default track if
* there is one, or the first track if there's no default. The default value is {@code 0}. * there is one, or the first track if there's no default. The default value is {@code 0}.
*/ */
public final @C.RoleFlags int preferredVideoRoleFlags; public final @C.RoleFlags int preferredVideoRoleFlags;
// Audio // Audio
/** /**
* The preferred languages for audio and forced text tracks as IETF BCP 47 conformant tags in * The preferred languages for audio and forced text tracks as IETF BCP 47 conformant tags in
@ -973,21 +989,25 @@ public class TrackSelectionParameters implements Bundleable {
* default. The default value is an empty list. * default. The default value is an empty list.
*/ */
public final ImmutableList<String> preferredAudioLanguages; public final ImmutableList<String> preferredAudioLanguages;
/** /**
* The preferred {@link C.RoleFlags} for audio tracks. {@code 0} selects the default track if * The preferred {@link C.RoleFlags} for audio tracks. {@code 0} selects the default track if
* there is one, or the first track if there's no default. The default value is {@code 0}. * there is one, or the first track if there's no default. The default value is {@code 0}.
*/ */
public final @C.RoleFlags int preferredAudioRoleFlags; public final @C.RoleFlags int preferredAudioRoleFlags;
/** /**
* Maximum allowed audio channel count. The default value is {@link Integer#MAX_VALUE} (i.e. no * Maximum allowed audio channel count. The default value is {@link Integer#MAX_VALUE} (i.e. no
* constraint). * constraint).
*/ */
public final int maxAudioChannelCount; public final int maxAudioChannelCount;
/** /**
* Maximum allowed audio bitrate in bits per second. The default value is {@link * Maximum allowed audio bitrate in bits per second. The default value is {@link
* Integer#MAX_VALUE} (i.e. no constraint). * Integer#MAX_VALUE} (i.e. no constraint).
*/ */
public final int maxAudioBitrate; public final int maxAudioBitrate;
/** /**
* The preferred sample MIME types for audio tracks in order of preference, or an empty list for * The preferred sample MIME types for audio tracks in order of preference, or an empty list for
* no preference. The default is an empty list. * no preference. The default is an empty list.
@ -999,12 +1019,14 @@ public class TrackSelectionParameters implements Bundleable {
* #AUDIO_OFFLOAD_MODE_PREFERENCE_DISABLED}. * #AUDIO_OFFLOAD_MODE_PREFERENCE_DISABLED}.
*/ */
public final @AudioOffloadModePreference int audioOffloadModePreference; public final @AudioOffloadModePreference int audioOffloadModePreference;
/** /**
* A constraint on enabling offload. If {@code isGaplessSupportRequired}, then audio offload will * A constraint on enabling offload. If {@code isGaplessSupportRequired}, then audio offload will
* be enabled only if the device supports gapless transitions during offload or the selected audio * be enabled only if the device supports gapless transitions during offload or the selected audio
* is not gapless. * is not gapless.
*/ */
public final boolean isGaplessSupportRequired; public final boolean isGaplessSupportRequired;
/** /**
* A constraint on enabling offload. If {@code isSpeedChangeSupportRequired}, then audio offload * A constraint on enabling offload. If {@code isSpeedChangeSupportRequired}, then audio offload
* will be enabled only if the device supports changing playback speed during offload. * will be enabled only if the device supports changing playback speed during offload.
@ -1019,6 +1041,7 @@ public class TrackSelectionParameters implements Bundleable {
* enabled. * enabled.
*/ */
public final ImmutableList<String> preferredTextLanguages; public final ImmutableList<String> preferredTextLanguages;
/** /**
* The preferred {@link C.RoleFlags} for text tracks. {@code 0} selects the default track if there * The preferred {@link C.RoleFlags} for text tracks. {@code 0} selects the default track if there
* is one, or no track otherwise. The default value is {@code 0}, or {@link C#ROLE_FLAG_SUBTITLE} * is one, or no track otherwise. The default value is {@code 0}, or {@link C#ROLE_FLAG_SUBTITLE}
@ -1026,23 +1049,27 @@ public class TrackSelectionParameters implements Bundleable {
* is enabled. * is enabled.
*/ */
public final @C.RoleFlags int preferredTextRoleFlags; public final @C.RoleFlags int preferredTextRoleFlags;
/** /**
* Bitmask of selection flags that are ignored for text track selections. See {@link * Bitmask of selection flags that are ignored for text track selections. See {@link
* C.SelectionFlags}. The default value is {@code 0} (i.e., no flags are ignored). * C.SelectionFlags}. The default value is {@code 0} (i.e., no flags are ignored).
*/ */
public final @C.SelectionFlags int ignoredTextSelectionFlags; public final @C.SelectionFlags int ignoredTextSelectionFlags;
/** /**
* Whether a text track with undetermined language should be selected if no track with {@link * Whether a text track with undetermined language should be selected if no track with {@link
* #preferredTextLanguages} is available, or if {@link #preferredTextLanguages} is unset. The * #preferredTextLanguages} is available, or if {@link #preferredTextLanguages} is unset. The
* default value is {@code false}. * default value is {@code false}.
*/ */
public final boolean selectUndeterminedTextLanguage; public final boolean selectUndeterminedTextLanguage;
// General // General
/** /**
* Whether to force selection of the single lowest bitrate audio and video tracks that comply with * Whether to force selection of the single lowest bitrate audio and video tracks that comply with
* all other constraints. The default value is {@code false}. * all other constraints. The default value is {@code false}.
*/ */
public final boolean forceLowestBitrate; public final boolean forceLowestBitrate;
/** /**
* Whether to force selection of the highest bitrate audio and video tracks that comply with all * Whether to force selection of the highest bitrate audio and video tracks that comply with all
* other constraints. The default value is {@code false}. * other constraints. The default value is {@code false}.

View File

@ -374,6 +374,7 @@ public final class Tracks implements Bundleable {
public int hashCode() { public int hashCode() {
return groups.hashCode(); return groups.hashCode();
} }
// Bundleable implementation. // Bundleable implementation.
private static final String FIELD_TRACK_GROUPS = Util.intToStringMaxRadix(0); private static final String FIELD_TRACK_GROUPS = Util.intToStringMaxRadix(0);

View File

@ -56,10 +56,13 @@ public interface VideoFrameProcessor {
@Target(TYPE_USE) @Target(TYPE_USE)
@IntDef({INPUT_TYPE_SURFACE, INPUT_TYPE_BITMAP, INPUT_TYPE_TEXTURE_ID}) @IntDef({INPUT_TYPE_SURFACE, INPUT_TYPE_BITMAP, INPUT_TYPE_TEXTURE_ID})
@interface InputType {} @interface InputType {}
/** Input frames come from a {@link #getInputSurface surface}. */ /** Input frames come from a {@link #getInputSurface surface}. */
int INPUT_TYPE_SURFACE = 1; int INPUT_TYPE_SURFACE = 1;
/** Input frames come from a {@link Bitmap}. */ /** Input frames come from a {@link Bitmap}. */
int INPUT_TYPE_BITMAP = 2; int INPUT_TYPE_BITMAP = 2;
/** /**
* Input frames come from a {@linkplain android.opengl.GLES10#GL_TEXTURE_2D traditional GLES * Input frames come from a {@linkplain android.opengl.GLES10#GL_TEXTURE_2D traditional GLES
* texture}. * texture}.

View File

@ -71,6 +71,7 @@ public final class AudioProcessingPipeline {
/** The {@link AudioProcessor} instances passed to {@link AudioProcessingPipeline}. */ /** The {@link AudioProcessor} instances passed to {@link AudioProcessingPipeline}. */
private final ImmutableList<AudioProcessor> audioProcessors; private final ImmutableList<AudioProcessor> audioProcessors;
/** /**
* The processors that are {@linkplain AudioProcessor#isActive() active} based on the current * The processors that are {@linkplain AudioProcessor#isActive() active} based on the current
* configuration. * configuration.
@ -82,10 +83,13 @@ public final class AudioProcessingPipeline {
* as {@link #activeAudioProcessors}. * as {@link #activeAudioProcessors}.
*/ */
private ByteBuffer[] outputBuffers; private ByteBuffer[] outputBuffers;
/** The {@link AudioFormat} currently being output by the pipeline. */ /** The {@link AudioFormat} currently being output by the pipeline. */
private AudioFormat outputAudioFormat; private AudioFormat outputAudioFormat;
/** The {@link AudioFormat} that will be output following a {@link #flush()}. */ /** The {@link AudioFormat} that will be output following a {@link #flush()}. */
private AudioFormat pendingOutputAudioFormat; private AudioFormat pendingOutputAudioFormat;
/** Whether input has ended, either due to configuration change or end of stream. */ /** Whether input has ended, either due to configuration change or end of stream. */
private boolean inputEnded; private boolean inputEnded;

View File

@ -52,10 +52,13 @@ public interface AudioProcessor {
/** The sample rate in Hertz. */ /** The sample rate in Hertz. */
public final int sampleRate; public final int sampleRate;
/** 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. */
public final @C.PcmEncoding 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;

View File

@ -31,6 +31,7 @@ public abstract class BaseAudioProcessor implements AudioProcessor {
/** The current input audio format. */ /** The current input audio format. */
protected AudioFormat inputAudioFormat; protected AudioFormat inputAudioFormat;
/** The current output audio format. */ /** The current output audio format. */
protected AudioFormat outputAudioFormat; protected AudioFormat outputAudioFormat;

View File

@ -34,6 +34,7 @@ public final class SpeedChangingAudioProcessor extends BaseAudioProcessor {
/** The speed provider that provides the speed for each timestamp. */ /** The speed provider that provides the speed for each timestamp. */
private final SpeedProvider speedProvider; private final SpeedProvider speedProvider;
/** /**
* The {@link SonicAudioProcessor} used to change the speed, when needed. If there is no speed * The {@link SonicAudioProcessor} used to change the speed, when needed. If there is no speed
* change required, the input buffer is copied to the output buffer and this processor is not * change required, the input buffer is copied to the output buffer and this processor is not

View File

@ -44,6 +44,7 @@ public final class CueGroup implements Bundleable {
* <p>This list may be empty if the group represents a state with no cues. * <p>This list may be empty if the group represents a state with no cues.
*/ */
public final ImmutableList<Cue> cues; public final ImmutableList<Cue> cues;
/** /**
* The presentation time of the {@link #cues}, in microseconds. * The presentation time of the {@link #cues}, in microseconds.
* *

View File

@ -56,8 +56,10 @@ public final class EGLSurfaceTexture implements SurfaceTexture.OnFrameAvailableL
/** No secure EGL surface and context required. */ /** No secure EGL surface and context required. */
public static final int SECURE_MODE_NONE = 0; public static final int SECURE_MODE_NONE = 0;
/** Creating a surfaceless, secured EGL context. */ /** Creating a surfaceless, secured EGL context. */
public static final int SECURE_MODE_SURFACELESS_CONTEXT = 1; public static final int SECURE_MODE_SURFACELESS_CONTEXT = 1;
/** Creating a secure surface backed by a pixel buffer. */ /** Creating a secure surface backed by a pixel buffer. */
public static final int SECURE_MODE_PROTECTED_PBUFFER = 2; public static final int SECURE_MODE_PROTECTED_PBUFFER = 2;

View File

@ -38,6 +38,7 @@ public final class GlProgram {
// https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_YUV_target.txt // https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_YUV_target.txt
private static final int GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT = 0x8BE7; private static final int GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT = 0x8BE7;
/** The identifier of a compiled and linked GLSL shader program. */ /** The identifier of a compiled and linked GLSL shader program. */
private final int programId; private final int programId;
@ -367,6 +368,7 @@ public final class GlProgram {
this.texIdValue = texId; this.texIdValue = texId;
this.texUnitIndex = texUnitIndex; this.texUnitIndex = texUnitIndex;
} }
/** Configures {@link #bind()} to use the specified {@code int} {@code value}. */ /** Configures {@link #bind()} to use the specified {@code int} {@code value}. */
public void setInt(int value) { public void setInt(int value) {
this.intValue = value; this.intValue = value;

View File

@ -45,14 +45,19 @@ public final class Log {
@Target(TYPE_USE) @Target(TYPE_USE)
@IntDef({LOG_LEVEL_ALL, LOG_LEVEL_INFO, LOG_LEVEL_WARNING, LOG_LEVEL_ERROR, LOG_LEVEL_OFF}) @IntDef({LOG_LEVEL_ALL, LOG_LEVEL_INFO, LOG_LEVEL_WARNING, LOG_LEVEL_ERROR, LOG_LEVEL_OFF})
public @interface LogLevel {} public @interface LogLevel {}
/** Log level to log all messages. */ /** Log level to log all messages. */
public static final int LOG_LEVEL_ALL = 0; public static final int LOG_LEVEL_ALL = 0;
/** Log level to only log informative, warning and error messages. */ /** Log level to only log informative, warning and error messages. */
public static final int LOG_LEVEL_INFO = 1; public static final int LOG_LEVEL_INFO = 1;
/** Log level to only log warning and error messages. */ /** Log level to only log warning and error messages. */
public static final int LOG_LEVEL_WARNING = 2; public static final int LOG_LEVEL_WARNING = 2;
/** Log level to only log error messages. */ /** Log level to only log error messages. */
public static final int LOG_LEVEL_ERROR = 3; public static final int LOG_LEVEL_ERROR = 3;
/** Log level to disable all logging. */ /** Log level to disable all logging. */
public static final int LOG_LEVEL_OFF = Integer.MAX_VALUE; public static final int LOG_LEVEL_OFF = Integer.MAX_VALUE;

View File

@ -54,26 +54,32 @@ public final class NotificationUtil {
IMPORTANCE_HIGH IMPORTANCE_HIGH
}) })
public @interface Importance {} public @interface Importance {}
/** /**
* @see NotificationManager#IMPORTANCE_UNSPECIFIED * @see NotificationManager#IMPORTANCE_UNSPECIFIED
*/ */
public static final int IMPORTANCE_UNSPECIFIED = NotificationManager.IMPORTANCE_UNSPECIFIED; public static final int IMPORTANCE_UNSPECIFIED = NotificationManager.IMPORTANCE_UNSPECIFIED;
/** /**
* @see NotificationManager#IMPORTANCE_NONE * @see NotificationManager#IMPORTANCE_NONE
*/ */
public static final int IMPORTANCE_NONE = NotificationManager.IMPORTANCE_NONE; public static final int IMPORTANCE_NONE = NotificationManager.IMPORTANCE_NONE;
/** /**
* @see NotificationManager#IMPORTANCE_MIN * @see NotificationManager#IMPORTANCE_MIN
*/ */
public static final int IMPORTANCE_MIN = NotificationManager.IMPORTANCE_MIN; public static final int IMPORTANCE_MIN = NotificationManager.IMPORTANCE_MIN;
/** /**
* @see NotificationManager#IMPORTANCE_LOW * @see NotificationManager#IMPORTANCE_LOW
*/ */
public static final int IMPORTANCE_LOW = NotificationManager.IMPORTANCE_LOW; public static final int IMPORTANCE_LOW = NotificationManager.IMPORTANCE_LOW;
/** /**
* @see NotificationManager#IMPORTANCE_DEFAULT * @see NotificationManager#IMPORTANCE_DEFAULT
*/ */
public static final int IMPORTANCE_DEFAULT = NotificationManager.IMPORTANCE_DEFAULT; public static final int IMPORTANCE_DEFAULT = NotificationManager.IMPORTANCE_DEFAULT;
/** /**
* @see NotificationManager#IMPORTANCE_HIGH * @see NotificationManager#IMPORTANCE_HIGH
*/ */

View File

@ -46,10 +46,13 @@ public final class RepeatModeUtil {
flag = true, flag = true,
value = {REPEAT_TOGGLE_MODE_NONE, REPEAT_TOGGLE_MODE_ONE, REPEAT_TOGGLE_MODE_ALL}) value = {REPEAT_TOGGLE_MODE_NONE, REPEAT_TOGGLE_MODE_ONE, REPEAT_TOGGLE_MODE_ALL})
public @interface RepeatToggleModes {} public @interface RepeatToggleModes {}
/** All repeat mode buttons disabled. */ /** All repeat mode buttons disabled. */
public static final int REPEAT_TOGGLE_MODE_NONE = 0; public static final int REPEAT_TOGGLE_MODE_NONE = 0;
/** "Repeat One" button enabled. */ /** "Repeat One" button enabled. */
public static final int REPEAT_TOGGLE_MODE_ONE = 1; public static final int REPEAT_TOGGLE_MODE_ONE = 1;
/** "Repeat All" button enabled. */ /** "Repeat All" button enabled. */
public static final int REPEAT_TOGGLE_MODE_ALL = 1 << 1; // 2 public static final int REPEAT_TOGGLE_MODE_ALL = 1 << 1; // 2

View File

@ -25,6 +25,7 @@ public final class UriUtil {
/** The length of arrays returned by {@link #getUriIndices(String)}. */ /** The length of arrays returned by {@link #getUriIndices(String)}. */
private static final int INDEX_COUNT = 4; private static final int INDEX_COUNT = 4;
/** /**
* An index into an array returned by {@link #getUriIndices(String)}. * An index into an array returned by {@link #getUriIndices(String)}.
* *
@ -33,6 +34,7 @@ public final class UriUtil {
* including when the URI has no scheme. * including when the URI has no scheme.
*/ */
private static final int SCHEME_COLON = 0; private static final int SCHEME_COLON = 0;
/** /**
* An index into an array returned by {@link #getUriIndices(String)}. * An index into an array returned by {@link #getUriIndices(String)}.
* *
@ -42,6 +44,7 @@ public final class UriUtil {
* authority part is non-empty (in this case the double-slash means the first segment is empty). * authority part is non-empty (in this case the double-slash means the first segment is empty).
*/ */
private static final int PATH = 1; private static final int PATH = 1;
/** /**
* An index into an array returned by {@link #getUriIndices(String)}. * An index into an array returned by {@link #getUriIndices(String)}.
* *
@ -50,6 +53,7 @@ public final class UriUtil {
* single '?' with no data. * single '?' with no data.
*/ */
private static final int QUERY = 2; private static final int QUERY = 2;
/** /**
* An index into an array returned by {@link #getUriIndices(String)}. * An index into an array returned by {@link #getUriIndices(String)}.
* *

View File

@ -35,17 +35,22 @@ public final class MdtaMetadataEntry implements Metadata.Entry {
/** The type indicator for UTF-8 string. */ /** The type indicator for UTF-8 string. */
public static final int TYPE_INDICATOR_STRING = 1; public static final int TYPE_INDICATOR_STRING = 1;
/** The type indicator for Float32. */ /** The type indicator for Float32. */
public static final int TYPE_INDICATOR_FLOAT32 = 23; public static final int TYPE_INDICATOR_FLOAT32 = 23;
/** The type indicator for 32-bit signed integer. */ /** The type indicator for 32-bit signed integer. */
public static final int TYPE_INDICATOR_INT32 = 67; public static final int TYPE_INDICATOR_INT32 = 67;
/** The metadata key name. */ /** The metadata key name. */
public final String key; public final String key;
/** The payload. The interpretation of the value depends on {@link #typeIndicator}. */ /** The payload. The interpretation of the value depends on {@link #typeIndicator}. */
public final byte[] value; public final byte[] value;
/** The four byte locale indicator. */ /** The four byte locale indicator. */
public final int localeIndicator; public final int localeIndicator;
/** The four byte type indicator. */ /** The four byte type indicator. */
public final int typeIndicator; public final int typeIndicator;

View File

@ -31,8 +31,10 @@ public final class Mp4TimestampData implements Metadata.Entry {
/** The creation timestamp. */ /** The creation timestamp. */
public final long creationTimestampSeconds; public final long creationTimestampSeconds;
/** The modification timestamp. */ /** The modification timestamp. */
public final long modificationTimestampSeconds; public final long modificationTimestampSeconds;
/** The timescale of the movie. */ /** The timescale of the movie. */
public final long timescale; public final long timescale;

View File

@ -36,16 +36,22 @@ public final class NalUnitUtil {
/** Coded slice of a non-IDR picture. */ /** Coded slice of a non-IDR picture. */
public static final int NAL_UNIT_TYPE_NON_IDR = 1; public static final int NAL_UNIT_TYPE_NON_IDR = 1;
/** Coded slice data partition A. */ /** Coded slice data partition A. */
public static final int NAL_UNIT_TYPE_PARTITION_A = 2; public static final int NAL_UNIT_TYPE_PARTITION_A = 2;
/** Coded slice of an IDR picture. */ /** Coded slice of an IDR picture. */
public static final int NAL_UNIT_TYPE_IDR = 5; public static final int NAL_UNIT_TYPE_IDR = 5;
/** Supplemental enhancement information. */ /** Supplemental enhancement information. */
public static final int NAL_UNIT_TYPE_SEI = 6; public static final int NAL_UNIT_TYPE_SEI = 6;
/** Sequence parameter set. */ /** Sequence parameter set. */
public static final int NAL_UNIT_TYPE_SPS = 7; public static final int NAL_UNIT_TYPE_SPS = 7;
/** Picture parameter set. */ /** Picture parameter set. */
public static final int NAL_UNIT_TYPE_PPS = 8; public static final int NAL_UNIT_TYPE_PPS = 8;
/** Access unit delimiter. */ /** Access unit delimiter. */
public static final int NAL_UNIT_TYPE_AUD = 9; public static final int NAL_UNIT_TYPE_AUD = 9;
@ -186,6 +192,7 @@ public final class NalUnitUtil {
/** Value for aspect_ratio_idc indicating an extended aspect ratio, in H.264 and H.265 SPSs. */ /** Value for aspect_ratio_idc indicating an extended aspect ratio, in H.264 and H.265 SPSs. */
public static final int EXTENDED_SAR = 0xFF; public static final int EXTENDED_SAR = 0xFF;
/** Aspect ratios indexed by aspect_ratio_idc, in H.264 and H.265 SPSs. */ /** Aspect ratios indexed by aspect_ratio_idc, in H.264 and H.265 SPSs. */
public static final float[] ASPECT_RATIO_IDC_VALUES = public static final float[] ASPECT_RATIO_IDC_VALUES =
new float[] { new float[] {

View File

@ -43,12 +43,16 @@ public final class VersionTable {
/** Returned by {@link #getVersion(SQLiteDatabase, int, String)} if the version is unset. */ /** Returned by {@link #getVersion(SQLiteDatabase, int, String)} if the version is unset. */
public static final int VERSION_UNSET = -1; public static final int VERSION_UNSET = -1;
/** Version of tables used for offline functionality. */ /** Version of tables used for offline functionality. */
public static final int FEATURE_OFFLINE = 0; public static final int FEATURE_OFFLINE = 0;
/** Version of tables used for cache content metadata. */ /** Version of tables used for cache content metadata. */
public static final int FEATURE_CACHE_CONTENT_METADATA = 1; public static final int FEATURE_CACHE_CONTENT_METADATA = 1;
/** Version of tables used for cache file metadata. */ /** Version of tables used for cache file metadata. */
public static final int FEATURE_CACHE_FILE_METADATA = 2; public static final int FEATURE_CACHE_FILE_METADATA = 2;
/** Version of tables used from external features. */ /** Version of tables used from external features. */
public static final int FEATURE_EXTERNAL = 1000; public static final int FEATURE_EXTERNAL = 1000;

View File

@ -259,6 +259,7 @@ public final class DataSpec {
FLAG_MIGHT_NOT_USE_FULL_NETWORK_SPEED FLAG_MIGHT_NOT_USE_FULL_NETWORK_SPEED
}) })
public @interface Flags {} public @interface Flags {}
/** /**
* Allows an underlying network stack to request that the server use gzip compression. * Allows an underlying network stack to request that the server use gzip compression.
* *
@ -271,8 +272,10 @@ public final class DataSpec {
* DataSource#read(byte[], int, int)} will be the decompressed data. * DataSource#read(byte[], int, int)} will be the decompressed data.
*/ */
public static final int FLAG_ALLOW_GZIP = 1; public static final int FLAG_ALLOW_GZIP = 1;
/** Prevents caching if the length cannot be resolved when the {@link DataSource} is opened. */ /** Prevents caching if the length cannot be resolved when the {@link DataSource} is opened. */
public static final int FLAG_DONT_CACHE_IF_LENGTH_UNKNOWN = 1 << 1; public static final int FLAG_DONT_CACHE_IF_LENGTH_UNKNOWN = 1 << 1;
/** /**
* Allows fragmentation of this request into multiple cache files, meaning a cache eviction policy * Allows fragmentation of this request into multiple cache files, meaning a cache eviction policy
* will be able to evict individual fragments of the data. Depending on the cache implementation, * will be able to evict individual fragments of the data. Depending on the cache implementation,
@ -280,6 +283,7 @@ public final class DataSpec {
* whilst writing another). * whilst writing another).
*/ */
public static final int FLAG_ALLOW_CACHE_FRAGMENTATION = 1 << 2; public static final int FLAG_ALLOW_CACHE_FRAGMENTATION = 1 << 2;
/** /**
* Indicates there are known external factors that might prevent the data from being loaded at * Indicates there are known external factors that might prevent the data from being loaded at
* full network speed (e.g. server throttling or unfinished live media chunks). * full network speed (e.g. server throttling or unfinished live media chunks).
@ -295,10 +299,13 @@ public final class DataSpec {
@Target(TYPE_USE) @Target(TYPE_USE)
@IntDef({HTTP_METHOD_GET, HTTP_METHOD_POST, HTTP_METHOD_HEAD}) @IntDef({HTTP_METHOD_GET, HTTP_METHOD_POST, HTTP_METHOD_HEAD})
public @interface HttpMethod {} public @interface HttpMethod {}
/** HTTP GET method. */ /** HTTP GET method. */
public static final int HTTP_METHOD_GET = 1; public static final int HTTP_METHOD_GET = 1;
/** HTTP POST method. */ /** HTTP POST method. */
public static final int HTTP_METHOD_POST = 2; public static final int HTTP_METHOD_POST = 2;
/** HTTP HEAD method. */ /** HTTP HEAD method. */
public static final int HTTP_METHOD_HEAD = 3; public static final int HTTP_METHOD_HEAD = 3;

View File

@ -220,6 +220,7 @@ public class DefaultHttpDataSource extends BaseDataSource implements HttpDataSou
/** The default connection timeout, in milliseconds. */ /** The default connection timeout, in milliseconds. */
@UnstableApi public static final int DEFAULT_CONNECT_TIMEOUT_MILLIS = 8 * 1000; @UnstableApi public static final int DEFAULT_CONNECT_TIMEOUT_MILLIS = 8 * 1000;
/** The default read timeout, in milliseconds. */ /** The default read timeout, in milliseconds. */
@UnstableApi public static final int DEFAULT_READ_TIMEOUT_MILLIS = 8 * 1000; @UnstableApi public static final int DEFAULT_READ_TIMEOUT_MILLIS = 8 * 1000;

View File

@ -204,8 +204,10 @@ public interface HttpDataSource extends DataSource {
/** The error occurred reading data from a {@code HttpDataSource}. */ /** The error occurred reading data from a {@code HttpDataSource}. */
public static final int TYPE_OPEN = 1; public static final int TYPE_OPEN = 1;
/** The error occurred in opening a {@code HttpDataSource}. */ /** The error occurred in opening a {@code HttpDataSource}. */
public static final int TYPE_READ = 2; public static final int TYPE_READ = 2;
/** The error occurred in closing a {@code HttpDataSource}. */ /** The error occurred in closing a {@code HttpDataSource}. */
public static final int TYPE_CLOSE = 3; public static final int TYPE_CLOSE = 3;

View File

@ -122,6 +122,7 @@ public final class CacheDataSink implements DataSink {
/** Default {@code fragmentSize} recommended for caching use cases. */ /** Default {@code fragmentSize} recommended for caching use cases. */
public static final long DEFAULT_FRAGMENT_SIZE = 5 * 1024 * 1024; public static final long DEFAULT_FRAGMENT_SIZE = 5 * 1024 * 1024;
/** Default buffer size in bytes. */ /** Default buffer size in bytes. */
public static final int DEFAULT_BUFFER_SIZE = 20 * 1024; public static final int DEFAULT_BUFFER_SIZE = 20 * 1024;

View File

@ -355,6 +355,7 @@ public final class CacheDataSource implements DataSource {
FLAG_IGNORE_CACHE_FOR_UNSET_LENGTH_REQUESTS FLAG_IGNORE_CACHE_FOR_UNSET_LENGTH_REQUESTS
}) })
public @interface Flags {} public @interface Flags {}
/** /**
* A flag indicating whether we will block reads if the cache key is locked. If unset then data is * A flag indicating whether we will block reads if the cache key is locked. If unset then data is
* read from upstream if the cache key is locked, regardless of whether the data is cached. * read from upstream if the cache key is locked, regardless of whether the data is cached.

View File

@ -26,16 +26,21 @@ public class CacheSpan implements Comparable<CacheSpan> {
/** The cache key that uniquely identifies the resource. */ /** The cache key that uniquely identifies the resource. */
public final String key; public final String key;
/** The position of the {@link CacheSpan} in the resource. */ /** The position of the {@link CacheSpan} in the resource. */
public final long position; public final long position;
/** /**
* The length of the {@link CacheSpan}, or {@link C#LENGTH_UNSET} if this is an open-ended hole. * The length of the {@link CacheSpan}, or {@link C#LENGTH_UNSET} if this is an open-ended hole.
*/ */
public final long length; public final long length;
/** Whether the {@link CacheSpan} is cached. */ /** Whether the {@link CacheSpan} is cached. */
public final boolean isCached; public final boolean isCached;
/** The file corresponding to this {@link CacheSpan}, or null if {@link #isCached} is false. */ /** The file corresponding to this {@link CacheSpan}, or null if {@link #isCached} is false. */
@Nullable public final File file; @Nullable public final File file;
/** The last touch timestamp, or {@link C#TIME_UNSET} if {@link #isCached} is false. */ /** The last touch timestamp, or {@link C#TIME_UNSET} if {@link #isCached} is false. */
public final long lastTouchTimestamp; public final long lastTouchTimestamp;

View File

@ -35,10 +35,13 @@ import java.util.TreeSet;
/** The cache id that uniquely identifies the resource. */ /** The cache id that uniquely identifies the resource. */
public final int id; public final int id;
/** The cache key that uniquely identifies the resource. */ /** The cache key that uniquely identifies the resource. */
public final String key; public final String key;
/** The cached spans of this content. */ /** The cached spans of this content. */
private final TreeSet<SimpleCacheSpan> cachedSpans; private final TreeSet<SimpleCacheSpan> cachedSpans;
/** Currently locked ranges. */ /** Currently locked ranges. */
private final ArrayList<Range> lockedRanges; private final ArrayList<Range> lockedRanges;
@ -280,6 +283,7 @@ import java.util.TreeSet;
/** The starting position of the range. */ /** The starting position of the range. */
public final long position; public final long position;
/** The length of the range, or {@link C#LENGTH_UNSET} if unbounded. */ /** The length of the range, or {@link C#LENGTH_UNSET} if unbounded. */
public final long length; public final long length;

View File

@ -74,6 +74,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
private static final int INCREMENTAL_METADATA_READ_LENGTH = 10 * 1024 * 1024; private static final int INCREMENTAL_METADATA_READ_LENGTH = 10 * 1024 * 1024;
private final HashMap<String, CachedContent> keyToContent; private final HashMap<String, CachedContent> keyToContent;
/** /**
* Maps assigned ids to their corresponding keys. Also contains (id -> null) entries for ids that * Maps assigned ids to their corresponding keys. Also contains (id -> null) entries for ids that
* have been removed from the index since it was last stored. This prevents reuse of these ids, * have been removed from the index since it was last stored. This prevents reuse of these ids,
@ -92,11 +93,13 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
* reuse. * reuse.
*/ */
private final SparseArray<@NullableType String> idToKey; private final SparseArray<@NullableType String> idToKey;
/** /**
* Tracks ids for which (id -> null) entries are present in idToKey, so that they can be removed * Tracks ids for which (id -> null) entries are present in idToKey, so that they can be removed
* efficiently when the index is next stored. * efficiently when the index is next stored.
*/ */
private final SparseBooleanArray removedIds; private final SparseBooleanArray removedIds;
/** Tracks ids that are new since the index was last stored. */ /** Tracks ids that are new since the index was last stored. */
private final SparseBooleanArray newIds; private final SparseBooleanArray newIds;

View File

@ -30,8 +30,10 @@ public interface ContentMetadata {
*/ */
@SuppressWarnings("unused") @SuppressWarnings("unused")
String KEY_CUSTOM_PREFIX = "custom_"; String KEY_CUSTOM_PREFIX = "custom_";
/** Key for redirected uri (type: String). */ /** Key for redirected uri (type: String). */
String KEY_REDIRECTED_URI = "exo_redir"; String KEY_REDIRECTED_URI = "exo_redir";
/** Key for content length in bytes (type: long). */ /** Key for content length in bytes (type: long). */
String KEY_CONTENT_LENGTH = "exo_len"; String KEY_CONTENT_LENGTH = "exo_len";

View File

@ -51,6 +51,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
public final class SimpleCache implements Cache { public final class SimpleCache implements Cache {
private static final String TAG = "SimpleCache"; private static final String TAG = "SimpleCache";
/** /**
* Cache files are distributed between a number of subdirectories. This helps to avoid poor * Cache files are distributed between a number of subdirectories. This helps to avoid poor
* performance in cases where the performance of the underlying file system (e.g. FAT32) scales * performance in cases where the performance of the underlying file system (e.g. FAT32) scales

View File

@ -415,6 +415,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
/** The default connection timeout, in milliseconds. */ /** The default connection timeout, in milliseconds. */
@UnstableApi public static final int DEFAULT_CONNECT_TIMEOUT_MILLIS = 8 * 1000; @UnstableApi public static final int DEFAULT_CONNECT_TIMEOUT_MILLIS = 8 * 1000;
/** The default read timeout, in milliseconds. */ /** The default read timeout, in milliseconds. */
@UnstableApi public static final int DEFAULT_READ_TIMEOUT_MILLIS = 8 * 1000; @UnstableApi public static final int DEFAULT_READ_TIMEOUT_MILLIS = 8 * 1000;

View File

@ -37,18 +37,21 @@ public final class CryptoInfo {
* @see android.media.MediaCodec.CryptoInfo#iv * @see android.media.MediaCodec.CryptoInfo#iv
*/ */
@Nullable public byte[] iv; @Nullable public byte[] iv;
/** /**
* The 16 byte key id. * The 16 byte key id.
* *
* @see android.media.MediaCodec.CryptoInfo#key * @see android.media.MediaCodec.CryptoInfo#key
*/ */
@Nullable public byte[] key; @Nullable public byte[] key;
/** /**
* The type of encryption that has been applied. Must be one of the {@link C.CryptoMode} values. * The type of encryption that has been applied. Must be one of the {@link C.CryptoMode} values.
* *
* @see android.media.MediaCodec.CryptoInfo#mode * @see android.media.MediaCodec.CryptoInfo#mode
*/ */
public @C.CryptoMode 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.
@ -56,6 +59,7 @@ public final class CryptoInfo {
* @see android.media.MediaCodec.CryptoInfo#numBytesOfClearData * @see android.media.MediaCodec.CryptoInfo#numBytesOfClearData
*/ */
@Nullable public int[] numBytesOfClearData; @Nullable public int[] numBytesOfClearData;
/** /**
* The number of trailing encrypted bytes in each sub-sample. If null, all bytes are treated as * The number of trailing encrypted bytes in each sub-sample. If null, all bytes are treated as
* clear and {@link #numBytesOfClearData} must be specified. * clear and {@link #numBytesOfClearData} must be specified.
@ -63,16 +67,19 @@ public final class CryptoInfo {
* @see android.media.MediaCodec.CryptoInfo#numBytesOfEncryptedData * @see android.media.MediaCodec.CryptoInfo#numBytesOfEncryptedData
*/ */
@Nullable public int[] numBytesOfEncryptedData; @Nullable public int[] numBytesOfEncryptedData;
/** /**
* The number of subSamples that make up the buffer's contents. * The number of subSamples that make up the buffer's contents.
* *
* @see android.media.MediaCodec.CryptoInfo#numSubSamples * @see android.media.MediaCodec.CryptoInfo#numSubSamples
*/ */
public int numSubSamples; public int numSubSamples;
/** /**
* @see android.media.MediaCodec.CryptoInfo.Pattern * @see android.media.MediaCodec.CryptoInfo.Pattern
*/ */
public int encryptedBlocks; public int encryptedBlocks;
/** /**
* @see android.media.MediaCodec.CryptoInfo.Pattern * @see android.media.MediaCodec.CryptoInfo.Pattern
*/ */

View File

@ -47,6 +47,7 @@ public class DecoderInputBuffer extends Buffer {
/** The current capacity of the buffer. */ /** The current capacity of the buffer. */
public final int currentCapacity; public final int currentCapacity;
/** The required capacity of the buffer. */ /** The required capacity of the buffer. */
public final int requiredCapacity; public final int requiredCapacity;
@ -78,10 +79,13 @@ public class DecoderInputBuffer extends Buffer {
BUFFER_REPLACEMENT_MODE_DIRECT BUFFER_REPLACEMENT_MODE_DIRECT
}) })
public @interface BufferReplacementMode {} public @interface BufferReplacementMode {}
/** Disallows buffer replacement. */ /** Disallows buffer replacement. */
public static final int BUFFER_REPLACEMENT_MODE_DISABLED = 0; public static final int BUFFER_REPLACEMENT_MODE_DISABLED = 0;
/** Allows buffer replacement using {@link ByteBuffer#allocate(int)}. */ /** Allows buffer replacement using {@link ByteBuffer#allocate(int)}. */
public static final int BUFFER_REPLACEMENT_MODE_NORMAL = 1; public static final int BUFFER_REPLACEMENT_MODE_NORMAL = 1;
/** Allows buffer replacement using {@link ByteBuffer#allocateDirect(int)}. */ /** Allows buffer replacement using {@link ByteBuffer#allocateDirect(int)}. */
public static final int BUFFER_REPLACEMENT_MODE_DIRECT = 2; public static final int BUFFER_REPLACEMENT_MODE_DIRECT = 2;

View File

@ -35,11 +35,13 @@ public class VideoDecoderOutputBuffer extends DecoderOutputBuffer {
/** Output mode. */ /** Output mode. */
public @C.VideoOutputMode 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;
public int width; public int width;
public int height; public int height;
/** The format of the input from which this output buffer was decoded. */ /** The format of the input from which this output buffer was decoded. */
@Nullable public Format format; @Nullable public Format format;

View File

@ -47,6 +47,7 @@ public class Libgav1VideoRenderer extends DecoderVideoRenderer {
private static final String TAG = "Libgav1VideoRenderer"; private static final String TAG = "Libgav1VideoRenderer";
private static final int DEFAULT_NUM_OF_INPUT_BUFFERS = 4; private static final int DEFAULT_NUM_OF_INPUT_BUFFERS = 4;
private static final int DEFAULT_NUM_OF_OUTPUT_BUFFERS = 4; private static final int DEFAULT_NUM_OF_OUTPUT_BUFFERS = 4;
/** /**
* Default input buffer size in bytes, based on 720p resolution video compressed by a factor of * Default input buffer size in bytes, based on 720p resolution video compressed by a factor of
* two. * two.
@ -56,6 +57,7 @@ public class Libgav1VideoRenderer extends DecoderVideoRenderer {
/** The number of input buffers. */ /** The number of input buffers. */
private final int numInputBuffers; private final int numInputBuffers;
/** /**
* The number of output buffers. The renderer may limit the minimum possible value due to * The number of output buffers. The renderer may limit the minimum possible value due to
* requiring multiple output buffers to be dequeued at a time for it to make progress. * requiring multiple output buffers to be dequeued at a time for it to make progress.

View File

@ -44,6 +44,7 @@ public final class FfmpegAudioRenderer extends DecoderAudioRenderer<FfmpegAudioD
/** The number of input and output buffers. */ /** The number of input and output buffers. */
private static final int NUM_BUFFERS = 16; private static final int NUM_BUFFERS = 16;
/** The default input buffer size. */ /** The default input buffer size. */
private static final int DEFAULT_INPUT_BUFFER_SIZE = 960 * 6; private static final int DEFAULT_INPUT_BUFFER_SIZE = 960 * 6;

View File

@ -41,12 +41,16 @@ import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
/** The number of channels output by the decoder. */ /** The number of channels output by the decoder. */
public static final int NUM_OUTPUT_CHANNELS = 2; public static final int NUM_OUTPUT_CHANNELS = 2;
/** The default input buffer count. */ /** The default input buffer count. */
public static final int DEFAULT_INPUT_BUFFER_COUNT = 16; public static final int DEFAULT_INPUT_BUFFER_COUNT = 16;
/** The default output buffer count. */ /** The default output buffer count. */
public static final int DEFAULT_OUTPUT_BUFFER_COUNT = 16; public static final int DEFAULT_OUTPUT_BUFFER_COUNT = 16;
/** The standard number of MIDI channels. */ /** The standard number of MIDI channels. */
public static final int CHANNEL_COUNT = 16; public static final int CHANNEL_COUNT = 16;
/** The default sample rate, measured in Hertz. */ /** The default sample rate, measured in Hertz. */
public static final int DEFAULT_SAMPLE_RATE = 44100; public static final int DEFAULT_SAMPLE_RATE = 44100;

View File

@ -63,6 +63,7 @@ public final class MidiRenderer extends DecoderAudioRenderer<MidiDecoder> {
throws MidiDecoderException { throws MidiDecoderException {
return new MidiDecoder(context); return new MidiDecoder(context);
} }
/** /**
* {@inheritDoc} * {@inheritDoc}
* *

View File

@ -32,6 +32,7 @@ import androidx.media3.common.util.UnstableApi;
/** The length of a MIDI event message in bytes. */ /** The length of a MIDI event message in bytes. */
public static final int MIDI_MESSAGE_LENGTH_BYTES = 3; public static final int MIDI_MESSAGE_LENGTH_BYTES = 3;
/** A default or unset data value. */ /** A default or unset data value. */
public static final int DATA_FIELD_UNSET = Integer.MIN_VALUE; public static final int DATA_FIELD_UNSET = Integer.MIN_VALUE;

View File

@ -35,8 +35,10 @@ import androidx.media3.exoplayer.audio.DecoderAudioRenderer;
public class LibopusAudioRenderer extends DecoderAudioRenderer<OpusDecoder> { public class LibopusAudioRenderer extends DecoderAudioRenderer<OpusDecoder> {
private static final String TAG = "LibopusAudioRenderer"; private static final String TAG = "LibopusAudioRenderer";
/** The number of input and output buffers. */ /** The number of input and output buffers. */
private static final int NUM_BUFFERS = 16; private static final int NUM_BUFFERS = 16;
/** The default input buffer size. */ /** The default input buffer size. */
private static final int DEFAULT_INPUT_BUFFER_SIZE = 960 * 6; private static final int DEFAULT_INPUT_BUFFER_SIZE = 960 * 6;

View File

@ -41,11 +41,13 @@ public class LibvpxVideoRenderer extends DecoderVideoRenderer {
/** The number of input buffers. */ /** The number of input buffers. */
private final int numInputBuffers; private final int numInputBuffers;
/** /**
* The number of output buffers. The renderer may limit the minimum possible value due to * The number of output buffers. The renderer may limit the minimum possible value due to
* requiring multiple output buffers to be dequeued at a time for it to make progress. * requiring multiple output buffers to be dequeued at a time for it to make progress.
*/ */
private final int numOutputBuffers; private final int numOutputBuffers;
/** /**
* The default input buffer size. The value is based on <a * The default input buffer size. The value is based on <a
* href="https://android.googlesource.com/platform/frameworks/av/+/d42b90c5183fbd9d6a28d9baee613fddbf8131d6/media/libstagefright/codecs/on2/dec/SoftVPX.cpp">SoftVPX.cpp</a>. * href="https://android.googlesource.com/platform/frameworks/av/+/d42b90c5183fbd9d6a28d9baee613fddbf8131d6/media/libstagefright/codecs/on2/dec/SoftVPX.cpp">SoftVPX.cpp</a>.

View File

@ -60,11 +60,13 @@ public final class DefaultVideoFrameProcessorVideoFrameRenderingTest {
private static final int WIDTH = 200; private static final int WIDTH = 200;
private static final int HEIGHT = 100; private static final int HEIGHT = 100;
/** /**
* Time to wait between rendering frames to avoid frame drops between GL and the {@link * Time to wait between rendering frames to avoid frame drops between GL and the {@link
* ImageReader}. * ImageReader}.
*/ */
private static final long PER_FRAME_RENDERING_WAIT_TIME_MS = 1000L; private static final long PER_FRAME_RENDERING_WAIT_TIME_MS = 1000L;
/** Maximum time to wait for each rendered frame to be notified. */ /** Maximum time to wait for each rendered frame to be notified. */
private static final long PER_FRAME_TIMEOUT_MS = 5000L; private static final long PER_FRAME_TIMEOUT_MS = 5000L;

View File

@ -101,27 +101,34 @@ import java.util.List;
/** The {@link MatrixTransformation MatrixTransformations} to apply. */ /** The {@link MatrixTransformation MatrixTransformations} to apply. */
private final ImmutableList<GlMatrixTransformation> matrixTransformations; private final ImmutableList<GlMatrixTransformation> matrixTransformations;
/** The {@link RgbMatrix RgbMatrices} to apply. */ /** The {@link RgbMatrix RgbMatrices} to apply. */
private final ImmutableList<RgbMatrix> rgbMatrices; private final ImmutableList<RgbMatrix> rgbMatrices;
/** Whether the frame is in HDR or not. */ /** Whether the frame is in HDR or not. */
private final boolean useHdr; private final boolean useHdr;
/** /**
* The transformation matrices provided by the {@link MatrixTransformation MatrixTransformations} * The transformation matrices provided by the {@link MatrixTransformation MatrixTransformations}
* for the most recent frame. * for the most recent frame.
*/ */
private final float[][] transformationMatrixCache; private final float[][] transformationMatrixCache;
/** The RGB matrices provided by the {@link RgbMatrix RgbMatrices} for the most recent frame. */ /** The RGB matrices provided by the {@link RgbMatrix RgbMatrices} for the most recent frame. */
private final float[][] rgbMatrixCache; private final float[][] rgbMatrixCache;
/** /**
* The product of the {@link #transformationMatrixCache} for the most recent frame, to be applied * The product of the {@link #transformationMatrixCache} for the most recent frame, to be applied
* in the vertex shader. * in the vertex shader.
*/ */
private final float[] compositeTransformationMatrixArray; private final float[] compositeTransformationMatrixArray;
/** /**
* The product of the {@link #rgbMatrixCache} for the most recent frame, to be applied in the * The product of the {@link #rgbMatrixCache} for the most recent frame, to be applied in the
* fragment shader. * fragment shader.
*/ */
private final float[] compositeRgbMatrixArray; private final float[] compositeRgbMatrixArray;
/** Matrix for storing an intermediate calculation result. */ /** Matrix for storing an intermediate calculation result. */
private final float[] tempResultMatrix; private final float[] tempResultMatrix;

View File

@ -297,6 +297,7 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor {
// Shader programs that apply Effects. // Shader programs that apply Effects.
private final List<GlShaderProgram> intermediateGlShaderPrograms; private final List<GlShaderProgram> intermediateGlShaderPrograms;
// Whether DefaultVideoFrameProcessor is currently processing an input stream. // Whether DefaultVideoFrameProcessor is currently processing an input stream.
@GuardedBy("lock") @GuardedBy("lock")
private boolean processingInput; private boolean processingInput;

View File

@ -44,6 +44,7 @@ import java.util.concurrent.atomic.AtomicInteger;
private static final String TAG = "ExtTexMgr"; private static final String TAG = "ExtTexMgr";
private static final String TIMER_THREAD_NAME = "ExtTexMgr:Timer"; private static final String TIMER_THREAD_NAME = "ExtTexMgr:Timer";
/** /**
* The time out in milliseconds after calling signalEndOfCurrentInputStream after which the input * The time out in milliseconds after calling signalEndOfCurrentInputStream after which the input
* stream is considered to have ended, even if not all expected frames have been received from the * stream is considered to have ended, even if not all expected frames have been received from the

View File

@ -101,8 +101,10 @@ public class HslAdjustment implements GlEffect {
/** Indicates the hue adjustment in degrees. */ /** Indicates the hue adjustment in degrees. */
public final float hueAdjustmentDegrees; public final float hueAdjustmentDegrees;
/** Indicates the saturation adjustment. */ /** Indicates the saturation adjustment. */
public final float saturationAdjustment; public final float saturationAdjustment;
/** Indicates the lightness adjustment. */ /** Indicates the lightness adjustment. */
public final float lightnessAdjustment; public final float lightnessAdjustment;

View File

@ -1,4 +1,5 @@
package androidx.media3.effect; package androidx.media3.effect;
/* /*
* Copyright 2022 The Android Open Source Project * Copyright 2022 The Android Open Source Project
* *

View File

@ -55,6 +55,7 @@ public final class Presentation implements MatrixTransformation {
@Target(TYPE_USE) @Target(TYPE_USE)
@IntDef({LAYOUT_SCALE_TO_FIT, LAYOUT_SCALE_TO_FIT_WITH_CROP, LAYOUT_STRETCH_TO_FIT}) @IntDef({LAYOUT_SCALE_TO_FIT, LAYOUT_SCALE_TO_FIT_WITH_CROP, LAYOUT_STRETCH_TO_FIT})
public @interface Layout {} public @interface Layout {}
/** /**
* Empty pixels added above and below the input frame (for letterboxing), or to the left and right * Empty pixels added above and below the input frame (for letterboxing), or to the left and right
* of the input frame (for pillarboxing), until the desired aspect ratio is achieved. All input * of the input frame (for pillarboxing), until the desired aspect ratio is achieved. All input
@ -70,6 +71,7 @@ public final class Presentation implements MatrixTransformation {
* </ul> * </ul>
*/ */
public static final int LAYOUT_SCALE_TO_FIT = 0; public static final int LAYOUT_SCALE_TO_FIT = 0;
/** /**
* Pixels cropped from the input frame, until the desired aspect ratio is achieved. Pixels may be * Pixels cropped from the input frame, until the desired aspect ratio is achieved. Pixels may be
* cropped either from the bottom and top, or from the left and right sides, of the input frame. * cropped either from the bottom and top, or from the left and right sides, of the input frame.
@ -84,6 +86,7 @@ public final class Presentation implements MatrixTransformation {
* </ul> * </ul>
*/ */
public static final int LAYOUT_SCALE_TO_FIT_WITH_CROP = 1; public static final int LAYOUT_SCALE_TO_FIT_WITH_CROP = 1;
/** /**
* Frame stretched larger on the x or y axes to fit the desired aspect ratio. * Frame stretched larger on the x or y axes to fit the desired aspect ratio.
* *

View File

@ -48,6 +48,7 @@ public class RgbFilter implements RgbMatrix {
}; };
private final int colorFilter; private final int colorFilter;
/** /**
* Ensures that the usage of HDR is consistent. {@code null} indicates that HDR has not yet been * Ensures that the usage of HDR is consistent. {@code null} indicates that HDR has not yet been
* set. * set.

View File

@ -97,8 +97,10 @@ public final class ScaleAndRotateTransformation implements MatrixTransformation
/** The multiplier by which the frame will scale horizontally, along the x-axis. */ /** The multiplier by which the frame will scale horizontally, along the x-axis. */
public final float scaleX; public final float scaleX;
/** The multiplier by which the frame will scale vertically, along the y-axis. */ /** The multiplier by which the frame will scale vertically, along the y-axis. */
public final float scaleY; public final float scaleY;
/** /**
* The counterclockwise rotation, in degrees. The value should always be between 0 (included) and * The counterclockwise rotation, in degrees. The value should always be between 0 (included) and
* 360 degrees (excluded). * 360 degrees (excluded).

View File

@ -71,10 +71,13 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
PLAYER_COMMAND_PLAY_WHEN_READY, PLAYER_COMMAND_PLAY_WHEN_READY,
}) })
public @interface PlayerCommand {} public @interface PlayerCommand {}
/** Do not play. */ /** Do not play. */
public static final int PLAYER_COMMAND_DO_NOT_PLAY = -1; public static final int PLAYER_COMMAND_DO_NOT_PLAY = -1;
/** Do not play now. Wait for callback to play. */ /** Do not play now. Wait for callback to play. */
public static final int PLAYER_COMMAND_WAIT_FOR_CALLBACK = 0; public static final int PLAYER_COMMAND_WAIT_FOR_CALLBACK = 0;
/** Play freely. */ /** Play freely. */
public static final int PLAYER_COMMAND_PLAY_WHEN_READY = 1; public static final int PLAYER_COMMAND_PLAY_WHEN_READY = 1;
@ -89,12 +92,16 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
AUDIO_FOCUS_STATE_LOSS_TRANSIENT_DUCK AUDIO_FOCUS_STATE_LOSS_TRANSIENT_DUCK
}) })
private @interface AudioFocusState {} private @interface AudioFocusState {}
/** No audio focus is currently being held. */ /** No audio focus is currently being held. */
private static final int AUDIO_FOCUS_STATE_NO_FOCUS = 0; private static final int AUDIO_FOCUS_STATE_NO_FOCUS = 0;
/** The requested audio focus is currently held. */ /** The requested audio focus is currently held. */
private static final int AUDIO_FOCUS_STATE_HAVE_FOCUS = 1; private static final int AUDIO_FOCUS_STATE_HAVE_FOCUS = 1;
/** Audio focus has been temporarily lost. */ /** Audio focus has been temporarily lost. */
private static final int AUDIO_FOCUS_STATE_LOSS_TRANSIENT = 2; private static final int AUDIO_FOCUS_STATE_LOSS_TRANSIENT = 2;
/** Audio focus has been temporarily lost, but playback may continue with reduced volume. */ /** Audio focus has been temporarily lost, but playback may continue with reduced volume. */
private static final int AUDIO_FOCUS_STATE_LOSS_TRANSIENT_DUCK = 3; private static final int AUDIO_FOCUS_STATE_LOSS_TRANSIENT_DUCK = 3;
@ -114,24 +121,29 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
AUDIOFOCUS_GAIN_TRANSIENT_EXCLUSIVE AUDIOFOCUS_GAIN_TRANSIENT_EXCLUSIVE
}) })
private @interface AudioFocusGain {} private @interface AudioFocusGain {}
/** /**
* @see AudioManager#AUDIOFOCUS_NONE * @see AudioManager#AUDIOFOCUS_NONE
*/ */
@SuppressWarnings("InlinedApi") @SuppressWarnings("InlinedApi")
private static final int AUDIOFOCUS_NONE = AudioManager.AUDIOFOCUS_NONE; private static final int AUDIOFOCUS_NONE = AudioManager.AUDIOFOCUS_NONE;
/** /**
* @see AudioManager#AUDIOFOCUS_GAIN * @see AudioManager#AUDIOFOCUS_GAIN
*/ */
private static final int AUDIOFOCUS_GAIN = AudioManager.AUDIOFOCUS_GAIN; private static final int AUDIOFOCUS_GAIN = AudioManager.AUDIOFOCUS_GAIN;
/** /**
* @see AudioManager#AUDIOFOCUS_GAIN_TRANSIENT * @see AudioManager#AUDIOFOCUS_GAIN_TRANSIENT
*/ */
private static final int AUDIOFOCUS_GAIN_TRANSIENT = AudioManager.AUDIOFOCUS_GAIN_TRANSIENT; private static final int AUDIOFOCUS_GAIN_TRANSIENT = AudioManager.AUDIOFOCUS_GAIN_TRANSIENT;
/** /**
* @see AudioManager#AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK * @see AudioManager#AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK
*/ */
private static final int AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK = private static final int AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK =
AudioManager.AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK; AudioManager.AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK;
/** /**
* @see AudioManager#AUDIOFOCUS_GAIN_TRANSIENT_EXCLUSIVE * @see AudioManager#AUDIOFOCUS_GAIN_TRANSIENT_EXCLUSIVE
*/ */

View File

@ -32,18 +32,23 @@ public final class DecoderCounters {
/** The number of times a decoder has been initialized. */ /** The number of times a decoder has been initialized. */
public int decoderInitCount; public int decoderInitCount;
/** The number of times a decoder has been released. */ /** The number of times a decoder has been released. */
public int decoderReleaseCount; public int decoderReleaseCount;
/** The number of input buffers queued to the decoder. */ /** The number of input buffers queued to the decoder. */
public int queuedInputBufferCount; public int queuedInputBufferCount;
/** /**
* The number of skipped input buffers. * The number of skipped input buffers.
* *
* <p>A skipped input buffer is an input buffer that was deliberately not queued to the decoder. * <p>A skipped input buffer is an input buffer that was deliberately not queued to the decoder.
*/ */
public int skippedInputBufferCount; public int skippedInputBufferCount;
/** The number of rendered output buffers. */ /** The number of rendered output buffers. */
public int renderedOutputBufferCount; public int renderedOutputBufferCount;
/** /**
* The number of skipped output buffers. * The number of skipped output buffers.
* *
@ -52,6 +57,7 @@ public final class DecoderCounters {
* the codec due to a flush. * the codec due to a flush.
*/ */
public int skippedOutputBufferCount; public int skippedOutputBufferCount;
/** /**
* The number of dropped buffers. * The number of dropped buffers.
* *
@ -62,6 +68,7 @@ public final class DecoderCounters {
* being queued to the decoder. * being queued to the decoder.
*/ */
public int droppedBufferCount; public int droppedBufferCount;
/** /**
* The number of input buffers dropped. * The number of input buffers dropped.
* *
@ -69,12 +76,14 @@ public final class DecoderCounters {
* be rendered in time. * be rendered in time.
*/ */
public int droppedInputBufferCount; public int droppedInputBufferCount;
/** /**
* The maximum number of dropped buffers without an interleaving rendered output buffer. * The maximum number of dropped buffers without an interleaving rendered output buffer.
* *
* <p>Skipped buffers are ignored for the purposes of calculating this value. * <p>Skipped buffers are ignored for the purposes of calculating this value.
*/ */
public int maxConsecutiveDroppedBufferCount; public int maxConsecutiveDroppedBufferCount;
/** /**
* The number of times all buffers to a keyframe were dropped. * The number of times all buffers to a keyframe were dropped.
* *
@ -90,6 +99,7 @@ public final class DecoderCounters {
* </ul> * </ul>
*/ */
public int droppedToKeyframeCount; public int droppedToKeyframeCount;
/** /**
* The sum of the video frame processing offsets in microseconds. * The sum of the video frame processing offsets in microseconds.
* *
@ -103,6 +113,7 @@ public final class DecoderCounters {
* updating it directly. * updating it directly.
*/ */
public long totalVideoFrameProcessingOffsetUs; public long totalVideoFrameProcessingOffsetUs;
/** /**
* The number of video frame processing offsets added. * The number of video frame processing offsets added.
* *

View File

@ -47,15 +47,19 @@ public final class DecoderReuseEvaluation {
REUSE_RESULT_YES_WITHOUT_RECONFIGURATION REUSE_RESULT_YES_WITHOUT_RECONFIGURATION
}) })
public @interface DecoderReuseResult {} public @interface DecoderReuseResult {}
/** The decoder cannot be reused. */ /** The decoder cannot be reused. */
public static final int REUSE_RESULT_NO = 0; public static final int REUSE_RESULT_NO = 0;
/** The decoder can be reused, but must be flushed. */ /** The decoder can be reused, but must be flushed. */
public static final int REUSE_RESULT_YES_WITH_FLUSH = 1; public static final int REUSE_RESULT_YES_WITH_FLUSH = 1;
/** /**
* The decoder can be reused. It does not need to be flushed, but must be reconfigured by * The decoder can be reused. It does not need to be flushed, but must be reconfigured by
* prefixing the next input buffer with the new format's configuration data. * prefixing the next input buffer with the new format's configuration data.
*/ */
public static final int REUSE_RESULT_YES_WITH_RECONFIGURATION = 2; public static final int REUSE_RESULT_YES_WITH_RECONFIGURATION = 2;
/** The decoder can be kept. It does not need to be flushed and no reconfiguration is required. */ /** The decoder can be kept. It does not need to be flushed and no reconfiguration is required. */
public static final int REUSE_RESULT_YES_WITHOUT_RECONFIGURATION = 3; public static final int REUSE_RESULT_YES_WITHOUT_RECONFIGURATION = 3;
@ -87,34 +91,49 @@ public final class DecoderReuseEvaluation {
/** Decoder reuse is not implemented. */ /** Decoder reuse is not implemented. */
public static final int DISCARD_REASON_REUSE_NOT_IMPLEMENTED = 1 << 0; public static final int DISCARD_REASON_REUSE_NOT_IMPLEMENTED = 1 << 0;
/** Decoder reuse is disabled by a workaround. */ /** Decoder reuse is disabled by a workaround. */
public static final int DISCARD_REASON_WORKAROUND = 1 << 1; public static final int DISCARD_REASON_WORKAROUND = 1 << 1;
/** Decoder reuse is disabled by overriding behavior in application code. */ /** Decoder reuse is disabled by overriding behavior in application code. */
public static final int DISCARD_REASON_APP_OVERRIDE = 1 << 2; public static final int DISCARD_REASON_APP_OVERRIDE = 1 << 2;
/** The sample MIME type is changing. */ /** The sample MIME type is changing. */
public static final int DISCARD_REASON_MIME_TYPE_CHANGED = 1 << 3; public static final int DISCARD_REASON_MIME_TYPE_CHANGED = 1 << 3;
/** The codec's operating rate is changing. */ /** The codec's operating rate is changing. */
public static final int DISCARD_REASON_OPERATING_RATE_CHANGED = 1 << 4; public static final int DISCARD_REASON_OPERATING_RATE_CHANGED = 1 << 4;
/** The format initialization data is changing. */ /** The format initialization data is changing. */
public static final int DISCARD_REASON_INITIALIZATION_DATA_CHANGED = 1 << 5; public static final int DISCARD_REASON_INITIALIZATION_DATA_CHANGED = 1 << 5;
/** The new format may exceed the decoder's configured maximum sample size, in bytes. */ /** The new format may exceed the decoder's configured maximum sample size, in bytes. */
public static final int DISCARD_REASON_MAX_INPUT_SIZE_EXCEEDED = 1 << 6; public static final int DISCARD_REASON_MAX_INPUT_SIZE_EXCEEDED = 1 << 6;
/** The DRM session is changing. */ /** The DRM session is changing. */
public static final int DISCARD_REASON_DRM_SESSION_CHANGED = 1 << 7; public static final int DISCARD_REASON_DRM_SESSION_CHANGED = 1 << 7;
/** The new format may exceed the decoder's configured maximum resolution. */ /** The new format may exceed the decoder's configured maximum resolution. */
public static final int DISCARD_REASON_VIDEO_MAX_RESOLUTION_EXCEEDED = 1 << 8; public static final int DISCARD_REASON_VIDEO_MAX_RESOLUTION_EXCEEDED = 1 << 8;
/** The video resolution is changing. */ /** The video resolution is changing. */
public static final int DISCARD_REASON_VIDEO_RESOLUTION_CHANGED = 1 << 9; public static final int DISCARD_REASON_VIDEO_RESOLUTION_CHANGED = 1 << 9;
/** The video rotation is changing. */ /** The video rotation is changing. */
public static final int DISCARD_REASON_VIDEO_ROTATION_CHANGED = 1 << 10; public static final int DISCARD_REASON_VIDEO_ROTATION_CHANGED = 1 << 10;
/** The video {@link ColorInfo} is changing. */ /** The video {@link ColorInfo} is changing. */
public static final int DISCARD_REASON_VIDEO_COLOR_INFO_CHANGED = 1 << 11; public static final int DISCARD_REASON_VIDEO_COLOR_INFO_CHANGED = 1 << 11;
/** The audio channel count is changing. */ /** The audio channel count is changing. */
public static final int DISCARD_REASON_AUDIO_CHANNEL_COUNT_CHANGED = 1 << 12; public static final int DISCARD_REASON_AUDIO_CHANNEL_COUNT_CHANGED = 1 << 12;
/** The audio sample rate is changing. */ /** The audio sample rate is changing. */
public static final int DISCARD_REASON_AUDIO_SAMPLE_RATE_CHANGED = 1 << 13; public static final int DISCARD_REASON_AUDIO_SAMPLE_RATE_CHANGED = 1 << 13;
/** The audio encoding is changing. */ /** The audio encoding is changing. */
public static final int DISCARD_REASON_AUDIO_ENCODING_CHANGED = 1 << 14; public static final int DISCARD_REASON_AUDIO_ENCODING_CHANGED = 1 << 14;
/** The audio bypass mode is possible. */ /** The audio bypass mode is possible. */
public static final int DISCARD_REASON_AUDIO_BYPASS_POSSIBLE = 1 << 15; public static final int DISCARD_REASON_AUDIO_BYPASS_POSSIBLE = 1 << 15;

View File

@ -68,8 +68,10 @@ public class DefaultRenderersFactory implements RenderersFactory {
@Target(TYPE_USE) @Target(TYPE_USE)
@IntDef({EXTENSION_RENDERER_MODE_OFF, EXTENSION_RENDERER_MODE_ON, EXTENSION_RENDERER_MODE_PREFER}) @IntDef({EXTENSION_RENDERER_MODE_OFF, EXTENSION_RENDERER_MODE_ON, EXTENSION_RENDERER_MODE_PREFER})
public @interface ExtensionRendererMode {} public @interface ExtensionRendererMode {}
/** Do not allow use of extension renderers. */ /** Do not allow use of extension renderers. */
public static final int EXTENSION_RENDERER_MODE_OFF = 0; public static final int EXTENSION_RENDERER_MODE_OFF = 0;
/** /**
* Allow use of extension renderers. Extension renderers are indexed after core renderers of the * Allow use of extension renderers. Extension renderers are indexed after core renderers of the
* same type. A {@link TrackSelector} that prefers the first suitable renderer will therefore * same type. A {@link TrackSelector} that prefers the first suitable renderer will therefore
@ -77,6 +79,7 @@ public class DefaultRenderersFactory implements RenderersFactory {
* given track. * given track.
*/ */
public static final int EXTENSION_RENDERER_MODE_ON = 1; public static final int EXTENSION_RENDERER_MODE_ON = 1;
/** /**
* Allow use of extension renderers. Extension renderers are indexed before core renderers of the * Allow use of extension renderers. Extension renderers are indexed before core renderers of the
* same type. A {@link TrackSelector} that prefers the first suitable renderer will therefore * same type. A {@link TrackSelector} that prefers the first suitable renderer will therefore

View File

@ -58,24 +58,28 @@ public final class ExoPlaybackException extends PlaybackException {
@Target({FIELD, METHOD, PARAMETER, LOCAL_VARIABLE, TYPE_USE}) @Target({FIELD, METHOD, PARAMETER, LOCAL_VARIABLE, TYPE_USE})
@IntDef({TYPE_SOURCE, TYPE_RENDERER, TYPE_UNEXPECTED, TYPE_REMOTE}) @IntDef({TYPE_SOURCE, TYPE_RENDERER, TYPE_UNEXPECTED, TYPE_REMOTE})
public @interface Type {} public @interface Type {}
/** /**
* The error occurred loading data from a {@link MediaSource}. * The error occurred loading data from a {@link MediaSource}.
* *
* <p>Call {@link #getSourceException()} to retrieve the underlying cause. * <p>Call {@link #getSourceException()} to retrieve the underlying cause.
*/ */
@UnstableApi public static final int TYPE_SOURCE = 0; @UnstableApi public static final int TYPE_SOURCE = 0;
/** /**
* The error occurred in a {@link Renderer}. * The error occurred in a {@link Renderer}.
* *
* <p>Call {@link #getRendererException()} to retrieve the underlying cause. * <p>Call {@link #getRendererException()} to retrieve the underlying cause.
*/ */
@UnstableApi public static final int TYPE_RENDERER = 1; @UnstableApi public static final int TYPE_RENDERER = 1;
/** /**
* The error was an unexpected {@link RuntimeException}. * The error was an unexpected {@link RuntimeException}.
* *
* <p>Call {@link #getUnexpectedException()} to retrieve the underlying cause. * <p>Call {@link #getUnexpectedException()} to retrieve the underlying cause.
*/ */
@UnstableApi public static final int TYPE_UNEXPECTED = 2; @UnstableApi public static final int TYPE_UNEXPECTED = 2;
/** /**
* The error occurred in a remote component. * The error occurred in a remote component.
* *

View File

@ -143,6 +143,7 @@ import java.util.concurrent.TimeoutException;
* operation. * operation.
*/ */
/* package */ final TrackSelectorResult emptyTrackSelectorResult; /* package */ final TrackSelectorResult emptyTrackSelectorResult;
/* package */ final Commands permanentAvailableCommands; /* package */ final Commands permanentAvailableCommands;
private final ConditionVariable constructorFinished; private final ConditionVariable constructorFinished;

View File

@ -169,6 +169,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
private static final int ACTIVE_INTERVAL_MS = 10; private static final int ACTIVE_INTERVAL_MS = 10;
private static final int IDLE_INTERVAL_MS = 1000; private static final int IDLE_INTERVAL_MS = 1000;
/** /**
* Duration for which the player needs to appear stuck before the playback is failed on the * Duration for which the player needs to appear stuck before the playback is failed on the
* assumption that no further progress will be made. To appear stuck, the player's renderers must * assumption that no further progress will be made. To appear stuck, the player's renderers must
@ -176,6 +177,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
* to load it. * to load it.
*/ */
private static final long PLAYBACK_STUCK_AFTER_MS = 4000; private static final long PLAYBACK_STUCK_AFTER_MS = 4000;
/** /**
* Threshold under which a buffered duration is assumed to be empty. We cannot use zero to account * Threshold under which a buffered duration is assumed to be empty. We cannot use zero to account
* for buffers currently hold but not played by the renderer. * for buffers currently hold but not played by the renderer.

View File

@ -54,10 +54,13 @@ public final class ExoTimeoutException extends RuntimeException {
/** The operation where this error occurred is not defined. */ /** The operation where this error occurred is not defined. */
public static final int TIMEOUT_OPERATION_UNDEFINED = 0; public static final int TIMEOUT_OPERATION_UNDEFINED = 0;
/** The error occurred in {@link Player#release}. */ /** The error occurred in {@link Player#release}. */
public static final int TIMEOUT_OPERATION_RELEASE = 1; public static final int TIMEOUT_OPERATION_RELEASE = 1;
/** The error occurred in {@link ExoPlayer#setForegroundMode}. */ /** The error occurred in {@link ExoPlayer#setForegroundMode}. */
public static final int TIMEOUT_OPERATION_SET_FOREGROUND_MODE = 2; public static final int TIMEOUT_OPERATION_SET_FOREGROUND_MODE = 2;
/** The error occurred while detaching a surface from the player. */ /** The error occurred while detaching a surface from the player. */
public static final int TIMEOUT_OPERATION_DETACH_SURFACE = 3; public static final int TIMEOUT_OPERATION_DETACH_SURFACE = 3;

View File

@ -42,8 +42,10 @@ import androidx.media3.exoplayer.upstream.Allocator;
/** The {@link MediaPeriod} wrapped by this class. */ /** The {@link MediaPeriod} wrapped by this class. */
public final MediaPeriod mediaPeriod; public final MediaPeriod mediaPeriod;
/** The unique timeline period identifier the media period belongs to. */ /** The unique timeline period identifier the media period belongs to. */
public final Object uid; public final Object uid;
/** /**
* The sample streams for each renderer associated with this period. May contain null elements. * The sample streams for each renderer associated with this period. May contain null elements.
*/ */
@ -51,10 +53,13 @@ import androidx.media3.exoplayer.upstream.Allocator;
/** Whether the media period has finished preparing. */ /** Whether the media period has finished preparing. */
public boolean prepared; public boolean prepared;
/** Whether any of the tracks of this media period are enabled. */ /** Whether any of the tracks of this media period are enabled. */
public boolean hasEnabledTracks; public boolean hasEnabledTracks;
/** {@link MediaPeriodInfo} about this media period. */ /** {@link MediaPeriodInfo} about this media period. */
public MediaPeriodInfo info; public MediaPeriodInfo info;
/** /**
* Whether all renderers are in the correct state for this {@link #mediaPeriod}. * Whether all renderers are in the correct state for this {@link #mediaPeriod}.
* *

View File

@ -27,8 +27,10 @@ import androidx.media3.exoplayer.source.MediaSource.MediaPeriodId;
/** The media period's identifier. */ /** The media period's identifier. */
public final MediaPeriodId id; public final MediaPeriodId id;
/** The start position of the media to play within the media period, in microseconds. */ /** The start position of the media to play within the media period, in microseconds. */
public final long startPositionUs; public final long startPositionUs;
/** /**
* The requested next start position for the current timeline period, in microseconds, or {@link * The requested next start position for the current timeline period, in microseconds, or {@link
* C#TIME_UNSET} if the period was requested to start at its default position. * C#TIME_UNSET} if the period was requested to start at its default position.
@ -37,6 +39,7 @@ import androidx.media3.exoplayer.source.MediaSource.MediaPeriodId;
* suspended content. * suspended content.
*/ */
public final long requestedContentPositionUs; public final long requestedContentPositionUs;
/** /**
* The end position to which the media period's content is clipped in order to play a following ad * The end position to which the media period's content is clipped in order to play a following ad
* group or to terminate a server side ad inserted stream before a played postroll, in * group or to terminate a server side ad inserted stream before a played postroll, in
@ -45,25 +48,30 @@ import androidx.media3.exoplayer.source.MediaSource.MediaPeriodId;
* of this content media period. * of this content media period.
*/ */
public final long endPositionUs; public final long endPositionUs;
/** /**
* The duration of the media period, like {@link #endPositionUs} but with {@link * The duration of the media period, like {@link #endPositionUs} but with {@link
* C#TIME_END_OF_SOURCE} and {@link C#TIME_UNSET} resolved to the timeline period duration if * C#TIME_END_OF_SOURCE} and {@link C#TIME_UNSET} resolved to the timeline period duration if
* known. * known.
*/ */
public final long durationUs; public final long durationUs;
/** /**
* Whether this media period is followed by a transition to another media period of the same * Whether this media period is followed by a transition to another media period of the same
* server-side inserted ad stream. If true, {@link #isLastInTimelinePeriod}, {@link * server-side inserted ad stream. If true, {@link #isLastInTimelinePeriod}, {@link
* #isLastInTimelineWindow} and {@link #isFinal} will all be false. * #isLastInTimelineWindow} and {@link #isFinal} will all be false.
*/ */
public final boolean isFollowedByTransitionToSameStream; public final boolean isFollowedByTransitionToSameStream;
/** /**
* Whether this is the last media period in its timeline period (e.g., a postroll ad, or a media * Whether this is the last media period in its timeline period (e.g., a postroll ad, or a media
* period corresponding to a timeline period without ads). * period corresponding to a timeline period without ads).
*/ */
public final boolean isLastInTimelinePeriod; public final boolean isLastInTimelinePeriod;
/** Whether this is the last media period in its timeline window. */ /** Whether this is the last media period in its timeline window. */
public final boolean isLastInTimelineWindow; public final boolean isLastInTimelineWindow;
/** /**
* Whether this is the last media period in the entire timeline. If true, {@link * Whether this is the last media period in the entire timeline. If true, {@link
* #isLastInTimelinePeriod} will also be true. * #isLastInTimelinePeriod} will also be true.

View File

@ -43,8 +43,10 @@ import java.util.List;
/** The current {@link Timeline}. */ /** The current {@link Timeline}. */
public final Timeline timeline; public final Timeline timeline;
/** The {@link MediaPeriodId} of the currently playing media period in the {@link #timeline}. */ /** The {@link MediaPeriodId} of the currently playing media period in the {@link #timeline}. */
public final MediaPeriodId periodId; public final MediaPeriodId periodId;
/** /**
* The requested next start position for the current period in the {@link #timeline}, in * The requested next start position for the current period in the {@link #timeline}, in
* microseconds, or {@link C#TIME_UNSET} if the period was requested to start at its default * microseconds, or {@link C#TIME_UNSET} if the period was requested to start at its default
@ -54,28 +56,40 @@ import java.util.List;
* suspended content. * suspended content.
*/ */
public final long requestedContentPositionUs; public final long requestedContentPositionUs;
/** 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. */
public final @Player.State 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. */
public final boolean isLoading; public final boolean isLoading;
/** The currently available track groups. */ /** The currently available track groups. */
public final TrackGroupArray trackGroups; public final TrackGroupArray trackGroups;
/** The result of the current track selection. */ /** The result of the current track selection. */
public final TrackSelectorResult trackSelectorResult; public final TrackSelectorResult trackSelectorResult;
/** The current static metadata of the track selections. */ /** The current static metadata of the track selections. */
public final List<Metadata> staticMetadata; public final List<Metadata> staticMetadata;
/** The {@link MediaPeriodId} of the currently loading media period in the {@link #timeline}. */ /** The {@link MediaPeriodId} of the currently loading media period in the {@link #timeline}. */
public final MediaPeriodId loadingMediaPeriodId; public final MediaPeriodId loadingMediaPeriodId;
/** 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}. */
public final @PlaybackSuppressionReason int playbackSuppressionReason; public final @PlaybackSuppressionReason int playbackSuppressionReason;
/** The playback parameters. */ /** The playback parameters. */
public final PlaybackParameters playbackParameters; public final PlaybackParameters playbackParameters;
/** Whether the main player loop is sleeping, while using offload scheduling. */ /** Whether the main player loop is sleeping, while using offload scheduling. */
public final boolean sleepingForOffload; public final boolean sleepingForOffload;
@ -84,16 +98,19 @@ import java.util.List;
* of the associated period in the {@link #timeline}, in microseconds. * of the associated period in the {@link #timeline}, in microseconds.
*/ */
public volatile long bufferedPositionUs; public volatile long bufferedPositionUs;
/** /**
* Total duration of buffered media from {@link #positionUs} to {@link #bufferedPositionUs} * Total duration of buffered media from {@link #positionUs} to {@link #bufferedPositionUs}
* including all ads. * including all ads.
*/ */
public volatile long totalBufferedDurationUs; public volatile long totalBufferedDurationUs;
/** /**
* Current playback position in {@link #periodId} relative to the start of the associated period * Current playback position in {@link #periodId} relative to the start of the associated period
* in the {@link #timeline}, in microseconds. * in the {@link #timeline}, in microseconds.
*/ */
public volatile long positionUs; public volatile long positionUs;
/** /**
* The value of {@link SystemClock#elapsedRealtime()} when {@link #positionUs} was updated, in * The value of {@link SystemClock#elapsedRealtime()} when {@link #positionUs} was updated, in
* milliseconds. * milliseconds.

View File

@ -115,6 +115,7 @@ public interface Renderer extends PlayerMessage.Target {
MSG_SET_VIDEO_OUTPUT_RESOLUTION MSG_SET_VIDEO_OUTPUT_RESOLUTION
}) })
public @interface MessageType {} public @interface MessageType {}
/** /**
* The type of a message that can be passed to a video renderer via {@link * The type of a message that can be passed to a video renderer via {@link
* ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload is normally a {@link * ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload is normally a {@link
@ -125,12 +126,14 @@ public interface Renderer extends PlayerMessage.Target {
* any existing output that it has. * any existing output that it has.
*/ */
int MSG_SET_VIDEO_OUTPUT = 1; int MSG_SET_VIDEO_OUTPUT = 1;
/** /**
* A type of a message that can be passed to an audio renderer via {@link * A type of a message that can be passed to an audio renderer via {@link
* ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be a {@link Float} * ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be a {@link Float}
* with 0 being silence and 1 being unity gain. * with 0 being silence and 1 being unity gain.
*/ */
int MSG_SET_VOLUME = 2; int MSG_SET_VOLUME = 2;
/** /**
* A type of a message that can be passed to an audio renderer via {@link * A type of a message that can be passed to an audio renderer via {@link
* ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be an {@link * ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be an {@link
@ -152,6 +155,7 @@ public interface Renderer extends PlayerMessage.Target {
* an audio attributes instance. * an audio attributes instance.
*/ */
int MSG_SET_AUDIO_ATTRIBUTES = 3; int MSG_SET_AUDIO_ATTRIBUTES = 3;
/** /**
* The type of a message that can be passed to a {@link MediaCodec}-based video renderer via * The type of a message that can be passed to a {@link MediaCodec}-based video renderer via
* {@link ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be one of the * {@link ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be one of the
@ -161,36 +165,42 @@ public interface Renderer extends PlayerMessage.Target {
* owned by a {@link android.view.SurfaceView}. * owned by a {@link android.view.SurfaceView}.
*/ */
int MSG_SET_SCALING_MODE = 4; int MSG_SET_SCALING_MODE = 4;
/** /**
* The type of a message that can be passed to a video renderer via {@link * The type of a message that can be passed to a video renderer via {@link
* ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be one of the * ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be one of the
* integer strategy constants in {@link C.VideoChangeFrameRateStrategy}. * integer strategy constants in {@link C.VideoChangeFrameRateStrategy}.
*/ */
int MSG_SET_CHANGE_FRAME_RATE_STRATEGY = 5; int MSG_SET_CHANGE_FRAME_RATE_STRATEGY = 5;
/** /**
* A type of a message that can be passed to an audio renderer via {@link * A type of a message that can be passed to an audio renderer via {@link
* ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be an {@link * ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be an {@link
* AuxEffectInfo} instance representing an auxiliary audio effect for the underlying audio track. * AuxEffectInfo} instance representing an auxiliary audio effect for the underlying audio track.
*/ */
int MSG_SET_AUX_EFFECT_INFO = 6; int MSG_SET_AUX_EFFECT_INFO = 6;
/** /**
* The type of a message that can be passed to a video renderer via {@link * The type of a message that can be passed to a video renderer via {@link
* ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be a {@link * ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be a {@link
* VideoFrameMetadataListener} instance, or null. * VideoFrameMetadataListener} instance, or null.
*/ */
int MSG_SET_VIDEO_FRAME_METADATA_LISTENER = 7; int MSG_SET_VIDEO_FRAME_METADATA_LISTENER = 7;
/** /**
* The type of a message that can be passed to a camera motion renderer via {@link * The type of a message that can be passed to a camera motion renderer via {@link
* ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be a {@link * ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be a {@link
* CameraMotionListener} instance, or null. * CameraMotionListener} instance, or null.
*/ */
int MSG_SET_CAMERA_MOTION_LISTENER = 8; int MSG_SET_CAMERA_MOTION_LISTENER = 8;
/** /**
* The type of a message that can be passed to an audio renderer via {@link * The type of a message that can be passed to an audio renderer via {@link
* ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be a {@link Boolean} * ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be a {@link Boolean}
* instance telling whether to enable or disable skipping silences in the audio stream. * instance telling whether to enable or disable skipping silences in the audio stream.
*/ */
int MSG_SET_SKIP_SILENCE_ENABLED = 9; int MSG_SET_SKIP_SILENCE_ENABLED = 9;
/** /**
* The type of a message that can be passed to audio and video renderers via {@link * The type of a message that can be passed to audio and video renderers via {@link
* ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be an {@link * ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be an {@link
@ -199,6 +209,7 @@ public interface Renderer extends PlayerMessage.Target {
* tunneling is enabled. * tunneling is enabled.
*/ */
int MSG_SET_AUDIO_SESSION_ID = 10; int MSG_SET_AUDIO_SESSION_ID = 10;
/** /**
* The type of a message that can be passed to a {@link Renderer} via {@link * The type of a message that can be passed to a {@link Renderer} via {@link
* ExoPlayer#createMessage(PlayerMessage.Target)}, to inform the renderer that it can schedule * ExoPlayer#createMessage(PlayerMessage.Target)}, to inform the renderer that it can schedule
@ -207,6 +218,7 @@ public interface Renderer extends PlayerMessage.Target {
* <p>The message payload must be a {@link WakeupListener} instance. * <p>The message payload must be a {@link WakeupListener} instance.
*/ */
int MSG_SET_WAKEUP_LISTENER = 11; int MSG_SET_WAKEUP_LISTENER = 11;
/** /**
* The type of a message that can be passed to audio renderers via {@link * The type of a message that can be passed to audio renderers via {@link
* ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be an {@link * ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be an {@link
@ -214,17 +226,20 @@ public interface Renderer extends PlayerMessage.Target {
* restore the default. * restore the default.
*/ */
int MSG_SET_PREFERRED_AUDIO_DEVICE = 12; int MSG_SET_PREFERRED_AUDIO_DEVICE = 12;
/** /**
* The type of a message that can be passed to a video renderer. The message payload should be a * The type of a message that can be passed to a video renderer. The message payload should be a
* {@link List} containing {@linkplain Effect video effects}. * {@link List} containing {@linkplain Effect video effects}.
*/ */
int MSG_SET_VIDEO_EFFECTS = 13; int MSG_SET_VIDEO_EFFECTS = 13;
/** /**
* The type of a message that can be passed to a video renderer to set the desired output * The type of a message that can be passed to a video renderer to set the desired output
* resolution. The message payload should be a {@link Size} of the desired output width and * resolution. The message payload should be a {@link Size} of the desired output width and
* height. Use this method only when playing with video {@linkplain Effect effects}. * height. Use this method only when playing with video {@linkplain Effect effects}.
*/ */
int MSG_SET_VIDEO_OUTPUT_RESOLUTION = 14; int MSG_SET_VIDEO_OUTPUT_RESOLUTION = 14;
/** /**
* Applications or extensions may define custom {@code MSG_*} constants that can be passed to * Applications or extensions may define custom {@code MSG_*} constants that can be passed to
* renderers. These custom constants must be greater than or equal to this value. * renderers. These custom constants must be greater than or equal to this value.
@ -240,12 +255,14 @@ public interface Renderer extends PlayerMessage.Target {
@Target(TYPE_USE) @Target(TYPE_USE)
@IntDef({STATE_DISABLED, STATE_ENABLED, STATE_STARTED}) @IntDef({STATE_DISABLED, STATE_ENABLED, STATE_STARTED})
@interface State {} @interface State {}
/** /**
* The renderer is disabled. A renderer in this state will not proactively acquire resources that * The renderer is disabled. A renderer in this state will not proactively acquire resources that
* it requires for rendering (e.g., media decoders), but may continue to hold any that it already * it requires for rendering (e.g., media decoders), but may continue to hold any that it already
* has. {@link #reset()} can be called to force the renderer to release such resources. * has. {@link #reset()} can be called to force the renderer to release such resources.
*/ */
int STATE_DISABLED = 0; int STATE_DISABLED = 0;
/** /**
* The renderer is enabled but not started. A renderer in this state may render media at the * The renderer is enabled but not started. A renderer in this state may render media at the
* current position (e.g. an initial video frame), but the position will not advance. A renderer * current position (e.g. an initial video frame), but the position will not advance. A renderer
@ -253,6 +270,7 @@ public interface Renderer extends PlayerMessage.Target {
* decoders). * decoders).
*/ */
int STATE_ENABLED = 1; int STATE_ENABLED = 1;
/** /**
* The renderer is started. Calls to {@link #render(long, long)} will cause media to be rendered. * The renderer is started. Calls to {@link #render(long, long)} will cause media to be rendered.
*/ */

View File

@ -60,24 +60,30 @@ public interface RendererCapabilities {
}) })
@Deprecated @Deprecated
@interface FormatSupport {} @interface FormatSupport {}
/** A mask to apply to {@link Capabilities} to obtain the {@link C.FormatSupport} only. */ /** A mask to apply to {@link Capabilities} to obtain the {@link C.FormatSupport} only. */
int FORMAT_SUPPORT_MASK = 0b111; int FORMAT_SUPPORT_MASK = 0b111;
/** /**
* @deprecated Use {@link C#FORMAT_HANDLED} instead. * @deprecated Use {@link C#FORMAT_HANDLED} instead.
*/ */
@Deprecated int FORMAT_HANDLED = C.FORMAT_HANDLED; @Deprecated int FORMAT_HANDLED = C.FORMAT_HANDLED;
/** /**
* @deprecated Use {@link C#FORMAT_EXCEEDS_CAPABILITIES} instead. * @deprecated Use {@link C#FORMAT_EXCEEDS_CAPABILITIES} instead.
*/ */
@Deprecated int FORMAT_EXCEEDS_CAPABILITIES = C.FORMAT_EXCEEDS_CAPABILITIES; @Deprecated int FORMAT_EXCEEDS_CAPABILITIES = C.FORMAT_EXCEEDS_CAPABILITIES;
/** /**
* @deprecated Use {@link C#FORMAT_UNSUPPORTED_DRM} instead. * @deprecated Use {@link C#FORMAT_UNSUPPORTED_DRM} instead.
*/ */
@Deprecated int FORMAT_UNSUPPORTED_DRM = C.FORMAT_UNSUPPORTED_DRM; @Deprecated int FORMAT_UNSUPPORTED_DRM = C.FORMAT_UNSUPPORTED_DRM;
/** /**
* @deprecated Use {@link C#FORMAT_UNSUPPORTED_SUBTYPE} instead. * @deprecated Use {@link C#FORMAT_UNSUPPORTED_SUBTYPE} instead.
*/ */
@Deprecated int FORMAT_UNSUPPORTED_SUBTYPE = C.FORMAT_UNSUPPORTED_SUBTYPE; @Deprecated int FORMAT_UNSUPPORTED_SUBTYPE = C.FORMAT_UNSUPPORTED_SUBTYPE;
/** /**
* @deprecated Use {@link C#FORMAT_UNSUPPORTED_TYPE} instead. * @deprecated Use {@link C#FORMAT_UNSUPPORTED_TYPE} instead.
*/ */
@ -95,13 +101,16 @@ public interface RendererCapabilities {
/** A mask to apply to {@link Capabilities} to obtain the {@link AdaptiveSupport} only. */ /** A mask to apply to {@link Capabilities} to obtain the {@link AdaptiveSupport} only. */
int ADAPTIVE_SUPPORT_MASK = 0b11 << 3; int ADAPTIVE_SUPPORT_MASK = 0b11 << 3;
/** The {@link Renderer} can seamlessly adapt between formats. */ /** The {@link Renderer} can seamlessly adapt between formats. */
int ADAPTIVE_SEAMLESS = 0b10 << 3; int ADAPTIVE_SEAMLESS = 0b10 << 3;
/** /**
* The {@link Renderer} can adapt between formats, but may suffer a brief discontinuity * The {@link Renderer} can adapt between formats, but may suffer a brief discontinuity
* (~50-100ms) when adaptation occurs. * (~50-100ms) when adaptation occurs.
*/ */
int ADAPTIVE_NOT_SEAMLESS = 0b01 << 3; int ADAPTIVE_NOT_SEAMLESS = 0b01 << 3;
/** The {@link Renderer} does not support adaptation between formats. */ /** The {@link Renderer} does not support adaptation between formats. */
int ADAPTIVE_NOT_SUPPORTED = 0; int ADAPTIVE_NOT_SUPPORTED = 0;
@ -117,8 +126,10 @@ public interface RendererCapabilities {
/** A mask to apply to {@link Capabilities} to obtain {@link TunnelingSupport} only. */ /** A mask to apply to {@link Capabilities} to obtain {@link TunnelingSupport} only. */
int TUNNELING_SUPPORT_MASK = 0b1 << 5; int TUNNELING_SUPPORT_MASK = 0b1 << 5;
/** The {@link Renderer} supports tunneled output. */ /** The {@link Renderer} supports tunneled output. */
int TUNNELING_SUPPORTED = 0b1 << 5; int TUNNELING_SUPPORTED = 0b1 << 5;
/** The {@link Renderer} does not support tunneled output. */ /** The {@link Renderer} does not support tunneled output. */
int TUNNELING_NOT_SUPPORTED = 0; int TUNNELING_NOT_SUPPORTED = 0;
@ -136,10 +147,13 @@ public interface RendererCapabilities {
HARDWARE_ACCELERATION_NOT_SUPPORTED, HARDWARE_ACCELERATION_NOT_SUPPORTED,
}) })
@interface HardwareAccelerationSupport {} @interface HardwareAccelerationSupport {}
/** A mask to apply to {@link Capabilities} to obtain {@link HardwareAccelerationSupport} only. */ /** A mask to apply to {@link Capabilities} to obtain {@link HardwareAccelerationSupport} only. */
int HARDWARE_ACCELERATION_SUPPORT_MASK = 0b1 << 6; int HARDWARE_ACCELERATION_SUPPORT_MASK = 0b1 << 6;
/** The renderer is able to use hardware acceleration. */ /** The renderer is able to use hardware acceleration. */
int HARDWARE_ACCELERATION_SUPPORTED = 0b1 << 6; int HARDWARE_ACCELERATION_SUPPORTED = 0b1 << 6;
/** The renderer is not able to use hardware acceleration. */ /** The renderer is not able to use hardware acceleration. */
int HARDWARE_ACCELERATION_NOT_SUPPORTED = 0; int HARDWARE_ACCELERATION_NOT_SUPPORTED = 0;
@ -154,15 +168,19 @@ public interface RendererCapabilities {
@Target(TYPE_USE) @Target(TYPE_USE)
@IntDef({DECODER_SUPPORT_FALLBACK_MIMETYPE, DECODER_SUPPORT_PRIMARY, DECODER_SUPPORT_FALLBACK}) @IntDef({DECODER_SUPPORT_FALLBACK_MIMETYPE, DECODER_SUPPORT_PRIMARY, DECODER_SUPPORT_FALLBACK})
@interface DecoderSupport {} @interface DecoderSupport {}
/** A mask to apply to {@link Capabilities} to obtain {@link DecoderSupport} only. */ /** A mask to apply to {@link Capabilities} to obtain {@link DecoderSupport} only. */
int DECODER_SUPPORT_MASK = 0b11 << 7; int DECODER_SUPPORT_MASK = 0b11 << 7;
/** /**
* The format's MIME type is unsupported and the renderer may use a decoder for a fallback MIME * The format's MIME type is unsupported and the renderer may use a decoder for a fallback MIME
* type. * type.
*/ */
int DECODER_SUPPORT_FALLBACK_MIMETYPE = 0b10 << 7; int DECODER_SUPPORT_FALLBACK_MIMETYPE = 0b10 << 7;
/** The renderer is able to use the primary decoder for the format's MIME type. */ /** The renderer is able to use the primary decoder for the format's MIME type. */
int DECODER_SUPPORT_PRIMARY = 0b1 << 7; int DECODER_SUPPORT_PRIMARY = 0b1 << 7;
/** The format exceeds the primary decoder's capabilities but is supported by fallback decoder */ /** The format exceeds the primary decoder's capabilities but is supported by fallback decoder */
int DECODER_SUPPORT_FALLBACK = 0; int DECODER_SUPPORT_FALLBACK = 0;
@ -187,15 +205,19 @@ public interface RendererCapabilities {
AUDIO_OFFLOAD_NOT_SUPPORTED AUDIO_OFFLOAD_NOT_SUPPORTED
}) })
@interface AudioOffloadSupport {} @interface AudioOffloadSupport {}
/** A mask to apply to {@link Capabilities} to obtain {@link AudioOffloadSupport} only. */ /** A mask to apply to {@link Capabilities} to obtain {@link AudioOffloadSupport} only. */
int AUDIO_OFFLOAD_SUPPORT_MASK = 0b111 << 9; int AUDIO_OFFLOAD_SUPPORT_MASK = 0b111 << 9;
/** The renderer supports audio offload and speed changes with this format. */ /** The renderer supports audio offload and speed changes with this format. */
int AUDIO_OFFLOAD_SPEED_CHANGE_SUPPORTED = 0b100 << 9; int AUDIO_OFFLOAD_SPEED_CHANGE_SUPPORTED = 0b100 << 9;
/** The renderer supports audio offload and gapless transitions with this format. */ /** The renderer supports audio offload and gapless transitions with this format. */
int AUDIO_OFFLOAD_GAPLESS_SUPPORTED = 0b10 << 9; int AUDIO_OFFLOAD_GAPLESS_SUPPORTED = 0b10 << 9;
/** The renderer supports audio offload with this format. */ /** The renderer supports audio offload with this format. */
int AUDIO_OFFLOAD_SUPPORTED = 0b1 << 9; int AUDIO_OFFLOAD_SUPPORTED = 0b1 << 9;
/** Audio offload is not supported with this format. */ /** Audio offload is not supported with this format. */
int AUDIO_OFFLOAD_NOT_SUPPORTED = 0; int AUDIO_OFFLOAD_NOT_SUPPORTED = 0;

View File

@ -40,13 +40,17 @@ public final class SeekParameters {
/** Parameters for exact seeking. */ /** Parameters for exact seeking. */
public static final SeekParameters EXACT = new SeekParameters(0, 0); public static final SeekParameters EXACT = new SeekParameters(0, 0);
/** Parameters for seeking to the closest sync point. */ /** Parameters for seeking to the closest sync point. */
public static final SeekParameters CLOSEST_SYNC = public static final SeekParameters CLOSEST_SYNC =
new SeekParameters(Long.MAX_VALUE, Long.MAX_VALUE); new SeekParameters(Long.MAX_VALUE, Long.MAX_VALUE);
/** Parameters for seeking to the sync point immediately before a requested seek position. */ /** Parameters for seeking to the sync point immediately before a requested seek position. */
public static final SeekParameters PREVIOUS_SYNC = new SeekParameters(Long.MAX_VALUE, 0); public static final SeekParameters PREVIOUS_SYNC = new SeekParameters(Long.MAX_VALUE, 0);
/** Parameters for seeking to the sync point immediately after a requested seek position. */ /** Parameters for seeking to the sync point immediately after a requested seek position. */
public static final SeekParameters NEXT_SYNC = new SeekParameters(0, Long.MAX_VALUE); public static final SeekParameters NEXT_SYNC = new SeekParameters(0, Long.MAX_VALUE);
/** Default parameters. */ /** Default parameters. */
public static final SeekParameters DEFAULT = EXACT; public static final SeekParameters DEFAULT = EXACT;
@ -55,6 +59,7 @@ public final class SeekParameters {
* microseconds. * microseconds.
*/ */
public final long toleranceBeforeUs; public final long toleranceBeforeUs;
/** /**
* The maximum time that the actual position seeked to may exceed the requested seek position, in * The maximum time that the actual position seeked to may exceed the requested seek position, in
* microseconds. * microseconds.

View File

@ -234,142 +234,204 @@ public interface AnalyticsListener {
EVENT_VIDEO_CODEC_ERROR, EVENT_VIDEO_CODEC_ERROR,
}) })
@interface EventFlags {} @interface EventFlags {}
/** {@link Player#getCurrentTimeline()} changed. */ /** {@link Player#getCurrentTimeline()} changed. */
@UnstableApi int EVENT_TIMELINE_CHANGED = Player.EVENT_TIMELINE_CHANGED; @UnstableApi int EVENT_TIMELINE_CHANGED = Player.EVENT_TIMELINE_CHANGED;
/** /**
* {@link Player#getCurrentMediaItem()} changed or the player started repeating the current item. * {@link Player#getCurrentMediaItem()} changed or the player started repeating the current item.
*/ */
@UnstableApi int EVENT_MEDIA_ITEM_TRANSITION = Player.EVENT_MEDIA_ITEM_TRANSITION; @UnstableApi int EVENT_MEDIA_ITEM_TRANSITION = Player.EVENT_MEDIA_ITEM_TRANSITION;
/** {@link Player#getCurrentTracks()} changed. */ /** {@link Player#getCurrentTracks()} changed. */
@UnstableApi int EVENT_TRACKS_CHANGED = Player.EVENT_TRACKS_CHANGED; @UnstableApi int EVENT_TRACKS_CHANGED = Player.EVENT_TRACKS_CHANGED;
/** {@link Player#isLoading()} ()} changed. */ /** {@link Player#isLoading()} ()} changed. */
@UnstableApi int EVENT_IS_LOADING_CHANGED = Player.EVENT_IS_LOADING_CHANGED; @UnstableApi int EVENT_IS_LOADING_CHANGED = Player.EVENT_IS_LOADING_CHANGED;
/** {@link Player#getPlaybackState()} changed. */ /** {@link Player#getPlaybackState()} changed. */
@UnstableApi int EVENT_PLAYBACK_STATE_CHANGED = Player.EVENT_PLAYBACK_STATE_CHANGED; @UnstableApi int EVENT_PLAYBACK_STATE_CHANGED = Player.EVENT_PLAYBACK_STATE_CHANGED;
/** {@link Player#getPlayWhenReady()} changed. */ /** {@link Player#getPlayWhenReady()} changed. */
@UnstableApi int EVENT_PLAY_WHEN_READY_CHANGED = Player.EVENT_PLAY_WHEN_READY_CHANGED; @UnstableApi int EVENT_PLAY_WHEN_READY_CHANGED = Player.EVENT_PLAY_WHEN_READY_CHANGED;
/** {@link Player#getPlaybackSuppressionReason()} changed. */ /** {@link Player#getPlaybackSuppressionReason()} changed. */
@UnstableApi @UnstableApi
int EVENT_PLAYBACK_SUPPRESSION_REASON_CHANGED = Player.EVENT_PLAYBACK_SUPPRESSION_REASON_CHANGED; int EVENT_PLAYBACK_SUPPRESSION_REASON_CHANGED = Player.EVENT_PLAYBACK_SUPPRESSION_REASON_CHANGED;
/** {@link Player#isPlaying()} changed. */ /** {@link Player#isPlaying()} changed. */
@UnstableApi int EVENT_IS_PLAYING_CHANGED = Player.EVENT_IS_PLAYING_CHANGED; @UnstableApi int EVENT_IS_PLAYING_CHANGED = Player.EVENT_IS_PLAYING_CHANGED;
/** {@link Player#getRepeatMode()} changed. */ /** {@link Player#getRepeatMode()} changed. */
@UnstableApi int EVENT_REPEAT_MODE_CHANGED = Player.EVENT_REPEAT_MODE_CHANGED; @UnstableApi int EVENT_REPEAT_MODE_CHANGED = Player.EVENT_REPEAT_MODE_CHANGED;
/** {@link Player#getShuffleModeEnabled()} changed. */ /** {@link Player#getShuffleModeEnabled()} changed. */
@UnstableApi int EVENT_SHUFFLE_MODE_ENABLED_CHANGED = Player.EVENT_SHUFFLE_MODE_ENABLED_CHANGED; @UnstableApi int EVENT_SHUFFLE_MODE_ENABLED_CHANGED = Player.EVENT_SHUFFLE_MODE_ENABLED_CHANGED;
/** {@link Player#getPlayerError()} changed. */ /** {@link Player#getPlayerError()} changed. */
@UnstableApi int EVENT_PLAYER_ERROR = Player.EVENT_PLAYER_ERROR; @UnstableApi int EVENT_PLAYER_ERROR = Player.EVENT_PLAYER_ERROR;
/** /**
* A position discontinuity occurred. See {@link * A position discontinuity occurred. See {@link
* Player.Listener#onPositionDiscontinuity(Player.PositionInfo, Player.PositionInfo, int)}. * Player.Listener#onPositionDiscontinuity(Player.PositionInfo, Player.PositionInfo, int)}.
*/ */
@UnstableApi int EVENT_POSITION_DISCONTINUITY = Player.EVENT_POSITION_DISCONTINUITY; @UnstableApi int EVENT_POSITION_DISCONTINUITY = Player.EVENT_POSITION_DISCONTINUITY;
/** {@link Player#getPlaybackParameters()} changed. */ /** {@link Player#getPlaybackParameters()} changed. */
@UnstableApi int EVENT_PLAYBACK_PARAMETERS_CHANGED = Player.EVENT_PLAYBACK_PARAMETERS_CHANGED; @UnstableApi int EVENT_PLAYBACK_PARAMETERS_CHANGED = Player.EVENT_PLAYBACK_PARAMETERS_CHANGED;
/** {@link Player#getAvailableCommands()} changed. */ /** {@link Player#getAvailableCommands()} changed. */
@UnstableApi int EVENT_AVAILABLE_COMMANDS_CHANGED = Player.EVENT_AVAILABLE_COMMANDS_CHANGED; @UnstableApi int EVENT_AVAILABLE_COMMANDS_CHANGED = Player.EVENT_AVAILABLE_COMMANDS_CHANGED;
/** {@link Player#getMediaMetadata()} changed. */ /** {@link Player#getMediaMetadata()} changed. */
@UnstableApi int EVENT_MEDIA_METADATA_CHANGED = Player.EVENT_MEDIA_METADATA_CHANGED; @UnstableApi int EVENT_MEDIA_METADATA_CHANGED = Player.EVENT_MEDIA_METADATA_CHANGED;
/** {@link Player#getPlaylistMetadata()} changed. */ /** {@link Player#getPlaylistMetadata()} changed. */
@UnstableApi int EVENT_PLAYLIST_METADATA_CHANGED = Player.EVENT_PLAYLIST_METADATA_CHANGED; @UnstableApi int EVENT_PLAYLIST_METADATA_CHANGED = Player.EVENT_PLAYLIST_METADATA_CHANGED;
/** {@link Player#getSeekBackIncrement()} changed. */ /** {@link Player#getSeekBackIncrement()} changed. */
@UnstableApi int EVENT_SEEK_BACK_INCREMENT_CHANGED = Player.EVENT_SEEK_BACK_INCREMENT_CHANGED; @UnstableApi int EVENT_SEEK_BACK_INCREMENT_CHANGED = Player.EVENT_SEEK_BACK_INCREMENT_CHANGED;
/** {@link Player#getSeekForwardIncrement()} changed. */ /** {@link Player#getSeekForwardIncrement()} changed. */
@UnstableApi @UnstableApi
int EVENT_SEEK_FORWARD_INCREMENT_CHANGED = Player.EVENT_SEEK_FORWARD_INCREMENT_CHANGED; int EVENT_SEEK_FORWARD_INCREMENT_CHANGED = Player.EVENT_SEEK_FORWARD_INCREMENT_CHANGED;
/** {@link Player#getMaxSeekToPreviousPosition()} changed. */ /** {@link Player#getMaxSeekToPreviousPosition()} changed. */
@UnstableApi @UnstableApi
int EVENT_MAX_SEEK_TO_PREVIOUS_POSITION_CHANGED = int EVENT_MAX_SEEK_TO_PREVIOUS_POSITION_CHANGED =
Player.EVENT_MAX_SEEK_TO_PREVIOUS_POSITION_CHANGED; Player.EVENT_MAX_SEEK_TO_PREVIOUS_POSITION_CHANGED;
/** {@link Player#getTrackSelectionParameters()} changed. */ /** {@link Player#getTrackSelectionParameters()} changed. */
@UnstableApi @UnstableApi
int EVENT_TRACK_SELECTION_PARAMETERS_CHANGED = Player.EVENT_TRACK_SELECTION_PARAMETERS_CHANGED; int EVENT_TRACK_SELECTION_PARAMETERS_CHANGED = Player.EVENT_TRACK_SELECTION_PARAMETERS_CHANGED;
/** Audio attributes changed. */ /** Audio attributes changed. */
@UnstableApi int EVENT_AUDIO_ATTRIBUTES_CHANGED = Player.EVENT_AUDIO_ATTRIBUTES_CHANGED; @UnstableApi int EVENT_AUDIO_ATTRIBUTES_CHANGED = Player.EVENT_AUDIO_ATTRIBUTES_CHANGED;
/** An audio session id was set. */ /** An audio session id was set. */
@UnstableApi int EVENT_AUDIO_SESSION_ID = Player.EVENT_AUDIO_SESSION_ID; @UnstableApi int EVENT_AUDIO_SESSION_ID = Player.EVENT_AUDIO_SESSION_ID;
/** The volume changed. */ /** The volume changed. */
@UnstableApi int EVENT_VOLUME_CHANGED = Player.EVENT_VOLUME_CHANGED; @UnstableApi int EVENT_VOLUME_CHANGED = Player.EVENT_VOLUME_CHANGED;
/** Skipping silences was enabled or disabled in the audio stream. */ /** Skipping silences was enabled or disabled in the audio stream. */
@UnstableApi int EVENT_SKIP_SILENCE_ENABLED_CHANGED = Player.EVENT_SKIP_SILENCE_ENABLED_CHANGED; @UnstableApi int EVENT_SKIP_SILENCE_ENABLED_CHANGED = Player.EVENT_SKIP_SILENCE_ENABLED_CHANGED;
/** The surface size changed. */ /** The surface size changed. */
@UnstableApi int EVENT_SURFACE_SIZE_CHANGED = Player.EVENT_SURFACE_SIZE_CHANGED; @UnstableApi int EVENT_SURFACE_SIZE_CHANGED = Player.EVENT_SURFACE_SIZE_CHANGED;
/** The video size changed. */ /** The video size changed. */
@UnstableApi int EVENT_VIDEO_SIZE_CHANGED = Player.EVENT_VIDEO_SIZE_CHANGED; @UnstableApi int EVENT_VIDEO_SIZE_CHANGED = Player.EVENT_VIDEO_SIZE_CHANGED;
/** /**
* The first frame has been rendered since setting the surface, since the renderer was reset or * The first frame has been rendered since setting the surface, since the renderer was reset or
* since the stream changed. * since the stream changed.
*/ */
@UnstableApi int EVENT_RENDERED_FIRST_FRAME = Player.EVENT_RENDERED_FIRST_FRAME; @UnstableApi int EVENT_RENDERED_FIRST_FRAME = Player.EVENT_RENDERED_FIRST_FRAME;
/** Metadata associated with the current playback time was reported. */ /** Metadata associated with the current playback time was reported. */
@UnstableApi int EVENT_METADATA = Player.EVENT_METADATA; @UnstableApi int EVENT_METADATA = Player.EVENT_METADATA;
/** {@link Player#getCurrentCues()} changed. */ /** {@link Player#getCurrentCues()} changed. */
@UnstableApi int EVENT_CUES = Player.EVENT_CUES; @UnstableApi int EVENT_CUES = Player.EVENT_CUES;
/** {@link Player#getDeviceInfo()} changed. */ /** {@link Player#getDeviceInfo()} changed. */
@UnstableApi int EVENT_DEVICE_INFO_CHANGED = Player.EVENT_DEVICE_INFO_CHANGED; @UnstableApi int EVENT_DEVICE_INFO_CHANGED = Player.EVENT_DEVICE_INFO_CHANGED;
/** {@link Player#getDeviceVolume()} changed. */ /** {@link Player#getDeviceVolume()} changed. */
@UnstableApi int EVENT_DEVICE_VOLUME_CHANGED = Player.EVENT_DEVICE_VOLUME_CHANGED; @UnstableApi int EVENT_DEVICE_VOLUME_CHANGED = Player.EVENT_DEVICE_VOLUME_CHANGED;
/** A source started loading data. */ /** A source started loading data. */
@UnstableApi @UnstableApi
int EVENT_LOAD_STARTED = 1000; // Intentional gap to leave space for new Player events int EVENT_LOAD_STARTED = 1000; // Intentional gap to leave space for new Player events
/** A source started completed loading data. */ /** A source started completed loading data. */
@UnstableApi int EVENT_LOAD_COMPLETED = 1001; @UnstableApi int EVENT_LOAD_COMPLETED = 1001;
/** A source canceled loading data. */ /** A source canceled loading data. */
@UnstableApi int EVENT_LOAD_CANCELED = 1002; @UnstableApi int EVENT_LOAD_CANCELED = 1002;
/** A source had a non-fatal error loading data. */ /** A source had a non-fatal error loading data. */
@UnstableApi int EVENT_LOAD_ERROR = 1003; @UnstableApi int EVENT_LOAD_ERROR = 1003;
/** The downstream format sent to renderers changed. */ /** The downstream format sent to renderers changed. */
@UnstableApi int EVENT_DOWNSTREAM_FORMAT_CHANGED = 1004; @UnstableApi int EVENT_DOWNSTREAM_FORMAT_CHANGED = 1004;
/** Data was removed from the end of the media buffer. */ /** Data was removed from the end of the media buffer. */
@UnstableApi int EVENT_UPSTREAM_DISCARDED = 1005; @UnstableApi int EVENT_UPSTREAM_DISCARDED = 1005;
/** The bandwidth estimate has been updated. */ /** The bandwidth estimate has been updated. */
@UnstableApi int EVENT_BANDWIDTH_ESTIMATE = 1006; @UnstableApi int EVENT_BANDWIDTH_ESTIMATE = 1006;
/** An audio renderer was enabled. */ /** An audio renderer was enabled. */
@UnstableApi int EVENT_AUDIO_ENABLED = 1007; @UnstableApi int EVENT_AUDIO_ENABLED = 1007;
/** An audio renderer created a decoder. */ /** An audio renderer created a decoder. */
@UnstableApi int EVENT_AUDIO_DECODER_INITIALIZED = 1008; @UnstableApi int EVENT_AUDIO_DECODER_INITIALIZED = 1008;
/** The format consumed by an audio renderer changed. */ /** The format consumed by an audio renderer changed. */
@UnstableApi int EVENT_AUDIO_INPUT_FORMAT_CHANGED = 1009; @UnstableApi int EVENT_AUDIO_INPUT_FORMAT_CHANGED = 1009;
/** The audio position has increased for the first time since the last pause or position reset. */ /** The audio position has increased for the first time since the last pause or position reset. */
@UnstableApi int EVENT_AUDIO_POSITION_ADVANCING = 1010; @UnstableApi int EVENT_AUDIO_POSITION_ADVANCING = 1010;
/** An audio underrun occurred. */ /** An audio underrun occurred. */
@UnstableApi int EVENT_AUDIO_UNDERRUN = 1011; @UnstableApi int EVENT_AUDIO_UNDERRUN = 1011;
/** An audio renderer released a decoder. */ /** An audio renderer released a decoder. */
@UnstableApi int EVENT_AUDIO_DECODER_RELEASED = 1012; @UnstableApi int EVENT_AUDIO_DECODER_RELEASED = 1012;
/** An audio renderer was disabled. */ /** An audio renderer was disabled. */
@UnstableApi int EVENT_AUDIO_DISABLED = 1013; @UnstableApi int EVENT_AUDIO_DISABLED = 1013;
/** The audio sink encountered a non-fatal error. */ /** The audio sink encountered a non-fatal error. */
@UnstableApi int EVENT_AUDIO_SINK_ERROR = 1014; @UnstableApi int EVENT_AUDIO_SINK_ERROR = 1014;
/** A video renderer was enabled. */ /** A video renderer was enabled. */
@UnstableApi int EVENT_VIDEO_ENABLED = 1015; @UnstableApi int EVENT_VIDEO_ENABLED = 1015;
/** A video renderer created a decoder. */ /** A video renderer created a decoder. */
@UnstableApi int EVENT_VIDEO_DECODER_INITIALIZED = 1016; @UnstableApi int EVENT_VIDEO_DECODER_INITIALIZED = 1016;
/** The format consumed by a video renderer changed. */ /** The format consumed by a video renderer changed. */
@UnstableApi int EVENT_VIDEO_INPUT_FORMAT_CHANGED = 1017; @UnstableApi int EVENT_VIDEO_INPUT_FORMAT_CHANGED = 1017;
/** Video frames have been dropped. */ /** Video frames have been dropped. */
@UnstableApi int EVENT_DROPPED_VIDEO_FRAMES = 1018; @UnstableApi int EVENT_DROPPED_VIDEO_FRAMES = 1018;
/** A video renderer released a decoder. */ /** A video renderer released a decoder. */
@UnstableApi int EVENT_VIDEO_DECODER_RELEASED = 1019; @UnstableApi int EVENT_VIDEO_DECODER_RELEASED = 1019;
/** A video renderer was disabled. */ /** A video renderer was disabled. */
@UnstableApi int EVENT_VIDEO_DISABLED = 1020; @UnstableApi int EVENT_VIDEO_DISABLED = 1020;
/** Video frame processing offset data has been reported. */ /** Video frame processing offset data has been reported. */
@UnstableApi int EVENT_VIDEO_FRAME_PROCESSING_OFFSET = 1021; @UnstableApi int EVENT_VIDEO_FRAME_PROCESSING_OFFSET = 1021;
/** A DRM session has been acquired. */ /** A DRM session has been acquired. */
@UnstableApi int EVENT_DRM_SESSION_ACQUIRED = 1022; @UnstableApi int EVENT_DRM_SESSION_ACQUIRED = 1022;
/** DRM keys were loaded. */ /** DRM keys were loaded. */
@UnstableApi int EVENT_DRM_KEYS_LOADED = 1023; @UnstableApi int EVENT_DRM_KEYS_LOADED = 1023;
/** A non-fatal DRM session manager error occurred. */ /** A non-fatal DRM session manager error occurred. */
@UnstableApi int EVENT_DRM_SESSION_MANAGER_ERROR = 1024; @UnstableApi int EVENT_DRM_SESSION_MANAGER_ERROR = 1024;
/** DRM keys were restored. */ /** DRM keys were restored. */
@UnstableApi int EVENT_DRM_KEYS_RESTORED = 1025; @UnstableApi int EVENT_DRM_KEYS_RESTORED = 1025;
/** DRM keys were removed. */ /** DRM keys were removed. */
@UnstableApi int EVENT_DRM_KEYS_REMOVED = 1026; @UnstableApi int EVENT_DRM_KEYS_REMOVED = 1026;
/** A DRM session has been released. */ /** A DRM session has been released. */
@UnstableApi int EVENT_DRM_SESSION_RELEASED = 1027; @UnstableApi int EVENT_DRM_SESSION_RELEASED = 1027;
/** The player was released. */ /** The player was released. */
@UnstableApi int EVENT_PLAYER_RELEASED = 1028; @UnstableApi int EVENT_PLAYER_RELEASED = 1028;
/** The audio codec encountered an error. */ /** The audio codec encountered an error. */
@UnstableApi int EVENT_AUDIO_CODEC_ERROR = 1029; @UnstableApi int EVENT_AUDIO_CODEC_ERROR = 1029;
/** The video codec encountered an error. */ /** The video codec encountered an error. */
@UnstableApi int EVENT_VIDEO_CODEC_ERROR = 1030; @UnstableApi int EVENT_VIDEO_CODEC_ERROR = 1030;

View File

@ -41,6 +41,7 @@ public final class PlaybackStats {
public static final class EventTimeAndPlaybackState { public static final class EventTimeAndPlaybackState {
/** The event time at which the playback state became active. */ /** The event time at which the playback state became active. */
public final EventTime eventTime; public final EventTime eventTime;
/** The playback state that became active. */ /** The playback state that became active. */
public final @PlaybackState int playbackState; public final @PlaybackState int playbackState;
@ -85,6 +86,7 @@ public final class PlaybackStats {
public static final class EventTimeAndFormat { public static final class EventTimeAndFormat {
/** The event time associated with {@link #format}. */ /** The event time associated with {@link #format}. */
public final EventTime eventTime; public final EventTime eventTime;
/** The format that started being used, or {@code null} if no format was used. */ /** The format that started being used, or {@code null} if no format was used. */
@Nullable public final Format format; @Nullable public final Format format;
@ -126,6 +128,7 @@ public final class PlaybackStats {
public static final class EventTimeAndException { public static final class EventTimeAndException {
/** The event time at which the exception occurred. */ /** The event time at which the exception occurred. */
public final EventTime eventTime; public final EventTime eventTime;
/** The exception that was thrown. */ /** The exception that was thrown. */
public final Exception exception; public final Exception exception;
@ -193,36 +196,52 @@ public final class PlaybackStats {
PLAYBACK_STATE_ABANDONED PLAYBACK_STATE_ABANDONED
}) })
@interface PlaybackState {} @interface PlaybackState {}
/** Playback has not started (initial state). */ /** Playback has not started (initial state). */
public static final int PLAYBACK_STATE_NOT_STARTED = 0; public static final int PLAYBACK_STATE_NOT_STARTED = 0;
/** Playback is buffering in the background for initial playback start. */ /** Playback is buffering in the background for initial playback start. */
public static final int PLAYBACK_STATE_JOINING_BACKGROUND = 1; public static final int PLAYBACK_STATE_JOINING_BACKGROUND = 1;
/** Playback is buffering in the foreground for initial playback start. */ /** Playback is buffering in the foreground for initial playback start. */
public static final int PLAYBACK_STATE_JOINING_FOREGROUND = 2; public static final int PLAYBACK_STATE_JOINING_FOREGROUND = 2;
/** Playback is actively playing. */ /** Playback is actively playing. */
public static final int PLAYBACK_STATE_PLAYING = 3; public static final int PLAYBACK_STATE_PLAYING = 3;
/** Playback is paused but ready to play. */ /** Playback is paused but ready to play. */
public static final int PLAYBACK_STATE_PAUSED = 4; public static final int PLAYBACK_STATE_PAUSED = 4;
/** Playback is handling a seek. */ /** Playback is handling a seek. */
public static final int PLAYBACK_STATE_SEEKING = 5; public static final int PLAYBACK_STATE_SEEKING = 5;
/** Playback is buffering to resume active playback. */ /** Playback is buffering to resume active playback. */
public static final int PLAYBACK_STATE_BUFFERING = 6; public static final int PLAYBACK_STATE_BUFFERING = 6;
/** Playback is buffering while paused. */ /** Playback is buffering while paused. */
public static final int PLAYBACK_STATE_PAUSED_BUFFERING = 7; public static final int PLAYBACK_STATE_PAUSED_BUFFERING = 7;
/** Playback is suppressed (e.g. due to audio focus loss). */ /** Playback is suppressed (e.g. due to audio focus loss). */
public static final int PLAYBACK_STATE_SUPPRESSED = 9; public static final int PLAYBACK_STATE_SUPPRESSED = 9;
/** Playback is suppressed (e.g. due to audio focus loss) while buffering to resume a playback. */ /** Playback is suppressed (e.g. due to audio focus loss) while buffering to resume a playback. */
public static final int PLAYBACK_STATE_SUPPRESSED_BUFFERING = 10; public static final int PLAYBACK_STATE_SUPPRESSED_BUFFERING = 10;
/** Playback has reached the end of the media. */ /** Playback has reached the end of the media. */
public static final int PLAYBACK_STATE_ENDED = 11; public static final int PLAYBACK_STATE_ENDED = 11;
/** Playback is stopped and can be restarted. */ /** Playback is stopped and can be restarted. */
public static final int PLAYBACK_STATE_STOPPED = 12; public static final int PLAYBACK_STATE_STOPPED = 12;
/** Playback is stopped due a fatal error and can be retried. */ /** Playback is stopped due a fatal error and can be retried. */
public static final int PLAYBACK_STATE_FAILED = 13; public static final int PLAYBACK_STATE_FAILED = 13;
/** Playback is interrupted by an ad. */ /** Playback is interrupted by an ad. */
public static final int PLAYBACK_STATE_INTERRUPTED_BY_AD = 14; public static final int PLAYBACK_STATE_INTERRUPTED_BY_AD = 14;
/** Playback is abandoned before reaching the end of the media. */ /** Playback is abandoned before reaching the end of the media. */
public static final int PLAYBACK_STATE_ABANDONED = 15; public static final int PLAYBACK_STATE_ABANDONED = 15;
/** Total number of playback states. */ /** Total number of playback states. */
/* package */ static final int PLAYBACK_STATE_COUNT = 16; /* package */ static final int PLAYBACK_STATE_COUNT = 16;
@ -388,25 +407,32 @@ public final class PlaybackStats {
* ordered by {@code EventTime.realTimeMs}. * ordered by {@code EventTime.realTimeMs}.
*/ */
public final List<EventTimeAndPlaybackState> playbackStateHistory; public final List<EventTimeAndPlaybackState> playbackStateHistory;
/** /**
* The media time history as an ordered list of long[2] arrays with [0] being the realtime as * The media time history as an ordered list of long[2] arrays with [0] being the realtime as
* returned by {@code SystemClock.elapsedRealtime()} and [1] being the media time at this * returned by {@code SystemClock.elapsedRealtime()} and [1] being the media time at this
* realtime, in milliseconds. * realtime, in milliseconds.
*/ */
public final List<long[]> mediaTimeHistory; public final List<long[]> mediaTimeHistory;
/** /**
* The elapsed real-time as returned by {@code SystemClock.elapsedRealtime()} of the first * The elapsed real-time as returned by {@code SystemClock.elapsedRealtime()} of the first
* reported playback event, or {@link C#TIME_UNSET} if no event has been reported. * reported playback event, or {@link C#TIME_UNSET} if no event has been reported.
*/ */
public final long firstReportedTimeMs; public final long firstReportedTimeMs;
/** The number of playbacks which were the active foreground playback at some point. */ /** The number of playbacks which were the active foreground playback at some point. */
public final int foregroundPlaybackCount; public final int foregroundPlaybackCount;
/** The number of playbacks which were abandoned before they were ready to play. */ /** The number of playbacks which were abandoned before they were ready to play. */
public final int abandonedBeforeReadyCount; public final int abandonedBeforeReadyCount;
/** The number of playbacks which reached the ended state at least once. */ /** The number of playbacks which reached the ended state at least once. */
public final int endedCount; public final int endedCount;
/** The number of playbacks which were pre-buffered in the background. */ /** The number of playbacks which were pre-buffered in the background. */
public final int backgroundJoiningCount; public final int backgroundJoiningCount;
/** /**
* The total time spent joining the playback, in milliseconds, or {@link C#TIME_UNSET} if no valid * The total time spent joining the playback, in milliseconds, or {@link C#TIME_UNSET} if no valid
* join time could be determined. * join time could be determined.
@ -416,29 +442,36 @@ public final class PlaybackStats {
* joining was interrupted by a seek, stop, or error state. * joining was interrupted by a seek, stop, or error state.
*/ */
public final long totalValidJoinTimeMs; public final long totalValidJoinTimeMs;
/** /**
* The number of playbacks with a valid join time as documented in {@link #totalValidJoinTimeMs}. * The number of playbacks with a valid join time as documented in {@link #totalValidJoinTimeMs}.
*/ */
public final int validJoinTimeCount; public final int validJoinTimeCount;
/** The total number of times a playback has been paused. */ /** The total number of times a playback has been paused. */
public final int totalPauseCount; public final int totalPauseCount;
/** The total number of times a playback has been paused while rebuffering. */ /** The total number of times a playback has been paused while rebuffering. */
public final int totalPauseBufferCount; public final int totalPauseBufferCount;
/** /**
* The total number of times a seek occurred. This includes seeks happening before playback * The total number of times a seek occurred. This includes seeks happening before playback
* resumed after another seek. * resumed after another seek.
*/ */
public final int totalSeekCount; public final int totalSeekCount;
/** /**
* The total number of times a rebuffer occurred. This excludes initial joining and buffering * The total number of times a rebuffer occurred. This excludes initial joining and buffering
* after seek. * after seek.
*/ */
public final int totalRebufferCount; public final int totalRebufferCount;
/** /**
* The maximum time spent during a single rebuffer, in milliseconds, or {@link C#TIME_UNSET} if no * The maximum time spent during a single rebuffer, in milliseconds, or {@link C#TIME_UNSET} if no
* rebuffer occurred. * rebuffer occurred.
*/ */
public final long maxRebufferTimeMs; public final long maxRebufferTimeMs;
/** The number of ad playbacks. */ /** The number of ad playbacks. */
public final int adPlaybackCount; public final int adPlaybackCount;
@ -449,48 +482,61 @@ public final class PlaybackStats {
* EventTime.realTimeMs}. The {@link Format} may be null if no video format was used. * EventTime.realTimeMs}. The {@link Format} may be null if no video format was used.
*/ */
public final List<EventTimeAndFormat> videoFormatHistory; public final List<EventTimeAndFormat> videoFormatHistory;
/** /**
* The audio format history as {@link EventTimeAndFormat EventTimeAndFormats} ordered by {@code * The audio format history as {@link EventTimeAndFormat EventTimeAndFormats} ordered by {@code
* EventTime.realTimeMs}. The {@link Format} may be null if no audio format was used. * EventTime.realTimeMs}. The {@link Format} may be null if no audio format was used.
*/ */
public final List<EventTimeAndFormat> audioFormatHistory; public final List<EventTimeAndFormat> audioFormatHistory;
/** The total media time for which video format height data is available, in milliseconds. */ /** The total media time for which video format height data is available, in milliseconds. */
public final long totalVideoFormatHeightTimeMs; public final long totalVideoFormatHeightTimeMs;
/** /**
* The accumulated sum of all video format heights, in pixels, times the time the format was used * The accumulated sum of all video format heights, in pixels, times the time the format was used
* for playback, in milliseconds. * for playback, in milliseconds.
*/ */
public final long totalVideoFormatHeightTimeProduct; public final long totalVideoFormatHeightTimeProduct;
/** The total media time for which video format bitrate data is available, in milliseconds. */ /** The total media time for which video format bitrate data is available, in milliseconds. */
public final long totalVideoFormatBitrateTimeMs; public final long totalVideoFormatBitrateTimeMs;
/** /**
* The accumulated sum of all video format bitrates, in bits per second, times the time the format * The accumulated sum of all video format bitrates, in bits per second, times the time the format
* was used for playback, in milliseconds. * was used for playback, in milliseconds.
*/ */
public final long totalVideoFormatBitrateTimeProduct; public final long totalVideoFormatBitrateTimeProduct;
/** The total media time for which audio format data is available, in milliseconds. */ /** The total media time for which audio format data is available, in milliseconds. */
public final long totalAudioFormatTimeMs; public final long totalAudioFormatTimeMs;
/** /**
* The accumulated sum of all audio format bitrates, in bits per second, times the time the format * The accumulated sum of all audio format bitrates, in bits per second, times the time the format
* was used for playback, in milliseconds. * was used for playback, in milliseconds.
*/ */
public final long totalAudioFormatBitrateTimeProduct; public final long totalAudioFormatBitrateTimeProduct;
/** The number of playbacks with initial video format height data. */ /** The number of playbacks with initial video format height data. */
public final int initialVideoFormatHeightCount; public final int initialVideoFormatHeightCount;
/** The number of playbacks with initial video format bitrate data. */ /** The number of playbacks with initial video format bitrate data. */
public final int initialVideoFormatBitrateCount; public final int initialVideoFormatBitrateCount;
/** /**
* The total initial video format height for all playbacks, in pixels, or {@link C#LENGTH_UNSET} * The total initial video format height for all playbacks, in pixels, or {@link C#LENGTH_UNSET}
* if no initial video format data is available. * if no initial video format data is available.
*/ */
public final int totalInitialVideoFormatHeight; public final int totalInitialVideoFormatHeight;
/** /**
* The total initial video format bitrate for all playbacks, in bits per second, or {@link * The total initial video format bitrate for all playbacks, in bits per second, or {@link
* C#LENGTH_UNSET} if no initial video format data is available. * C#LENGTH_UNSET} if no initial video format data is available.
*/ */
public final long totalInitialVideoFormatBitrate; public final long totalInitialVideoFormatBitrate;
/** The number of playbacks with initial audio format bitrate data. */ /** The number of playbacks with initial audio format bitrate data. */
public final int initialAudioFormatBitrateCount; public final int initialAudioFormatBitrateCount;
/** /**
* The total initial audio format bitrate for all playbacks, in bits per second, or {@link * The total initial audio format bitrate for all playbacks, in bits per second, or {@link
* C#LENGTH_UNSET} if no initial audio format data is available. * C#LENGTH_UNSET} if no initial audio format data is available.
@ -501,6 +547,7 @@ public final class PlaybackStats {
/** The total time for which bandwidth measurement data is available, in milliseconds. */ /** The total time for which bandwidth measurement data is available, in milliseconds. */
public final long totalBandwidthTimeMs; public final long totalBandwidthTimeMs;
/** The total bytes transferred during {@link #totalBandwidthTimeMs}. */ /** The total bytes transferred during {@link #totalBandwidthTimeMs}. */
public final long totalBandwidthBytes; public final long totalBandwidthBytes;
@ -508,6 +555,7 @@ public final class PlaybackStats {
/** The total number of dropped video frames. */ /** The total number of dropped video frames. */
public final long totalDroppedFrames; public final long totalDroppedFrames;
/** The total number of audio underruns. */ /** The total number of audio underruns. */
public final long totalAudioUnderruns; public final long totalAudioUnderruns;
@ -518,18 +566,22 @@ public final class PlaybackStats {
* stopped due to this error. * stopped due to this error.
*/ */
public final int fatalErrorPlaybackCount; public final int fatalErrorPlaybackCount;
/** The total number of fatal errors. Errors are fatal if playback stopped due to this error. */ /** The total number of fatal errors. Errors are fatal if playback stopped due to this error. */
public final int fatalErrorCount; public final int fatalErrorCount;
/** /**
* The total number of non-fatal errors. Error are non-fatal if playback can recover from the * The total number of non-fatal errors. Error are non-fatal if playback can recover from the
* error without stopping. * error without stopping.
*/ */
public final int nonFatalErrorCount; public final int nonFatalErrorCount;
/** /**
* The history of fatal errors as {@link EventTimeAndException EventTimeAndExceptions} ordered by * The history of fatal errors as {@link EventTimeAndException EventTimeAndExceptions} ordered by
* {@code EventTime.realTimeMs}. Errors are fatal if playback stopped due to this error. * {@code EventTime.realTimeMs}. Errors are fatal if playback stopped due to this error.
*/ */
public final List<EventTimeAndException> fatalErrorHistory; public final List<EventTimeAndException> fatalErrorHistory;
/** /**
* The history of non-fatal errors as {@link EventTimeAndException EventTimeAndExceptions} ordered * The history of non-fatal errors as {@link EventTimeAndException EventTimeAndExceptions} ordered
* by {@code EventTime.realTimeMs}. Errors are non-fatal if playback can recover from the error * by {@code EventTime.realTimeMs}. Errors are non-fatal if playback can recover from the error

View File

@ -31,8 +31,10 @@ public final class AudioOffloadSupport {
public static final class Builder { public static final class Builder {
/** Whether the format is supported with offload playback. */ /** Whether the format is supported with offload playback. */
private boolean isFormatSupported; private boolean isFormatSupported;
/** Whether playback of the format is supported with gapless transitions. */ /** Whether playback of the format is supported with gapless transitions. */
private boolean isGaplessSupported; private boolean isGaplessSupported;
/** Whether playback of the format is supported with speed changes. */ /** Whether playback of the format is supported with speed changes. */
private boolean isSpeedChangeSupported; private boolean isSpeedChangeSupported;
@ -94,8 +96,10 @@ public final class AudioOffloadSupport {
/** Whether the format is supported with offload playback. */ /** Whether the format is supported with offload playback. */
public final boolean isFormatSupported; public final boolean isFormatSupported;
/** Whether playback of the format is supported with gapless transitions. */ /** Whether playback of the format is supported with gapless transitions. */
public final boolean isGaplessSupported; public final boolean isGaplessSupported;
/** Whether playback of the format is supported with speed changes. */ /** Whether playback of the format is supported with speed changes. */
public final boolean isSpeedChangeSupported; public final boolean isSpeedChangeSupported;

View File

@ -163,8 +163,10 @@ public interface AudioSink {
/** The underlying {@link AudioTrack}'s state. */ /** The underlying {@link AudioTrack}'s state. */
public final int audioTrackState; public final int audioTrackState;
/** If the exception can be recovered by recreating the sink. */ /** If the exception can be recovered by recreating the sink. */
public final boolean isRecoverable; public final boolean isRecoverable;
/** The input {@link Format} of the sink when the error occurs. */ /** The input {@link Format} of the sink when the error occurs. */
public final Format format; public final Format format;
@ -212,8 +214,10 @@ public interface AudioSink {
* Otherwise, the meaning of the error code depends on the sink implementation. * Otherwise, the meaning of the error code depends on the sink implementation.
*/ */
public final int errorCode; public final int errorCode;
/** If the exception can be recovered by recreating the sink. */ /** If the exception can be recovered by recreating the sink. */
public final boolean isRecoverable; public final boolean isRecoverable;
/** The input {@link Format} of the sink when the error occurs. */ /** The input {@link Format} of the sink when the error occurs. */
public final Format format; public final Format format;
@ -236,6 +240,7 @@ public interface AudioSink {
final class UnexpectedDiscontinuityException extends Exception { final class UnexpectedDiscontinuityException extends Exception {
/** The actual presentation time of a sample, in microseconds. */ /** The actual presentation time of a sample, in microseconds. */
public final long actualPresentationTimeUs; public final long actualPresentationTimeUs;
/** The expected presentation time of a sample, in microseconds. */ /** The expected presentation time of a sample, in microseconds. */
public final long expectedPresentationTimeUs; public final long expectedPresentationTimeUs;
@ -272,13 +277,16 @@ public interface AudioSink {
SINK_FORMAT_UNSUPPORTED SINK_FORMAT_UNSUPPORTED
}) })
@interface SinkFormatSupport {} @interface SinkFormatSupport {}
/** The sink supports the format directly, without the need for internal transcoding. */ /** The sink supports the format directly, without the need for internal transcoding. */
int SINK_FORMAT_SUPPORTED_DIRECTLY = 2; int SINK_FORMAT_SUPPORTED_DIRECTLY = 2;
/** /**
* The sink supports the format, but needs to transcode it internally to do so. Internal * The sink supports the format, but needs to transcode it internally to do so. Internal
* transcoding may result in lower quality and higher CPU load in some cases. * transcoding may result in lower quality and higher CPU load in some cases.
*/ */
int SINK_FORMAT_SUPPORTED_WITH_TRANSCODING = 1; int SINK_FORMAT_SUPPORTED_WITH_TRANSCODING = 1;
/** The sink does not support the format. */ /** The sink does not support the format. */
int SINK_FORMAT_UNSUPPORTED = 0; int SINK_FORMAT_UNSUPPORTED = 0;
@ -301,6 +309,7 @@ public interface AudioSink {
/** The audio sink will never play in offload mode. */ /** The audio sink will never play in offload mode. */
int OFFLOAD_MODE_DISABLED = 0; int OFFLOAD_MODE_DISABLED = 0;
/** /**
* The audio sink will prefer offload playback except in the case where both the track is gapless * The audio sink will prefer offload playback except in the case where both the track is gapless
* and the device does support gapless offload playback. * and the device does support gapless offload playback.
@ -309,6 +318,7 @@ public interface AudioSink {
* savings. * savings.
*/ */
int OFFLOAD_MODE_ENABLED_GAPLESS_REQUIRED = 1; int OFFLOAD_MODE_ENABLED_GAPLESS_REQUIRED = 1;
/** /**
* The audio sink will prefer offload playback even if this might result in silence gaps between * The audio sink will prefer offload playback even if this might result in silence gaps between
* tracks. * tracks.

View File

@ -61,23 +61,30 @@ import java.lang.annotation.Target;
STATE_ERROR STATE_ERROR
}) })
private @interface State {} private @interface State {}
/** State when first initializing. */ /** State when first initializing. */
private static final int STATE_INITIALIZING = 0; private static final int STATE_INITIALIZING = 0;
/** State when we have a timestamp and we don't know if it's advancing. */ /** State when we have a timestamp and we don't know if it's advancing. */
private static final int STATE_TIMESTAMP = 1; private static final int STATE_TIMESTAMP = 1;
/** State when we have a timestamp and we know it is advancing. */ /** State when we have a timestamp and we know it is advancing. */
private static final int STATE_TIMESTAMP_ADVANCING = 2; private static final int STATE_TIMESTAMP_ADVANCING = 2;
/** State when the no timestamp is available. */ /** State when the no timestamp is available. */
private static final int STATE_NO_TIMESTAMP = 3; private static final int STATE_NO_TIMESTAMP = 3;
/** State when the last timestamp was rejected as invalid. */ /** State when the last timestamp was rejected as invalid. */
private static final int STATE_ERROR = 4; private static final int STATE_ERROR = 4;
/** The polling interval for {@link #STATE_INITIALIZING} and {@link #STATE_TIMESTAMP}. */ /** The polling interval for {@link #STATE_INITIALIZING} and {@link #STATE_TIMESTAMP}. */
private static final int FAST_POLL_INTERVAL_US = 10_000; private static final int FAST_POLL_INTERVAL_US = 10_000;
/** /**
* The polling interval for {@link #STATE_TIMESTAMP_ADVANCING} and {@link #STATE_NO_TIMESTAMP}. * The polling interval for {@link #STATE_TIMESTAMP_ADVANCING} and {@link #STATE_NO_TIMESTAMP}.
*/ */
private static final int SLOW_POLL_INTERVAL_US = 10_000_000; private static final int SLOW_POLL_INTERVAL_US = 10_000_000;
/** The polling interval for {@link #STATE_ERROR}. */ /** The polling interval for {@link #STATE_ERROR}. */
private static final int ERROR_POLL_INTERVAL_US = 500_000; private static final int ERROR_POLL_INTERVAL_US = 500_000;

View File

@ -116,14 +116,17 @@ import java.lang.reflect.Method;
@Target(TYPE_USE) @Target(TYPE_USE)
@IntDef({PLAYSTATE_STOPPED, PLAYSTATE_PAUSED, PLAYSTATE_PLAYING}) @IntDef({PLAYSTATE_STOPPED, PLAYSTATE_PAUSED, PLAYSTATE_PLAYING})
private @interface PlayState {} private @interface PlayState {}
/** /**
* @see AudioTrack#PLAYSTATE_STOPPED * @see AudioTrack#PLAYSTATE_STOPPED
*/ */
private static final int PLAYSTATE_STOPPED = AudioTrack.PLAYSTATE_STOPPED; private static final int PLAYSTATE_STOPPED = AudioTrack.PLAYSTATE_STOPPED;
/** /**
* @see AudioTrack#PLAYSTATE_PAUSED * @see AudioTrack#PLAYSTATE_PAUSED
*/ */
private static final int PLAYSTATE_PAUSED = AudioTrack.PLAYSTATE_PAUSED; private static final int PLAYSTATE_PAUSED = AudioTrack.PLAYSTATE_PAUSED;
/** /**
* @see AudioTrack#PLAYSTATE_PLAYING * @see AudioTrack#PLAYSTATE_PLAYING
*/ */
@ -143,6 +146,7 @@ import java.lang.reflect.Method;
* <p>This is a fail safe that should not be required on correctly functioning devices. * <p>This is a fail safe that should not be required on correctly functioning devices.
*/ */
private static final long MAX_LATENCY_US = 5 * C.MICROS_PER_SECOND; private static final long MAX_LATENCY_US = 5 * C.MICROS_PER_SECOND;
/** The duration of time used to smooth over an adjustment between position sampling modes. */ /** The duration of time used to smooth over an adjustment between position sampling modes. */
private static final long MODE_SWITCH_SMOOTHING_DURATION_US = C.MICROS_PER_SECOND; private static final long MODE_SWITCH_SMOOTHING_DURATION_US = C.MICROS_PER_SECOND;

View File

@ -110,20 +110,24 @@ public abstract class DecoderAudioRenderer<
REINITIALIZATION_STATE_WAIT_END_OF_STREAM REINITIALIZATION_STATE_WAIT_END_OF_STREAM
}) })
private @interface ReinitializationState {} private @interface ReinitializationState {}
/** The decoder does not need to be re-initialized. */ /** The decoder does not need to be re-initialized. */
private static final int REINITIALIZATION_STATE_NONE = 0; private static final int REINITIALIZATION_STATE_NONE = 0;
/** /**
* The input format has changed in a way that requires the decoder to be re-initialized, but we * The input format has changed in a way that requires the decoder to be re-initialized, but we
* haven't yet signaled an end of stream to the existing decoder. We need to do so in order to * haven't yet signaled an end of stream to the existing decoder. We need to do so in order to
* ensure that it outputs any remaining buffers before we release it. * ensure that it outputs any remaining buffers before we release it.
*/ */
private static final int REINITIALIZATION_STATE_SIGNAL_END_OF_STREAM = 1; private static final int REINITIALIZATION_STATE_SIGNAL_END_OF_STREAM = 1;
/** /**
* The input format has changed in a way that requires the decoder to be re-initialized, and we've * The input format has changed in a way that requires the decoder to be re-initialized, and we've
* signaled an end of stream to the existing decoder. We're waiting for the decoder to output an * signaled an end of stream to the existing decoder. We're waiting for the decoder to output an
* end of stream signal to indicate that it has output any remaining buffers before we release it. * end of stream signal to indicate that it has output any remaining buffers before we release it.
*/ */
private static final int REINITIALIZATION_STATE_WAIT_END_OF_STREAM = 2; private static final int REINITIALIZATION_STATE_WAIT_END_OF_STREAM = 2;
/** /**
* Generally there is zero or one pending output stream offset. We track more offsets to allow for * Generally there is zero or one pending output stream offset. We track more offsets to allow for
* pending output streams that have fewer frames than the codec latency. * pending output streams that have fewer frames than the codec latency.

View File

@ -194,6 +194,7 @@ public final class DefaultAudioSink implements AudioSink {
/** Default instance. */ /** Default instance. */
AudioTrackBufferSizeProvider DEFAULT = AudioTrackBufferSizeProvider DEFAULT =
new DefaultAudioTrackBufferSizeProvider.Builder().build(); new DefaultAudioTrackBufferSizeProvider.Builder().build();
/** /**
* Returns the buffer size to use when creating an {@link AudioTrack} for a specific format and * Returns the buffer size to use when creating an {@link AudioTrack} for a specific format and
* output mode. * output mode.
@ -404,12 +405,16 @@ public final class DefaultAudioSink implements AudioSink {
/** The default playback speed. */ /** The default playback speed. */
public static final float DEFAULT_PLAYBACK_SPEED = 1f; public static final float DEFAULT_PLAYBACK_SPEED = 1f;
/** The minimum allowed playback speed. Lower values will be constrained to fall in range. */ /** The minimum allowed playback speed. Lower values will be constrained to fall in range. */
public static final float MIN_PLAYBACK_SPEED = 0.1f; public static final float MIN_PLAYBACK_SPEED = 0.1f;
/** The maximum allowed playback speed. Higher values will be constrained to fall in range. */ /** The maximum allowed playback speed. Higher values will be constrained to fall in range. */
public static final float MAX_PLAYBACK_SPEED = 8f; public static final float MAX_PLAYBACK_SPEED = 8f;
/** The minimum allowed pitch factor. Lower values will be constrained to fall in range. */ /** The minimum allowed pitch factor. Lower values will be constrained to fall in range. */
public static final float MIN_PITCH = 0.1f; public static final float MIN_PITCH = 0.1f;
/** The maximum allowed pitch factor. Higher values will be constrained to fall in range. */ /** The maximum allowed pitch factor. Higher values will be constrained to fall in range. */
public static final float MAX_PITCH = 8f; public static final float MAX_PITCH = 8f;
@ -425,8 +430,10 @@ public final class DefaultAudioSink implements AudioSink {
/** The audio sink plays PCM audio. */ /** The audio sink plays PCM audio. */
public static final int OUTPUT_MODE_PCM = 0; public static final int OUTPUT_MODE_PCM = 0;
/** The audio sink plays encoded audio in offload. */ /** The audio sink plays encoded audio in offload. */
public static final int OUTPUT_MODE_OFFLOAD = 1; public static final int OUTPUT_MODE_OFFLOAD = 1;
/** The audio sink plays encoded audio in passthrough. */ /** The audio sink plays encoded audio in passthrough. */
public static final int OUTPUT_MODE_PASSTHROUGH = 2; public static final int OUTPUT_MODE_PASSTHROUGH = 2;
@ -1874,8 +1881,10 @@ public final class DefaultAudioSink implements AudioSink {
/** The playback parameters. */ /** The playback parameters. */
public final PlaybackParameters playbackParameters; public final PlaybackParameters playbackParameters;
/** The media time from which the playback parameters apply, in microseconds. */ /** The media time from which the playback parameters apply, in microseconds. */
public final long mediaTimeUs; public final long mediaTimeUs;
/** The audio track position from which the playback parameters apply, in microseconds. */ /** The audio track position from which the playback parameters apply, in microseconds. */
public final long audioTrackPositionUs; public final long audioTrackPositionUs;

View File

@ -44,14 +44,19 @@ public class DefaultAudioTrackBufferSizeProvider
/** Default minimum length for the {@link AudioTrack} buffer, in microseconds. */ /** Default minimum length for the {@link AudioTrack} buffer, in microseconds. */
private static final int MIN_PCM_BUFFER_DURATION_US = 250_000; private static final int MIN_PCM_BUFFER_DURATION_US = 250_000;
/** Default maximum length for the {@link AudioTrack} buffer, in microseconds. */ /** Default maximum length for the {@link AudioTrack} buffer, in microseconds. */
private static final int MAX_PCM_BUFFER_DURATION_US = 750_000; private static final int MAX_PCM_BUFFER_DURATION_US = 750_000;
/** Default multiplication factor to apply to the minimum buffer size requested. */ /** Default multiplication factor to apply to the minimum buffer size requested. */
private static final int PCM_BUFFER_MULTIPLICATION_FACTOR = 4; private static final int PCM_BUFFER_MULTIPLICATION_FACTOR = 4;
/** Default length for passthrough {@link AudioTrack} buffers, in microseconds. */ /** Default length for passthrough {@link AudioTrack} buffers, in microseconds. */
private static final int PASSTHROUGH_BUFFER_DURATION_US = 250_000; private static final int PASSTHROUGH_BUFFER_DURATION_US = 250_000;
/** Default length for offload {@link AudioTrack} buffers, in microseconds. */ /** Default length for offload {@link AudioTrack} buffers, in microseconds. */
private static final int OFFLOAD_BUFFER_DURATION_US = 50_000_000; private static final int OFFLOAD_BUFFER_DURATION_US = 50_000_000;
/** /**
* Default multiplication factor to apply to AC3 passthrough buffer to avoid underruns on some * Default multiplication factor to apply to AC3 passthrough buffer to avoid underruns on some
* devices (e.g., Broadcom 7271). * devices (e.g., Broadcom 7271).
@ -146,14 +151,19 @@ public class DefaultAudioTrackBufferSizeProvider
/** The minimum length for PCM {@link AudioTrack} buffers, in microseconds. */ /** The minimum length for PCM {@link AudioTrack} buffers, in microseconds. */
protected final int minPcmBufferDurationUs; protected final int minPcmBufferDurationUs;
/** The maximum length for PCM {@link AudioTrack} buffers, in microseconds. */ /** The maximum length for PCM {@link AudioTrack} buffers, in microseconds. */
protected final int maxPcmBufferDurationUs; protected final int maxPcmBufferDurationUs;
/** The multiplication factor to apply to the minimum buffer size requested. */ /** The multiplication factor to apply to the minimum buffer size requested. */
protected final int pcmBufferMultiplicationFactor; protected final int pcmBufferMultiplicationFactor;
/** The length for passthrough {@link AudioTrack} buffers, in microseconds. */ /** The length for passthrough {@link AudioTrack} buffers, in microseconds. */
protected final int passthroughBufferDurationUs; protected final int passthroughBufferDurationUs;
/** The length for offload {@link AudioTrack} buffers, in microseconds. */ /** The length for offload {@link AudioTrack} buffers, in microseconds. */
protected final int offloadBufferDurationUs; protected final int offloadBufferDurationUs;
/** /**
* The multiplication factor to apply to AC3 passthrough buffer to avoid underruns on some devices * The multiplication factor to apply to AC3 passthrough buffer to avoid underruns on some devices
* (e.g., Broadcom 7271). * (e.g., Broadcom 7271).

View File

@ -93,6 +93,7 @@ import java.util.List;
public class MediaCodecAudioRenderer extends MediaCodecRenderer implements MediaClock { public class MediaCodecAudioRenderer extends MediaCodecRenderer implements MediaClock {
private static final String TAG = "MediaCodecAudioRenderer"; private static final String TAG = "MediaCodecAudioRenderer";
/** /**
* Custom key used to indicate bits per sample by some decoders on Vivo devices. For example * Custom key used to indicate bits per sample by some decoders on Vivo devices. For example
* OMX.vivo.alac.decoder on the Vivo Z1 Pro. * OMX.vivo.alac.decoder on the Vivo Z1 Pro.
@ -106,6 +107,7 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
private int codecMaxInputSize; private int codecMaxInputSize;
private boolean codecNeedsDiscardChannelsWorkaround; private boolean codecNeedsDiscardChannelsWorkaround;
@Nullable private Format inputFormat; @Nullable private Format inputFormat;
/** Codec used for DRM decryption only in passthrough and offload. */ /** Codec used for DRM decryption only in passthrough and offload. */
@Nullable private Format decryptOnlyCodecFormat; @Nullable private Format decryptOnlyCodecFormat;

View File

@ -44,11 +44,13 @@ public final class SilenceSkippingAudioProcessor extends BaseAudioProcessor {
* minimumSilenceDurationUs}. * minimumSilenceDurationUs}.
*/ */
public static final long DEFAULT_MINIMUM_SILENCE_DURATION_US = 150_000; public static final long DEFAULT_MINIMUM_SILENCE_DURATION_US = 150_000;
/** /**
* The default value for {@link #SilenceSkippingAudioProcessor(long, long, short) * The default value for {@link #SilenceSkippingAudioProcessor(long, long, short)
* paddingSilenceUs}. * paddingSilenceUs}.
*/ */
public static final long DEFAULT_PADDING_SILENCE_US = 20_000; public static final long DEFAULT_PADDING_SILENCE_US = 20_000;
/** /**
* The default value for {@link #SilenceSkippingAudioProcessor(long, long, short) * The default value for {@link #SilenceSkippingAudioProcessor(long, long, short)
* silenceThresholdLevel}. * silenceThresholdLevel}.
@ -65,10 +67,13 @@ public final class SilenceSkippingAudioProcessor extends BaseAudioProcessor {
STATE_SILENT, STATE_SILENT,
}) })
private @interface State {} private @interface State {}
/** State when the input is not silent. */ /** State when the input is not silent. */
private static final int STATE_NOISY = 0; private static final int STATE_NOISY = 0;
/** State when the input may be silent but we haven't read enough yet to know. */ /** State when the input may be silent but we haven't read enough yet to know. */
private static final int STATE_MAYBE_SILENT = 1; private static final int STATE_MAYBE_SILENT = 1;
/** State when the input is silent. */ /** State when the input is silent. */
private static final int STATE_SILENT = 2; private static final int STATE_SILENT = 2;

View File

@ -276,19 +276,25 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
@Target(TYPE_USE) @Target(TYPE_USE)
@IntDef({MODE_PLAYBACK, MODE_QUERY, MODE_DOWNLOAD, MODE_RELEASE}) @IntDef({MODE_PLAYBACK, MODE_QUERY, MODE_DOWNLOAD, MODE_RELEASE})
public @interface Mode {} public @interface Mode {}
/** /**
* Loads and refreshes (if necessary) a license for playback. Supports streaming and offline * Loads and refreshes (if necessary) a license for playback. Supports streaming and offline
* licenses. * licenses.
*/ */
public static final int MODE_PLAYBACK = 0; public static final int MODE_PLAYBACK = 0;
/** Restores an offline license to allow its status to be queried. */ /** Restores an offline license to allow its status to be queried. */
public static final int MODE_QUERY = 1; public static final int MODE_QUERY = 1;
/** Downloads an offline license or renews an existing one. */ /** Downloads an offline license or renews an existing one. */
public static final int MODE_DOWNLOAD = 2; public static final int MODE_DOWNLOAD = 2;
/** Releases an existing offline license. */ /** Releases an existing offline license. */
public static final int MODE_RELEASE = 3; public static final int MODE_RELEASE = 3;
/** Number of times to retry for initial provisioning and key request for reporting error. */ /** Number of times to retry for initial provisioning and key request for reporting error. */
public static final int INITIAL_DRM_REQUEST_RETRY_COUNT = 3; public static final int INITIAL_DRM_REQUEST_RETRY_COUNT = 3;
/** Default value for {@link Builder#setSessionKeepaliveMs(long)}. */ /** Default value for {@link Builder#setSessionKeepaliveMs(long)}. */
public static final long DEFAULT_SESSION_KEEPALIVE_MS = 5 * 60 * C.MILLIS_PER_SECOND; public static final long DEFAULT_SESSION_KEEPALIVE_MS = 5 * 60 * C.MILLIS_PER_SECOND;

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