Commit 75932a02 by ibaker Committed by Ian Baker

Mark all public 'rarely used' IntDefs as only TYPE_USE

This is a breaking change if the annotation itself is in use in Kotlin
code. It's judged that the IntDefs in this commit are unlikely to be
referred to often in Kotlin code. This is because they're either:
- Related to esoteric parts of the library, or
- In a common part of the library but only returned from methods (and
  never passed to callback methods).

A follow-up change will fix the positions of existing usages to match
this new config.

#minor-release

PiperOrigin-RevId: 426410237
parent 2bd27dd1
Showing with 290 additions and 24 deletions
...@@ -172,7 +172,81 @@ ...@@ -172,7 +172,81 @@
* Change the following `IntDefs` to `@Target(TYPE_USE)` only. This may break * Change the following `IntDefs` to `@Target(TYPE_USE)` only. This may break
the compilation of usages in Kotlin, which can be fixed by moving the the compilation of usages in Kotlin, which can be fixed by moving the
annotation to annotate the type (`Int`). annotation to annotate the type (`Int`).
* `@AacAudioObjectType`
* `@Ac3Util.SyncFrameInfo.StreamType`
* `@AdLoadException.Type`
* `@AdtsExtractor.Flags`
* `@AmrExtractor.Flags`
* `@AspectRatioFrameLayout.ResizeMode`
* `@AudioFocusManager.PlayerCommand`
* `@AudioSink.SinkFormatSupport`
* `@BinarySearchSeeker.TimestampSearchResult.Type`
* `@BufferReplacementMode`
* `@C.BufferFlags`
* `@C.ColorRange`
* `@C.ColorSpace`
* `@C.ColorTransfer`
* `@C.CryptoMode`
* `@C.Encoding`
* `@C.PcmEncoding`
* `@C.Projection`
* `@C.SelectionReason` * `@C.SelectionReason`
* `@C.StereoMode`
* `@C.VideoOutputMode`
* `@CacheDataSource.Flags`
* `@CaptionStyleCompat.EdgeType`
* `@DataSpec.Flags`
* `@DataSpec.HttpMethods`
* `@DecoderDiscardReasons`
* `@DecoderReuseResult`
* `@DefaultAudioSink.OutputMode`
* `@DefaultDrmSessionManager.Mode`
* `@DefaultTrackSelector.SelectionEligibility`
* `@DefaultTsPayloadReaderFactory.Flags`
* `@EGLSurfaceTexture.SecureMode`
* `@EbmlProcessor.ElementType`
* `@ExoMediaDrm.KeyRequest.RequestType`
* `@ExtensionRendererMode`
* `@Extractor.ReadResult`
* `@FileTypes.Type`
* `@FlacExtractor.Flags` (in `com.google.android.exoplayer2.ext.flac`
package)
* `@FlacExtractor.Flags` (in
`com.google.android.exoplayer2.extractor.flac` package)
* `@FragmentedMp4Extractor.Flags`
* `@HlsMediaPlaylist.PlaylistType`
* `@HttpDataSourceException.Type`
* `@IllegalClippingException.Reason`
* `@IllegalMergeException.Reason`
* `@LoadErrorHandlingPolicy.FallbackType`
* `@MatroskaExtractor.Flags`
* `@Mp3Extractor.Flags`
* `@Mp4Extractor.Flags`
* `@NotificationUtil.Importance`
* `@PlaybackException.FieldNumber`
* `@PlayerNotificationManager.Priority`
* `@PlayerNotificationManager.Visibility`
* `@PlayerView.ShowBuffering`
* `@Renderer.State`
* `@RendererCapabilities.AdaptiveSupport`
* `@RendererCapabilities.Capabilities`
* `@RendererCapabilities.DecoderSupport`
* `@RendererCapabilities.FormatSupport`
* `@RendererCapabilities.HardwareAccelerationSupport`
* `@RendererCapabilities.TunnelingSupport`
* `@SampleStream.ReadDataResult`
* `@SampleStream.ReadFlags`
* `@StyledPlayerView.ShowBuffering`
* `@SubtitleView.ViewType`
* `@TextAnnotation.Position`
* `@TextEmphasisSpan.MarkFill`
* `@TextEmphasisSpan.MarkShape`
* `@Track.Transformation`
* `@TrackOutput.SampleDataPart`
* `@Transformer.ProgressState`
* `@TsExtractor.Mode`
* `@TsPayloadReader.Flags`
* `@WebvttCssStyle.FontSizeUnit`
### 2.16.1 (2021-11-18) ### 2.16.1 (2021-11-18)
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
package com.google.android.exoplayer2.ext.flac; package com.google.android.exoplayer2.ext.flac;
import static com.google.android.exoplayer2.util.Util.getPcmEncoding; import static com.google.android.exoplayer2.util.Util.getPcmEncoding;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
...@@ -40,6 +41,7 @@ import java.io.IOException; ...@@ -40,6 +41,7 @@ import java.io.IOException;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import org.checkerframework.checker.nullness.qual.EnsuresNonNull; import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull; import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...@@ -61,6 +63,7 @@ public final class FlacExtractor implements Extractor { ...@@ -61,6 +63,7 @@ public final class FlacExtractor implements Extractor {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef( @IntDef(
flag = true, flag = true,
value = {FLAG_DISABLE_ID3_METADATA}) value = {FLAG_DISABLE_ID3_METADATA})
......
...@@ -163,6 +163,7 @@ public final class C { ...@@ -163,6 +163,7 @@ public final class C {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({CRYPTO_MODE_UNENCRYPTED, CRYPTO_MODE_AES_CTR, CRYPTO_MODE_AES_CBC}) @IntDef({CRYPTO_MODE_UNENCRYPTED, CRYPTO_MODE_AES_CTR, CRYPTO_MODE_AES_CBC})
public @interface CryptoMode {} public @interface CryptoMode {}
/** @see MediaCodec#CRYPTO_MODE_UNENCRYPTED */ /** @see MediaCodec#CRYPTO_MODE_UNENCRYPTED */
...@@ -188,6 +189,7 @@ public final class C { ...@@ -188,6 +189,7 @@ public final class C {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({ @IntDef({
Format.NO_VALUE, Format.NO_VALUE,
ENCODING_INVALID, ENCODING_INVALID,
...@@ -222,6 +224,7 @@ public final class C { ...@@ -222,6 +224,7 @@ public final class C {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({ @IntDef({
Format.NO_VALUE, Format.NO_VALUE,
ENCODING_INVALID, ENCODING_INVALID,
...@@ -478,6 +481,7 @@ public final class C { ...@@ -478,6 +481,7 @@ public final class C {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef( @IntDef(
flag = true, flag = true,
value = { value = {
...@@ -508,6 +512,7 @@ public final class C { ...@@ -508,6 +512,7 @@ public final class C {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@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. */
...@@ -636,6 +641,7 @@ public final class C { ...@@ -636,6 +641,7 @@ public final class C {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef( @IntDef(
open = true, open = true,
value = { value = {
...@@ -828,6 +834,7 @@ public final class C { ...@@ -828,6 +834,7 @@ public final class C {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({ @IntDef({
Format.NO_VALUE, Format.NO_VALUE,
STEREO_MODE_MONO, STEREO_MODE_MONO,
...@@ -854,6 +861,7 @@ public final class C { ...@@ -854,6 +861,7 @@ public final class C {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({Format.NO_VALUE, COLOR_SPACE_BT709, COLOR_SPACE_BT601, COLOR_SPACE_BT2020}) @IntDef({Format.NO_VALUE, COLOR_SPACE_BT709, COLOR_SPACE_BT601, COLOR_SPACE_BT2020})
public @interface ColorSpace {} public @interface ColorSpace {}
/** @see MediaFormat#COLOR_STANDARD_BT709 */ /** @see MediaFormat#COLOR_STANDARD_BT709 */
...@@ -869,6 +877,7 @@ public final class C { ...@@ -869,6 +877,7 @@ public final class C {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({Format.NO_VALUE, COLOR_TRANSFER_SDR, COLOR_TRANSFER_ST2084, COLOR_TRANSFER_HLG}) @IntDef({Format.NO_VALUE, COLOR_TRANSFER_SDR, COLOR_TRANSFER_ST2084, COLOR_TRANSFER_HLG})
public @interface ColorTransfer {} public @interface ColorTransfer {}
/** @see MediaFormat#COLOR_TRANSFER_SDR_VIDEO */ /** @see MediaFormat#COLOR_TRANSFER_SDR_VIDEO */
...@@ -884,6 +893,7 @@ public final class C { ...@@ -884,6 +893,7 @@ public final class C {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@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 MediaFormat#COLOR_RANGE_LIMITED */ /** @see MediaFormat#COLOR_RANGE_LIMITED */
...@@ -894,6 +904,7 @@ public final class C { ...@@ -894,6 +904,7 @@ public final class C {
/** Video projection types. */ /** Video projection types. */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({ @IntDef({
Format.NO_VALUE, Format.NO_VALUE,
PROJECTION_RECTANGULAR, PROJECTION_RECTANGULAR,
......
...@@ -406,6 +406,7 @@ public class PlaybackException extends Exception implements Bundleable { ...@@ -406,6 +406,7 @@ public class PlaybackException extends Exception implements Bundleable {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef( @IntDef(
open = true, open = true,
value = { value = {
......
...@@ -15,11 +15,13 @@ ...@@ -15,11 +15,13 @@
*/ */
package com.google.android.exoplayer2.text.span; package com.google.android.exoplayer2.text.span;
import static java.lang.annotation.ElementType.TYPE_USE;
import static java.lang.annotation.RetentionPolicy.SOURCE; import static java.lang.annotation.RetentionPolicy.SOURCE;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/** Properties of a text annotation (i.e. ruby, text emphasis marks). */ /** Properties of a text annotation (i.e. ruby, text emphasis marks). */
public final class TextAnnotation { public final class TextAnnotation {
...@@ -55,6 +57,7 @@ public final class TextAnnotation { ...@@ -55,6 +57,7 @@ public final class TextAnnotation {
*/ */
@Documented @Documented
@Retention(SOURCE) @Retention(SOURCE)
@Target(TYPE_USE)
@IntDef({POSITION_UNKNOWN, POSITION_BEFORE, POSITION_AFTER}) @IntDef({POSITION_UNKNOWN, POSITION_BEFORE, POSITION_AFTER})
public @interface Position {} public @interface Position {}
......
...@@ -15,11 +15,13 @@ ...@@ -15,11 +15,13 @@
*/ */
package com.google.android.exoplayer2.text.span; package com.google.android.exoplayer2.text.span;
import static java.lang.annotation.ElementType.TYPE_USE;
import static java.lang.annotation.RetentionPolicy.SOURCE; import static java.lang.annotation.RetentionPolicy.SOURCE;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/** /**
* A styling span for text emphasis marks. * A styling span for text emphasis marks.
...@@ -48,6 +50,7 @@ public final class TextEmphasisSpan implements LanguageFeatureSpan { ...@@ -48,6 +50,7 @@ public final class TextEmphasisSpan implements LanguageFeatureSpan {
*/ */
@Documented @Documented
@Retention(SOURCE) @Retention(SOURCE)
@Target(TYPE_USE)
@IntDef({MARK_SHAPE_NONE, MARK_SHAPE_CIRCLE, MARK_SHAPE_DOT, MARK_SHAPE_SESAME}) @IntDef({MARK_SHAPE_NONE, MARK_SHAPE_CIRCLE, MARK_SHAPE_DOT, MARK_SHAPE_SESAME})
public @interface MarkShape {} public @interface MarkShape {}
...@@ -69,6 +72,7 @@ public final class TextEmphasisSpan implements LanguageFeatureSpan { ...@@ -69,6 +72,7 @@ public final class TextEmphasisSpan implements LanguageFeatureSpan {
*/ */
@Documented @Documented
@Retention(SOURCE) @Retention(SOURCE)
@Target(TYPE_USE)
@IntDef({MARK_FILL_UNKNOWN, MARK_FILL_FILLED, MARK_FILL_OPEN}) @IntDef({MARK_FILL_UNKNOWN, MARK_FILL_FILLED, MARK_FILL_OPEN})
public @interface MarkFill {} public @interface MarkFill {}
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package com.google.android.exoplayer2.util; package com.google.android.exoplayer2.util;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.graphics.SurfaceTexture; import android.graphics.SurfaceTexture;
import android.opengl.EGL14; import android.opengl.EGL14;
import android.opengl.EGLConfig; import android.opengl.EGLConfig;
...@@ -29,6 +31,7 @@ import androidx.annotation.RequiresApi; ...@@ -29,6 +31,7 @@ import androidx.annotation.RequiresApi;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** Generates a {@link SurfaceTexture} using EGL/GLES functions. */ /** Generates a {@link SurfaceTexture} using EGL/GLES functions. */
@RequiresApi(17) @RequiresApi(17)
...@@ -46,6 +49,7 @@ public final class EGLSurfaceTexture implements SurfaceTexture.OnFrameAvailableL ...@@ -46,6 +49,7 @@ public final class EGLSurfaceTexture implements SurfaceTexture.OnFrameAvailableL
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({SECURE_MODE_NONE, SECURE_MODE_SURFACELESS_CONTEXT, SECURE_MODE_PROTECTED_PBUFFER}) @IntDef({SECURE_MODE_NONE, SECURE_MODE_SURFACELESS_CONTEXT, SECURE_MODE_PROTECTED_PBUFFER})
public @interface SecureMode {} public @interface SecureMode {}
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
package com.google.android.exoplayer2.util; package com.google.android.exoplayer2.util;
import static com.google.android.exoplayer2.util.MimeTypes.normalizeMimeType; import static com.google.android.exoplayer2.util.MimeTypes.normalizeMimeType;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.net.Uri; import android.net.Uri;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
...@@ -24,6 +25,7 @@ import androidx.annotation.VisibleForTesting; ...@@ -24,6 +25,7 @@ import androidx.annotation.VisibleForTesting;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -37,6 +39,7 @@ public final class FileTypes { ...@@ -37,6 +39,7 @@ public final class FileTypes {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({ @IntDef({
UNKNOWN, AC3, AC4, ADTS, AMR, FLAC, FLV, MATROSKA, MP3, MP4, OGG, PS, TS, WAV, WEBVTT, JPEG UNKNOWN, AC3, AC4, ADTS, AMR, FLAC, FLV, MATROSKA, MP3, MP4, OGG, PS, TS, WAV, WEBVTT, JPEG
}) })
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
package com.google.android.exoplayer2.util; package com.google.android.exoplayer2.util;
import static com.google.android.exoplayer2.util.Assertions.checkNotNull; import static com.google.android.exoplayer2.util.Assertions.checkNotNull;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.Notification; import android.app.Notification;
...@@ -29,6 +30,7 @@ import androidx.annotation.StringRes; ...@@ -29,6 +30,7 @@ import androidx.annotation.StringRes;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** Utility methods for displaying {@link Notification Notifications}. */ /** Utility methods for displaying {@link Notification Notifications}. */
@SuppressLint("InlinedApi") @SuppressLint("InlinedApi")
...@@ -41,6 +43,7 @@ public final class NotificationUtil { ...@@ -41,6 +43,7 @@ public final class NotificationUtil {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({ @IntDef({
IMPORTANCE_UNSPECIFIED, IMPORTANCE_UNSPECIFIED,
IMPORTANCE_NONE, IMPORTANCE_NONE,
......
...@@ -62,6 +62,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -62,6 +62,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({ @IntDef({
PLAYER_COMMAND_DO_NOT_PLAY, PLAYER_COMMAND_DO_NOT_PLAY,
PLAYER_COMMAND_WAIT_FOR_CALLBACK, PLAYER_COMMAND_WAIT_FOR_CALLBACK,
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package com.google.android.exoplayer2; package com.google.android.exoplayer2;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.content.Context; import android.content.Context;
import android.media.MediaCodec; import android.media.MediaCodec;
import android.media.PlaybackParams; import android.media.PlaybackParams;
...@@ -42,6 +44,7 @@ import com.google.android.exoplayer2.video.spherical.CameraMotionRenderer; ...@@ -42,6 +44,7 @@ import com.google.android.exoplayer2.video.spherical.CameraMotionRenderer;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -60,6 +63,7 @@ public class DefaultRenderersFactory implements RenderersFactory { ...@@ -60,6 +63,7 @@ public class DefaultRenderersFactory implements RenderersFactory {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@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. */
......
...@@ -15,11 +15,12 @@ ...@@ -15,11 +15,12 @@
*/ */
package com.google.android.exoplayer2; package com.google.android.exoplayer2;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.media.MediaCodec; import android.media.MediaCodec;
import android.view.Surface; import android.view.Surface;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.google.android.exoplayer2.PlayerMessage.Target;
import com.google.android.exoplayer2.analytics.PlayerId; import com.google.android.exoplayer2.analytics.PlayerId;
import com.google.android.exoplayer2.audio.AudioAttributes; import com.google.android.exoplayer2.audio.AudioAttributes;
import com.google.android.exoplayer2.audio.AuxEffectInfo; import com.google.android.exoplayer2.audio.AuxEffectInfo;
...@@ -33,6 +34,7 @@ import java.io.IOException; ...@@ -33,6 +34,7 @@ import java.io.IOException;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** /**
* Renders media read from a {@link SampleStream}. * Renders media read from a {@link SampleStream}.
...@@ -86,6 +88,7 @@ public interface Renderer extends PlayerMessage.Target { ...@@ -86,6 +88,7 @@ public interface Renderer extends PlayerMessage.Target {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef( @IntDef(
open = true, open = true,
value = { value = {
...@@ -104,8 +107,9 @@ public interface Renderer extends PlayerMessage.Target { ...@@ -104,8 +107,9 @@ public interface Renderer extends PlayerMessage.Target {
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(Target)}. The message payload is normally a {@link Surface}, however * ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload is normally a {@link
* some video renderers may accept other outputs (e.g., {@link VideoDecoderOutputBufferRenderer}). * Surface}, however some video renderers may accept other outputs (e.g., {@link
* VideoDecoderOutputBufferRenderer}).
* *
* <p>If the receiving renderer does not support the payload type as an output, then it will clear * <p>If the receiving renderer does not support the payload type as an output, then it will clear
* any existing output that it has. * any existing output that it has.
...@@ -113,15 +117,15 @@ public interface Renderer extends PlayerMessage.Target { ...@@ -113,15 +117,15 @@ public interface Renderer extends PlayerMessage.Target {
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(Target)}. The message payload should be a {@link Float} with 0 being * ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be a {@link Float}
* 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(Target)}. The message payload should be an {@link AudioAttributes} * ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be an {@link
* instance that will configure the underlying audio track. If not set, the default audio * AudioAttributes} instance that will configure the underlying audio track. If not set, the
* attributes will be used. They are suitable for general media playback. * default audio attributes will be used. They are suitable for general media playback.
* *
* <p>Setting the audio attributes during playback may introduce a short gap in audio output as * <p>Setting the audio attributes during playback may introduce a short gap in audio output as
* the audio track is recreated. A new audio session id will also be generated. * the audio track is recreated. A new audio session id will also be generated.
...@@ -140,8 +144,8 @@ public interface Renderer extends PlayerMessage.Target { ...@@ -140,8 +144,8 @@ public interface Renderer extends PlayerMessage.Target {
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(Target)}. The message payload should be one of the integer * {@link ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be one of the
* scaling modes in {@link C.VideoScalingMode}. * integer scaling modes in {@link C.VideoScalingMode}.
* *
* <p>Note that the scaling mode only applies if the {@link Surface} targeted by the renderer is * <p>Note that the scaling mode only applies if the {@link Surface} targeted by the renderer is
* owned by a {@link android.view.SurfaceView}. * owned by a {@link android.view.SurfaceView}.
...@@ -149,45 +153,46 @@ public interface Renderer extends PlayerMessage.Target { ...@@ -149,45 +153,46 @@ public interface Renderer extends PlayerMessage.Target {
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(Target)}. The message payload should be one of the integer strategy * ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be one of the
* 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(Target)}. The message payload should be an {@link AuxEffectInfo} * ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be an {@link
* 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(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(Target)}. The message payload should be a {@link CameraMotionListener} * ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be a {@link
* 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(Target)}. The message payload should be a {@link Boolean} instance * ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be a {@link Boolean}
* 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(Target)}. The message payload should be an {@link Integer} instance * ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be an {@link
* representing the audio session ID that will be attached to the underlying audio track. Video * Integer} instance representing the audio session ID that will be attached to the underlying
* renderers that support tunneling will use the audio session ID when tunneling is enabled. * audio track. Video renderers that support tunneling will use the audio session ID when
* 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(Target)}, to inform the renderer that it can schedule waking up another * ExoPlayer#createMessage(PlayerMessage.Target)}, to inform the renderer that it can schedule
* component. * waking up another component.
* *
* <p>The message payload must be a {@link WakeupListener} instance. * <p>The message payload must be a {@link WakeupListener} instance.
*/ */
...@@ -204,6 +209,7 @@ public interface Renderer extends PlayerMessage.Target { ...@@ -204,6 +209,7 @@ public interface Renderer extends PlayerMessage.Target {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({STATE_DISABLED, STATE_ENABLED, STATE_STARTED}) @IntDef({STATE_DISABLED, STATE_ENABLED, STATE_STARTED})
@interface State {} @interface State {}
/** /**
......
...@@ -15,11 +15,14 @@ ...@@ -15,11 +15,14 @@
*/ */
package com.google.android.exoplayer2; package com.google.android.exoplayer2;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** Defines the capabilities of a {@link Renderer}. */ /** Defines the capabilities of a {@link Renderer}. */
public interface RendererCapabilities { public interface RendererCapabilities {
...@@ -28,6 +31,7 @@ public interface RendererCapabilities { ...@@ -28,6 +31,7 @@ public interface RendererCapabilities {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({ @IntDef({
FORMAT_HANDLED, FORMAT_HANDLED,
FORMAT_EXCEEDS_CAPABILITIES, FORMAT_EXCEEDS_CAPABILITIES,
...@@ -56,6 +60,7 @@ public interface RendererCapabilities { ...@@ -56,6 +60,7 @@ public interface RendererCapabilities {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({ADAPTIVE_SEAMLESS, ADAPTIVE_NOT_SEAMLESS, ADAPTIVE_NOT_SUPPORTED}) @IntDef({ADAPTIVE_SEAMLESS, ADAPTIVE_NOT_SEAMLESS, ADAPTIVE_NOT_SUPPORTED})
@interface AdaptiveSupport {} @interface AdaptiveSupport {}
...@@ -77,6 +82,7 @@ public interface RendererCapabilities { ...@@ -77,6 +82,7 @@ public interface RendererCapabilities {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({TUNNELING_SUPPORTED, TUNNELING_NOT_SUPPORTED}) @IntDef({TUNNELING_SUPPORTED, TUNNELING_NOT_SUPPORTED})
@interface TunnelingSupport {} @interface TunnelingSupport {}
...@@ -95,6 +101,7 @@ public interface RendererCapabilities { ...@@ -95,6 +101,7 @@ public interface RendererCapabilities {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({ @IntDef({
HARDWARE_ACCELERATION_SUPPORTED, HARDWARE_ACCELERATION_SUPPORTED,
HARDWARE_ACCELERATION_NOT_SUPPORTED, HARDWARE_ACCELERATION_NOT_SUPPORTED,
...@@ -115,6 +122,7 @@ public interface RendererCapabilities { ...@@ -115,6 +122,7 @@ public interface RendererCapabilities {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({ @IntDef({
DECODER_SUPPORT_PRIMARY, DECODER_SUPPORT_PRIMARY,
DECODER_SUPPORT_FALLBACK, DECODER_SUPPORT_FALLBACK,
...@@ -163,6 +171,7 @@ public interface RendererCapabilities { ...@@ -163,6 +171,7 @@ public interface RendererCapabilities {
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
// Intentionally empty to prevent assignment or comparison with individual flags without masking. // Intentionally empty to prevent assignment or comparison with individual flags without masking.
@Target(TYPE_USE)
@IntDef({}) @IntDef({})
@interface Capabilities {} @interface Capabilities {}
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package com.google.android.exoplayer2.audio; package com.google.android.exoplayer2.audio;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.media.AudioTrack; import android.media.AudioTrack;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
...@@ -28,6 +30,7 @@ import com.google.android.exoplayer2.analytics.PlayerId; ...@@ -28,6 +30,7 @@ import com.google.android.exoplayer2.analytics.PlayerId;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
/** /**
...@@ -256,6 +259,7 @@ public interface AudioSink { ...@@ -256,6 +259,7 @@ public interface AudioSink {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({ @IntDef({
SINK_FORMAT_SUPPORTED_DIRECTLY, SINK_FORMAT_SUPPORTED_DIRECTLY,
SINK_FORMAT_SUPPORTED_WITH_TRANSCODING, SINK_FORMAT_SUPPORTED_WITH_TRANSCODING,
......
...@@ -21,6 +21,7 @@ import static com.google.android.exoplayer2.util.Util.constrainValue; ...@@ -21,6 +21,7 @@ import static com.google.android.exoplayer2.util.Util.constrainValue;
import static com.google.common.base.MoreObjects.firstNonNull; import static com.google.common.base.MoreObjects.firstNonNull;
import static java.lang.Math.max; import static java.lang.Math.max;
import static java.lang.Math.min; import static java.lang.Math.min;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.media.AudioFormat; import android.media.AudioFormat;
...@@ -50,6 +51,7 @@ import com.google.errorprone.annotations.InlineMeValidationDisabled; ...@@ -50,6 +51,7 @@ import com.google.errorprone.annotations.InlineMeValidationDisabled;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.util.ArrayDeque; import java.util.ArrayDeque;
...@@ -382,6 +384,7 @@ public final class DefaultAudioSink implements AudioSink { ...@@ -382,6 +384,7 @@ public final class DefaultAudioSink implements AudioSink {
/** Audio offload mode configuration. */ /** Audio offload mode configuration. */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({ @IntDef({
OFFLOAD_MODE_DISABLED, OFFLOAD_MODE_DISABLED,
OFFLOAD_MODE_ENABLED_GAPLESS_REQUIRED, OFFLOAD_MODE_ENABLED_GAPLESS_REQUIRED,
...@@ -419,6 +422,7 @@ public final class DefaultAudioSink implements AudioSink { ...@@ -419,6 +422,7 @@ public final class DefaultAudioSink implements AudioSink {
/** Output mode of the audio sink. */ /** Output mode of the audio sink. */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({OUTPUT_MODE_PCM, OUTPUT_MODE_OFFLOAD, OUTPUT_MODE_PASSTHROUGH}) @IntDef({OUTPUT_MODE_PCM, OUTPUT_MODE_OFFLOAD, OUTPUT_MODE_PASSTHROUGH})
public @interface OutputMode {} public @interface OutputMode {}
......
...@@ -18,6 +18,7 @@ package com.google.android.exoplayer2.decoder; ...@@ -18,6 +18,7 @@ package com.google.android.exoplayer2.decoder;
import static com.google.android.exoplayer2.util.Assertions.checkArgument; import static com.google.android.exoplayer2.util.Assertions.checkArgument;
import static com.google.android.exoplayer2.util.Assertions.checkNotEmpty; import static com.google.android.exoplayer2.util.Assertions.checkNotEmpty;
import static com.google.android.exoplayer2.util.Assertions.checkNotNull; import static com.google.android.exoplayer2.util.Assertions.checkNotNull;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
...@@ -26,6 +27,7 @@ import com.google.android.exoplayer2.video.ColorInfo; ...@@ -26,6 +27,7 @@ import com.google.android.exoplayer2.video.ColorInfo;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** /**
* The result of an evaluation to determine whether a decoder can be reused for a new input format. * The result of an evaluation to determine whether a decoder can be reused for a new input format.
...@@ -35,6 +37,7 @@ public final class DecoderReuseEvaluation { ...@@ -35,6 +37,7 @@ public final class DecoderReuseEvaluation {
/** Possible outcomes of the evaluation. */ /** Possible outcomes of the evaluation. */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({ @IntDef({
REUSE_RESULT_NO, REUSE_RESULT_NO,
REUSE_RESULT_YES_WITH_FLUSH, REUSE_RESULT_YES_WITH_FLUSH,
...@@ -57,6 +60,7 @@ public final class DecoderReuseEvaluation { ...@@ -57,6 +60,7 @@ public final class DecoderReuseEvaluation {
/** Possible reasons why reuse is not possible. */ /** Possible reasons why reuse is not possible. */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef( @IntDef(
flag = true, flag = true,
value = { value = {
......
...@@ -19,6 +19,7 @@ import static com.google.android.exoplayer2.util.Assertions.checkArgument; ...@@ -19,6 +19,7 @@ import static com.google.android.exoplayer2.util.Assertions.checkArgument;
import static com.google.android.exoplayer2.util.Assertions.checkNotNull; import static com.google.android.exoplayer2.util.Assertions.checkNotNull;
import static com.google.android.exoplayer2.util.Assertions.checkState; import static com.google.android.exoplayer2.util.Assertions.checkState;
import static com.google.android.exoplayer2.util.Assertions.checkStateNotNull; import static com.google.android.exoplayer2.util.Assertions.checkStateNotNull;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.media.ResourceBusyException; import android.media.ResourceBusyException;
...@@ -47,6 +48,7 @@ import com.google.common.collect.Sets; ...@@ -47,6 +48,7 @@ import com.google.common.collect.Sets;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
...@@ -260,6 +262,7 @@ public class DefaultDrmSessionManager implements DrmSessionManager { ...@@ -260,6 +262,7 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@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 {}
/** /**
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package com.google.android.exoplayer2.drm; package com.google.android.exoplayer2.drm;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.media.DeniedByServerException; import android.media.DeniedByServerException;
import android.media.MediaCryptoException; import android.media.MediaCryptoException;
import android.media.MediaDrm; import android.media.MediaDrm;
...@@ -32,6 +34,7 @@ import com.google.android.exoplayer2.drm.DrmInitData.SchemeData; ...@@ -32,6 +34,7 @@ import com.google.android.exoplayer2.drm.DrmInitData.SchemeData;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -226,6 +229,7 @@ public interface ExoMediaDrm { ...@@ -226,6 +229,7 @@ public interface ExoMediaDrm {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({ @IntDef({
REQUEST_TYPE_UNKNOWN, REQUEST_TYPE_UNKNOWN,
REQUEST_TYPE_INITIAL, REQUEST_TYPE_INITIAL,
......
...@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.source; ...@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.source;
import static java.lang.Math.max; import static java.lang.Math.max;
import static java.lang.Math.min; import static java.lang.Math.min;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
...@@ -31,6 +32,7 @@ import java.io.IOException; ...@@ -31,6 +32,7 @@ import java.io.IOException;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayList; import java.util.ArrayList;
/** /**
...@@ -48,6 +50,7 @@ public final class ClippingMediaSource extends CompositeMediaSource<Void> { ...@@ -48,6 +50,7 @@ public final class ClippingMediaSource extends CompositeMediaSource<Void> {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({REASON_INVALID_PERIOD_COUNT, REASON_NOT_SEEKABLE_TO_START, REASON_START_EXCEEDS_END}) @IntDef({REASON_INVALID_PERIOD_COUNT, REASON_NOT_SEEKABLE_TO_START, REASON_START_EXCEEDS_END})
public @interface Reason {} public @interface Reason {}
/** The wrapped source doesn't consist of a single period. */ /** The wrapped source doesn't consist of a single period. */
......
...@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.source; ...@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.source;
import static com.google.android.exoplayer2.util.Assertions.checkNotNull; import static com.google.android.exoplayer2.util.Assertions.checkNotNull;
import static java.lang.Math.min; import static java.lang.Math.min;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
...@@ -31,6 +32,7 @@ import java.io.IOException; ...@@ -31,6 +32,7 @@ import java.io.IOException;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
...@@ -50,6 +52,7 @@ public final class MergingMediaSource extends CompositeMediaSource<Integer> { ...@@ -50,6 +52,7 @@ public final class MergingMediaSource extends CompositeMediaSource<Integer> {
/** The reason the merge failed. One of {@link #REASON_PERIOD_COUNT_MISMATCH}. */ /** The reason the merge failed. One of {@link #REASON_PERIOD_COUNT_MISMATCH}. */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({REASON_PERIOD_COUNT_MISMATCH}) @IntDef({REASON_PERIOD_COUNT_MISMATCH})
public @interface Reason {} public @interface Reason {}
/** The sources have different period counts. */ /** The sources have different period counts. */
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package com.google.android.exoplayer2.source; package com.google.android.exoplayer2.source;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.FormatHolder; import com.google.android.exoplayer2.FormatHolder;
...@@ -24,6 +26,7 @@ import java.io.IOException; ...@@ -24,6 +26,7 @@ import java.io.IOException;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** A stream of media samples (and associated format information). */ /** A stream of media samples (and associated format information). */
public interface SampleStream { public interface SampleStream {
...@@ -34,6 +37,7 @@ public interface SampleStream { ...@@ -34,6 +37,7 @@ public interface SampleStream {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef( @IntDef(
flag = true, flag = true,
value = {FLAG_PEEK, FLAG_REQUIRE_FORMAT, FLAG_OMIT_SAMPLE_DATA}) value = {FLAG_PEEK, FLAG_REQUIRE_FORMAT, FLAG_OMIT_SAMPLE_DATA})
...@@ -67,6 +71,7 @@ public interface SampleStream { ...@@ -67,6 +71,7 @@ public interface SampleStream {
/** Return values of {@link #readData}. */ /** Return values of {@link #readData}. */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({C.RESULT_NOTHING_READ, C.RESULT_FORMAT_READ, C.RESULT_BUFFER_READ}) @IntDef({C.RESULT_NOTHING_READ, C.RESULT_FORMAT_READ, C.RESULT_BUFFER_READ})
@interface ReadDataResult {} @interface ReadDataResult {}
......
...@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.source.ads; ...@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.source.ads;
import static com.google.android.exoplayer2.util.Assertions.checkNotNull; import static com.google.android.exoplayer2.util.Assertions.checkNotNull;
import static com.google.android.exoplayer2.util.Assertions.checkState; import static com.google.android.exoplayer2.util.Assertions.checkState;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.net.Uri; import android.net.Uri;
import android.os.Handler; import android.os.Handler;
...@@ -45,6 +46,7 @@ import java.io.IOException; ...@@ -45,6 +46,7 @@ import java.io.IOException;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
...@@ -71,6 +73,7 @@ public final class AdsMediaSource extends CompositeMediaSource<MediaPeriodId> { ...@@ -71,6 +73,7 @@ public final class AdsMediaSource extends CompositeMediaSource<MediaPeriodId> {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({TYPE_AD, TYPE_AD_GROUP, TYPE_ALL_ADS, TYPE_UNEXPECTED}) @IntDef({TYPE_AD, TYPE_AD_GROUP, TYPE_ALL_ADS, TYPE_UNEXPECTED})
public @interface Type {} public @interface Type {}
/** Type for when an ad failed to load. The ad will be skipped. */ /** Type for when an ad failed to load. The ad will be skipped. */
......
...@@ -1420,6 +1420,7 @@ public class DefaultTrackSelector extends MappingTrackSelector { ...@@ -1420,6 +1420,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({SELECTION_ELIGIBILITY_NO, SELECTION_ELIGIBILITY_FIXED, SELECTION_ELIGIBILITY_ADAPTIVE}) @IntDef({SELECTION_ELIGIBILITY_NO, SELECTION_ELIGIBILITY_FIXED, SELECTION_ELIGIBILITY_ADAPTIVE})
protected @interface SelectionEligibility {} protected @interface SelectionEligibility {}
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
package com.google.android.exoplayer2.upstream; package com.google.android.exoplayer2.upstream;
import static com.google.android.exoplayer2.util.Assertions.checkArgument; import static com.google.android.exoplayer2.util.Assertions.checkArgument;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
...@@ -28,6 +29,7 @@ import java.io.IOException; ...@@ -28,6 +29,7 @@ import java.io.IOException;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** /**
* A policy that defines how load errors are handled. * A policy that defines how load errors are handled.
...@@ -52,6 +54,7 @@ public interface LoadErrorHandlingPolicy { ...@@ -52,6 +54,7 @@ public interface LoadErrorHandlingPolicy {
/** Fallback type. One of {@link #FALLBACK_TYPE_LOCATION} or {@link #FALLBACK_TYPE_TRACK}. */ /** Fallback type. One of {@link #FALLBACK_TYPE_LOCATION} or {@link #FALLBACK_TYPE_TRACK}. */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({FALLBACK_TYPE_LOCATION, FALLBACK_TYPE_TRACK}) @IntDef({FALLBACK_TYPE_LOCATION, FALLBACK_TYPE_TRACK})
@interface FallbackType {} @interface FallbackType {}
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package com.google.android.exoplayer2.upstream; package com.google.android.exoplayer2.upstream;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.net.Uri; import android.net.Uri;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
...@@ -24,6 +26,7 @@ import com.google.android.exoplayer2.util.Assertions; ...@@ -24,6 +26,7 @@ import com.google.android.exoplayer2.util.Assertions;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
...@@ -232,6 +235,7 @@ public final class DataSpec { ...@@ -232,6 +235,7 @@ public final class DataSpec {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef( @IntDef(
flag = true, flag = true,
value = { value = {
...@@ -274,6 +278,7 @@ public final class DataSpec { ...@@ -274,6 +278,7 @@ public final class DataSpec {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@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. */
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package com.google.android.exoplayer2.upstream; package com.google.android.exoplayer2.upstream;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.text.TextUtils; import android.text.TextUtils;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
...@@ -27,6 +29,7 @@ import java.io.InterruptedIOException; ...@@ -27,6 +29,7 @@ import java.io.InterruptedIOException;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.net.SocketTimeoutException; import java.net.SocketTimeoutException;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
...@@ -188,6 +191,7 @@ public interface HttpDataSource extends DataSource { ...@@ -188,6 +191,7 @@ public interface HttpDataSource extends DataSource {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({TYPE_OPEN, TYPE_READ, TYPE_CLOSE}) @IntDef({TYPE_OPEN, TYPE_READ, TYPE_CLOSE})
public @interface Type {} public @interface Type {}
......
...@@ -18,6 +18,7 @@ package com.google.android.exoplayer2.upstream.cache; ...@@ -18,6 +18,7 @@ package com.google.android.exoplayer2.upstream.cache;
import static com.google.android.exoplayer2.util.Assertions.checkNotNull; import static com.google.android.exoplayer2.util.Assertions.checkNotNull;
import static com.google.android.exoplayer2.util.Util.castNonNull; import static com.google.android.exoplayer2.util.Util.castNonNull;
import static java.lang.Math.min; import static java.lang.Math.min;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.net.Uri; import android.net.Uri;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
...@@ -41,6 +42,7 @@ import java.io.InterruptedIOException; ...@@ -41,6 +42,7 @@ import java.io.InterruptedIOException;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -328,6 +330,7 @@ public final class CacheDataSource implements DataSource { ...@@ -328,6 +330,7 @@ public final class CacheDataSource implements DataSource {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef( @IntDef(
flag = true, flag = true,
value = { value = {
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package com.google.android.exoplayer2.decoder; package com.google.android.exoplayer2.decoder;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
...@@ -23,6 +25,7 @@ import com.google.android.exoplayer2.Format; ...@@ -23,6 +25,7 @@ import com.google.android.exoplayer2.Format;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import org.checkerframework.checker.nullness.qual.EnsuresNonNull; import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
...@@ -66,6 +69,7 @@ public class DecoderInputBuffer extends Buffer { ...@@ -66,6 +69,7 @@ public class DecoderInputBuffer extends Buffer {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({ @IntDef({
BUFFER_REPLACEMENT_MODE_DISABLED, BUFFER_REPLACEMENT_MODE_DISABLED,
BUFFER_REPLACEMENT_MODE_NORMAL, BUFFER_REPLACEMENT_MODE_NORMAL,
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package com.google.android.exoplayer2.audio; package com.google.android.exoplayer2.audio;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ParserException; import com.google.android.exoplayer2.ParserException;
...@@ -23,6 +25,7 @@ import com.google.android.exoplayer2.util.ParsableBitArray; ...@@ -23,6 +25,7 @@ import com.google.android.exoplayer2.util.ParsableBitArray;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** Utility methods for handling AAC audio streams. */ /** Utility methods for handling AAC audio streams. */
public final class AacUtil { public final class AacUtil {
...@@ -157,6 +160,7 @@ public final class AacUtil { ...@@ -157,6 +160,7 @@ public final class AacUtil {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({ @IntDef({
AUDIO_OBJECT_TYPE_AAC_LC, AUDIO_OBJECT_TYPE_AAC_LC,
AUDIO_OBJECT_TYPE_AAC_SBR, AUDIO_OBJECT_TYPE_AAC_SBR,
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package com.google.android.exoplayer2.audio; package com.google.android.exoplayer2.audio;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
...@@ -28,6 +30,7 @@ import com.google.android.exoplayer2.util.Util; ...@@ -28,6 +30,7 @@ import com.google.android.exoplayer2.util.Util;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
/** /**
...@@ -45,6 +48,7 @@ public final class Ac3Util { ...@@ -45,6 +48,7 @@ public final class Ac3Util {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({STREAM_TYPE_UNDEFINED, STREAM_TYPE_TYPE0, STREAM_TYPE_TYPE1, STREAM_TYPE_TYPE2}) @IntDef({STREAM_TYPE_UNDEFINED, STREAM_TYPE_TYPE0, STREAM_TYPE_TYPE1, STREAM_TYPE_TYPE2})
public @interface StreamType {} public @interface StreamType {}
/** Undefined AC3 stream type. */ /** Undefined AC3 stream type. */
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package com.google.android.exoplayer2.extractor; package com.google.android.exoplayer2.extractor;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
...@@ -24,6 +26,7 @@ import java.io.IOException; ...@@ -24,6 +26,7 @@ import java.io.IOException;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** /**
* A seeker that supports seeking within a stream by searching for the target frame using binary * A seeker that supports seeking within a stream by searching for the target frame using binary
...@@ -405,6 +408,7 @@ public abstract class BinarySearchSeeker { ...@@ -405,6 +408,7 @@ public abstract class BinarySearchSeeker {
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({ @IntDef({
TYPE_TARGET_TIMESTAMP_FOUND, TYPE_TARGET_TIMESTAMP_FOUND,
TYPE_POSITION_OVERESTIMATED, TYPE_POSITION_OVERESTIMATED,
......
...@@ -15,12 +15,15 @@ ...@@ -15,12 +15,15 @@
*/ */
package com.google.android.exoplayer2.extractor; package com.google.android.exoplayer2.extractor;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import java.io.IOException; import java.io.IOException;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** Extracts media data from a container format. */ /** Extracts media data from a container format. */
public interface Extractor { public interface Extractor {
...@@ -49,6 +52,7 @@ public interface Extractor { ...@@ -49,6 +52,7 @@ public interface Extractor {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef(value = {RESULT_CONTINUE, RESULT_SEEK, RESULT_END_OF_INPUT}) @IntDef(value = {RESULT_CONTINUE, RESULT_SEEK, RESULT_END_OF_INPUT})
@interface ReadResult {} @interface ReadResult {}
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package com.google.android.exoplayer2.extractor; package com.google.android.exoplayer2.extractor;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
...@@ -26,6 +28,7 @@ import java.io.IOException; ...@@ -26,6 +28,7 @@ import java.io.IOException;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Arrays; import java.util.Arrays;
/** Receives track level data extracted by an {@link Extractor}. */ /** Receives track level data extracted by an {@link Extractor}. */
...@@ -93,6 +96,7 @@ public interface TrackOutput { ...@@ -93,6 +96,7 @@ public interface TrackOutput {
/** Defines the part of the sample data to which a call to {@link #sampleData} corresponds. */ /** Defines the part of the sample data to which a call to {@link #sampleData} corresponds. */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({SAMPLE_DATA_PART_MAIN, SAMPLE_DATA_PART_ENCRYPTION, SAMPLE_DATA_PART_SUPPLEMENTAL}) @IntDef({SAMPLE_DATA_PART_MAIN, SAMPLE_DATA_PART_ENCRYPTION, SAMPLE_DATA_PART_SUPPLEMENTAL})
@interface SampleDataPart {} @interface SampleDataPart {}
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package com.google.android.exoplayer2.extractor.amr; package com.google.android.exoplayer2.extractor.amr;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.Format; import com.google.android.exoplayer2.Format;
...@@ -37,6 +39,7 @@ import java.io.IOException; ...@@ -37,6 +39,7 @@ import java.io.IOException;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Arrays; import java.util.Arrays;
import org.checkerframework.checker.nullness.qual.EnsuresNonNull; import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull; import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...@@ -60,6 +63,7 @@ public final class AmrExtractor implements Extractor { ...@@ -60,6 +63,7 @@ public final class AmrExtractor implements Extractor {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef( @IntDef(
flag = true, flag = true,
value = {FLAG_ENABLE_CONSTANT_BITRATE_SEEKING, FLAG_ENABLE_CONSTANT_BITRATE_SEEKING_ALWAYS}) value = {FLAG_ENABLE_CONSTANT_BITRATE_SEEKING, FLAG_ENABLE_CONSTANT_BITRATE_SEEKING_ALWAYS})
......
...@@ -65,6 +65,7 @@ public final class FlacExtractor implements Extractor { ...@@ -65,6 +65,7 @@ public final class FlacExtractor implements Extractor {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef( @IntDef(
flag = true, flag = true,
value = {FLAG_DISABLE_ID3_METADATA}) value = {FLAG_DISABLE_ID3_METADATA})
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package com.google.android.exoplayer2.extractor.mkv; package com.google.android.exoplayer2.extractor.mkv;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import com.google.android.exoplayer2.ParserException; import com.google.android.exoplayer2.ParserException;
import com.google.android.exoplayer2.extractor.ExtractorInput; import com.google.android.exoplayer2.extractor.ExtractorInput;
...@@ -22,6 +24,7 @@ import java.io.IOException; ...@@ -22,6 +24,7 @@ import java.io.IOException;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** Defines EBML element IDs/types and processes events. */ /** Defines EBML element IDs/types and processes events. */
public interface EbmlProcessor { public interface EbmlProcessor {
...@@ -33,6 +36,7 @@ public interface EbmlProcessor { ...@@ -33,6 +36,7 @@ public interface EbmlProcessor {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({ @IntDef({
ELEMENT_TYPE_UNKNOWN, ELEMENT_TYPE_UNKNOWN,
ELEMENT_TYPE_MASTER, ELEMENT_TYPE_MASTER,
......
...@@ -21,6 +21,7 @@ import static com.google.android.exoplayer2.util.Assertions.checkState; ...@@ -21,6 +21,7 @@ import static com.google.android.exoplayer2.util.Assertions.checkState;
import static com.google.android.exoplayer2.util.Assertions.checkStateNotNull; import static com.google.android.exoplayer2.util.Assertions.checkStateNotNull;
import static java.lang.Math.max; import static java.lang.Math.max;
import static java.lang.Math.min; import static java.lang.Math.min;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.util.Pair; import android.util.Pair;
import android.util.SparseArray; import android.util.SparseArray;
...@@ -58,6 +59,7 @@ import java.io.IOException; ...@@ -58,6 +59,7 @@ import java.io.IOException;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -85,6 +87,7 @@ public class MatroskaExtractor implements Extractor { ...@@ -85,6 +87,7 @@ public class MatroskaExtractor implements Extractor {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef( @IntDef(
flag = true, flag = true,
value = {FLAG_DISABLE_SEEK_FOR_CUES}) value = {FLAG_DISABLE_SEEK_FOR_CUES})
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package com.google.android.exoplayer2.extractor.mp3; package com.google.android.exoplayer2.extractor.mp3;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
...@@ -46,6 +48,7 @@ import java.io.IOException; ...@@ -46,6 +48,7 @@ import java.io.IOException;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.checkerframework.checker.nullness.qual.EnsuresNonNull; import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull; import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
import org.checkerframework.checker.nullness.qual.RequiresNonNull; import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...@@ -63,6 +66,7 @@ public final class Mp3Extractor implements Extractor { ...@@ -63,6 +66,7 @@ public final class Mp3Extractor implements Extractor {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef( @IntDef(
flag = true, flag = true,
value = { value = {
......
...@@ -21,6 +21,7 @@ import static com.google.android.exoplayer2.util.Assertions.checkState; ...@@ -21,6 +21,7 @@ import static com.google.android.exoplayer2.util.Assertions.checkState;
import static com.google.android.exoplayer2.util.Util.castNonNull; import static com.google.android.exoplayer2.util.Util.castNonNull;
import static com.google.android.exoplayer2.util.Util.nullSafeArrayCopy; import static com.google.android.exoplayer2.util.Util.nullSafeArrayCopy;
import static java.lang.Math.max; import static java.lang.Math.max;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.util.Pair; import android.util.Pair;
import android.util.SparseArray; import android.util.SparseArray;
...@@ -56,6 +57,7 @@ import java.io.IOException; ...@@ -56,6 +57,7 @@ import java.io.IOException;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayDeque; import java.util.ArrayDeque;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
...@@ -78,6 +80,7 @@ public class FragmentedMp4Extractor implements Extractor { ...@@ -78,6 +80,7 @@ public class FragmentedMp4Extractor implements Extractor {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef( @IntDef(
flag = true, flag = true,
value = { value = {
......
...@@ -74,6 +74,7 @@ public final class Mp4Extractor implements Extractor, SeekMap { ...@@ -74,6 +74,7 @@ public final class Mp4Extractor implements Extractor, SeekMap {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef( @IntDef(
flag = true, flag = true,
value = { value = {
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package com.google.android.exoplayer2.extractor.mp4; package com.google.android.exoplayer2.extractor.mp4;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
...@@ -22,6 +24,7 @@ import com.google.android.exoplayer2.Format; ...@@ -22,6 +24,7 @@ import com.google.android.exoplayer2.Format;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** Encapsulates information describing an MP4 track. */ /** Encapsulates information describing an MP4 track. */
public final class Track { public final class Track {
...@@ -32,6 +35,7 @@ public final class Track { ...@@ -32,6 +35,7 @@ public final class Track {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({TRANSFORMATION_NONE, TRANSFORMATION_CEA608_CDAT}) @IntDef({TRANSFORMATION_NONE, TRANSFORMATION_CEA608_CDAT})
public @interface Transformation {} public @interface Transformation {}
/** A no-op sample transformation. */ /** A no-op sample transformation. */
......
...@@ -18,6 +18,7 @@ package com.google.android.exoplayer2.extractor.ts; ...@@ -18,6 +18,7 @@ package com.google.android.exoplayer2.extractor.ts;
import static com.google.android.exoplayer2.extractor.ts.TsPayloadReader.FLAG_DATA_ALIGNMENT_INDICATOR; import static com.google.android.exoplayer2.extractor.ts.TsPayloadReader.FLAG_DATA_ALIGNMENT_INDICATOR;
import static com.google.android.exoplayer2.metadata.id3.Id3Decoder.ID3_HEADER_LENGTH; import static com.google.android.exoplayer2.metadata.id3.Id3Decoder.ID3_HEADER_LENGTH;
import static com.google.android.exoplayer2.metadata.id3.Id3Decoder.ID3_TAG; import static com.google.android.exoplayer2.metadata.id3.Id3Decoder.ID3_TAG;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
...@@ -40,6 +41,7 @@ import java.io.IOException; ...@@ -40,6 +41,7 @@ import java.io.IOException;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull; import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
import org.checkerframework.checker.nullness.qual.RequiresNonNull; import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...@@ -56,6 +58,7 @@ public final class AdtsExtractor implements Extractor { ...@@ -56,6 +58,7 @@ public final class AdtsExtractor implements Extractor {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef( @IntDef(
flag = true, flag = true,
value = {FLAG_ENABLE_CONSTANT_BITRATE_SEEKING, FLAG_ENABLE_CONSTANT_BITRATE_SEEKING_ALWAYS}) value = {FLAG_ENABLE_CONSTANT_BITRATE_SEEKING, FLAG_ENABLE_CONSTANT_BITRATE_SEEKING_ALWAYS})
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package com.google.android.exoplayer2.extractor.ts; package com.google.android.exoplayer2.extractor.ts;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.util.SparseArray; import android.util.SparseArray;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
...@@ -27,6 +29,7 @@ import com.google.common.collect.ImmutableList; ...@@ -27,6 +29,7 @@ import com.google.common.collect.ImmutableList;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -42,6 +45,7 @@ public final class DefaultTsPayloadReaderFactory implements TsPayloadReader.Fact ...@@ -42,6 +45,7 @@ public final class DefaultTsPayloadReaderFactory implements TsPayloadReader.Fact
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef( @IntDef(
flag = true, flag = true,
value = { value = {
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
package com.google.android.exoplayer2.extractor.ts; package com.google.android.exoplayer2.extractor.ts;
import static com.google.android.exoplayer2.extractor.ts.TsPayloadReader.FLAG_PAYLOAD_UNIT_START_INDICATOR; import static com.google.android.exoplayer2.extractor.ts.TsPayloadReader.FLAG_PAYLOAD_UNIT_START_INDICATOR;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.util.SparseArray; import android.util.SparseArray;
import android.util.SparseBooleanArray; import android.util.SparseBooleanArray;
...@@ -44,6 +45,7 @@ import java.io.IOException; ...@@ -44,6 +45,7 @@ import java.io.IOException;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
...@@ -63,6 +65,7 @@ public final class TsExtractor implements Extractor { ...@@ -63,6 +65,7 @@ public final class TsExtractor implements Extractor {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({MODE_MULTI_PMT, MODE_SINGLE_PMT, MODE_HLS}) @IntDef({MODE_MULTI_PMT, MODE_SINGLE_PMT, MODE_HLS})
public @interface Mode {} public @interface Mode {}
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package com.google.android.exoplayer2.extractor.ts; package com.google.android.exoplayer2.extractor.ts;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.util.SparseArray; import android.util.SparseArray;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
...@@ -26,6 +28,7 @@ import com.google.android.exoplayer2.util.TimestampAdjuster; ...@@ -26,6 +28,7 @@ import com.google.android.exoplayer2.util.TimestampAdjuster;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
...@@ -176,6 +179,7 @@ public interface TsPayloadReader { ...@@ -176,6 +179,7 @@ public interface TsPayloadReader {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef( @IntDef(
flag = true, flag = true,
value = { value = {
......
...@@ -49,6 +49,7 @@ public final class WebvttCssStyle { ...@@ -49,6 +49,7 @@ public final class WebvttCssStyle {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef( @IntDef(
flag = true, flag = true,
value = {UNSPECIFIED, STYLE_NORMAL, STYLE_BOLD, STYLE_ITALIC, STYLE_BOLD_ITALIC}) value = {UNSPECIFIED, STYLE_NORMAL, STYLE_BOLD, STYLE_ITALIC, STYLE_BOLD_ITALIC})
...@@ -65,6 +66,7 @@ public final class WebvttCssStyle { ...@@ -65,6 +66,7 @@ public final class WebvttCssStyle {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({UNSPECIFIED, FONT_SIZE_UNIT_PIXEL, FONT_SIZE_UNIT_EM, FONT_SIZE_UNIT_PERCENT}) @IntDef({UNSPECIFIED, FONT_SIZE_UNIT_PIXEL, FONT_SIZE_UNIT_EM, FONT_SIZE_UNIT_PERCENT})
public @interface FontSizeUnit {} public @interface FontSizeUnit {}
......
...@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.source.hls.playlist; ...@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.source.hls.playlist;
import static java.lang.Math.max; import static java.lang.Math.max;
import static java.lang.Math.min; import static java.lang.Math.min;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.net.Uri; import android.net.Uri;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
...@@ -30,6 +31,7 @@ import com.google.common.collect.Iterables; ...@@ -30,6 +31,7 @@ import com.google.common.collect.Iterables;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -385,6 +387,7 @@ public final class HlsMediaPlaylist extends HlsPlaylist { ...@@ -385,6 +387,7 @@ public final class HlsMediaPlaylist extends HlsPlaylist {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({PLAYLIST_TYPE_UNKNOWN, PLAYLIST_TYPE_VOD, PLAYLIST_TYPE_EVENT}) @IntDef({PLAYLIST_TYPE_UNKNOWN, PLAYLIST_TYPE_VOD, PLAYLIST_TYPE_EVENT})
public @interface PlaylistType {} public @interface PlaylistType {}
......
...@@ -23,6 +23,7 @@ import static com.google.android.exoplayer2.DefaultLoadControl.DEFAULT_MIN_BUFFE ...@@ -23,6 +23,7 @@ import static com.google.android.exoplayer2.DefaultLoadControl.DEFAULT_MIN_BUFFE
import static com.google.android.exoplayer2.util.Assertions.checkNotNull; import static com.google.android.exoplayer2.util.Assertions.checkNotNull;
import static com.google.android.exoplayer2.util.Assertions.checkState; import static com.google.android.exoplayer2.util.Assertions.checkState;
import static java.lang.Math.min; import static java.lang.Math.min;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.content.Context; import android.content.Context;
import android.graphics.Matrix; import android.graphics.Matrix;
...@@ -62,6 +63,7 @@ import java.io.IOException; ...@@ -62,6 +63,7 @@ import java.io.IOException;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull; import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
/** /**
...@@ -501,6 +503,7 @@ public final class Transformer { ...@@ -501,6 +503,7 @@ public final class Transformer {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({ @IntDef({
PROGRESS_STATE_WAITING_FOR_AVAILABILITY, PROGRESS_STATE_WAITING_FOR_AVAILABILITY,
PROGRESS_STATE_AVAILABLE, PROGRESS_STATE_AVAILABLE,
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package com.google.android.exoplayer2.ui; package com.google.android.exoplayer2.ui;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.content.Context; import android.content.Context;
import android.content.res.TypedArray; import android.content.res.TypedArray;
import android.util.AttributeSet; import android.util.AttributeSet;
...@@ -24,6 +26,7 @@ import androidx.annotation.Nullable; ...@@ -24,6 +26,7 @@ import androidx.annotation.Nullable;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** A {@link FrameLayout} that resizes itself to match a specified aspect ratio. */ /** A {@link FrameLayout} that resizes itself to match a specified aspect ratio. */
public final class AspectRatioFrameLayout extends FrameLayout { public final class AspectRatioFrameLayout extends FrameLayout {
...@@ -51,6 +54,7 @@ public final class AspectRatioFrameLayout extends FrameLayout { ...@@ -51,6 +54,7 @@ public final class AspectRatioFrameLayout extends FrameLayout {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({ @IntDef({
RESIZE_MODE_FIT, RESIZE_MODE_FIT,
RESIZE_MODE_FIXED_WIDTH, RESIZE_MODE_FIXED_WIDTH,
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package com.google.android.exoplayer2.ui; package com.google.android.exoplayer2.ui;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.Typeface; import android.graphics.Typeface;
import android.view.accessibility.CaptioningManager; import android.view.accessibility.CaptioningManager;
...@@ -26,6 +28,7 @@ import com.google.android.exoplayer2.util.Util; ...@@ -26,6 +28,7 @@ import com.google.android.exoplayer2.util.Util;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** A compatibility wrapper for {@link CaptionStyle}. */ /** A compatibility wrapper for {@link CaptionStyle}. */
public final class CaptionStyleCompat { public final class CaptionStyleCompat {
...@@ -37,6 +40,7 @@ public final class CaptionStyleCompat { ...@@ -37,6 +40,7 @@ public final class CaptionStyleCompat {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({ @IntDef({
EDGE_TYPE_NONE, EDGE_TYPE_NONE,
EDGE_TYPE_OUTLINE, EDGE_TYPE_OUTLINE,
......
...@@ -30,6 +30,7 @@ import static com.google.android.exoplayer2.Player.EVENT_SHUFFLE_MODE_ENABLED_CH ...@@ -30,6 +30,7 @@ import static com.google.android.exoplayer2.Player.EVENT_SHUFFLE_MODE_ENABLED_CH
import static com.google.android.exoplayer2.Player.EVENT_TIMELINE_CHANGED; import static com.google.android.exoplayer2.Player.EVENT_TIMELINE_CHANGED;
import static com.google.android.exoplayer2.util.Assertions.checkArgument; import static com.google.android.exoplayer2.util.Assertions.checkArgument;
import static com.google.android.exoplayer2.util.Assertions.checkState; import static com.google.android.exoplayer2.util.Assertions.checkState;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.app.Notification; import android.app.Notification;
import android.app.NotificationChannel; import android.app.NotificationChannel;
...@@ -58,6 +59,7 @@ import com.google.android.exoplayer2.util.Util; ...@@ -58,6 +59,7 @@ import com.google.android.exoplayer2.util.Util;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
...@@ -637,6 +639,7 @@ public class PlayerNotificationManager { ...@@ -637,6 +639,7 @@ public class PlayerNotificationManager {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({ @IntDef({
NotificationCompat.VISIBILITY_PRIVATE, NotificationCompat.VISIBILITY_PRIVATE,
NotificationCompat.VISIBILITY_PUBLIC, NotificationCompat.VISIBILITY_PUBLIC,
...@@ -652,6 +655,7 @@ public class PlayerNotificationManager { ...@@ -652,6 +655,7 @@ public class PlayerNotificationManager {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({ @IntDef({
NotificationCompat.PRIORITY_DEFAULT, NotificationCompat.PRIORITY_DEFAULT,
NotificationCompat.PRIORITY_MAX, NotificationCompat.PRIORITY_MAX,
......
...@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.ui; ...@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.ui;
import static com.google.android.exoplayer2.Player.COMMAND_GET_TEXT; import static com.google.android.exoplayer2.Player.COMMAND_GET_TEXT;
import static com.google.android.exoplayer2.Player.COMMAND_SET_VIDEO_SURFACE; import static com.google.android.exoplayer2.Player.COMMAND_SET_VIDEO_SURFACE;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
...@@ -64,6 +65,7 @@ import com.google.common.collect.ImmutableList; ...@@ -64,6 +65,7 @@ import com.google.common.collect.ImmutableList;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.checkerframework.checker.nullness.qual.EnsuresNonNullIf; import org.checkerframework.checker.nullness.qual.EnsuresNonNullIf;
...@@ -261,6 +263,7 @@ public class PlayerView extends FrameLayout implements AdViewProvider { ...@@ -261,6 +263,7 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({SHOW_BUFFERING_NEVER, SHOW_BUFFERING_WHEN_PLAYING, SHOW_BUFFERING_ALWAYS}) @IntDef({SHOW_BUFFERING_NEVER, SHOW_BUFFERING_WHEN_PLAYING, SHOW_BUFFERING_ALWAYS})
public @interface ShowBuffering {} public @interface ShowBuffering {}
/** The buffering view is never shown. */ /** The buffering view is never shown. */
......
...@@ -18,6 +18,7 @@ package com.google.android.exoplayer2.ui; ...@@ -18,6 +18,7 @@ package com.google.android.exoplayer2.ui;
import static com.google.android.exoplayer2.Player.COMMAND_GET_TEXT; import static com.google.android.exoplayer2.Player.COMMAND_GET_TEXT;
import static com.google.android.exoplayer2.Player.COMMAND_SET_VIDEO_SURFACE; import static com.google.android.exoplayer2.Player.COMMAND_SET_VIDEO_SURFACE;
import static com.google.android.exoplayer2.util.Assertions.checkNotNull; import static com.google.android.exoplayer2.util.Assertions.checkNotNull;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
...@@ -65,6 +66,7 @@ import com.google.common.collect.ImmutableList; ...@@ -65,6 +66,7 @@ import com.google.common.collect.ImmutableList;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.checkerframework.checker.nullness.qual.EnsuresNonNullIf; import org.checkerframework.checker.nullness.qual.EnsuresNonNullIf;
...@@ -183,6 +185,7 @@ public class StyledPlayerView extends FrameLayout implements AdViewProvider { ...@@ -183,6 +185,7 @@ public class StyledPlayerView extends FrameLayout implements AdViewProvider {
*/ */
@Documented @Documented
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({SHOW_BUFFERING_NEVER, SHOW_BUFFERING_WHEN_PLAYING, SHOW_BUFFERING_ALWAYS}) @IntDef({SHOW_BUFFERING_NEVER, SHOW_BUFFERING_WHEN_PLAYING, SHOW_BUFFERING_ALWAYS})
public @interface ShowBuffering {} public @interface ShowBuffering {}
/** The buffering view is never shown. */ /** The buffering view is never shown. */
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
*/ */
package com.google.android.exoplayer2.ui; package com.google.android.exoplayer2.ui;
import static java.lang.annotation.ElementType.TYPE_USE;
import static java.lang.annotation.RetentionPolicy.SOURCE; import static java.lang.annotation.RetentionPolicy.SOURCE;
import android.content.Context; import android.content.Context;
...@@ -35,6 +36,7 @@ import com.google.android.exoplayer2.text.Cue; ...@@ -35,6 +36,7 @@ import com.google.android.exoplayer2.text.Cue;
import com.google.android.exoplayer2.util.Util; import com.google.android.exoplayer2.util.Util;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
...@@ -111,6 +113,7 @@ public final class SubtitleView extends FrameLayout implements Player.Listener { ...@@ -111,6 +113,7 @@ public final class SubtitleView extends FrameLayout implements Player.Listener {
*/ */
@Documented @Documented
@Retention(SOURCE) @Retention(SOURCE)
@Target(TYPE_USE)
@IntDef({VIEW_TYPE_CANVAS, VIEW_TYPE_WEB}) @IntDef({VIEW_TYPE_CANVAS, VIEW_TYPE_WEB})
public @interface ViewType {} public @interface ViewType {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment