diff --git a/library/core/src/main/java/com/google/android/exoplayer2/C.java b/library/core/src/main/java/com/google/android/exoplayer2/C.java index 8256716a25..de4ad65b44 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/C.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/C.java @@ -380,14 +380,10 @@ public final class C { * Flag for empty buffers that signal that the end of the stream was reached. */ public static final int BUFFER_FLAG_END_OF_STREAM = MediaCodec.BUFFER_FLAG_END_OF_STREAM; - /** - * Indicates that a buffer is (at least partially) encrypted. - */ - public static final int BUFFER_FLAG_ENCRYPTED = 0x40000000; - /** - * Indicates that a buffer should be decoded but not rendered. - */ - public static final int BUFFER_FLAG_DECODE_ONLY = 0x80000000; + /** Indicates that a buffer is (at least partially) encrypted. */ + public static final int BUFFER_FLAG_ENCRYPTED = 1 << 30; // 0x40000000 + /** Indicates that a buffer should be decoded but not rendered. */ + public static final int BUFFER_FLAG_DECODE_ONLY = 1 << 31; // 0x80000000 /** * Video scaling modes for {@link MediaCodec}-based {@link Renderer}s. @@ -421,15 +417,13 @@ public final class C { * Indicates that the track should be selected if user preferences do not state otherwise. */ public static final int SELECTION_FLAG_DEFAULT = 1; - /** - * Indicates that the track must be displayed. Only applies to text tracks. - */ - public static final int SELECTION_FLAG_FORCED = 2; + /** Indicates that the track must be displayed. Only applies to text tracks. */ + public static final int SELECTION_FLAG_FORCED = 1 << 1; // 2 /** * Indicates that the player may choose to play the track in absence of an explicit user * preference. */ - public static final int SELECTION_FLAG_AUTOSELECT = 4; + public static final int SELECTION_FLAG_AUTOSELECT = 1 << 2; // 4 /** * Represents an undetermined language as an ISO 639 alpha-3 language code. diff --git a/library/core/src/main/java/com/google/android/exoplayer2/extractor/mp4/FragmentedMp4Extractor.java b/library/core/src/main/java/com/google/android/exoplayer2/extractor/mp4/FragmentedMp4Extractor.java index a67c990193..c8002646e0 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/extractor/mp4/FragmentedMp4Extractor.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/extractor/mp4/FragmentedMp4Extractor.java @@ -77,24 +77,20 @@ public final class FragmentedMp4Extractor implements Extractor { * This flag does nothing if the stream is not a video stream. */ public static final int FLAG_WORKAROUND_EVERY_VIDEO_FRAME_IS_SYNC_FRAME = 1; - /** - * Flag to ignore any tfdt boxes in the stream. - */ - public static final int FLAG_WORKAROUND_IGNORE_TFDT_BOX = 2; + /** Flag to ignore any tfdt boxes in the stream. */ + public static final int FLAG_WORKAROUND_IGNORE_TFDT_BOX = 1 << 1; // 2 /** * Flag to indicate that the extractor should output an event message metadata track. Any event * messages in the stream will be delivered as samples to this track. */ - public static final int FLAG_ENABLE_EMSG_TRACK = 4; + public static final int FLAG_ENABLE_EMSG_TRACK = 1 << 2; // 4 /** * Flag to indicate that the {@link Track} was sideloaded, instead of being declared by the MP4 * container. */ - private static final int FLAG_SIDELOADED = 8; - /** - * Flag to ignore any edit lists in the stream. - */ - public static final int FLAG_WORKAROUND_IGNORE_EDIT_LISTS = 16; + private static final int FLAG_SIDELOADED = 1 << 3; // 8 + /** Flag to ignore any edit lists in the stream. */ + public static final int FLAG_WORKAROUND_IGNORE_EDIT_LISTS = 1 << 4; // 16 private static final String TAG = "FragmentedMp4Extractor"; private static final int SAMPLE_GROUP_TYPE_seig = Util.getIntegerCodeForString("seig"); diff --git a/library/core/src/main/java/com/google/android/exoplayer2/upstream/DataSpec.java b/library/core/src/main/java/com/google/android/exoplayer2/upstream/DataSpec.java index ad7a9d0147..9f95fc662c 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/upstream/DataSpec.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/upstream/DataSpec.java @@ -46,13 +46,13 @@ public final class DataSpec { * {@link DataSource#open(DataSpec)} will typically be {@link C#LENGTH_UNSET}. The data read from * {@link DataSource#read(byte[], int, int)} will be the decompressed data. */ - public static final int FLAG_ALLOW_GZIP = 1 << 0; + public static final int FLAG_ALLOW_GZIP = 1; /** * Permits content to be cached even if its length can not be resolved. Typically this's the case * for progressive live streams and when {@link #FLAG_ALLOW_GZIP} is used. */ - public static final int FLAG_ALLOW_CACHING_UNKNOWN_LENGTH = 1 << 1; + public static final int FLAG_ALLOW_CACHING_UNKNOWN_LENGTH = 1 << 1; // 2 /** * The source from which data should be read. diff --git a/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheDataSource.java b/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheDataSource.java index 04c0990147..9a116b08a6 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheDataSource.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheDataSource.java @@ -65,20 +65,20 @@ public final class CacheDataSource implements DataSource { * A flag indicating whether we will block reads if the cache key is locked. If unset then data is * read from upstream if the cache key is locked, regardless of whether the data is cached. */ - public static final int FLAG_BLOCK_ON_CACHE = 1 << 0; + public static final int FLAG_BLOCK_ON_CACHE = 1; /** * A flag indicating whether the cache is bypassed following any cache related error. If set * then cache related exceptions may be thrown for one cycle of open, read and close calls. * Subsequent cycles of these calls will then bypass the cache. */ - public static final int FLAG_IGNORE_CACHE_ON_ERROR = 1 << 1; + public static final int FLAG_IGNORE_CACHE_ON_ERROR = 1 << 1; // 2 /** * A flag indicating that the cache should be bypassed for requests whose lengths are unset. This * flag is provided for legacy reasons only. */ - public static final int FLAG_IGNORE_CACHE_FOR_UNSET_LENGTH_REQUESTS = 1 << 2; + public static final int FLAG_IGNORE_CACHE_FOR_UNSET_LENGTH_REQUESTS = 1 << 2; // 4 /** Reasons the cache may be ignored. */ @Retention(RetentionPolicy.SOURCE) diff --git a/library/core/src/main/java/com/google/android/exoplayer2/util/RepeatModeUtil.java b/library/core/src/main/java/com/google/android/exoplayer2/util/RepeatModeUtil.java index 53cb051230..d386206bdd 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/util/RepeatModeUtil.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/util/RepeatModeUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 The Android Open Source Project + * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,10 +40,8 @@ public final class RepeatModeUtil { * "Repeat One" button enabled. */ public static final int REPEAT_TOGGLE_MODE_ONE = 1; - /** - * "Repeat All" button enabled. - */ - public static final int REPEAT_TOGGLE_MODE_ALL = 2; + /** "Repeat All" button enabled. */ + public static final int REPEAT_TOGGLE_MODE_ALL = 1 << 1; // 2 private RepeatModeUtil() { // Prevent instantiation.