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
This commit is contained in:
ibaker 2022-02-04 16:30:40 +00:00 committed by Ian Baker
parent 8554ae5a02
commit 01c814e2f0
54 changed files with 220 additions and 24 deletions

View File

@ -163,6 +163,7 @@ public final class C {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({CRYPTO_MODE_UNENCRYPTED, CRYPTO_MODE_AES_CTR, CRYPTO_MODE_AES_CBC})
@UnstableApi
public @interface CryptoMode {}
@ -191,6 +192,7 @@ public final class C {
@UnstableApi
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({
Format.NO_VALUE,
ENCODING_INVALID,
@ -226,6 +228,7 @@ public final class C {
@UnstableApi
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({
Format.NO_VALUE,
ENCODING_INVALID,
@ -484,6 +487,7 @@ public final class C {
@UnstableApi
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef(
flag = true,
value = {
@ -516,6 +520,7 @@ public final class C {
@UnstableApi
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef(value = {VIDEO_OUTPUT_MODE_NONE, VIDEO_OUTPUT_MODE_YUV, VIDEO_OUTPUT_MODE_SURFACE_YUV})
public @interface VideoOutputMode {}
/** Video decoder output mode is not set. */
@ -651,6 +656,7 @@ public final class C {
@UnstableApi
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef(
open = true,
value = {
@ -849,6 +855,7 @@ public final class C {
@UnstableApi
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({
Format.NO_VALUE,
STEREO_MODE_MONO,
@ -876,6 +883,7 @@ public final class C {
@UnstableApi
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({Format.NO_VALUE, COLOR_SPACE_BT709, COLOR_SPACE_BT601, COLOR_SPACE_BT2020})
public @interface ColorSpace {}
/** @see MediaFormat#COLOR_STANDARD_BT709 */
@ -892,6 +900,7 @@ public final class C {
@UnstableApi
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({Format.NO_VALUE, COLOR_TRANSFER_SDR, COLOR_TRANSFER_ST2084, COLOR_TRANSFER_HLG})
public @interface ColorTransfer {}
/** @see MediaFormat#COLOR_TRANSFER_SDR_VIDEO */
@ -908,6 +917,7 @@ public final class C {
@UnstableApi
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({Format.NO_VALUE, COLOR_RANGE_LIMITED, COLOR_RANGE_FULL})
public @interface ColorRange {}
/** @see MediaFormat#COLOR_RANGE_LIMITED */
@ -919,6 +929,7 @@ public final class C {
@UnstableApi
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({
Format.NO_VALUE,
PROJECTION_RECTANGULAR,

View File

@ -16,6 +16,7 @@
package androidx.media3.common;
import static androidx.media3.common.MimeTypes.normalizeMimeType;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.net.Uri;
import androidx.annotation.IntDef;
@ -25,6 +26,7 @@ import androidx.media3.common.util.UnstableApi;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.List;
import java.util.Map;
@ -39,6 +41,7 @@ public final class FileTypes {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({
UNKNOWN, AC3, AC4, ADTS, AMR, FLAC, FLV, MATROSKA, MP3, MP4, OGG, PS, TS, WAV, WEBVTT, JPEG
})

View File

@ -410,6 +410,7 @@ public class PlaybackException extends Exception implements Bundleable {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef(
open = true,
value = {

View File

@ -15,12 +15,14 @@
*/
package androidx.media3.common.text;
import static java.lang.annotation.ElementType.TYPE_USE;
import static java.lang.annotation.RetentionPolicy.SOURCE;
import androidx.annotation.IntDef;
import androidx.media3.common.util.UnstableApi;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/** Properties of a text annotation (i.e. ruby, text emphasis marks). */
@UnstableApi
@ -57,6 +59,7 @@ public final class TextAnnotation {
*/
@Documented
@Retention(SOURCE)
@Target(TYPE_USE)
@IntDef({POSITION_UNKNOWN, POSITION_BEFORE, POSITION_AFTER})
public @interface Position {}

View File

@ -15,12 +15,14 @@
*/
package androidx.media3.common.text;
import static java.lang.annotation.ElementType.TYPE_USE;
import static java.lang.annotation.RetentionPolicy.SOURCE;
import androidx.annotation.IntDef;
import androidx.media3.common.util.UnstableApi;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* A styling span for text emphasis marks.
@ -50,6 +52,7 @@ public final class TextEmphasisSpan implements LanguageFeatureSpan {
*/
@Documented
@Retention(SOURCE)
@Target(TYPE_USE)
@IntDef({MARK_SHAPE_NONE, MARK_SHAPE_CIRCLE, MARK_SHAPE_DOT, MARK_SHAPE_SESAME})
public @interface MarkShape {}
@ -71,6 +74,7 @@ public final class TextEmphasisSpan implements LanguageFeatureSpan {
*/
@Documented
@Retention(SOURCE)
@Target(TYPE_USE)
@IntDef({MARK_FILL_UNKNOWN, MARK_FILL_FILLED, MARK_FILL_OPEN})
public @interface MarkFill {}

View File

@ -15,6 +15,8 @@
*/
package androidx.media3.common.util;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.graphics.SurfaceTexture;
import android.opengl.EGL14;
import android.opengl.EGLConfig;
@ -29,6 +31,7 @@ import androidx.annotation.RequiresApi;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** Generates a {@link SurfaceTexture} using EGL/GLES functions. */
@RequiresApi(17)
@ -47,6 +50,7 @@ public final class EGLSurfaceTexture implements SurfaceTexture.OnFrameAvailableL
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({SECURE_MODE_NONE, SECURE_MODE_SURFACELESS_CONTEXT, SECURE_MODE_PROTECTED_PBUFFER})
public @interface SecureMode {}

View File

@ -16,6 +16,7 @@
package androidx.media3.common.util;
import static androidx.media3.common.util.Assertions.checkNotNull;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.annotation.SuppressLint;
import android.app.Notification;
@ -29,6 +30,7 @@ import androidx.annotation.StringRes;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** Utility methods for displaying {@link Notification Notifications}. */
@SuppressLint("InlinedApi")
@ -42,6 +44,7 @@ public final class NotificationUtil {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({
IMPORTANCE_UNSPECIFIED,
IMPORTANCE_NONE,

View File

@ -15,6 +15,8 @@
*/
package androidx.media3.datasource;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.net.Uri;
import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
@ -25,6 +27,7 @@ import androidx.media3.common.util.UnstableApi;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@ -234,6 +237,7 @@ public final class DataSpec {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef(
flag = true,
value = {
@ -276,6 +280,7 @@ public final class DataSpec {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({HTTP_METHOD_GET, HTTP_METHOD_POST, HTTP_METHOD_HEAD})
public @interface HttpMethod {}
/** HTTP GET method. */

View File

@ -15,6 +15,8 @@
*/
package androidx.media3.datasource;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.text.TextUtils;
import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
@ -28,6 +30,7 @@ import java.io.InterruptedIOException;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.net.SocketTimeoutException;
import java.util.Collections;
import java.util.HashMap;
@ -190,6 +193,7 @@ public interface HttpDataSource extends DataSource {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({TYPE_OPEN, TYPE_READ, TYPE_CLOSE})
public @interface Type {}

View File

@ -18,6 +18,7 @@ package androidx.media3.datasource.cache;
import static androidx.media3.common.util.Assertions.checkNotNull;
import static androidx.media3.common.util.Util.castNonNull;
import static java.lang.Math.min;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.net.Uri;
import androidx.annotation.IntDef;
@ -42,6 +43,7 @@ import java.io.InterruptedIOException;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@ -330,6 +332,7 @@ public final class CacheDataSource implements DataSource {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef(
flag = true,
value = {

View File

@ -15,6 +15,8 @@
*/
package androidx.media3.decoder;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
import androidx.media3.common.C;
@ -24,6 +26,7 @@ import androidx.media3.common.util.UnstableApi;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.nio.ByteBuffer;
import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
@ -68,6 +71,7 @@ public class DecoderInputBuffer extends Buffer {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({
BUFFER_REPLACEMENT_MODE_DISABLED,
BUFFER_REPLACEMENT_MODE_NORMAL,

View File

@ -16,6 +16,7 @@
package androidx.media3.decoder.flac;
import static androidx.media3.common.util.Util.getPcmEncoding;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
@ -41,6 +42,7 @@ import java.io.IOException;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.nio.ByteBuffer;
import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
@ -63,6 +65,7 @@ public final class FlacExtractor implements Extractor {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef(
flag = true,
value = {FLAG_DISABLE_ID3_METADATA})

View File

@ -64,6 +64,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({
PLAYER_COMMAND_DO_NOT_PLAY,
PLAYER_COMMAND_WAIT_FOR_CALLBACK,

View File

@ -18,6 +18,7 @@ package androidx.media3.exoplayer;
import static androidx.media3.common.util.Assertions.checkArgument;
import static androidx.media3.common.util.Assertions.checkNotEmpty;
import static androidx.media3.common.util.Assertions.checkNotNull;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
@ -27,6 +28,7 @@ import androidx.media3.common.util.UnstableApi;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
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.
@ -37,6 +39,7 @@ public final class DecoderReuseEvaluation {
/** Possible outcomes of the evaluation. */
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({
REUSE_RESULT_NO,
REUSE_RESULT_YES_WITH_FLUSH,
@ -59,6 +62,7 @@ public final class DecoderReuseEvaluation {
/** Possible reasons why reuse is not possible. */
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef(
flag = true,
value = {

View File

@ -15,6 +15,8 @@
*/
package androidx.media3.exoplayer;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.content.Context;
import android.media.MediaCodec;
import android.media.PlaybackParams;
@ -43,6 +45,7 @@ import androidx.media3.exoplayer.video.spherical.CameraMotionRenderer;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
@ -62,6 +65,7 @@ public class DefaultRenderersFactory implements RenderersFactory {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({EXTENSION_RENDERER_MODE_OFF, EXTENSION_RENDERER_MODE_ON, EXTENSION_RENDERER_MODE_PREFER})
public @interface ExtensionRendererMode {}
/** Do not allow use of extension renderers. */

View File

@ -15,6 +15,8 @@
*/
package androidx.media3.exoplayer;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.media.MediaCodec;
import android.view.Surface;
import androidx.annotation.IntDef;
@ -26,7 +28,6 @@ import androidx.media3.common.Format;
import androidx.media3.common.Player;
import androidx.media3.common.util.UnstableApi;
import androidx.media3.common.util.Util;
import androidx.media3.exoplayer.PlayerMessage.Target;
import androidx.media3.exoplayer.analytics.PlayerId;
import androidx.media3.exoplayer.source.SampleStream;
import androidx.media3.exoplayer.video.VideoDecoderOutputBufferRenderer;
@ -36,6 +37,7 @@ import java.io.IOException;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Renders media read from a {@link SampleStream}.
@ -90,6 +92,7 @@ public interface Renderer extends PlayerMessage.Target {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef(
open = true,
value = {
@ -108,8 +111,9 @@ public interface Renderer extends PlayerMessage.Target {
public @interface MessageType {}
/**
* 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
* some video renderers may accept other outputs (e.g., {@link VideoDecoderOutputBufferRenderer}).
* ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload is normally a {@link
* 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
* any existing output that it has.
@ -117,15 +121,15 @@ public interface Renderer extends PlayerMessage.Target {
int MSG_SET_VIDEO_OUTPUT = 1;
/**
* 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
* silence and 1 being unity gain.
* ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be a {@link Float}
* with 0 being silence and 1 being unity gain.
*/
int MSG_SET_VOLUME = 2;
/**
* 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}
* instance that will configure the underlying audio track. If not set, the default audio
* attributes will be used. They are suitable for general media playback.
* ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be an {@link
* AudioAttributes} instance that will configure the underlying audio track. If not set, the
* 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
* the audio track is recreated. A new audio session id will also be generated.
@ -144,8 +148,8 @@ public interface Renderer extends PlayerMessage.Target {
int MSG_SET_AUDIO_ATTRIBUTES = 3;
/**
* 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
* scaling modes in {@link C.VideoScalingMode}.
* {@link ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be one of the
* integer scaling modes in {@link C.VideoScalingMode}.
*
* <p>Note that the scaling mode only applies if the {@link Surface} targeted by the renderer is
* owned by a {@link android.view.SurfaceView}.
@ -153,45 +157,46 @@ public interface Renderer extends PlayerMessage.Target {
int MSG_SET_SCALING_MODE = 4;
/**
* 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
* constants in {@link C.VideoChangeFrameRateStrategy}.
* ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be one of the
* integer strategy constants in {@link C.VideoChangeFrameRateStrategy}.
*/
int MSG_SET_CHANGE_FRAME_RATE_STRATEGY = 5;
/**
* 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}
* instance representing an auxiliary audio effect for the underlying audio track.
* ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be an {@link
* AuxEffectInfo} instance representing an auxiliary audio effect for the underlying audio track.
*/
int MSG_SET_AUX_EFFECT_INFO = 6;
/**
* 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.
*/
int MSG_SET_VIDEO_FRAME_METADATA_LISTENER = 7;
/**
* 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}
* instance, or null.
* ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be a {@link
* CameraMotionListener} instance, or null.
*/
int MSG_SET_CAMERA_MOTION_LISTENER = 8;
/**
* 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
* telling whether to enable or disable skipping silences in the audio stream.
* ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be a {@link Boolean}
* instance telling whether to enable or disable skipping silences in the audio stream.
*/
int MSG_SET_SKIP_SILENCE_ENABLED = 9;
/**
* 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
* representing the audio session ID that will be attached to the underlying audio track. Video
* renderers that support tunneling will use the audio session ID when tunneling is enabled.
* ExoPlayer#createMessage(PlayerMessage.Target)}. The message payload should be an {@link
* Integer} instance representing the audio session ID that will be attached to the underlying
* audio track. Video renderers that support tunneling will use the audio session ID when
* tunneling is enabled.
*/
int MSG_SET_AUDIO_SESSION_ID = 10;
/**
* 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
* component.
* ExoPlayer#createMessage(PlayerMessage.Target)}, to inform the renderer that it can schedule
* waking up another component.
*
* <p>The message payload must be a {@link WakeupListener} instance.
*/
@ -208,6 +213,7 @@ public interface Renderer extends PlayerMessage.Target {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({STATE_DISABLED, STATE_ENABLED, STATE_STARTED})
@interface State {}
/**

View File

@ -15,6 +15,8 @@
*/
package androidx.media3.exoplayer;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.annotation.SuppressLint;
import androidx.annotation.IntDef;
import androidx.media3.common.C;
@ -23,6 +25,7 @@ import androidx.media3.common.util.UnstableApi;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** Defines the capabilities of a {@link Renderer}. */
@UnstableApi
@ -32,6 +35,7 @@ public interface RendererCapabilities {
@SuppressWarnings("deprecation")
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({
FORMAT_HANDLED,
FORMAT_EXCEEDS_CAPABILITIES,
@ -60,6 +64,7 @@ public interface RendererCapabilities {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({ADAPTIVE_SEAMLESS, ADAPTIVE_NOT_SEAMLESS, ADAPTIVE_NOT_SUPPORTED})
@interface AdaptiveSupport {}
@ -81,6 +86,7 @@ public interface RendererCapabilities {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({TUNNELING_SUPPORTED, TUNNELING_NOT_SUPPORTED})
@interface TunnelingSupport {}
@ -99,6 +105,7 @@ public interface RendererCapabilities {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({
HARDWARE_ACCELERATION_SUPPORTED,
HARDWARE_ACCELERATION_NOT_SUPPORTED,
@ -119,6 +126,7 @@ public interface RendererCapabilities {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({
DECODER_SUPPORT_PRIMARY,
DECODER_SUPPORT_FALLBACK,
@ -167,6 +175,7 @@ public interface RendererCapabilities {
@Documented
@Retention(RetentionPolicy.SOURCE)
// Intentionally empty to prevent assignment or comparison with individual flags without masking.
@Target(TYPE_USE)
@IntDef({})
@interface Capabilities {}

View File

@ -15,6 +15,8 @@
*/
package androidx.media3.exoplayer.audio;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.media.AudioTrack;
import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
@ -31,6 +33,7 @@ import androidx.media3.exoplayer.analytics.PlayerId;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.nio.ByteBuffer;
/**
@ -260,6 +263,7 @@ public interface AudioSink {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({
SINK_FORMAT_SUPPORTED_DIRECTLY,
SINK_FORMAT_SUPPORTED_WITH_TRANSCODING,

View File

@ -21,6 +21,7 @@ import static androidx.media3.exoplayer.audio.AudioCapabilities.DEFAULT_AUDIO_CA
import static com.google.common.base.MoreObjects.firstNonNull;
import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.annotation.SuppressLint;
import android.media.AudioFormat;
@ -58,6 +59,7 @@ import com.google.errorprone.annotations.InlineMeValidationDisabled;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.ArrayDeque;
@ -391,6 +393,7 @@ public final class DefaultAudioSink implements AudioSink {
/** Audio offload mode configuration. */
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({
OFFLOAD_MODE_DISABLED,
OFFLOAD_MODE_ENABLED_GAPLESS_REQUIRED,
@ -428,6 +431,7 @@ public final class DefaultAudioSink implements AudioSink {
/** Output mode of the audio sink. */
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({OUTPUT_MODE_PCM, OUTPUT_MODE_OFFLOAD, OUTPUT_MODE_PASSTHROUGH})
public @interface OutputMode {}

View File

@ -19,6 +19,7 @@ import static androidx.media3.common.util.Assertions.checkArgument;
import static androidx.media3.common.util.Assertions.checkNotNull;
import static androidx.media3.common.util.Assertions.checkState;
import static androidx.media3.common.util.Assertions.checkStateNotNull;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.annotation.SuppressLint;
import android.media.ResourceBusyException;
@ -49,6 +50,7 @@ import com.google.common.collect.Sets;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@ -263,6 +265,7 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({MODE_PLAYBACK, MODE_QUERY, MODE_DOWNLOAD, MODE_RELEASE})
public @interface Mode {}
/**

View File

@ -15,6 +15,8 @@
*/
package androidx.media3.exoplayer.drm;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.media.DeniedByServerException;
import android.media.MediaCryptoException;
import android.media.MediaDrm;
@ -33,6 +35,7 @@ import androidx.media3.exoplayer.analytics.PlayerId;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -228,6 +231,7 @@ public interface ExoMediaDrm {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({
REQUEST_TYPE_UNKNOWN,
REQUEST_TYPE_INITIAL,

View File

@ -17,6 +17,7 @@ package androidx.media3.exoplayer.source;
import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
@ -32,6 +33,7 @@ import java.io.IOException;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayList;
/**
@ -50,6 +52,7 @@ public final class ClippingMediaSource extends CompositeMediaSource<Void> {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({REASON_INVALID_PERIOD_COUNT, REASON_NOT_SEEKABLE_TO_START, REASON_START_EXCEEDS_END})
public @interface Reason {}
/** The wrapped source doesn't consist of a single period. */

View File

@ -17,6 +17,7 @@ package androidx.media3.exoplayer.source;
import static androidx.media3.common.util.Assertions.checkNotNull;
import static java.lang.Math.min;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
@ -32,6 +33,7 @@ import java.io.IOException;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@ -52,6 +54,7 @@ public final class MergingMediaSource extends CompositeMediaSource<Integer> {
/** The reason the merge failed. One of {@link #REASON_PERIOD_COUNT_MISMATCH}. */
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({REASON_PERIOD_COUNT_MISMATCH})
public @interface Reason {}
/** The sources have different period counts. */

View File

@ -15,6 +15,8 @@
*/
package androidx.media3.exoplayer.source;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef;
import androidx.media3.common.C;
import androidx.media3.common.util.UnstableApi;
@ -25,6 +27,7 @@ import java.io.IOException;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** A stream of media samples (and associated format information). */
@UnstableApi
@ -36,6 +39,7 @@ public interface SampleStream {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef(
flag = true,
value = {FLAG_PEEK, FLAG_REQUIRE_FORMAT, FLAG_OMIT_SAMPLE_DATA})
@ -69,6 +73,7 @@ public interface SampleStream {
/** Return values of {@link #readData}. */
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({C.RESULT_NOTHING_READ, C.RESULT_FORMAT_READ, C.RESULT_BUFFER_READ})
@interface ReadDataResult {}

View File

@ -17,6 +17,7 @@ package androidx.media3.exoplayer.source.ads;
import static androidx.media3.common.util.Assertions.checkNotNull;
import static androidx.media3.common.util.Assertions.checkState;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.net.Uri;
import android.os.Handler;
@ -47,6 +48,7 @@ import java.io.IOException;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -74,6 +76,7 @@ public final class AdsMediaSource extends CompositeMediaSource<MediaPeriodId> {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({TYPE_AD, TYPE_AD_GROUP, TYPE_ALL_ADS, TYPE_UNEXPECTED})
public @interface Type {}
/** Type for when an ad failed to load. The ad will be skipped. */

View File

@ -1428,6 +1428,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({SELECTION_ELIGIBILITY_NO, SELECTION_ELIGIBILITY_FIXED, SELECTION_ELIGIBILITY_ADAPTIVE})
protected @interface SelectionEligibility {}

View File

@ -16,6 +16,7 @@
package androidx.media3.exoplayer.upstream;
import static androidx.media3.common.util.Assertions.checkArgument;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
@ -29,6 +30,7 @@ import java.io.IOException;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* A policy that defines how load errors are handled.
@ -54,6 +56,7 @@ public interface LoadErrorHandlingPolicy {
/** Fallback type. One of {@link #FALLBACK_TYPE_LOCATION} or {@link #FALLBACK_TYPE_TRACK}. */
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({FALLBACK_TYPE_LOCATION, FALLBACK_TYPE_TRACK})
@interface FallbackType {}

View File

@ -17,6 +17,7 @@ package androidx.media3.exoplayer.hls.playlist;
import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.net.Uri;
import androidx.annotation.IntDef;
@ -31,6 +32,7 @@ import com.google.common.collect.Iterables;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -387,6 +389,7 @@ public final class HlsMediaPlaylist extends HlsPlaylist {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({PLAYLIST_TYPE_UNKNOWN, PLAYLIST_TYPE_VOD, PLAYLIST_TYPE_EVENT})
public @interface PlaylistType {}

View File

@ -15,6 +15,8 @@
*/
package androidx.media3.extractor;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef;
import androidx.media3.common.C;
import androidx.media3.common.ParserException;
@ -24,6 +26,7 @@ import androidx.media3.common.util.UnstableApi;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** Utility methods for handling AAC audio streams. */
@UnstableApi
@ -159,6 +162,7 @@ public final class AacUtil {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({
AUDIO_OBJECT_TYPE_AAC_LC,
AUDIO_OBJECT_TYPE_AAC_SBR,

View File

@ -15,6 +15,8 @@
*/
package androidx.media3.extractor;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
import androidx.media3.common.C;
@ -29,6 +31,7 @@ import androidx.media3.extractor.Ac3Util.SyncFrameInfo.StreamType;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.nio.ByteBuffer;
/**
@ -47,6 +50,7 @@ public final class Ac3Util {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({STREAM_TYPE_UNDEFINED, STREAM_TYPE_TYPE0, STREAM_TYPE_TYPE1, STREAM_TYPE_TYPE2})
public @interface StreamType {}
/** Undefined AC3 stream type. */

View File

@ -15,6 +15,8 @@
*/
package androidx.media3.extractor;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
import androidx.media3.common.C;
@ -25,6 +27,7 @@ import java.io.IOException;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
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
@ -407,6 +410,7 @@ public abstract class BinarySearchSeeker {
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({
TYPE_TARGET_TIMESTAMP_FOUND,
TYPE_POSITION_OVERESTIMATED,

View File

@ -15,6 +15,8 @@
*/
package androidx.media3.extractor;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef;
import androidx.media3.common.C;
import androidx.media3.common.util.UnstableApi;
@ -22,6 +24,7 @@ import java.io.IOException;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** Extracts media data from a container format. */
@UnstableApi
@ -51,6 +54,7 @@ public interface Extractor {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef(value = {RESULT_CONTINUE, RESULT_SEEK, RESULT_END_OF_INPUT})
@interface ReadResult {}

View File

@ -15,6 +15,8 @@
*/
package androidx.media3.extractor;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
import androidx.media3.common.C;
@ -27,6 +29,7 @@ import java.io.IOException;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Arrays;
/** Receives track level data extracted by an {@link Extractor}. */
@ -95,6 +98,7 @@ public interface TrackOutput {
/** Defines the part of the sample data to which a call to {@link #sampleData} corresponds. */
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({SAMPLE_DATA_PART_MAIN, SAMPLE_DATA_PART_ENCRYPTION, SAMPLE_DATA_PART_SUPPLEMENTAL})
@interface SampleDataPart {}

View File

@ -15,6 +15,8 @@
*/
package androidx.media3.extractor.amr;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef;
import androidx.media3.common.C;
import androidx.media3.common.Format;
@ -38,6 +40,7 @@ import java.io.IOException;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Arrays;
import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
@ -62,6 +65,7 @@ public final class AmrExtractor implements Extractor {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef(
flag = true,
value = {FLAG_ENABLE_CONSTANT_BITRATE_SEEKING, FLAG_ENABLE_CONSTANT_BITRATE_SEEKING_ALWAYS})

View File

@ -67,6 +67,7 @@ public final class FlacExtractor implements Extractor {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef(
flag = true,
value = {FLAG_DISABLE_ID3_METADATA})

View File

@ -15,6 +15,8 @@
*/
package androidx.media3.extractor.mkv;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef;
import androidx.media3.common.ParserException;
import androidx.media3.common.util.UnstableApi;
@ -23,6 +25,7 @@ import java.io.IOException;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** Defines EBML element IDs/types and processes events. */
@UnstableApi
@ -35,6 +38,7 @@ public interface EbmlProcessor {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({
ELEMENT_TYPE_UNKNOWN,
ELEMENT_TYPE_MASTER,

View File

@ -21,6 +21,7 @@ import static androidx.media3.common.util.Assertions.checkState;
import static androidx.media3.common.util.Assertions.checkStateNotNull;
import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.util.Pair;
import android.util.SparseArray;
@ -59,6 +60,7 @@ import java.io.IOException;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.ArrayList;
@ -87,6 +89,7 @@ public class MatroskaExtractor implements Extractor {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef(
flag = true,
value = {FLAG_DISABLE_SEEK_FOR_CUES})

View File

@ -15,6 +15,8 @@
*/
package androidx.media3.extractor.mp3;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
import androidx.media3.common.C;
@ -47,6 +49,7 @@ import java.io.IOException;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
@ -65,6 +68,7 @@ public final class Mp3Extractor implements Extractor {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef(
flag = true,
value = {

View File

@ -21,6 +21,7 @@ import static androidx.media3.common.util.Util.castNonNull;
import static androidx.media3.common.util.Util.nullSafeArrayCopy;
import static androidx.media3.extractor.mp4.AtomParsers.parseTraks;
import static java.lang.Math.max;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.util.Pair;
import android.util.SparseArray;
@ -57,6 +58,7 @@ import java.io.IOException;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
@ -80,6 +82,7 @@ public class FragmentedMp4Extractor implements Extractor {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef(
flag = true,
value = {

View File

@ -76,6 +76,7 @@ public final class Mp4Extractor implements Extractor, SeekMap {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef(
flag = true,
value = {

View File

@ -15,6 +15,8 @@
*/
package androidx.media3.extractor.mp4;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
import androidx.media3.common.C;
@ -23,6 +25,7 @@ import androidx.media3.common.util.UnstableApi;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** Encapsulates information describing an MP4 track. */
@UnstableApi
@ -34,6 +37,7 @@ public final class Track {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({TRANSFORMATION_NONE, TRANSFORMATION_CEA608_CDAT})
public @interface Transformation {}
/** A no-op sample transformation. */

View File

@ -51,6 +51,7 @@ public final class WebvttCssStyle {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef(
flag = true,
value = {UNSPECIFIED, STYLE_NORMAL, STYLE_BOLD, STYLE_ITALIC, STYLE_BOLD_ITALIC})
@ -67,6 +68,7 @@ public final class WebvttCssStyle {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({UNSPECIFIED, FONT_SIZE_UNIT_PIXEL, FONT_SIZE_UNIT_EM, FONT_SIZE_UNIT_PERCENT})
public @interface FontSizeUnit {}

View File

@ -18,6 +18,7 @@ package androidx.media3.extractor.ts;
import static androidx.media3.extractor.metadata.id3.Id3Decoder.ID3_HEADER_LENGTH;
import static androidx.media3.extractor.metadata.id3.Id3Decoder.ID3_TAG;
import static androidx.media3.extractor.ts.TsPayloadReader.FLAG_DATA_ALIGNMENT_INDICATOR;
import static java.lang.annotation.ElementType.TYPE_USE;
import androidx.annotation.IntDef;
import androidx.media3.common.C;
@ -41,6 +42,7 @@ import java.io.IOException;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
@ -58,6 +60,7 @@ public final class AdtsExtractor implements Extractor {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef(
flag = true,
value = {FLAG_ENABLE_CONSTANT_BITRATE_SEEKING, FLAG_ENABLE_CONSTANT_BITRATE_SEEKING_ALWAYS})

View File

@ -15,6 +15,8 @@
*/
package androidx.media3.extractor.ts;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.util.SparseArray;
import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
@ -28,6 +30,7 @@ import com.google.common.collect.ImmutableList;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayList;
import java.util.List;
@ -44,6 +47,7 @@ public final class DefaultTsPayloadReaderFactory implements TsPayloadReader.Fact
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef(
flag = true,
value = {

View File

@ -16,6 +16,7 @@
package androidx.media3.extractor.ts;
import static androidx.media3.extractor.ts.TsPayloadReader.FLAG_PAYLOAD_UNIT_START_INDICATOR;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.util.SparseArray;
import android.util.SparseBooleanArray;
@ -45,6 +46,7 @@ import java.io.IOException;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@ -65,6 +67,7 @@ public final class TsExtractor implements Extractor {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({MODE_MULTI_PMT, MODE_SINGLE_PMT, MODE_HLS})
public @interface Mode {}

View File

@ -15,6 +15,8 @@
*/
package androidx.media3.extractor.ts;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.util.SparseArray;
import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
@ -27,6 +29,7 @@ import androidx.media3.extractor.TrackOutput;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Collections;
import java.util.List;
@ -178,6 +181,7 @@ public interface TsPayloadReader {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef(
flag = true,
value = {

View File

@ -32,6 +32,7 @@ import static androidx.media3.common.Player.EVENT_SHUFFLE_MODE_ENABLED_CHANGED;
import static androidx.media3.common.Player.EVENT_TIMELINE_CHANGED;
import static androidx.media3.common.util.Assertions.checkArgument;
import static androidx.media3.common.util.Assertions.checkStateNotNull;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.app.Notification;
import android.app.NotificationChannel;
@ -67,6 +68,7 @@ import com.google.common.util.concurrent.ListenableFuture;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -412,6 +414,7 @@ public class PlayerNotificationManager {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({
NotificationCompat.VISIBILITY_PRIVATE,
NotificationCompat.VISIBILITY_PUBLIC,
@ -427,6 +430,7 @@ public class PlayerNotificationManager {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({
NotificationCompat.PRIORITY_DEFAULT,
NotificationCompat.PRIORITY_MAX,

View File

@ -23,6 +23,7 @@ import static androidx.media3.exoplayer.DefaultLoadControl.DEFAULT_BUFFER_FOR_PL
import static androidx.media3.exoplayer.DefaultLoadControl.DEFAULT_MAX_BUFFER_MS;
import static androidx.media3.exoplayer.DefaultLoadControl.DEFAULT_MIN_BUFFER_MS;
import static java.lang.Math.min;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.content.Context;
import android.graphics.Matrix;
@ -63,6 +64,7 @@ import java.io.IOException;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
/**
@ -503,6 +505,7 @@ public final class Transformer {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({
PROGRESS_STATE_WAITING_FOR_AVAILABILITY,
PROGRESS_STATE_AVAILABLE,

View File

@ -15,6 +15,8 @@
*/
package androidx.media3.ui;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
@ -25,6 +27,7 @@ import androidx.media3.common.util.UnstableApi;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** A {@link FrameLayout} that resizes itself to match a specified aspect ratio. */
@UnstableApi
@ -53,6 +56,7 @@ public final class AspectRatioFrameLayout extends FrameLayout {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({
RESIZE_MODE_FIT,
RESIZE_MODE_FIXED_WIDTH,

View File

@ -15,6 +15,8 @@
*/
package androidx.media3.ui;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.graphics.Color;
import android.graphics.Typeface;
import android.view.accessibility.CaptioningManager;
@ -27,6 +29,7 @@ import androidx.media3.common.util.Util;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** A compatibility wrapper for {@link CaptionStyle}. */
@UnstableApi
@ -39,6 +42,7 @@ public final class CaptionStyleCompat {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({
EDGE_TYPE_NONE,
EDGE_TYPE_OUTLINE,

View File

@ -17,6 +17,7 @@ package androidx.media3.ui;
import static androidx.media3.common.Player.COMMAND_GET_TEXT;
import static androidx.media3.common.Player.COMMAND_SET_VIDEO_SURFACE;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.annotation.SuppressLint;
import android.content.Context;
@ -67,6 +68,7 @@ import com.google.common.collect.ImmutableList;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayList;
import java.util.List;
import org.checkerframework.checker.nullness.qual.EnsuresNonNullIf;
@ -265,6 +267,7 @@ public class LegacyPlayerView extends FrameLayout implements AdViewProvider {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({SHOW_BUFFERING_NEVER, SHOW_BUFFERING_WHEN_PLAYING, SHOW_BUFFERING_ALWAYS})
public @interface ShowBuffering {}
/** The buffering view is never shown. */

View File

@ -30,6 +30,7 @@ import static androidx.media3.common.Player.EVENT_SHUFFLE_MODE_ENABLED_CHANGED;
import static androidx.media3.common.Player.EVENT_TIMELINE_CHANGED;
import static androidx.media3.common.util.Assertions.checkArgument;
import static androidx.media3.common.util.Assertions.checkState;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.app.Notification;
import android.app.NotificationChannel;
@ -59,6 +60,7 @@ import androidx.media3.common.util.Util;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@ -639,6 +641,7 @@ public class PlayerNotificationManager {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({
NotificationCompat.VISIBILITY_PRIVATE,
NotificationCompat.VISIBILITY_PUBLIC,
@ -654,6 +657,7 @@ public class PlayerNotificationManager {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({
NotificationCompat.PRIORITY_DEFAULT,
NotificationCompat.PRIORITY_MAX,

View File

@ -18,6 +18,7 @@ package androidx.media3.ui;
import static androidx.media3.common.Player.COMMAND_GET_TEXT;
import static androidx.media3.common.Player.COMMAND_SET_VIDEO_SURFACE;
import static androidx.media3.common.util.Assertions.checkNotNull;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.annotation.SuppressLint;
import android.content.Context;
@ -68,6 +69,7 @@ import com.google.common.collect.ImmutableList;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayList;
import java.util.List;
import org.checkerframework.checker.nullness.qual.EnsuresNonNullIf;
@ -187,6 +189,7 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(TYPE_USE)
@IntDef({SHOW_BUFFERING_NEVER, SHOW_BUFFERING_WHEN_PLAYING, SHOW_BUFFERING_ALWAYS})
public @interface ShowBuffering {}
/** The buffering view is never shown. */

View File

@ -16,6 +16,7 @@
*/
package androidx.media3.ui;
import static java.lang.annotation.ElementType.TYPE_USE;
import static java.lang.annotation.RetentionPolicy.SOURCE;
import android.content.Context;
@ -36,6 +37,7 @@ import androidx.media3.common.util.UnstableApi;
import androidx.media3.common.util.Util;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@ -113,6 +115,7 @@ public final class SubtitleView extends FrameLayout implements Player.Listener {
*/
@Documented
@Retention(SOURCE)
@Target(TYPE_USE)
@IntDef({VIEW_TYPE_CANVAS, VIEW_TYPE_WEB})
public @interface ViewType {}