mirror of
https://github.com/androidx/media.git
synced 2025-05-08 08:00:49 +08:00
Annotate methods that always return this
with @CanIgnoreReturnValue
It's always safe to ignore the result of these methods, because the caller already has a reference to the returned value. PiperOrigin-RevId: 462388947
This commit is contained in:
parent
dae7a99875
commit
21cab6124d
@ -24,6 +24,7 @@ dependencies {
|
|||||||
implementation project(modulePrefix + 'library-common')
|
implementation project(modulePrefix + 'library-common')
|
||||||
implementation project(modulePrefix + 'library-datasource')
|
implementation project(modulePrefix + 'library-datasource')
|
||||||
implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion
|
implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion
|
||||||
|
compileOnly 'com.google.errorprone:error_prone_annotations:' + errorProneVersion
|
||||||
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
|
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
|
||||||
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
|
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
|
||||||
androidTestImplementation 'androidx.test:rules:' + androidxTestRulesVersion
|
androidTestImplementation 'androidx.test:rules:' + androidxTestRulesVersion
|
||||||
|
@ -41,6 +41,7 @@ import com.google.common.base.Ascii;
|
|||||||
import com.google.common.base.Predicate;
|
import com.google.common.base.Predicate;
|
||||||
import com.google.common.net.HttpHeaders;
|
import com.google.common.net.HttpHeaders;
|
||||||
import com.google.common.primitives.Longs;
|
import com.google.common.primitives.Longs;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InterruptedIOException;
|
import java.io.InterruptedIOException;
|
||||||
import java.net.SocketTimeoutException;
|
import java.net.SocketTimeoutException;
|
||||||
@ -140,6 +141,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
|
|||||||
readTimeoutMs = DEFAULT_READ_TIMEOUT_MILLIS;
|
readTimeoutMs = DEFAULT_READ_TIMEOUT_MILLIS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public final Factory setDefaultRequestProperties(Map<String, String> defaultRequestProperties) {
|
public final Factory setDefaultRequestProperties(Map<String, String> defaultRequestProperties) {
|
||||||
this.defaultRequestProperties.clearAndSet(defaultRequestProperties);
|
this.defaultRequestProperties.clearAndSet(defaultRequestProperties);
|
||||||
@ -159,6 +161,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
|
|||||||
* agent of the underlying {@link CronetEngine}.
|
* agent of the underlying {@link CronetEngine}.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setUserAgent(@Nullable String userAgent) {
|
public Factory setUserAgent(@Nullable String userAgent) {
|
||||||
this.userAgent = userAgent;
|
this.userAgent = userAgent;
|
||||||
if (internalFallbackFactory != null) {
|
if (internalFallbackFactory != null) {
|
||||||
@ -177,6 +180,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
|
|||||||
* UrlRequest.Builder#REQUEST_PRIORITY_*} constants.
|
* UrlRequest.Builder#REQUEST_PRIORITY_*} constants.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setRequestPriority(int requestPriority) {
|
public Factory setRequestPriority(int requestPriority) {
|
||||||
this.requestPriority = requestPriority;
|
this.requestPriority = requestPriority;
|
||||||
return this;
|
return this;
|
||||||
@ -190,6 +194,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
|
|||||||
* @param connectTimeoutMs The connect timeout, in milliseconds, that will be used.
|
* @param connectTimeoutMs The connect timeout, in milliseconds, that will be used.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setConnectionTimeoutMs(int connectTimeoutMs) {
|
public Factory setConnectionTimeoutMs(int connectTimeoutMs) {
|
||||||
this.connectTimeoutMs = connectTimeoutMs;
|
this.connectTimeoutMs = connectTimeoutMs;
|
||||||
if (internalFallbackFactory != null) {
|
if (internalFallbackFactory != null) {
|
||||||
@ -206,6 +211,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
|
|||||||
* @param resetTimeoutOnRedirects Whether the connect timeout is reset when a redirect occurs.
|
* @param resetTimeoutOnRedirects Whether the connect timeout is reset when a redirect occurs.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setResetTimeoutOnRedirects(boolean resetTimeoutOnRedirects) {
|
public Factory setResetTimeoutOnRedirects(boolean resetTimeoutOnRedirects) {
|
||||||
this.resetTimeoutOnRedirects = resetTimeoutOnRedirects;
|
this.resetTimeoutOnRedirects = resetTimeoutOnRedirects;
|
||||||
return this;
|
return this;
|
||||||
@ -221,6 +227,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
|
|||||||
* to the redirect url in the "Cookie" header.
|
* to the redirect url in the "Cookie" header.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setHandleSetCookieRequests(boolean handleSetCookieRequests) {
|
public Factory setHandleSetCookieRequests(boolean handleSetCookieRequests) {
|
||||||
this.handleSetCookieRequests = handleSetCookieRequests;
|
this.handleSetCookieRequests = handleSetCookieRequests;
|
||||||
return this;
|
return this;
|
||||||
@ -234,6 +241,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
|
|||||||
* @param readTimeoutMs The connect timeout, in milliseconds, that will be used.
|
* @param readTimeoutMs The connect timeout, in milliseconds, that will be used.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setReadTimeoutMs(int readTimeoutMs) {
|
public Factory setReadTimeoutMs(int readTimeoutMs) {
|
||||||
this.readTimeoutMs = readTimeoutMs;
|
this.readTimeoutMs = readTimeoutMs;
|
||||||
if (internalFallbackFactory != null) {
|
if (internalFallbackFactory != null) {
|
||||||
@ -252,6 +260,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
|
|||||||
* predicate that was previously set.
|
* predicate that was previously set.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setContentTypePredicate(@Nullable Predicate<String> contentTypePredicate) {
|
public Factory setContentTypePredicate(@Nullable Predicate<String> contentTypePredicate) {
|
||||||
this.contentTypePredicate = contentTypePredicate;
|
this.contentTypePredicate = contentTypePredicate;
|
||||||
if (internalFallbackFactory != null) {
|
if (internalFallbackFactory != null) {
|
||||||
@ -264,6 +273,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
|
|||||||
* Sets whether we should keep the POST method and body when we have HTTP 302 redirects for a
|
* Sets whether we should keep the POST method and body when we have HTTP 302 redirects for a
|
||||||
* POST request.
|
* POST request.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setKeepPostFor302Redirects(boolean keepPostFor302Redirects) {
|
public Factory setKeepPostFor302Redirects(boolean keepPostFor302Redirects) {
|
||||||
this.keepPostFor302Redirects = keepPostFor302Redirects;
|
this.keepPostFor302Redirects = keepPostFor302Redirects;
|
||||||
if (internalFallbackFactory != null) {
|
if (internalFallbackFactory != null) {
|
||||||
@ -282,6 +292,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
|
|||||||
* @param transferListener The listener that will be used.
|
* @param transferListener The listener that will be used.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setTransferListener(@Nullable TransferListener transferListener) {
|
public Factory setTransferListener(@Nullable TransferListener transferListener) {
|
||||||
this.transferListener = transferListener;
|
this.transferListener = transferListener;
|
||||||
if (internalFallbackFactory != null) {
|
if (internalFallbackFactory != null) {
|
||||||
@ -301,6 +312,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
|
|||||||
* @deprecated Do not use {@link CronetDataSource} or its factory in cases where a suitable
|
* @deprecated Do not use {@link CronetDataSource} or its factory in cases where a suitable
|
||||||
* {@link CronetEngine} is not available. Use the fallback factory directly in such cases.
|
* {@link CronetEngine} is not available. Use the fallback factory directly in such cases.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Factory setFallbackFactory(@Nullable HttpDataSource.Factory fallbackFactory) {
|
public Factory setFallbackFactory(@Nullable HttpDataSource.Factory fallbackFactory) {
|
||||||
this.fallbackFactory = fallbackFactory;
|
this.fallbackFactory = fallbackFactory;
|
||||||
|
@ -28,6 +28,7 @@ dependencies {
|
|||||||
api 'com.google.ads.interactivemedia.v3:interactivemedia:3.26.0'
|
api 'com.google.ads.interactivemedia.v3:interactivemedia:3.26.0'
|
||||||
implementation project(modulePrefix + 'library-core')
|
implementation project(modulePrefix + 'library-core')
|
||||||
implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion
|
implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion
|
||||||
|
compileOnly 'com.google.errorprone:error_prone_annotations:' + errorProneVersion
|
||||||
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
|
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
|
||||||
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
|
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
|
||||||
androidTestImplementation project(modulePrefix + 'testutils')
|
androidTestImplementation project(modulePrefix + 'testutils')
|
||||||
|
@ -55,6 +55,7 @@ import com.google.android.exoplayer2.util.MimeTypes;
|
|||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -151,6 +152,7 @@ public final class ImaAdsLoader implements AdsLoader {
|
|||||||
* @param imaSdkSettings The {@link ImaSdkSettings}.
|
* @param imaSdkSettings The {@link ImaSdkSettings}.
|
||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setImaSdkSettings(ImaSdkSettings imaSdkSettings) {
|
public Builder setImaSdkSettings(ImaSdkSettings imaSdkSettings) {
|
||||||
this.imaSdkSettings = checkNotNull(imaSdkSettings);
|
this.imaSdkSettings = checkNotNull(imaSdkSettings);
|
||||||
return this;
|
return this;
|
||||||
@ -164,6 +166,7 @@ public final class ImaAdsLoader implements AdsLoader {
|
|||||||
* @param adErrorListener The ad error listener.
|
* @param adErrorListener The ad error listener.
|
||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAdErrorListener(AdErrorListener adErrorListener) {
|
public Builder setAdErrorListener(AdErrorListener adErrorListener) {
|
||||||
this.adErrorListener = checkNotNull(adErrorListener);
|
this.adErrorListener = checkNotNull(adErrorListener);
|
||||||
return this;
|
return this;
|
||||||
@ -176,6 +179,7 @@ public final class ImaAdsLoader implements AdsLoader {
|
|||||||
* @param adEventListener The ad event listener.
|
* @param adEventListener The ad event listener.
|
||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAdEventListener(AdEventListener adEventListener) {
|
public Builder setAdEventListener(AdEventListener adEventListener) {
|
||||||
this.adEventListener = checkNotNull(adEventListener);
|
this.adEventListener = checkNotNull(adEventListener);
|
||||||
return this;
|
return this;
|
||||||
@ -191,6 +195,7 @@ public final class ImaAdsLoader implements AdsLoader {
|
|||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
* @see com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer.VideoAdPlayerCallback
|
* @see com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer.VideoAdPlayerCallback
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setVideoAdPlayerCallback(
|
public Builder setVideoAdPlayerCallback(
|
||||||
VideoAdPlayer.VideoAdPlayerCallback videoAdPlayerCallback) {
|
VideoAdPlayer.VideoAdPlayerCallback videoAdPlayerCallback) {
|
||||||
this.videoAdPlayerCallback = checkNotNull(videoAdPlayerCallback);
|
this.videoAdPlayerCallback = checkNotNull(videoAdPlayerCallback);
|
||||||
@ -204,6 +209,7 @@ public final class ImaAdsLoader implements AdsLoader {
|
|||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
* @see AdsRenderingSettings#setUiElements(Set)
|
* @see AdsRenderingSettings#setUiElements(Set)
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAdUiElements(Set<UiElement> adUiElements) {
|
public Builder setAdUiElements(Set<UiElement> adUiElements) {
|
||||||
this.adUiElements = ImmutableSet.copyOf(checkNotNull(adUiElements));
|
this.adUiElements = ImmutableSet.copyOf(checkNotNull(adUiElements));
|
||||||
return this;
|
return this;
|
||||||
@ -216,6 +222,7 @@ public final class ImaAdsLoader implements AdsLoader {
|
|||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
* @see AdDisplayContainer#setCompanionSlots(Collection)
|
* @see AdDisplayContainer#setCompanionSlots(Collection)
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setCompanionAdSlots(Collection<CompanionAdSlot> companionAdSlots) {
|
public Builder setCompanionAdSlots(Collection<CompanionAdSlot> companionAdSlots) {
|
||||||
this.companionAdSlots = ImmutableList.copyOf(checkNotNull(companionAdSlots));
|
this.companionAdSlots = ImmutableList.copyOf(checkNotNull(companionAdSlots));
|
||||||
return this;
|
return this;
|
||||||
@ -233,6 +240,7 @@ public final class ImaAdsLoader implements AdsLoader {
|
|||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
* @see AdsRenderingSettings#setMimeTypes(List)
|
* @see AdsRenderingSettings#setMimeTypes(List)
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAdMediaMimeTypes(List<String> adMediaMimeTypes) {
|
public Builder setAdMediaMimeTypes(List<String> adMediaMimeTypes) {
|
||||||
this.adMediaMimeTypes = ImmutableList.copyOf(checkNotNull(adMediaMimeTypes));
|
this.adMediaMimeTypes = ImmutableList.copyOf(checkNotNull(adMediaMimeTypes));
|
||||||
return this;
|
return this;
|
||||||
@ -247,6 +255,7 @@ public final class ImaAdsLoader implements AdsLoader {
|
|||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
* @see AdsRequest#setContinuousPlayback(boolean)
|
* @see AdsRequest#setContinuousPlayback(boolean)
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setEnableContinuousPlayback(boolean enableContinuousPlayback) {
|
public Builder setEnableContinuousPlayback(boolean enableContinuousPlayback) {
|
||||||
this.enableContinuousPlayback = enableContinuousPlayback;
|
this.enableContinuousPlayback = enableContinuousPlayback;
|
||||||
return this;
|
return this;
|
||||||
@ -265,6 +274,7 @@ public final class ImaAdsLoader implements AdsLoader {
|
|||||||
* C#TIME_UNSET} for no timeout.
|
* C#TIME_UNSET} for no timeout.
|
||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAdPreloadTimeoutMs(long adPreloadTimeoutMs) {
|
public Builder setAdPreloadTimeoutMs(long adPreloadTimeoutMs) {
|
||||||
checkArgument(adPreloadTimeoutMs == C.TIME_UNSET || adPreloadTimeoutMs > 0);
|
checkArgument(adPreloadTimeoutMs == C.TIME_UNSET || adPreloadTimeoutMs > 0);
|
||||||
this.adPreloadTimeoutMs = adPreloadTimeoutMs;
|
this.adPreloadTimeoutMs = adPreloadTimeoutMs;
|
||||||
@ -278,6 +288,7 @@ public final class ImaAdsLoader implements AdsLoader {
|
|||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
* @see AdsRequest#setVastLoadTimeout(float)
|
* @see AdsRequest#setVastLoadTimeout(float)
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setVastLoadTimeoutMs(@IntRange(from = 1) int vastLoadTimeoutMs) {
|
public Builder setVastLoadTimeoutMs(@IntRange(from = 1) int vastLoadTimeoutMs) {
|
||||||
checkArgument(vastLoadTimeoutMs > 0);
|
checkArgument(vastLoadTimeoutMs > 0);
|
||||||
this.vastLoadTimeoutMs = vastLoadTimeoutMs;
|
this.vastLoadTimeoutMs = vastLoadTimeoutMs;
|
||||||
@ -291,6 +302,7 @@ public final class ImaAdsLoader implements AdsLoader {
|
|||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
* @see AdsRenderingSettings#setLoadVideoTimeout(int)
|
* @see AdsRenderingSettings#setLoadVideoTimeout(int)
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMediaLoadTimeoutMs(@IntRange(from = 1) int mediaLoadTimeoutMs) {
|
public Builder setMediaLoadTimeoutMs(@IntRange(from = 1) int mediaLoadTimeoutMs) {
|
||||||
checkArgument(mediaLoadTimeoutMs > 0);
|
checkArgument(mediaLoadTimeoutMs > 0);
|
||||||
this.mediaLoadTimeoutMs = mediaLoadTimeoutMs;
|
this.mediaLoadTimeoutMs = mediaLoadTimeoutMs;
|
||||||
@ -304,6 +316,7 @@ public final class ImaAdsLoader implements AdsLoader {
|
|||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
* @see AdsRenderingSettings#setBitrateKbps(int)
|
* @see AdsRenderingSettings#setBitrateKbps(int)
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMaxMediaBitrate(@IntRange(from = 1) int bitrate) {
|
public Builder setMaxMediaBitrate(@IntRange(from = 1) int bitrate) {
|
||||||
checkArgument(bitrate > 0);
|
checkArgument(bitrate > 0);
|
||||||
this.mediaBitrate = bitrate;
|
this.mediaBitrate = bitrate;
|
||||||
@ -319,6 +332,7 @@ public final class ImaAdsLoader implements AdsLoader {
|
|||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
* @see AdsRenderingSettings#setFocusSkipButtonWhenAvailable(boolean)
|
* @see AdsRenderingSettings#setFocusSkipButtonWhenAvailable(boolean)
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setFocusSkipButtonWhenAvailable(boolean focusSkipButtonWhenAvailable) {
|
public Builder setFocusSkipButtonWhenAvailable(boolean focusSkipButtonWhenAvailable) {
|
||||||
this.focusSkipButtonWhenAvailable = focusSkipButtonWhenAvailable;
|
this.focusSkipButtonWhenAvailable = focusSkipButtonWhenAvailable;
|
||||||
return this;
|
return this;
|
||||||
@ -334,6 +348,7 @@ public final class ImaAdsLoader implements AdsLoader {
|
|||||||
* beginning playback.
|
* beginning playback.
|
||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPlayAdBeforeStartPosition(boolean playAdBeforeStartPosition) {
|
public Builder setPlayAdBeforeStartPosition(boolean playAdBeforeStartPosition) {
|
||||||
this.playAdBeforeStartPosition = playAdBeforeStartPosition;
|
this.playAdBeforeStartPosition = playAdBeforeStartPosition;
|
||||||
return this;
|
return this;
|
||||||
@ -349,11 +364,13 @@ public final class ImaAdsLoader implements AdsLoader {
|
|||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
* @see ImaSdkSettings#setDebugMode(boolean)
|
* @see ImaSdkSettings#setDebugMode(boolean)
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setDebugModeEnabled(boolean debugModeEnabled) {
|
public Builder setDebugModeEnabled(boolean debugModeEnabled) {
|
||||||
this.debugModeEnabled = debugModeEnabled;
|
this.debugModeEnabled = debugModeEnabled;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
/* package */ Builder setImaFactory(ImaUtil.ImaFactory imaFactory) {
|
/* package */ Builder setImaFactory(ImaUtil.ImaFactory imaFactory) {
|
||||||
this.imaFactory = checkNotNull(imaFactory);
|
this.imaFactory = checkNotNull(imaFactory);
|
||||||
|
@ -92,6 +92,7 @@ import com.google.android.exoplayer2.util.ConditionVariable;
|
|||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
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;
|
||||||
@ -132,6 +133,7 @@ public final class ImaServerSideAdInsertionMediaSource extends CompositeMediaSou
|
|||||||
this.contentMediaSourceFactory = contentMediaSourceFactory;
|
this.contentMediaSourceFactory = contentMediaSourceFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public MediaSource.Factory setLoadErrorHandlingPolicy(
|
public MediaSource.Factory setLoadErrorHandlingPolicy(
|
||||||
LoadErrorHandlingPolicy loadErrorHandlingPolicy) {
|
LoadErrorHandlingPolicy loadErrorHandlingPolicy) {
|
||||||
@ -139,6 +141,7 @@ public final class ImaServerSideAdInsertionMediaSource extends CompositeMediaSou
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public MediaSource.Factory setDrmSessionManagerProvider(
|
public MediaSource.Factory setDrmSessionManagerProvider(
|
||||||
DrmSessionManagerProvider drmSessionManagerProvider) {
|
DrmSessionManagerProvider drmSessionManagerProvider) {
|
||||||
@ -213,6 +216,7 @@ public final class ImaServerSideAdInsertionMediaSource extends CompositeMediaSou
|
|||||||
* @param imaSdkSettings The {@link ImaSdkSettings}.
|
* @param imaSdkSettings The {@link ImaSdkSettings}.
|
||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public AdsLoader.Builder setImaSdkSettings(ImaSdkSettings imaSdkSettings) {
|
public AdsLoader.Builder setImaSdkSettings(ImaSdkSettings imaSdkSettings) {
|
||||||
this.imaSdkSettings = imaSdkSettings;
|
this.imaSdkSettings = imaSdkSettings;
|
||||||
return this;
|
return this;
|
||||||
@ -225,6 +229,7 @@ public final class ImaServerSideAdInsertionMediaSource extends CompositeMediaSou
|
|||||||
* @param adEventListener The ad event listener.
|
* @param adEventListener The ad event listener.
|
||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public AdsLoader.Builder setAdEventListener(AdEventListener adEventListener) {
|
public AdsLoader.Builder setAdEventListener(AdEventListener adEventListener) {
|
||||||
this.adEventListener = adEventListener;
|
this.adEventListener = adEventListener;
|
||||||
return this;
|
return this;
|
||||||
@ -237,6 +242,7 @@ public final class ImaServerSideAdInsertionMediaSource extends CompositeMediaSou
|
|||||||
* @param adErrorListener The {@link AdErrorEvent.AdErrorListener}.
|
* @param adErrorListener The {@link AdErrorEvent.AdErrorListener}.
|
||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public AdsLoader.Builder setAdErrorListener(AdErrorEvent.AdErrorListener adErrorListener) {
|
public AdsLoader.Builder setAdErrorListener(AdErrorEvent.AdErrorListener adErrorListener) {
|
||||||
this.adErrorListener = adErrorListener;
|
this.adErrorListener = adErrorListener;
|
||||||
return this;
|
return this;
|
||||||
@ -249,6 +255,7 @@ public final class ImaServerSideAdInsertionMediaSource extends CompositeMediaSou
|
|||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
* @see AdDisplayContainer#setCompanionSlots(Collection)
|
* @see AdDisplayContainer#setCompanionSlots(Collection)
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public AdsLoader.Builder setCompanionAdSlots(Collection<CompanionAdSlot> companionAdSlots) {
|
public AdsLoader.Builder setCompanionAdSlots(Collection<CompanionAdSlot> companionAdSlots) {
|
||||||
this.companionAdSlots = ImmutableList.copyOf(companionAdSlots);
|
this.companionAdSlots = ImmutableList.copyOf(companionAdSlots);
|
||||||
return this;
|
return this;
|
||||||
@ -262,6 +269,7 @@ public final class ImaServerSideAdInsertionMediaSource extends CompositeMediaSou
|
|||||||
* @param state The state to resume with.
|
* @param state The state to resume with.
|
||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public AdsLoader.Builder setAdsLoaderState(State state) {
|
public AdsLoader.Builder setAdsLoaderState(State state) {
|
||||||
this.state = state;
|
this.state = state;
|
||||||
return this;
|
return this;
|
||||||
|
@ -28,6 +28,7 @@ import com.google.ads.interactivemedia.v3.api.StreamRequest.StreamFormat;
|
|||||||
import com.google.android.exoplayer2.C;
|
import com.google.android.exoplayer2.C;
|
||||||
import com.google.android.exoplayer2.C.ContentType;
|
import com.google.android.exoplayer2.C.ContentType;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -83,6 +84,7 @@ public final class ImaServerSideAdInsertionUriBuilder {
|
|||||||
* @param adsId The ads identifier.
|
* @param adsId The ads identifier.
|
||||||
* @return This instance, for convenience.
|
* @return This instance, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ImaServerSideAdInsertionUriBuilder setAdsId(String adsId) {
|
public ImaServerSideAdInsertionUriBuilder setAdsId(String adsId) {
|
||||||
this.adsId = adsId;
|
this.adsId = adsId;
|
||||||
return this;
|
return this;
|
||||||
@ -94,6 +96,7 @@ public final class ImaServerSideAdInsertionUriBuilder {
|
|||||||
* @param assetKey Live stream asset key.
|
* @param assetKey Live stream asset key.
|
||||||
* @return This instance, for convenience.
|
* @return This instance, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ImaServerSideAdInsertionUriBuilder setAssetKey(@Nullable String assetKey) {
|
public ImaServerSideAdInsertionUriBuilder setAssetKey(@Nullable String assetKey) {
|
||||||
this.assetKey = assetKey;
|
this.assetKey = assetKey;
|
||||||
return this;
|
return this;
|
||||||
@ -107,6 +110,7 @@ public final class ImaServerSideAdInsertionUriBuilder {
|
|||||||
* @param authToken Live stream authorization token.
|
* @param authToken Live stream authorization token.
|
||||||
* @return This instance, for convenience.
|
* @return This instance, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ImaServerSideAdInsertionUriBuilder setAuthToken(@Nullable String authToken) {
|
public ImaServerSideAdInsertionUriBuilder setAuthToken(@Nullable String authToken) {
|
||||||
this.authToken = authToken;
|
this.authToken = authToken;
|
||||||
return this;
|
return this;
|
||||||
@ -118,6 +122,7 @@ public final class ImaServerSideAdInsertionUriBuilder {
|
|||||||
* @param contentSourceId VOD stream content source id.
|
* @param contentSourceId VOD stream content source id.
|
||||||
* @return This instance, for convenience.
|
* @return This instance, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ImaServerSideAdInsertionUriBuilder setContentSourceId(@Nullable String contentSourceId) {
|
public ImaServerSideAdInsertionUriBuilder setContentSourceId(@Nullable String contentSourceId) {
|
||||||
this.contentSourceId = contentSourceId;
|
this.contentSourceId = contentSourceId;
|
||||||
return this;
|
return this;
|
||||||
@ -129,6 +134,7 @@ public final class ImaServerSideAdInsertionUriBuilder {
|
|||||||
* @param videoId VOD stream video id.
|
* @param videoId VOD stream video id.
|
||||||
* @return This instance, for convenience.
|
* @return This instance, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ImaServerSideAdInsertionUriBuilder setVideoId(@Nullable String videoId) {
|
public ImaServerSideAdInsertionUriBuilder setVideoId(@Nullable String videoId) {
|
||||||
this.videoId = videoId;
|
this.videoId = videoId;
|
||||||
return this;
|
return this;
|
||||||
@ -140,6 +146,7 @@ public final class ImaServerSideAdInsertionUriBuilder {
|
|||||||
* @param format {@link C#TYPE_DASH} or {@link C#TYPE_HLS}.
|
* @param format {@link C#TYPE_DASH} or {@link C#TYPE_HLS}.
|
||||||
* @return This instance, for convenience.
|
* @return This instance, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ImaServerSideAdInsertionUriBuilder setFormat(@ContentType int format) {
|
public ImaServerSideAdInsertionUriBuilder setFormat(@ContentType int format) {
|
||||||
checkArgument(format == C.CONTENT_TYPE_DASH || format == C.CONTENT_TYPE_HLS);
|
checkArgument(format == C.CONTENT_TYPE_DASH || format == C.CONTENT_TYPE_HLS);
|
||||||
this.format = format;
|
this.format = format;
|
||||||
@ -154,6 +161,7 @@ public final class ImaServerSideAdInsertionUriBuilder {
|
|||||||
* @param apiKey Stream api key.
|
* @param apiKey Stream api key.
|
||||||
* @return This instance, for convenience.
|
* @return This instance, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ImaServerSideAdInsertionUriBuilder setApiKey(@Nullable String apiKey) {
|
public ImaServerSideAdInsertionUriBuilder setApiKey(@Nullable String apiKey) {
|
||||||
this.apiKey = apiKey;
|
this.apiKey = apiKey;
|
||||||
return this;
|
return this;
|
||||||
@ -167,6 +175,7 @@ public final class ImaServerSideAdInsertionUriBuilder {
|
|||||||
* @param streamActivityMonitorId ID for debugging the stream with the stream activity monitor.
|
* @param streamActivityMonitorId ID for debugging the stream with the stream activity monitor.
|
||||||
* @return This instance, for convenience.
|
* @return This instance, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ImaServerSideAdInsertionUriBuilder setStreamActivityMonitorId(
|
public ImaServerSideAdInsertionUriBuilder setStreamActivityMonitorId(
|
||||||
@Nullable String streamActivityMonitorId) {
|
@Nullable String streamActivityMonitorId) {
|
||||||
this.streamActivityMonitorId = streamActivityMonitorId;
|
this.streamActivityMonitorId = streamActivityMonitorId;
|
||||||
@ -185,6 +194,7 @@ public final class ImaServerSideAdInsertionUriBuilder {
|
|||||||
* @param adTagParameters A map of extra parameters to pass to the ad server.
|
* @param adTagParameters A map of extra parameters to pass to the ad server.
|
||||||
* @return This instance, for convenience.
|
* @return This instance, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ImaServerSideAdInsertionUriBuilder setAdTagParameters(
|
public ImaServerSideAdInsertionUriBuilder setAdTagParameters(
|
||||||
Map<String, String> adTagParameters) {
|
Map<String, String> adTagParameters) {
|
||||||
this.adTagParameters = ImmutableMap.copyOf(adTagParameters);
|
this.adTagParameters = ImmutableMap.copyOf(adTagParameters);
|
||||||
@ -198,6 +208,7 @@ public final class ImaServerSideAdInsertionUriBuilder {
|
|||||||
* @param manifestSuffix Stream manifest's suffix.
|
* @param manifestSuffix Stream manifest's suffix.
|
||||||
* @return This instance, for convenience.
|
* @return This instance, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ImaServerSideAdInsertionUriBuilder setManifestSuffix(@Nullable String manifestSuffix) {
|
public ImaServerSideAdInsertionUriBuilder setManifestSuffix(@Nullable String manifestSuffix) {
|
||||||
this.manifestSuffix = manifestSuffix;
|
this.manifestSuffix = manifestSuffix;
|
||||||
return this;
|
return this;
|
||||||
@ -211,6 +222,7 @@ public final class ImaServerSideAdInsertionUriBuilder {
|
|||||||
* @param contentUrl Deep link to the content's screen.
|
* @param contentUrl Deep link to the content's screen.
|
||||||
* @return This instance, for convenience.
|
* @return This instance, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ImaServerSideAdInsertionUriBuilder setContentUrl(@Nullable String contentUrl) {
|
public ImaServerSideAdInsertionUriBuilder setContentUrl(@Nullable String contentUrl) {
|
||||||
this.contentUrl = contentUrl;
|
this.contentUrl = contentUrl;
|
||||||
return this;
|
return this;
|
||||||
@ -224,6 +236,7 @@ public final class ImaServerSideAdInsertionUriBuilder {
|
|||||||
* @param loadVideoTimeoutMs The timeout after which to give up resolving the video URI.
|
* @param loadVideoTimeoutMs The timeout after which to give up resolving the video URI.
|
||||||
* @return This instance, for convenience.
|
* @return This instance, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ImaServerSideAdInsertionUriBuilder setLoadVideoTimeoutMs(int loadVideoTimeoutMs) {
|
public ImaServerSideAdInsertionUriBuilder setLoadVideoTimeoutMs(int loadVideoTimeoutMs) {
|
||||||
this.loadVideoTimeoutMs = loadVideoTimeoutMs;
|
this.loadVideoTimeoutMs = loadVideoTimeoutMs;
|
||||||
return this;
|
return this;
|
||||||
|
@ -18,6 +18,7 @@ dependencies {
|
|||||||
implementation 'androidx.collection:collection:' + androidxCollectionVersion
|
implementation 'androidx.collection:collection:' + androidxCollectionVersion
|
||||||
implementation 'androidx.concurrent:concurrent-futures:' + androidxFuturesVersion
|
implementation 'androidx.concurrent:concurrent-futures:' + androidxFuturesVersion
|
||||||
api 'androidx.media2:media2-session:' + androidxMedia2Version
|
api 'androidx.media2:media2-session:' + androidxMedia2Version
|
||||||
|
compileOnly 'com.google.errorprone:error_prone_annotations:' + errorProneVersion
|
||||||
compileOnly 'org.checkerframework:checker-compat-qual:' + checkerframeworkCompatVersion
|
compileOnly 'org.checkerframework:checker-compat-qual:' + checkerframeworkCompatVersion
|
||||||
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
|
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
|
||||||
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
|
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
|
||||||
|
@ -36,6 +36,7 @@ import androidx.media2.session.SessionCommand;
|
|||||||
import androidx.media2.session.SessionCommandGroup;
|
import androidx.media2.session.SessionCommandGroup;
|
||||||
import androidx.media2.session.SessionResult;
|
import androidx.media2.session.SessionResult;
|
||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -394,6 +395,7 @@ public final class SessionCallbackBuilder {
|
|||||||
* @see MediaSession.SessionCallback#onSetRating(MediaSession, ControllerInfo, String, Rating)
|
* @see MediaSession.SessionCallback#onSetRating(MediaSession, ControllerInfo, String, Rating)
|
||||||
* @see androidx.media2.session.MediaController#setRating(String, Rating)
|
* @see androidx.media2.session.MediaController#setRating(String, Rating)
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public SessionCallbackBuilder setRatingCallback(@Nullable RatingCallback ratingCallback) {
|
public SessionCallbackBuilder setRatingCallback(@Nullable RatingCallback ratingCallback) {
|
||||||
this.ratingCallback = ratingCallback;
|
this.ratingCallback = ratingCallback;
|
||||||
return this;
|
return this;
|
||||||
@ -408,6 +410,7 @@ public final class SessionCallbackBuilder {
|
|||||||
* Bundle)
|
* Bundle)
|
||||||
* @see androidx.media2.session.MediaController#sendCustomCommand(SessionCommand, Bundle)
|
* @see androidx.media2.session.MediaController#sendCustomCommand(SessionCommand, Bundle)
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public SessionCallbackBuilder setCustomCommandProvider(
|
public SessionCallbackBuilder setCustomCommandProvider(
|
||||||
@Nullable CustomCommandProvider customCommandProvider) {
|
@Nullable CustomCommandProvider customCommandProvider) {
|
||||||
this.customCommandProvider = customCommandProvider;
|
this.customCommandProvider = customCommandProvider;
|
||||||
@ -425,6 +428,7 @@ public final class SessionCallbackBuilder {
|
|||||||
* @see androidx.media2.session.MediaController#setMediaItem(String)
|
* @see androidx.media2.session.MediaController#setMediaItem(String)
|
||||||
* @see androidx.media2.session.MediaController#setPlaylist(List, MediaMetadata)
|
* @see androidx.media2.session.MediaController#setPlaylist(List, MediaMetadata)
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public SessionCallbackBuilder setMediaItemProvider(
|
public SessionCallbackBuilder setMediaItemProvider(
|
||||||
@Nullable MediaItemProvider mediaItemProvider) {
|
@Nullable MediaItemProvider mediaItemProvider) {
|
||||||
this.mediaItemProvider = mediaItemProvider;
|
this.mediaItemProvider = mediaItemProvider;
|
||||||
@ -437,6 +441,7 @@ public final class SessionCallbackBuilder {
|
|||||||
* @param allowedCommandProvider A allowed command provider.
|
* @param allowedCommandProvider A allowed command provider.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public SessionCallbackBuilder setAllowedCommandProvider(
|
public SessionCallbackBuilder setAllowedCommandProvider(
|
||||||
@Nullable AllowedCommandProvider allowedCommandProvider) {
|
@Nullable AllowedCommandProvider allowedCommandProvider) {
|
||||||
this.allowedCommandProvider = allowedCommandProvider;
|
this.allowedCommandProvider = allowedCommandProvider;
|
||||||
@ -453,6 +458,7 @@ public final class SessionCallbackBuilder {
|
|||||||
* @see MediaController#skipBackward()
|
* @see MediaController#skipBackward()
|
||||||
* @see MediaController#skipForward()
|
* @see MediaController#skipForward()
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public SessionCallbackBuilder setSkipCallback(@Nullable SkipCallback skipCallback) {
|
public SessionCallbackBuilder setSkipCallback(@Nullable SkipCallback skipCallback) {
|
||||||
this.skipCallback = skipCallback;
|
this.skipCallback = skipCallback;
|
||||||
return this;
|
return this;
|
||||||
@ -465,6 +471,7 @@ public final class SessionCallbackBuilder {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @see MediaSession.SessionCallback#onPostConnect(MediaSession, ControllerInfo)
|
* @see MediaSession.SessionCallback#onPostConnect(MediaSession, ControllerInfo)
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public SessionCallbackBuilder setPostConnectCallback(
|
public SessionCallbackBuilder setPostConnectCallback(
|
||||||
@Nullable PostConnectCallback postConnectCallback) {
|
@Nullable PostConnectCallback postConnectCallback) {
|
||||||
this.postConnectCallback = postConnectCallback;
|
this.postConnectCallback = postConnectCallback;
|
||||||
@ -478,6 +485,7 @@ public final class SessionCallbackBuilder {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @see MediaSession.SessionCallback#onDisconnected(MediaSession, ControllerInfo)
|
* @see MediaSession.SessionCallback#onDisconnected(MediaSession, ControllerInfo)
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public SessionCallbackBuilder setDisconnectedCallback(
|
public SessionCallbackBuilder setDisconnectedCallback(
|
||||||
@Nullable DisconnectedCallback disconnectedCallback) {
|
@Nullable DisconnectedCallback disconnectedCallback) {
|
||||||
this.disconnectedCallback = disconnectedCallback;
|
this.disconnectedCallback = disconnectedCallback;
|
||||||
@ -493,6 +501,7 @@ public final class SessionCallbackBuilder {
|
|||||||
* @see MediaSession.SessionCallback#onRewind(MediaSession, MediaSession.ControllerInfo)
|
* @see MediaSession.SessionCallback#onRewind(MediaSession, MediaSession.ControllerInfo)
|
||||||
* @see #setSeekTimeoutMs(int)
|
* @see #setSeekTimeoutMs(int)
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public SessionCallbackBuilder setRewindIncrementMs(int rewindMs) {
|
public SessionCallbackBuilder setRewindIncrementMs(int rewindMs) {
|
||||||
this.rewindMs = rewindMs;
|
this.rewindMs = rewindMs;
|
||||||
return this;
|
return this;
|
||||||
@ -507,6 +516,7 @@ public final class SessionCallbackBuilder {
|
|||||||
* @see MediaSession.SessionCallback#onFastForward(MediaSession, MediaSession.ControllerInfo)
|
* @see MediaSession.SessionCallback#onFastForward(MediaSession, MediaSession.ControllerInfo)
|
||||||
* @see #setSeekTimeoutMs(int)
|
* @see #setSeekTimeoutMs(int)
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public SessionCallbackBuilder setFastForwardIncrementMs(int fastForwardMs) {
|
public SessionCallbackBuilder setFastForwardIncrementMs(int fastForwardMs) {
|
||||||
this.fastForwardMs = fastForwardMs;
|
this.fastForwardMs = fastForwardMs;
|
||||||
return this;
|
return this;
|
||||||
@ -521,6 +531,7 @@ public final class SessionCallbackBuilder {
|
|||||||
* forever.
|
* forever.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public SessionCallbackBuilder setSeekTimeoutMs(int seekTimeoutMs) {
|
public SessionCallbackBuilder setSeekTimeoutMs(int seekTimeoutMs) {
|
||||||
this.seekTimeoutMs = seekTimeoutMs;
|
this.seekTimeoutMs = seekTimeoutMs;
|
||||||
return this;
|
return this;
|
||||||
|
@ -19,6 +19,7 @@ dependencies {
|
|||||||
implementation project(modulePrefix + 'library-common')
|
implementation project(modulePrefix + 'library-common')
|
||||||
implementation project(modulePrefix + 'library-datasource')
|
implementation project(modulePrefix + 'library-datasource')
|
||||||
implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion
|
implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion
|
||||||
|
compileOnly 'com.google.errorprone:error_prone_annotations:' + errorProneVersion
|
||||||
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
|
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
|
||||||
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
|
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
|
||||||
testImplementation project(modulePrefix + 'testutils')
|
testImplementation project(modulePrefix + 'testutils')
|
||||||
|
@ -39,6 +39,7 @@ import com.google.android.exoplayer2.util.Util;
|
|||||||
import com.google.common.base.Predicate;
|
import com.google.common.base.Predicate;
|
||||||
import com.google.common.net.HttpHeaders;
|
import com.google.common.net.HttpHeaders;
|
||||||
import com.google.common.util.concurrent.SettableFuture;
|
import com.google.common.util.concurrent.SettableFuture;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InterruptedIOException;
|
import java.io.InterruptedIOException;
|
||||||
@ -93,6 +94,7 @@ public class OkHttpDataSource extends BaseDataSource implements HttpDataSource {
|
|||||||
defaultRequestProperties = new RequestProperties();
|
defaultRequestProperties = new RequestProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public final Factory setDefaultRequestProperties(Map<String, String> defaultRequestProperties) {
|
public final Factory setDefaultRequestProperties(Map<String, String> defaultRequestProperties) {
|
||||||
this.defaultRequestProperties.clearAndSet(defaultRequestProperties);
|
this.defaultRequestProperties.clearAndSet(defaultRequestProperties);
|
||||||
@ -109,6 +111,7 @@ public class OkHttpDataSource extends BaseDataSource implements HttpDataSource {
|
|||||||
* agent of the underlying {@link OkHttpClient}.
|
* agent of the underlying {@link OkHttpClient}.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setUserAgent(@Nullable String userAgent) {
|
public Factory setUserAgent(@Nullable String userAgent) {
|
||||||
this.userAgent = userAgent;
|
this.userAgent = userAgent;
|
||||||
return this;
|
return this;
|
||||||
@ -122,6 +125,7 @@ public class OkHttpDataSource extends BaseDataSource implements HttpDataSource {
|
|||||||
* @param cacheControl The cache control that will be used.
|
* @param cacheControl The cache control that will be used.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setCacheControl(@Nullable CacheControl cacheControl) {
|
public Factory setCacheControl(@Nullable CacheControl cacheControl) {
|
||||||
this.cacheControl = cacheControl;
|
this.cacheControl = cacheControl;
|
||||||
return this;
|
return this;
|
||||||
@ -138,6 +142,7 @@ public class OkHttpDataSource extends BaseDataSource implements HttpDataSource {
|
|||||||
* predicate that was previously set.
|
* predicate that was previously set.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setContentTypePredicate(@Nullable Predicate<String> contentTypePredicate) {
|
public Factory setContentTypePredicate(@Nullable Predicate<String> contentTypePredicate) {
|
||||||
this.contentTypePredicate = contentTypePredicate;
|
this.contentTypePredicate = contentTypePredicate;
|
||||||
return this;
|
return this;
|
||||||
@ -153,6 +158,7 @@ public class OkHttpDataSource extends BaseDataSource implements HttpDataSource {
|
|||||||
* @param transferListener The listener that will be used.
|
* @param transferListener The listener that will be used.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setTransferListener(@Nullable TransferListener transferListener) {
|
public Factory setTransferListener(@Nullable TransferListener transferListener) {
|
||||||
this.transferListener = transferListener;
|
this.transferListener = transferListener;
|
||||||
return this;
|
return this;
|
||||||
|
@ -18,6 +18,7 @@ dependencies {
|
|||||||
implementation project(modulePrefix + 'library-datasource')
|
implementation project(modulePrefix + 'library-datasource')
|
||||||
implementation 'io.antmedia:rtmp-client:3.2.0'
|
implementation 'io.antmedia:rtmp-client:3.2.0'
|
||||||
implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion
|
implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion
|
||||||
|
compileOnly 'com.google.errorprone:error_prone_annotations:' + errorProneVersion
|
||||||
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
|
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
|
||||||
testImplementation project(modulePrefix + 'library-core')
|
testImplementation project(modulePrefix + 'library-core')
|
||||||
testImplementation project(modulePrefix + 'testutils')
|
testImplementation project(modulePrefix + 'testutils')
|
||||||
|
@ -25,6 +25,7 @@ import com.google.android.exoplayer2.upstream.BaseDataSource;
|
|||||||
import com.google.android.exoplayer2.upstream.DataSource;
|
import com.google.android.exoplayer2.upstream.DataSource;
|
||||||
import com.google.android.exoplayer2.upstream.DataSpec;
|
import com.google.android.exoplayer2.upstream.DataSpec;
|
||||||
import com.google.android.exoplayer2.upstream.TransferListener;
|
import com.google.android.exoplayer2.upstream.TransferListener;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import io.antmedia.rtmp_client.RtmpClient;
|
import io.antmedia.rtmp_client.RtmpClient;
|
||||||
import io.antmedia.rtmp_client.RtmpClient.RtmpIOException;
|
import io.antmedia.rtmp_client.RtmpClient.RtmpIOException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -51,6 +52,7 @@ public final class RtmpDataSource extends BaseDataSource {
|
|||||||
* @param transferListener The listener that will be used.
|
* @param transferListener The listener that will be used.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setTransferListener(@Nullable TransferListener transferListener) {
|
public Factory setTransferListener(@Nullable TransferListener transferListener) {
|
||||||
this.transferListener = transferListener;
|
this.transferListener = transferListener;
|
||||||
return this;
|
return this;
|
||||||
|
@ -27,6 +27,7 @@ import com.google.android.exoplayer2.util.MimeTypes;
|
|||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
import com.google.android.exoplayer2.video.ColorInfo;
|
import com.google.android.exoplayer2.video.ColorInfo;
|
||||||
import com.google.common.base.Joiner;
|
import com.google.common.base.Joiner;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
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;
|
||||||
@ -250,6 +251,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param id The {@link Format#id}.
|
* @param id The {@link Format#id}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setId(@Nullable String id) {
|
public Builder setId(@Nullable String id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
@ -262,6 +264,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param id The {@link Format#id}.
|
* @param id The {@link Format#id}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setId(int id) {
|
public Builder setId(int id) {
|
||||||
this.id = Integer.toString(id);
|
this.id = Integer.toString(id);
|
||||||
return this;
|
return this;
|
||||||
@ -273,6 +276,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param label The {@link Format#label}.
|
* @param label The {@link Format#label}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setLabel(@Nullable String label) {
|
public Builder setLabel(@Nullable String label) {
|
||||||
this.label = label;
|
this.label = label;
|
||||||
return this;
|
return this;
|
||||||
@ -284,6 +288,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param language The {@link Format#language}.
|
* @param language The {@link Format#language}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setLanguage(@Nullable String language) {
|
public Builder setLanguage(@Nullable String language) {
|
||||||
this.language = language;
|
this.language = language;
|
||||||
return this;
|
return this;
|
||||||
@ -295,6 +300,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param selectionFlags The {@link Format#selectionFlags}.
|
* @param selectionFlags The {@link Format#selectionFlags}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSelectionFlags(@C.SelectionFlags int selectionFlags) {
|
public Builder setSelectionFlags(@C.SelectionFlags int selectionFlags) {
|
||||||
this.selectionFlags = selectionFlags;
|
this.selectionFlags = selectionFlags;
|
||||||
return this;
|
return this;
|
||||||
@ -306,6 +312,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param roleFlags The {@link Format#roleFlags}.
|
* @param roleFlags The {@link Format#roleFlags}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setRoleFlags(@C.RoleFlags int roleFlags) {
|
public Builder setRoleFlags(@C.RoleFlags int roleFlags) {
|
||||||
this.roleFlags = roleFlags;
|
this.roleFlags = roleFlags;
|
||||||
return this;
|
return this;
|
||||||
@ -317,6 +324,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param averageBitrate The {@link Format#averageBitrate}.
|
* @param averageBitrate The {@link Format#averageBitrate}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAverageBitrate(int averageBitrate) {
|
public Builder setAverageBitrate(int averageBitrate) {
|
||||||
this.averageBitrate = averageBitrate;
|
this.averageBitrate = averageBitrate;
|
||||||
return this;
|
return this;
|
||||||
@ -328,6 +336,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param peakBitrate The {@link Format#peakBitrate}.
|
* @param peakBitrate The {@link Format#peakBitrate}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPeakBitrate(int peakBitrate) {
|
public Builder setPeakBitrate(int peakBitrate) {
|
||||||
this.peakBitrate = peakBitrate;
|
this.peakBitrate = peakBitrate;
|
||||||
return this;
|
return this;
|
||||||
@ -339,6 +348,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param codecs The {@link Format#codecs}.
|
* @param codecs The {@link Format#codecs}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setCodecs(@Nullable String codecs) {
|
public Builder setCodecs(@Nullable String codecs) {
|
||||||
this.codecs = codecs;
|
this.codecs = codecs;
|
||||||
return this;
|
return this;
|
||||||
@ -350,6 +360,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param metadata The {@link Format#metadata}.
|
* @param metadata The {@link Format#metadata}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMetadata(@Nullable Metadata metadata) {
|
public Builder setMetadata(@Nullable Metadata metadata) {
|
||||||
this.metadata = metadata;
|
this.metadata = metadata;
|
||||||
return this;
|
return this;
|
||||||
@ -363,6 +374,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param containerMimeType The {@link Format#containerMimeType}.
|
* @param containerMimeType The {@link Format#containerMimeType}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setContainerMimeType(@Nullable String containerMimeType) {
|
public Builder setContainerMimeType(@Nullable String containerMimeType) {
|
||||||
this.containerMimeType = containerMimeType;
|
this.containerMimeType = containerMimeType;
|
||||||
return this;
|
return this;
|
||||||
@ -376,6 +388,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param sampleMimeType {@link Format#sampleMimeType}.
|
* @param sampleMimeType {@link Format#sampleMimeType}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSampleMimeType(@Nullable String sampleMimeType) {
|
public Builder setSampleMimeType(@Nullable String sampleMimeType) {
|
||||||
this.sampleMimeType = sampleMimeType;
|
this.sampleMimeType = sampleMimeType;
|
||||||
return this;
|
return this;
|
||||||
@ -387,6 +400,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param maxInputSize The {@link Format#maxInputSize}.
|
* @param maxInputSize The {@link Format#maxInputSize}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMaxInputSize(int maxInputSize) {
|
public Builder setMaxInputSize(int maxInputSize) {
|
||||||
this.maxInputSize = maxInputSize;
|
this.maxInputSize = maxInputSize;
|
||||||
return this;
|
return this;
|
||||||
@ -398,6 +412,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param initializationData The {@link Format#initializationData}.
|
* @param initializationData The {@link Format#initializationData}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setInitializationData(@Nullable List<byte[]> initializationData) {
|
public Builder setInitializationData(@Nullable List<byte[]> initializationData) {
|
||||||
this.initializationData = initializationData;
|
this.initializationData = initializationData;
|
||||||
return this;
|
return this;
|
||||||
@ -409,6 +424,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param drmInitData The {@link Format#drmInitData}.
|
* @param drmInitData The {@link Format#drmInitData}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setDrmInitData(@Nullable DrmInitData drmInitData) {
|
public Builder setDrmInitData(@Nullable DrmInitData drmInitData) {
|
||||||
this.drmInitData = drmInitData;
|
this.drmInitData = drmInitData;
|
||||||
return this;
|
return this;
|
||||||
@ -420,6 +436,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param subsampleOffsetUs The {@link Format#subsampleOffsetUs}.
|
* @param subsampleOffsetUs The {@link Format#subsampleOffsetUs}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSubsampleOffsetUs(long subsampleOffsetUs) {
|
public Builder setSubsampleOffsetUs(long subsampleOffsetUs) {
|
||||||
this.subsampleOffsetUs = subsampleOffsetUs;
|
this.subsampleOffsetUs = subsampleOffsetUs;
|
||||||
return this;
|
return this;
|
||||||
@ -433,6 +450,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param width The {@link Format#width}.
|
* @param width The {@link Format#width}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setWidth(int width) {
|
public Builder setWidth(int width) {
|
||||||
this.width = width;
|
this.width = width;
|
||||||
return this;
|
return this;
|
||||||
@ -444,6 +462,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param height The {@link Format#height}.
|
* @param height The {@link Format#height}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setHeight(int height) {
|
public Builder setHeight(int height) {
|
||||||
this.height = height;
|
this.height = height;
|
||||||
return this;
|
return this;
|
||||||
@ -455,6 +474,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param frameRate The {@link Format#frameRate}.
|
* @param frameRate The {@link Format#frameRate}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setFrameRate(float frameRate) {
|
public Builder setFrameRate(float frameRate) {
|
||||||
this.frameRate = frameRate;
|
this.frameRate = frameRate;
|
||||||
return this;
|
return this;
|
||||||
@ -466,6 +486,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param rotationDegrees The {@link Format#rotationDegrees}.
|
* @param rotationDegrees The {@link Format#rotationDegrees}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setRotationDegrees(int rotationDegrees) {
|
public Builder setRotationDegrees(int rotationDegrees) {
|
||||||
this.rotationDegrees = rotationDegrees;
|
this.rotationDegrees = rotationDegrees;
|
||||||
return this;
|
return this;
|
||||||
@ -477,6 +498,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param pixelWidthHeightRatio The {@link Format#pixelWidthHeightRatio}.
|
* @param pixelWidthHeightRatio The {@link Format#pixelWidthHeightRatio}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPixelWidthHeightRatio(float pixelWidthHeightRatio) {
|
public Builder setPixelWidthHeightRatio(float pixelWidthHeightRatio) {
|
||||||
this.pixelWidthHeightRatio = pixelWidthHeightRatio;
|
this.pixelWidthHeightRatio = pixelWidthHeightRatio;
|
||||||
return this;
|
return this;
|
||||||
@ -488,6 +510,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param projectionData The {@link Format#projectionData}.
|
* @param projectionData The {@link Format#projectionData}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setProjectionData(@Nullable byte[] projectionData) {
|
public Builder setProjectionData(@Nullable byte[] projectionData) {
|
||||||
this.projectionData = projectionData;
|
this.projectionData = projectionData;
|
||||||
return this;
|
return this;
|
||||||
@ -499,6 +522,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param stereoMode The {@link Format#stereoMode}.
|
* @param stereoMode The {@link Format#stereoMode}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setStereoMode(@C.StereoMode int stereoMode) {
|
public Builder setStereoMode(@C.StereoMode int stereoMode) {
|
||||||
this.stereoMode = stereoMode;
|
this.stereoMode = stereoMode;
|
||||||
return this;
|
return this;
|
||||||
@ -510,6 +534,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param colorInfo The {@link Format#colorInfo}.
|
* @param colorInfo The {@link Format#colorInfo}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setColorInfo(@Nullable ColorInfo colorInfo) {
|
public Builder setColorInfo(@Nullable ColorInfo colorInfo) {
|
||||||
this.colorInfo = colorInfo;
|
this.colorInfo = colorInfo;
|
||||||
return this;
|
return this;
|
||||||
@ -523,6 +548,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param channelCount The {@link Format#channelCount}.
|
* @param channelCount The {@link Format#channelCount}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setChannelCount(int channelCount) {
|
public Builder setChannelCount(int channelCount) {
|
||||||
this.channelCount = channelCount;
|
this.channelCount = channelCount;
|
||||||
return this;
|
return this;
|
||||||
@ -534,6 +560,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param sampleRate The {@link Format#sampleRate}.
|
* @param sampleRate The {@link Format#sampleRate}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSampleRate(int sampleRate) {
|
public Builder setSampleRate(int sampleRate) {
|
||||||
this.sampleRate = sampleRate;
|
this.sampleRate = sampleRate;
|
||||||
return this;
|
return this;
|
||||||
@ -545,6 +572,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param pcmEncoding The {@link Format#pcmEncoding}.
|
* @param pcmEncoding The {@link Format#pcmEncoding}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPcmEncoding(@C.PcmEncoding int pcmEncoding) {
|
public Builder setPcmEncoding(@C.PcmEncoding int pcmEncoding) {
|
||||||
this.pcmEncoding = pcmEncoding;
|
this.pcmEncoding = pcmEncoding;
|
||||||
return this;
|
return this;
|
||||||
@ -556,6 +584,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param encoderDelay The {@link Format#encoderDelay}.
|
* @param encoderDelay The {@link Format#encoderDelay}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setEncoderDelay(int encoderDelay) {
|
public Builder setEncoderDelay(int encoderDelay) {
|
||||||
this.encoderDelay = encoderDelay;
|
this.encoderDelay = encoderDelay;
|
||||||
return this;
|
return this;
|
||||||
@ -567,6 +596,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param encoderPadding The {@link Format#encoderPadding}.
|
* @param encoderPadding The {@link Format#encoderPadding}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setEncoderPadding(int encoderPadding) {
|
public Builder setEncoderPadding(int encoderPadding) {
|
||||||
this.encoderPadding = encoderPadding;
|
this.encoderPadding = encoderPadding;
|
||||||
return this;
|
return this;
|
||||||
@ -580,6 +610,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param accessibilityChannel The {@link Format#accessibilityChannel}.
|
* @param accessibilityChannel The {@link Format#accessibilityChannel}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAccessibilityChannel(int accessibilityChannel) {
|
public Builder setAccessibilityChannel(int accessibilityChannel) {
|
||||||
this.accessibilityChannel = accessibilityChannel;
|
this.accessibilityChannel = accessibilityChannel;
|
||||||
return this;
|
return this;
|
||||||
@ -593,6 +624,7 @@ public final class Format implements Bundleable {
|
|||||||
* @param cryptoType The {@link C.CryptoType}.
|
* @param cryptoType The {@link C.CryptoType}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setCryptoType(@C.CryptoType int cryptoType) {
|
public Builder setCryptoType(@C.CryptoType int cryptoType) {
|
||||||
this.cryptoType = cryptoType;
|
this.cryptoType = cryptoType;
|
||||||
return this;
|
return this;
|
||||||
|
@ -29,6 +29,7 @@ import com.google.android.exoplayer2.util.Assertions;
|
|||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import com.google.errorprone.annotations.InlineMe;
|
import com.google.errorprone.annotations.InlineMe;
|
||||||
import java.lang.annotation.Documented;
|
import java.lang.annotation.Documented;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
@ -126,6 +127,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
*
|
*
|
||||||
* <p>By default {@link #DEFAULT_MEDIA_ID} is used.
|
* <p>By default {@link #DEFAULT_MEDIA_ID} is used.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMediaId(String mediaId) {
|
public Builder setMediaId(String mediaId) {
|
||||||
this.mediaId = checkNotNull(mediaId);
|
this.mediaId = checkNotNull(mediaId);
|
||||||
return this;
|
return this;
|
||||||
@ -138,6 +140,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* during {@link #build()} and no other {@code Builder} methods that would populate {@link
|
* during {@link #build()} and no other {@code Builder} methods that would populate {@link
|
||||||
* MediaItem#localConfiguration} should be called.
|
* MediaItem#localConfiguration} should be called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setUri(@Nullable String uri) {
|
public Builder setUri(@Nullable String uri) {
|
||||||
return setUri(uri == null ? null : Uri.parse(uri));
|
return setUri(uri == null ? null : Uri.parse(uri));
|
||||||
}
|
}
|
||||||
@ -149,6 +152,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* during {@link #build()} and no other {@code Builder} methods that would populate {@link
|
* during {@link #build()} and no other {@code Builder} methods that would populate {@link
|
||||||
* MediaItem#localConfiguration} should be called.
|
* MediaItem#localConfiguration} should be called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setUri(@Nullable Uri uri) {
|
public Builder setUri(@Nullable Uri uri) {
|
||||||
this.uri = uri;
|
this.uri = uri;
|
||||||
return this;
|
return this;
|
||||||
@ -163,12 +167,14 @@ public final class MediaItem implements Bundleable {
|
|||||||
*
|
*
|
||||||
* @param mimeType The MIME type.
|
* @param mimeType The MIME type.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMimeType(@Nullable String mimeType) {
|
public Builder setMimeType(@Nullable String mimeType) {
|
||||||
this.mimeType = mimeType;
|
this.mimeType = mimeType;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the {@link ClippingConfiguration}, defaults to {@link ClippingConfiguration#UNSET}. */
|
/** Sets the {@link ClippingConfiguration}, defaults to {@link ClippingConfiguration#UNSET}. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setClippingConfiguration(ClippingConfiguration clippingConfiguration) {
|
public Builder setClippingConfiguration(ClippingConfiguration clippingConfiguration) {
|
||||||
this.clippingConfiguration = clippingConfiguration.buildUpon();
|
this.clippingConfiguration = clippingConfiguration.buildUpon();
|
||||||
return this;
|
return this;
|
||||||
@ -178,6 +184,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* @deprecated Use {@link #setClippingConfiguration(ClippingConfiguration)} and {@link
|
* @deprecated Use {@link #setClippingConfiguration(ClippingConfiguration)} and {@link
|
||||||
* ClippingConfiguration.Builder#setStartPositionMs(long)} instead.
|
* ClippingConfiguration.Builder#setStartPositionMs(long)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setClipStartPositionMs(@IntRange(from = 0) long startPositionMs) {
|
public Builder setClipStartPositionMs(@IntRange(from = 0) long startPositionMs) {
|
||||||
clippingConfiguration.setStartPositionMs(startPositionMs);
|
clippingConfiguration.setStartPositionMs(startPositionMs);
|
||||||
@ -188,6 +195,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* @deprecated Use {@link #setClippingConfiguration(ClippingConfiguration)} and {@link
|
* @deprecated Use {@link #setClippingConfiguration(ClippingConfiguration)} and {@link
|
||||||
* ClippingConfiguration.Builder#setEndPositionMs(long)} instead.
|
* ClippingConfiguration.Builder#setEndPositionMs(long)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setClipEndPositionMs(long endPositionMs) {
|
public Builder setClipEndPositionMs(long endPositionMs) {
|
||||||
clippingConfiguration.setEndPositionMs(endPositionMs);
|
clippingConfiguration.setEndPositionMs(endPositionMs);
|
||||||
@ -198,6 +206,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* @deprecated Use {@link #setClippingConfiguration(ClippingConfiguration)} and {@link
|
* @deprecated Use {@link #setClippingConfiguration(ClippingConfiguration)} and {@link
|
||||||
* ClippingConfiguration.Builder#setRelativeToLiveWindow(boolean)} instead.
|
* ClippingConfiguration.Builder#setRelativeToLiveWindow(boolean)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setClipRelativeToLiveWindow(boolean relativeToLiveWindow) {
|
public Builder setClipRelativeToLiveWindow(boolean relativeToLiveWindow) {
|
||||||
clippingConfiguration.setRelativeToLiveWindow(relativeToLiveWindow);
|
clippingConfiguration.setRelativeToLiveWindow(relativeToLiveWindow);
|
||||||
@ -208,6 +217,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* @deprecated Use {@link #setClippingConfiguration(ClippingConfiguration)} and {@link
|
* @deprecated Use {@link #setClippingConfiguration(ClippingConfiguration)} and {@link
|
||||||
* ClippingConfiguration.Builder#setRelativeToDefaultPosition(boolean)} instead.
|
* ClippingConfiguration.Builder#setRelativeToDefaultPosition(boolean)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setClipRelativeToDefaultPosition(boolean relativeToDefaultPosition) {
|
public Builder setClipRelativeToDefaultPosition(boolean relativeToDefaultPosition) {
|
||||||
clippingConfiguration.setRelativeToDefaultPosition(relativeToDefaultPosition);
|
clippingConfiguration.setRelativeToDefaultPosition(relativeToDefaultPosition);
|
||||||
@ -218,6 +228,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* @deprecated Use {@link #setClippingConfiguration(ClippingConfiguration)} and {@link
|
* @deprecated Use {@link #setClippingConfiguration(ClippingConfiguration)} and {@link
|
||||||
* ClippingConfiguration.Builder#setStartsAtKeyFrame(boolean)} instead.
|
* ClippingConfiguration.Builder#setStartsAtKeyFrame(boolean)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setClipStartsAtKeyFrame(boolean startsAtKeyFrame) {
|
public Builder setClipStartsAtKeyFrame(boolean startsAtKeyFrame) {
|
||||||
clippingConfiguration.setStartsAtKeyFrame(startsAtKeyFrame);
|
clippingConfiguration.setStartsAtKeyFrame(startsAtKeyFrame);
|
||||||
@ -225,6 +236,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the optional DRM configuration. */
|
/** Sets the optional DRM configuration. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setDrmConfiguration(@Nullable DrmConfiguration drmConfiguration) {
|
public Builder setDrmConfiguration(@Nullable DrmConfiguration drmConfiguration) {
|
||||||
this.drmConfiguration =
|
this.drmConfiguration =
|
||||||
drmConfiguration != null ? drmConfiguration.buildUpon() : new DrmConfiguration.Builder();
|
drmConfiguration != null ? drmConfiguration.buildUpon() : new DrmConfiguration.Builder();
|
||||||
@ -235,6 +247,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* @deprecated Use {@link #setDrmConfiguration(DrmConfiguration)} and {@link
|
* @deprecated Use {@link #setDrmConfiguration(DrmConfiguration)} and {@link
|
||||||
* DrmConfiguration.Builder#setLicenseUri(Uri)} instead.
|
* DrmConfiguration.Builder#setLicenseUri(Uri)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setDrmLicenseUri(@Nullable Uri licenseUri) {
|
public Builder setDrmLicenseUri(@Nullable Uri licenseUri) {
|
||||||
drmConfiguration.setLicenseUri(licenseUri);
|
drmConfiguration.setLicenseUri(licenseUri);
|
||||||
@ -245,6 +258,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* @deprecated Use {@link #setDrmConfiguration(DrmConfiguration)} and {@link
|
* @deprecated Use {@link #setDrmConfiguration(DrmConfiguration)} and {@link
|
||||||
* DrmConfiguration.Builder#setLicenseUri(String)} instead.
|
* DrmConfiguration.Builder#setLicenseUri(String)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setDrmLicenseUri(@Nullable String licenseUri) {
|
public Builder setDrmLicenseUri(@Nullable String licenseUri) {
|
||||||
drmConfiguration.setLicenseUri(licenseUri);
|
drmConfiguration.setLicenseUri(licenseUri);
|
||||||
@ -257,6 +271,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* DrmConfiguration.Builder#setLicenseRequestHeaders(Map)} doesn't accept null, use an empty
|
* DrmConfiguration.Builder#setLicenseRequestHeaders(Map)} doesn't accept null, use an empty
|
||||||
* map to clear the headers.
|
* map to clear the headers.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setDrmLicenseRequestHeaders(
|
public Builder setDrmLicenseRequestHeaders(
|
||||||
@Nullable Map<String, String> licenseRequestHeaders) {
|
@Nullable Map<String, String> licenseRequestHeaders) {
|
||||||
@ -269,6 +284,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* @deprecated Use {@link #setDrmConfiguration(DrmConfiguration)} and pass the {@code uuid} to
|
* @deprecated Use {@link #setDrmConfiguration(DrmConfiguration)} and pass the {@code uuid} to
|
||||||
* {@link DrmConfiguration.Builder#Builder(UUID)} instead.
|
* {@link DrmConfiguration.Builder#Builder(UUID)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setDrmUuid(@Nullable UUID uuid) {
|
public Builder setDrmUuid(@Nullable UUID uuid) {
|
||||||
drmConfiguration.setNullableScheme(uuid);
|
drmConfiguration.setNullableScheme(uuid);
|
||||||
@ -279,6 +295,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* @deprecated Use {@link #setDrmConfiguration(DrmConfiguration)} and {@link
|
* @deprecated Use {@link #setDrmConfiguration(DrmConfiguration)} and {@link
|
||||||
* DrmConfiguration.Builder#setMultiSession(boolean)} instead.
|
* DrmConfiguration.Builder#setMultiSession(boolean)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setDrmMultiSession(boolean multiSession) {
|
public Builder setDrmMultiSession(boolean multiSession) {
|
||||||
drmConfiguration.setMultiSession(multiSession);
|
drmConfiguration.setMultiSession(multiSession);
|
||||||
@ -289,6 +306,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* @deprecated Use {@link #setDrmConfiguration(DrmConfiguration)} and {@link
|
* @deprecated Use {@link #setDrmConfiguration(DrmConfiguration)} and {@link
|
||||||
* DrmConfiguration.Builder#setForceDefaultLicenseUri(boolean)} instead.
|
* DrmConfiguration.Builder#setForceDefaultLicenseUri(boolean)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setDrmForceDefaultLicenseUri(boolean forceDefaultLicenseUri) {
|
public Builder setDrmForceDefaultLicenseUri(boolean forceDefaultLicenseUri) {
|
||||||
drmConfiguration.setForceDefaultLicenseUri(forceDefaultLicenseUri);
|
drmConfiguration.setForceDefaultLicenseUri(forceDefaultLicenseUri);
|
||||||
@ -299,6 +317,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* @deprecated Use {@link #setDrmConfiguration(DrmConfiguration)} and {@link
|
* @deprecated Use {@link #setDrmConfiguration(DrmConfiguration)} and {@link
|
||||||
* DrmConfiguration.Builder#setPlayClearContentWithoutKey(boolean)} instead.
|
* DrmConfiguration.Builder#setPlayClearContentWithoutKey(boolean)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setDrmPlayClearContentWithoutKey(boolean playClearContentWithoutKey) {
|
public Builder setDrmPlayClearContentWithoutKey(boolean playClearContentWithoutKey) {
|
||||||
drmConfiguration.setPlayClearContentWithoutKey(playClearContentWithoutKey);
|
drmConfiguration.setPlayClearContentWithoutKey(playClearContentWithoutKey);
|
||||||
@ -309,6 +328,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* @deprecated Use {@link #setDrmConfiguration(DrmConfiguration)} and {@link
|
* @deprecated Use {@link #setDrmConfiguration(DrmConfiguration)} and {@link
|
||||||
* DrmConfiguration.Builder#setForceSessionsForAudioAndVideoTracks(boolean)} instead.
|
* DrmConfiguration.Builder#setForceSessionsForAudioAndVideoTracks(boolean)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setDrmSessionForClearPeriods(boolean sessionForClearPeriods) {
|
public Builder setDrmSessionForClearPeriods(boolean sessionForClearPeriods) {
|
||||||
drmConfiguration.setForceSessionsForAudioAndVideoTracks(sessionForClearPeriods);
|
drmConfiguration.setForceSessionsForAudioAndVideoTracks(sessionForClearPeriods);
|
||||||
@ -321,6 +341,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* DrmConfiguration.Builder#setForcedSessionTrackTypes(List)} doesn't accept null, use an
|
* DrmConfiguration.Builder#setForcedSessionTrackTypes(List)} doesn't accept null, use an
|
||||||
* empty list to clear the contents.
|
* empty list to clear the contents.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setDrmSessionForClearTypes(
|
public Builder setDrmSessionForClearTypes(
|
||||||
@Nullable List<@C.TrackType Integer> sessionForClearTypes) {
|
@Nullable List<@C.TrackType Integer> sessionForClearTypes) {
|
||||||
@ -333,6 +354,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* @deprecated Use {@link #setDrmConfiguration(DrmConfiguration)} and {@link
|
* @deprecated Use {@link #setDrmConfiguration(DrmConfiguration)} and {@link
|
||||||
* DrmConfiguration.Builder#setKeySetId(byte[])} instead.
|
* DrmConfiguration.Builder#setKeySetId(byte[])} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setDrmKeySetId(@Nullable byte[] keySetId) {
|
public Builder setDrmKeySetId(@Nullable byte[] keySetId) {
|
||||||
drmConfiguration.setKeySetId(keySetId);
|
drmConfiguration.setKeySetId(keySetId);
|
||||||
@ -348,6 +370,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* <p>If {@link #setUri} is passed a non-null {@code uri}, the stream keys are used to create a
|
* <p>If {@link #setUri} is passed a non-null {@code uri}, the stream keys are used to create a
|
||||||
* {@link LocalConfiguration} object. Otherwise they will be ignored.
|
* {@link LocalConfiguration} object. Otherwise they will be ignored.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setStreamKeys(@Nullable List<StreamKey> streamKeys) {
|
public Builder setStreamKeys(@Nullable List<StreamKey> streamKeys) {
|
||||||
this.streamKeys =
|
this.streamKeys =
|
||||||
streamKeys != null && !streamKeys.isEmpty()
|
streamKeys != null && !streamKeys.isEmpty()
|
||||||
@ -361,6 +384,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
*
|
*
|
||||||
* <p>This method should only be called if {@link #setUri} is passed a non-null value.
|
* <p>This method should only be called if {@link #setUri} is passed a non-null value.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setCustomCacheKey(@Nullable String customCacheKey) {
|
public Builder setCustomCacheKey(@Nullable String customCacheKey) {
|
||||||
this.customCacheKey = customCacheKey;
|
this.customCacheKey = customCacheKey;
|
||||||
return this;
|
return this;
|
||||||
@ -371,6 +395,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* #setSubtitleConfigurations(List)} doesn't accept null, use an empty list to clear the
|
* #setSubtitleConfigurations(List)} doesn't accept null, use an empty list to clear the
|
||||||
* contents.
|
* contents.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setSubtitles(@Nullable List<Subtitle> subtitles) {
|
public Builder setSubtitles(@Nullable List<Subtitle> subtitles) {
|
||||||
this.subtitleConfigurations =
|
this.subtitleConfigurations =
|
||||||
@ -383,6 +408,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
*
|
*
|
||||||
* <p>This method should only be called if {@link #setUri} is passed a non-null value.
|
* <p>This method should only be called if {@link #setUri} is passed a non-null value.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSubtitleConfigurations(List<SubtitleConfiguration> subtitleConfigurations) {
|
public Builder setSubtitleConfigurations(List<SubtitleConfiguration> subtitleConfigurations) {
|
||||||
this.subtitleConfigurations = ImmutableList.copyOf(subtitleConfigurations);
|
this.subtitleConfigurations = ImmutableList.copyOf(subtitleConfigurations);
|
||||||
return this;
|
return this;
|
||||||
@ -393,6 +419,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
*
|
*
|
||||||
* <p>This method should only be called if {@link #setUri} is passed a non-null value.
|
* <p>This method should only be called if {@link #setUri} is passed a non-null value.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAdsConfiguration(@Nullable AdsConfiguration adsConfiguration) {
|
public Builder setAdsConfiguration(@Nullable AdsConfiguration adsConfiguration) {
|
||||||
this.adsConfiguration = adsConfiguration;
|
this.adsConfiguration = adsConfiguration;
|
||||||
return this;
|
return this;
|
||||||
@ -403,6 +430,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* with {@link Uri#parse(String)} and pass the result to {@link
|
* with {@link Uri#parse(String)} and pass the result to {@link
|
||||||
* AdsConfiguration.Builder#Builder(Uri)} instead.
|
* AdsConfiguration.Builder#Builder(Uri)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setAdTagUri(@Nullable String adTagUri) {
|
public Builder setAdTagUri(@Nullable String adTagUri) {
|
||||||
return setAdTagUri(adTagUri != null ? Uri.parse(adTagUri) : null);
|
return setAdTagUri(adTagUri != null ? Uri.parse(adTagUri) : null);
|
||||||
@ -412,6 +440,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* @deprecated Use {@link #setAdsConfiguration(AdsConfiguration)} and pass the {@code adTagUri}
|
* @deprecated Use {@link #setAdsConfiguration(AdsConfiguration)} and pass the {@code adTagUri}
|
||||||
* to {@link AdsConfiguration.Builder#Builder(Uri)} instead.
|
* to {@link AdsConfiguration.Builder#Builder(Uri)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setAdTagUri(@Nullable Uri adTagUri) {
|
public Builder setAdTagUri(@Nullable Uri adTagUri) {
|
||||||
return setAdTagUri(adTagUri, /* adsId= */ null);
|
return setAdTagUri(adTagUri, /* adsId= */ null);
|
||||||
@ -422,6 +451,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* {@link AdsConfiguration.Builder#Builder(Uri)} and the {@code adsId} to {@link
|
* {@link AdsConfiguration.Builder#Builder(Uri)} and the {@code adsId} to {@link
|
||||||
* AdsConfiguration.Builder#setAdsId(Object)} instead.
|
* AdsConfiguration.Builder#setAdsId(Object)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setAdTagUri(@Nullable Uri adTagUri, @Nullable Object adsId) {
|
public Builder setAdTagUri(@Nullable Uri adTagUri, @Nullable Object adsId) {
|
||||||
this.adsConfiguration =
|
this.adsConfiguration =
|
||||||
@ -430,6 +460,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the {@link LiveConfiguration}. Defaults to {@link LiveConfiguration#UNSET}. */
|
/** Sets the {@link LiveConfiguration}. Defaults to {@link LiveConfiguration#UNSET}. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setLiveConfiguration(LiveConfiguration liveConfiguration) {
|
public Builder setLiveConfiguration(LiveConfiguration liveConfiguration) {
|
||||||
this.liveConfiguration = liveConfiguration.buildUpon();
|
this.liveConfiguration = liveConfiguration.buildUpon();
|
||||||
return this;
|
return this;
|
||||||
@ -439,6 +470,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* @deprecated Use {@link #setLiveConfiguration(LiveConfiguration)} and {@link
|
* @deprecated Use {@link #setLiveConfiguration(LiveConfiguration)} and {@link
|
||||||
* LiveConfiguration.Builder#setTargetOffsetMs(long)}.
|
* LiveConfiguration.Builder#setTargetOffsetMs(long)}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setLiveTargetOffsetMs(long liveTargetOffsetMs) {
|
public Builder setLiveTargetOffsetMs(long liveTargetOffsetMs) {
|
||||||
liveConfiguration.setTargetOffsetMs(liveTargetOffsetMs);
|
liveConfiguration.setTargetOffsetMs(liveTargetOffsetMs);
|
||||||
@ -449,6 +481,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* @deprecated Use {@link #setLiveConfiguration(LiveConfiguration)} and {@link
|
* @deprecated Use {@link #setLiveConfiguration(LiveConfiguration)} and {@link
|
||||||
* LiveConfiguration.Builder#setMinOffsetMs(long)}.
|
* LiveConfiguration.Builder#setMinOffsetMs(long)}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setLiveMinOffsetMs(long liveMinOffsetMs) {
|
public Builder setLiveMinOffsetMs(long liveMinOffsetMs) {
|
||||||
liveConfiguration.setMinOffsetMs(liveMinOffsetMs);
|
liveConfiguration.setMinOffsetMs(liveMinOffsetMs);
|
||||||
@ -459,6 +492,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* @deprecated Use {@link #setLiveConfiguration(LiveConfiguration)} and {@link
|
* @deprecated Use {@link #setLiveConfiguration(LiveConfiguration)} and {@link
|
||||||
* LiveConfiguration.Builder#setMaxOffsetMs(long)}.
|
* LiveConfiguration.Builder#setMaxOffsetMs(long)}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setLiveMaxOffsetMs(long liveMaxOffsetMs) {
|
public Builder setLiveMaxOffsetMs(long liveMaxOffsetMs) {
|
||||||
liveConfiguration.setMaxOffsetMs(liveMaxOffsetMs);
|
liveConfiguration.setMaxOffsetMs(liveMaxOffsetMs);
|
||||||
@ -469,6 +503,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* @deprecated Use {@link #setLiveConfiguration(LiveConfiguration)} and {@link
|
* @deprecated Use {@link #setLiveConfiguration(LiveConfiguration)} and {@link
|
||||||
* LiveConfiguration.Builder#setMinPlaybackSpeed(float)}.
|
* LiveConfiguration.Builder#setMinPlaybackSpeed(float)}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setLiveMinPlaybackSpeed(float minPlaybackSpeed) {
|
public Builder setLiveMinPlaybackSpeed(float minPlaybackSpeed) {
|
||||||
liveConfiguration.setMinPlaybackSpeed(minPlaybackSpeed);
|
liveConfiguration.setMinPlaybackSpeed(minPlaybackSpeed);
|
||||||
@ -479,6 +514,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* @deprecated Use {@link #setLiveConfiguration(LiveConfiguration)} and {@link
|
* @deprecated Use {@link #setLiveConfiguration(LiveConfiguration)} and {@link
|
||||||
* LiveConfiguration.Builder#setMaxPlaybackSpeed(float)}.
|
* LiveConfiguration.Builder#setMaxPlaybackSpeed(float)}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setLiveMaxPlaybackSpeed(float maxPlaybackSpeed) {
|
public Builder setLiveMaxPlaybackSpeed(float maxPlaybackSpeed) {
|
||||||
liveConfiguration.setMaxPlaybackSpeed(maxPlaybackSpeed);
|
liveConfiguration.setMaxPlaybackSpeed(maxPlaybackSpeed);
|
||||||
@ -492,18 +528,21 @@ public final class MediaItem implements Bundleable {
|
|||||||
*
|
*
|
||||||
* <p>This method should only be called if {@link #setUri} is passed a non-null value.
|
* <p>This method should only be called if {@link #setUri} is passed a non-null value.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setTag(@Nullable Object tag) {
|
public Builder setTag(@Nullable Object tag) {
|
||||||
this.tag = tag;
|
this.tag = tag;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the media metadata. */
|
/** Sets the media metadata. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMediaMetadata(MediaMetadata mediaMetadata) {
|
public Builder setMediaMetadata(MediaMetadata mediaMetadata) {
|
||||||
this.mediaMetadata = mediaMetadata;
|
this.mediaMetadata = mediaMetadata;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the request metadata. */
|
/** Sets the request metadata. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setRequestMetadata(RequestMetadata requestMetadata) {
|
public Builder setRequestMetadata(RequestMetadata requestMetadata) {
|
||||||
this.requestMetadata = requestMetadata;
|
this.requestMetadata = requestMetadata;
|
||||||
return this;
|
return this;
|
||||||
@ -587,6 +626,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the {@link UUID} of the protection scheme. */
|
/** Sets the {@link UUID} of the protection scheme. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setScheme(UUID scheme) {
|
public Builder setScheme(UUID scheme) {
|
||||||
this.scheme = scheme;
|
this.scheme = scheme;
|
||||||
return this;
|
return this;
|
||||||
@ -596,6 +636,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* @deprecated This only exists to support the deprecated {@link
|
* @deprecated This only exists to support the deprecated {@link
|
||||||
* MediaItem.Builder#setDrmUuid(UUID)}.
|
* MediaItem.Builder#setDrmUuid(UUID)}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
private Builder setNullableScheme(@Nullable UUID scheme) {
|
private Builder setNullableScheme(@Nullable UUID scheme) {
|
||||||
this.scheme = scheme;
|
this.scheme = scheme;
|
||||||
@ -603,24 +644,28 @@ public final class MediaItem implements Bundleable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the optional default DRM license server URI. */
|
/** Sets the optional default DRM license server URI. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setLicenseUri(@Nullable Uri licenseUri) {
|
public Builder setLicenseUri(@Nullable Uri licenseUri) {
|
||||||
this.licenseUri = licenseUri;
|
this.licenseUri = licenseUri;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the optional default DRM license server URI. */
|
/** Sets the optional default DRM license server URI. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setLicenseUri(@Nullable String licenseUri) {
|
public Builder setLicenseUri(@Nullable String licenseUri) {
|
||||||
this.licenseUri = licenseUri == null ? null : Uri.parse(licenseUri);
|
this.licenseUri = licenseUri == null ? null : Uri.parse(licenseUri);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the optional request headers attached to DRM license requests. */
|
/** Sets the optional request headers attached to DRM license requests. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setLicenseRequestHeaders(Map<String, String> licenseRequestHeaders) {
|
public Builder setLicenseRequestHeaders(Map<String, String> licenseRequestHeaders) {
|
||||||
this.licenseRequestHeaders = ImmutableMap.copyOf(licenseRequestHeaders);
|
this.licenseRequestHeaders = ImmutableMap.copyOf(licenseRequestHeaders);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets whether multi session is enabled. */
|
/** Sets whether multi session is enabled. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMultiSession(boolean multiSession) {
|
public Builder setMultiSession(boolean multiSession) {
|
||||||
this.multiSession = multiSession;
|
this.multiSession = multiSession;
|
||||||
return this;
|
return this;
|
||||||
@ -630,6 +675,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* Sets whether to always use the default DRM license server URI even if the media specifies
|
* Sets whether to always use the default DRM license server URI even if the media specifies
|
||||||
* its own DRM license server URI.
|
* its own DRM license server URI.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setForceDefaultLicenseUri(boolean forceDefaultLicenseUri) {
|
public Builder setForceDefaultLicenseUri(boolean forceDefaultLicenseUri) {
|
||||||
this.forceDefaultLicenseUri = forceDefaultLicenseUri;
|
this.forceDefaultLicenseUri = forceDefaultLicenseUri;
|
||||||
return this;
|
return this;
|
||||||
@ -639,6 +685,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* Sets whether clear samples within protected content should be played when keys for the
|
* Sets whether clear samples within protected content should be played when keys for the
|
||||||
* encrypted part of the content have yet to be loaded.
|
* encrypted part of the content have yet to be loaded.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPlayClearContentWithoutKey(boolean playClearContentWithoutKey) {
|
public Builder setPlayClearContentWithoutKey(boolean playClearContentWithoutKey) {
|
||||||
this.playClearContentWithoutKey = playClearContentWithoutKey;
|
this.playClearContentWithoutKey = playClearContentWithoutKey;
|
||||||
return this;
|
return this;
|
||||||
@ -647,6 +694,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link #setForceSessionsForAudioAndVideoTracks(boolean)} instead.
|
* @deprecated Use {@link #setForceSessionsForAudioAndVideoTracks(boolean)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@InlineMe(
|
@InlineMe(
|
||||||
replacement =
|
replacement =
|
||||||
@ -663,6 +711,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* <p>This method overrides what has been set by previously calling {@link
|
* <p>This method overrides what has been set by previously calling {@link
|
||||||
* #setForcedSessionTrackTypes(List)}.
|
* #setForcedSessionTrackTypes(List)}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setForceSessionsForAudioAndVideoTracks(
|
public Builder setForceSessionsForAudioAndVideoTracks(
|
||||||
boolean forceSessionsForAudioAndVideoTracks) {
|
boolean forceSessionsForAudioAndVideoTracks) {
|
||||||
this.setForcedSessionTrackTypes(
|
this.setForcedSessionTrackTypes(
|
||||||
@ -682,6 +731,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* <p>This method overrides what has been set by previously calling {@link
|
* <p>This method overrides what has been set by previously calling {@link
|
||||||
* #setForceSessionsForAudioAndVideoTracks(boolean)}.
|
* #setForceSessionsForAudioAndVideoTracks(boolean)}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setForcedSessionTrackTypes(
|
public Builder setForcedSessionTrackTypes(
|
||||||
List<@C.TrackType Integer> forcedSessionTrackTypes) {
|
List<@C.TrackType Integer> forcedSessionTrackTypes) {
|
||||||
this.forcedSessionTrackTypes = ImmutableList.copyOf(forcedSessionTrackTypes);
|
this.forcedSessionTrackTypes = ImmutableList.copyOf(forcedSessionTrackTypes);
|
||||||
@ -695,6 +745,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* release an existing offline license (see {@code DefaultDrmSessionManager#setMode(int
|
* release an existing offline license (see {@code DefaultDrmSessionManager#setMode(int
|
||||||
* mode,byte[] offlineLicenseKeySetId)}).
|
* mode,byte[] offlineLicenseKeySetId)}).
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setKeySetId(@Nullable byte[] keySetId) {
|
public Builder setKeySetId(@Nullable byte[] keySetId) {
|
||||||
this.keySetId = keySetId != null ? Arrays.copyOf(keySetId, keySetId.length) : null;
|
this.keySetId = keySetId != null ? Arrays.copyOf(keySetId, keySetId.length) : null;
|
||||||
return this;
|
return this;
|
||||||
@ -837,6 +888,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the ad tag URI to load. */
|
/** Sets the ad tag URI to load. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAdTagUri(Uri adTagUri) {
|
public Builder setAdTagUri(Uri adTagUri) {
|
||||||
this.adTagUri = adTagUri;
|
this.adTagUri = adTagUri;
|
||||||
return this;
|
return this;
|
||||||
@ -848,6 +900,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* <p>See details on {@link AdsConfiguration#adsId} for how the ads identifier is used and how
|
* <p>See details on {@link AdsConfiguration#adsId} for how the ads identifier is used and how
|
||||||
* it's calculated if not explicitly set.
|
* it's calculated if not explicitly set.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAdsId(@Nullable Object adsId) {
|
public Builder setAdsId(@Nullable Object adsId) {
|
||||||
this.adsId = adsId;
|
this.adsId = adsId;
|
||||||
return this;
|
return this;
|
||||||
@ -1065,6 +1118,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
*
|
*
|
||||||
* <p>Defaults to {@link C#TIME_UNSET}, indicating the media-defined default will be used.
|
* <p>Defaults to {@link C#TIME_UNSET}, indicating the media-defined default will be used.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setTargetOffsetMs(long targetOffsetMs) {
|
public Builder setTargetOffsetMs(long targetOffsetMs) {
|
||||||
this.targetOffsetMs = targetOffsetMs;
|
this.targetOffsetMs = targetOffsetMs;
|
||||||
return this;
|
return this;
|
||||||
@ -1077,6 +1131,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
*
|
*
|
||||||
* <p>Defaults to {@link C#TIME_UNSET}, indicating the media-defined default will be used.
|
* <p>Defaults to {@link C#TIME_UNSET}, indicating the media-defined default will be used.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMinOffsetMs(long minOffsetMs) {
|
public Builder setMinOffsetMs(long minOffsetMs) {
|
||||||
this.minOffsetMs = minOffsetMs;
|
this.minOffsetMs = minOffsetMs;
|
||||||
return this;
|
return this;
|
||||||
@ -1089,6 +1144,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
*
|
*
|
||||||
* <p>Defaults to {@link C#TIME_UNSET}, indicating the media-defined default will be used.
|
* <p>Defaults to {@link C#TIME_UNSET}, indicating the media-defined default will be used.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMaxOffsetMs(long maxOffsetMs) {
|
public Builder setMaxOffsetMs(long maxOffsetMs) {
|
||||||
this.maxOffsetMs = maxOffsetMs;
|
this.maxOffsetMs = maxOffsetMs;
|
||||||
return this;
|
return this;
|
||||||
@ -1099,6 +1155,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
*
|
*
|
||||||
* <p>Defaults to {@link C#RATE_UNSET}, indicating the media-defined default will be used.
|
* <p>Defaults to {@link C#RATE_UNSET}, indicating the media-defined default will be used.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMinPlaybackSpeed(float minPlaybackSpeed) {
|
public Builder setMinPlaybackSpeed(float minPlaybackSpeed) {
|
||||||
this.minPlaybackSpeed = minPlaybackSpeed;
|
this.minPlaybackSpeed = minPlaybackSpeed;
|
||||||
return this;
|
return this;
|
||||||
@ -1109,6 +1166,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
*
|
*
|
||||||
* <p>Defaults to {@link C#RATE_UNSET}, indicating the media-defined default will be used.
|
* <p>Defaults to {@link C#RATE_UNSET}, indicating the media-defined default will be used.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMaxPlaybackSpeed(float maxPlaybackSpeed) {
|
public Builder setMaxPlaybackSpeed(float maxPlaybackSpeed) {
|
||||||
this.maxPlaybackSpeed = maxPlaybackSpeed;
|
this.maxPlaybackSpeed = maxPlaybackSpeed;
|
||||||
return this;
|
return this;
|
||||||
@ -1298,42 +1356,49 @@ public final class MediaItem implements Bundleable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the {@link Uri} to the subtitle file. */
|
/** Sets the {@link Uri} to the subtitle file. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setUri(Uri uri) {
|
public Builder setUri(Uri uri) {
|
||||||
this.uri = uri;
|
this.uri = uri;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the MIME type. */
|
/** Sets the MIME type. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMimeType(@Nullable String mimeType) {
|
public Builder setMimeType(@Nullable String mimeType) {
|
||||||
this.mimeType = mimeType;
|
this.mimeType = mimeType;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the optional language of the subtitle file. */
|
/** Sets the optional language of the subtitle file. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setLanguage(@Nullable String language) {
|
public Builder setLanguage(@Nullable String language) {
|
||||||
this.language = language;
|
this.language = language;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the flags used for track selection. */
|
/** Sets the flags used for track selection. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSelectionFlags(@C.SelectionFlags int selectionFlags) {
|
public Builder setSelectionFlags(@C.SelectionFlags int selectionFlags) {
|
||||||
this.selectionFlags = selectionFlags;
|
this.selectionFlags = selectionFlags;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the role flags. These are used for track selection. */
|
/** Sets the role flags. These are used for track selection. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setRoleFlags(@C.RoleFlags int roleFlags) {
|
public Builder setRoleFlags(@C.RoleFlags int roleFlags) {
|
||||||
this.roleFlags = roleFlags;
|
this.roleFlags = roleFlags;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the optional label for this subtitle track. */
|
/** Sets the optional label for this subtitle track. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setLabel(@Nullable String label) {
|
public Builder setLabel(@Nullable String label) {
|
||||||
this.label = label;
|
this.label = label;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the optional ID for this subtitle track. */
|
/** Sets the optional ID for this subtitle track. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setId(@Nullable String id) {
|
public Builder setId(@Nullable String id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
@ -1506,6 +1571,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* Sets the optional start position in milliseconds which must be a value larger than or equal
|
* Sets the optional start position in milliseconds which must be a value larger than or equal
|
||||||
* to zero (Default: 0).
|
* to zero (Default: 0).
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setStartPositionMs(@IntRange(from = 0) long startPositionMs) {
|
public Builder setStartPositionMs(@IntRange(from = 0) long startPositionMs) {
|
||||||
Assertions.checkArgument(startPositionMs >= 0);
|
Assertions.checkArgument(startPositionMs >= 0);
|
||||||
this.startPositionMs = startPositionMs;
|
this.startPositionMs = startPositionMs;
|
||||||
@ -1517,6 +1583,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* to zero, or {@link C#TIME_END_OF_SOURCE} to end when playback reaches the end of media
|
* to zero, or {@link C#TIME_END_OF_SOURCE} to end when playback reaches the end of media
|
||||||
* (Default: {@link C#TIME_END_OF_SOURCE}).
|
* (Default: {@link C#TIME_END_OF_SOURCE}).
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setEndPositionMs(long endPositionMs) {
|
public Builder setEndPositionMs(long endPositionMs) {
|
||||||
Assertions.checkArgument(endPositionMs == C.TIME_END_OF_SOURCE || endPositionMs >= 0);
|
Assertions.checkArgument(endPositionMs == C.TIME_END_OF_SOURCE || endPositionMs >= 0);
|
||||||
this.endPositionMs = endPositionMs;
|
this.endPositionMs = endPositionMs;
|
||||||
@ -1528,6 +1595,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* {@code false}, live streams end when playback reaches the end position in live window seen
|
* {@code false}, live streams end when playback reaches the end position in live window seen
|
||||||
* when the media is first loaded (Default: {@code false}).
|
* when the media is first loaded (Default: {@code false}).
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setRelativeToLiveWindow(boolean relativeToLiveWindow) {
|
public Builder setRelativeToLiveWindow(boolean relativeToLiveWindow) {
|
||||||
this.relativeToLiveWindow = relativeToLiveWindow;
|
this.relativeToLiveWindow = relativeToLiveWindow;
|
||||||
return this;
|
return this;
|
||||||
@ -1537,6 +1605,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* Sets whether the start position and the end position are relative to the default position
|
* Sets whether the start position and the end position are relative to the default position
|
||||||
* in the window (Default: {@code false}).
|
* in the window (Default: {@code false}).
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setRelativeToDefaultPosition(boolean relativeToDefaultPosition) {
|
public Builder setRelativeToDefaultPosition(boolean relativeToDefaultPosition) {
|
||||||
this.relativeToDefaultPosition = relativeToDefaultPosition;
|
this.relativeToDefaultPosition = relativeToDefaultPosition;
|
||||||
return this;
|
return this;
|
||||||
@ -1546,6 +1615,7 @@ public final class MediaItem implements Bundleable {
|
|||||||
* Sets whether the start point is guaranteed to be a key frame. If {@code false}, the
|
* Sets whether the start point is guaranteed to be a key frame. If {@code false}, the
|
||||||
* playback transition into the clip may not be seamless (Default: {@code false}).
|
* playback transition into the clip may not be seamless (Default: {@code false}).
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setStartsAtKeyFrame(boolean startsAtKeyFrame) {
|
public Builder setStartsAtKeyFrame(boolean startsAtKeyFrame) {
|
||||||
this.startsAtKeyFrame = startsAtKeyFrame;
|
this.startsAtKeyFrame = startsAtKeyFrame;
|
||||||
return this;
|
return this;
|
||||||
@ -1731,18 +1801,21 @@ public final class MediaItem implements Bundleable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the URI of the requested media, or null if not known or applicable. */
|
/** Sets the URI of the requested media, or null if not known or applicable. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMediaUri(@Nullable Uri mediaUri) {
|
public Builder setMediaUri(@Nullable Uri mediaUri) {
|
||||||
this.mediaUri = mediaUri;
|
this.mediaUri = mediaUri;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the search query for the requested media, or null if not applicable. */
|
/** Sets the search query for the requested media, or null if not applicable. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSearchQuery(@Nullable String searchQuery) {
|
public Builder setSearchQuery(@Nullable String searchQuery) {
|
||||||
this.searchQuery = searchQuery;
|
this.searchQuery = searchQuery;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets optional extras {@link Bundle}. */
|
/** Sets optional extras {@link Bundle}. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setExtras(@Nullable Bundle extras) {
|
public Builder setExtras(@Nullable Bundle extras) {
|
||||||
this.extras = extras;
|
this.extras = extras;
|
||||||
return this;
|
return this;
|
||||||
|
@ -29,6 +29,7 @@ import androidx.annotation.Nullable;
|
|||||||
import com.google.android.exoplayer2.metadata.Metadata;
|
import com.google.android.exoplayer2.metadata.Metadata;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
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;
|
||||||
@ -114,30 +115,35 @@ public final class MediaMetadata implements Bundleable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the title. */
|
/** Sets the title. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setTitle(@Nullable CharSequence title) {
|
public Builder setTitle(@Nullable CharSequence title) {
|
||||||
this.title = title;
|
this.title = title;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the artist. */
|
/** Sets the artist. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setArtist(@Nullable CharSequence artist) {
|
public Builder setArtist(@Nullable CharSequence artist) {
|
||||||
this.artist = artist;
|
this.artist = artist;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the album title. */
|
/** Sets the album title. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAlbumTitle(@Nullable CharSequence albumTitle) {
|
public Builder setAlbumTitle(@Nullable CharSequence albumTitle) {
|
||||||
this.albumTitle = albumTitle;
|
this.albumTitle = albumTitle;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the album artist. */
|
/** Sets the album artist. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAlbumArtist(@Nullable CharSequence albumArtist) {
|
public Builder setAlbumArtist(@Nullable CharSequence albumArtist) {
|
||||||
this.albumArtist = albumArtist;
|
this.albumArtist = albumArtist;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the display title. */
|
/** Sets the display title. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setDisplayTitle(@Nullable CharSequence displayTitle) {
|
public Builder setDisplayTitle(@Nullable CharSequence displayTitle) {
|
||||||
this.displayTitle = displayTitle;
|
this.displayTitle = displayTitle;
|
||||||
return this;
|
return this;
|
||||||
@ -148,24 +154,28 @@ public final class MediaMetadata implements Bundleable {
|
|||||||
*
|
*
|
||||||
* <p>This is the secondary title of the media, unrelated to closed captions.
|
* <p>This is the secondary title of the media, unrelated to closed captions.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSubtitle(@Nullable CharSequence subtitle) {
|
public Builder setSubtitle(@Nullable CharSequence subtitle) {
|
||||||
this.subtitle = subtitle;
|
this.subtitle = subtitle;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the description. */
|
/** Sets the description. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setDescription(@Nullable CharSequence description) {
|
public Builder setDescription(@Nullable CharSequence description) {
|
||||||
this.description = description;
|
this.description = description;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the user {@link Rating}. */
|
/** Sets the user {@link Rating}. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setUserRating(@Nullable Rating userRating) {
|
public Builder setUserRating(@Nullable Rating userRating) {
|
||||||
this.userRating = userRating;
|
this.userRating = userRating;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the overall {@link Rating}. */
|
/** Sets the overall {@link Rating}. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setOverallRating(@Nullable Rating overallRating) {
|
public Builder setOverallRating(@Nullable Rating overallRating) {
|
||||||
this.overallRating = overallRating;
|
this.overallRating = overallRating;
|
||||||
return this;
|
return this;
|
||||||
@ -175,6 +185,7 @@ public final class MediaMetadata implements Bundleable {
|
|||||||
* @deprecated Use {@link #setArtworkData(byte[] data, Integer pictureType)} or {@link
|
* @deprecated Use {@link #setArtworkData(byte[] data, Integer pictureType)} or {@link
|
||||||
* #maybeSetArtworkData(byte[] data, int pictureType)}, providing a {@link PictureType}.
|
* #maybeSetArtworkData(byte[] data, int pictureType)}, providing a {@link PictureType}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setArtworkData(@Nullable byte[] artworkData) {
|
public Builder setArtworkData(@Nullable byte[] artworkData) {
|
||||||
return setArtworkData(artworkData, /* artworkDataType= */ null);
|
return setArtworkData(artworkData, /* artworkDataType= */ null);
|
||||||
@ -184,6 +195,7 @@ public final class MediaMetadata implements Bundleable {
|
|||||||
* Sets the artwork data as a compressed byte array with an associated {@link PictureType
|
* Sets the artwork data as a compressed byte array with an associated {@link PictureType
|
||||||
* artworkDataType}.
|
* artworkDataType}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setArtworkData(
|
public Builder setArtworkData(
|
||||||
@Nullable byte[] artworkData, @Nullable @PictureType Integer artworkDataType) {
|
@Nullable byte[] artworkData, @Nullable @PictureType Integer artworkDataType) {
|
||||||
this.artworkData = artworkData == null ? null : artworkData.clone();
|
this.artworkData = artworkData == null ? null : artworkData.clone();
|
||||||
@ -199,6 +211,7 @@ public final class MediaMetadata implements Bundleable {
|
|||||||
* <p>Use {@link #setArtworkData(byte[], Integer)} to set the artwork data without checking the
|
* <p>Use {@link #setArtworkData(byte[], Integer)} to set the artwork data without checking the
|
||||||
* {@link PictureType}.
|
* {@link PictureType}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder maybeSetArtworkData(byte[] artworkData, @PictureType int artworkDataType) {
|
public Builder maybeSetArtworkData(byte[] artworkData, @PictureType int artworkDataType) {
|
||||||
if (this.artworkData == null
|
if (this.artworkData == null
|
||||||
|| Util.areEqual(artworkDataType, PICTURE_TYPE_FRONT_COVER)
|
|| Util.areEqual(artworkDataType, PICTURE_TYPE_FRONT_COVER)
|
||||||
@ -210,30 +223,35 @@ public final class MediaMetadata implements Bundleable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the artwork {@link Uri}. */
|
/** Sets the artwork {@link Uri}. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setArtworkUri(@Nullable Uri artworkUri) {
|
public Builder setArtworkUri(@Nullable Uri artworkUri) {
|
||||||
this.artworkUri = artworkUri;
|
this.artworkUri = artworkUri;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the track number. */
|
/** Sets the track number. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setTrackNumber(@Nullable Integer trackNumber) {
|
public Builder setTrackNumber(@Nullable Integer trackNumber) {
|
||||||
this.trackNumber = trackNumber;
|
this.trackNumber = trackNumber;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the total number of tracks. */
|
/** Sets the total number of tracks. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setTotalTrackCount(@Nullable Integer totalTrackCount) {
|
public Builder setTotalTrackCount(@Nullable Integer totalTrackCount) {
|
||||||
this.totalTrackCount = totalTrackCount;
|
this.totalTrackCount = totalTrackCount;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the {@link FolderType}. */
|
/** Sets the {@link FolderType}. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setFolderType(@Nullable @FolderType Integer folderType) {
|
public Builder setFolderType(@Nullable @FolderType Integer folderType) {
|
||||||
this.folderType = folderType;
|
this.folderType = folderType;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets whether the media is playable. */
|
/** Sets whether the media is playable. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setIsPlayable(@Nullable Boolean isPlayable) {
|
public Builder setIsPlayable(@Nullable Boolean isPlayable) {
|
||||||
this.isPlayable = isPlayable;
|
this.isPlayable = isPlayable;
|
||||||
return this;
|
return this;
|
||||||
@ -242,12 +260,14 @@ public final class MediaMetadata implements Bundleable {
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link #setRecordingYear(Integer)} instead.
|
* @deprecated Use {@link #setRecordingYear(Integer)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setYear(@Nullable Integer year) {
|
public Builder setYear(@Nullable Integer year) {
|
||||||
return setRecordingYear(year);
|
return setRecordingYear(year);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the year of the recording date. */
|
/** Sets the year of the recording date. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setRecordingYear(@Nullable Integer recordingYear) {
|
public Builder setRecordingYear(@Nullable Integer recordingYear) {
|
||||||
this.recordingYear = recordingYear;
|
this.recordingYear = recordingYear;
|
||||||
return this;
|
return this;
|
||||||
@ -258,6 +278,7 @@ public final class MediaMetadata implements Bundleable {
|
|||||||
*
|
*
|
||||||
* <p>Value should be between 1 and 12.
|
* <p>Value should be between 1 and 12.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setRecordingMonth(
|
public Builder setRecordingMonth(
|
||||||
@Nullable @IntRange(from = 1, to = 12) Integer recordingMonth) {
|
@Nullable @IntRange(from = 1, to = 12) Integer recordingMonth) {
|
||||||
this.recordingMonth = recordingMonth;
|
this.recordingMonth = recordingMonth;
|
||||||
@ -269,12 +290,14 @@ public final class MediaMetadata implements Bundleable {
|
|||||||
*
|
*
|
||||||
* <p>Value should be between 1 and 31.
|
* <p>Value should be between 1 and 31.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setRecordingDay(@Nullable @IntRange(from = 1, to = 31) Integer recordingDay) {
|
public Builder setRecordingDay(@Nullable @IntRange(from = 1, to = 31) Integer recordingDay) {
|
||||||
this.recordingDay = recordingDay;
|
this.recordingDay = recordingDay;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the year of the release date. */
|
/** Sets the year of the release date. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setReleaseYear(@Nullable Integer releaseYear) {
|
public Builder setReleaseYear(@Nullable Integer releaseYear) {
|
||||||
this.releaseYear = releaseYear;
|
this.releaseYear = releaseYear;
|
||||||
return this;
|
return this;
|
||||||
@ -285,6 +308,7 @@ public final class MediaMetadata implements Bundleable {
|
|||||||
*
|
*
|
||||||
* <p>Value should be between 1 and 12.
|
* <p>Value should be between 1 and 12.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setReleaseMonth(@Nullable @IntRange(from = 1, to = 12) Integer releaseMonth) {
|
public Builder setReleaseMonth(@Nullable @IntRange(from = 1, to = 12) Integer releaseMonth) {
|
||||||
this.releaseMonth = releaseMonth;
|
this.releaseMonth = releaseMonth;
|
||||||
return this;
|
return this;
|
||||||
@ -295,60 +319,70 @@ public final class MediaMetadata implements Bundleable {
|
|||||||
*
|
*
|
||||||
* <p>Value should be between 1 and 31.
|
* <p>Value should be between 1 and 31.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setReleaseDay(@Nullable @IntRange(from = 1, to = 31) Integer releaseDay) {
|
public Builder setReleaseDay(@Nullable @IntRange(from = 1, to = 31) Integer releaseDay) {
|
||||||
this.releaseDay = releaseDay;
|
this.releaseDay = releaseDay;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the writer. */
|
/** Sets the writer. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setWriter(@Nullable CharSequence writer) {
|
public Builder setWriter(@Nullable CharSequence writer) {
|
||||||
this.writer = writer;
|
this.writer = writer;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the composer. */
|
/** Sets the composer. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setComposer(@Nullable CharSequence composer) {
|
public Builder setComposer(@Nullable CharSequence composer) {
|
||||||
this.composer = composer;
|
this.composer = composer;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the conductor. */
|
/** Sets the conductor. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setConductor(@Nullable CharSequence conductor) {
|
public Builder setConductor(@Nullable CharSequence conductor) {
|
||||||
this.conductor = conductor;
|
this.conductor = conductor;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the disc number. */
|
/** Sets the disc number. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setDiscNumber(@Nullable Integer discNumber) {
|
public Builder setDiscNumber(@Nullable Integer discNumber) {
|
||||||
this.discNumber = discNumber;
|
this.discNumber = discNumber;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the total number of discs. */
|
/** Sets the total number of discs. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setTotalDiscCount(@Nullable Integer totalDiscCount) {
|
public Builder setTotalDiscCount(@Nullable Integer totalDiscCount) {
|
||||||
this.totalDiscCount = totalDiscCount;
|
this.totalDiscCount = totalDiscCount;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the genre. */
|
/** Sets the genre. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setGenre(@Nullable CharSequence genre) {
|
public Builder setGenre(@Nullable CharSequence genre) {
|
||||||
this.genre = genre;
|
this.genre = genre;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the compilation. */
|
/** Sets the compilation. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setCompilation(@Nullable CharSequence compilation) {
|
public Builder setCompilation(@Nullable CharSequence compilation) {
|
||||||
this.compilation = compilation;
|
this.compilation = compilation;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the name of the station streaming the media. */
|
/** Sets the name of the station streaming the media. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setStation(@Nullable CharSequence station) {
|
public Builder setStation(@Nullable CharSequence station) {
|
||||||
this.station = station;
|
this.station = station;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the extras {@link Bundle}. */
|
/** Sets the extras {@link Bundle}. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setExtras(@Nullable Bundle extras) {
|
public Builder setExtras(@Nullable Bundle extras) {
|
||||||
this.extras = extras;
|
this.extras = extras;
|
||||||
return this;
|
return this;
|
||||||
@ -363,6 +397,7 @@ public final class MediaMetadata implements Bundleable {
|
|||||||
* <p>In the event that multiple {@link Metadata.Entry} objects within the {@link Metadata}
|
* <p>In the event that multiple {@link Metadata.Entry} objects within the {@link Metadata}
|
||||||
* relate to the same {@link MediaMetadata} field, then the last one will be used.
|
* relate to the same {@link MediaMetadata} field, then the last one will be used.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder populateFromMetadata(Metadata metadata) {
|
public Builder populateFromMetadata(Metadata metadata) {
|
||||||
for (int i = 0; i < metadata.length(); i++) {
|
for (int i = 0; i < metadata.length(); i++) {
|
||||||
Metadata.Entry entry = metadata.get(i);
|
Metadata.Entry entry = metadata.get(i);
|
||||||
@ -381,6 +416,7 @@ public final class MediaMetadata implements Bundleable {
|
|||||||
* <p>In the event that multiple {@link Metadata.Entry} objects within any of the {@link
|
* <p>In the event that multiple {@link Metadata.Entry} objects within any of the {@link
|
||||||
* Metadata} relate to the same {@link MediaMetadata} field, then the last one will be used.
|
* Metadata} relate to the same {@link MediaMetadata} field, then the last one will be used.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder populateFromMetadata(List<Metadata> metadataList) {
|
public Builder populateFromMetadata(List<Metadata> metadataList) {
|
||||||
for (int i = 0; i < metadataList.size(); i++) {
|
for (int i = 0; i < metadataList.size(); i++) {
|
||||||
Metadata metadata = metadataList.get(i);
|
Metadata metadata = metadataList.get(i);
|
||||||
@ -393,6 +429,7 @@ public final class MediaMetadata implements Bundleable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Populates all the fields from {@code mediaMetadata}, provided they are non-null. */
|
/** Populates all the fields from {@code mediaMetadata}, provided they are non-null. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder populate(@Nullable MediaMetadata mediaMetadata) {
|
public Builder populate(@Nullable MediaMetadata mediaMetadata) {
|
||||||
if (mediaMetadata == null) {
|
if (mediaMetadata == null) {
|
||||||
return this;
|
return this;
|
||||||
|
@ -40,6 +40,7 @@ import com.google.android.exoplayer2.util.FlagSet;
|
|||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
import com.google.android.exoplayer2.video.VideoSize;
|
import com.google.android.exoplayer2.video.VideoSize;
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
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;
|
||||||
@ -405,6 +406,7 @@ public interface Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder add(@Command int command) {
|
public Builder add(@Command int command) {
|
||||||
flagsBuilder.add(command);
|
flagsBuilder.add(command);
|
||||||
return this;
|
return this;
|
||||||
@ -418,6 +420,7 @@ public interface Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder addIf(@Command int command, boolean condition) {
|
public Builder addIf(@Command int command, boolean condition) {
|
||||||
flagsBuilder.addIf(command, condition);
|
flagsBuilder.addIf(command, condition);
|
||||||
return this;
|
return this;
|
||||||
@ -430,6 +433,7 @@ public interface Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder addAll(@Command int... commands) {
|
public Builder addAll(@Command int... commands) {
|
||||||
flagsBuilder.addAll(commands);
|
flagsBuilder.addAll(commands);
|
||||||
return this;
|
return this;
|
||||||
@ -442,6 +446,7 @@ public interface Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder addAll(Commands commands) {
|
public Builder addAll(Commands commands) {
|
||||||
flagsBuilder.addAll(commands.flags);
|
flagsBuilder.addAll(commands.flags);
|
||||||
return this;
|
return this;
|
||||||
@ -453,6 +458,7 @@ public interface Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder addAllCommands() {
|
public Builder addAllCommands() {
|
||||||
flagsBuilder.addAll(SUPPORTED_COMMANDS);
|
flagsBuilder.addAll(SUPPORTED_COMMANDS);
|
||||||
return this;
|
return this;
|
||||||
@ -465,6 +471,7 @@ public interface Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder remove(@Command int command) {
|
public Builder remove(@Command int command) {
|
||||||
flagsBuilder.remove(command);
|
flagsBuilder.remove(command);
|
||||||
return this;
|
return this;
|
||||||
@ -478,6 +485,7 @@ public interface Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder removeIf(@Command int command, boolean condition) {
|
public Builder removeIf(@Command int command, boolean condition) {
|
||||||
flagsBuilder.removeIf(command, condition);
|
flagsBuilder.removeIf(command, condition);
|
||||||
return this;
|
return this;
|
||||||
@ -490,6 +498,7 @@ public interface Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder removeAll(@Command int... commands) {
|
public Builder removeAll(@Command int... commands) {
|
||||||
flagsBuilder.removeAll(commands);
|
flagsBuilder.removeAll(commands);
|
||||||
return this;
|
return this;
|
||||||
|
@ -34,6 +34,7 @@ import com.google.android.exoplayer2.util.Assertions;
|
|||||||
import com.google.android.exoplayer2.util.BundleUtil;
|
import com.google.android.exoplayer2.util.BundleUtil;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import com.google.errorprone.annotations.InlineMe;
|
import com.google.errorprone.annotations.InlineMe;
|
||||||
import java.lang.annotation.Documented;
|
import java.lang.annotation.Documented;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
@ -261,6 +262,7 @@ public abstract class Timeline implements Bundleable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the data held by this window. */
|
/** Sets the data held by this window. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public Window set(
|
public Window set(
|
||||||
Object uid,
|
Object uid,
|
||||||
@ -624,6 +626,7 @@ public abstract class Timeline implements Bundleable {
|
|||||||
* period is not within the window.
|
* period is not within the window.
|
||||||
* @return This period, for convenience.
|
* @return This period, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Period set(
|
public Period set(
|
||||||
@Nullable Object id,
|
@Nullable Object id,
|
||||||
@Nullable Object uid,
|
@Nullable Object uid,
|
||||||
@ -659,6 +662,7 @@ public abstract class Timeline implements Bundleable {
|
|||||||
* information has yet to be loaded.
|
* information has yet to be loaded.
|
||||||
* @return This period, for convenience.
|
* @return This period, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Period set(
|
public Period set(
|
||||||
@Nullable Object id,
|
@Nullable Object id,
|
||||||
@Nullable Object uid,
|
@Nullable Object uid,
|
||||||
|
@ -25,6 +25,7 @@ import androidx.annotation.RequiresApi;
|
|||||||
import com.google.android.exoplayer2.Bundleable;
|
import com.google.android.exoplayer2.Bundleable;
|
||||||
import com.google.android.exoplayer2.C;
|
import com.google.android.exoplayer2.C;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
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;
|
||||||
@ -95,30 +96,35 @@ public final class AudioAttributes implements Bundleable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** See {@link android.media.AudioAttributes.Builder#setContentType(int)} */
|
/** See {@link android.media.AudioAttributes.Builder#setContentType(int)} */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setContentType(@C.AudioContentType int contentType) {
|
public Builder setContentType(@C.AudioContentType int contentType) {
|
||||||
this.contentType = contentType;
|
this.contentType = contentType;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** See {@link android.media.AudioAttributes.Builder#setFlags(int)} */
|
/** See {@link android.media.AudioAttributes.Builder#setFlags(int)} */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setFlags(@C.AudioFlags int flags) {
|
public Builder setFlags(@C.AudioFlags int flags) {
|
||||||
this.flags = flags;
|
this.flags = flags;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** See {@link android.media.AudioAttributes.Builder#setUsage(int)} */
|
/** See {@link android.media.AudioAttributes.Builder#setUsage(int)} */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setUsage(@C.AudioUsage int usage) {
|
public Builder setUsage(@C.AudioUsage int usage) {
|
||||||
this.usage = usage;
|
this.usage = usage;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** See {@link android.media.AudioAttributes.Builder#setAllowedCapturePolicy(int)}. */
|
/** See {@link android.media.AudioAttributes.Builder#setAllowedCapturePolicy(int)}. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAllowedCapturePolicy(@C.AudioAllowedCapturePolicy int allowedCapturePolicy) {
|
public Builder setAllowedCapturePolicy(@C.AudioAllowedCapturePolicy int allowedCapturePolicy) {
|
||||||
this.allowedCapturePolicy = allowedCapturePolicy;
|
this.allowedCapturePolicy = allowedCapturePolicy;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** See {@link android.media.AudioAttributes.Builder#setSpatializationBehavior(int)}. */
|
/** See {@link android.media.AudioAttributes.Builder#setSpatializationBehavior(int)}. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSpatializationBehavior(@C.SpatializationBehavior int spatializationBehavior) {
|
public Builder setSpatializationBehavior(@C.SpatializationBehavior int spatializationBehavior) {
|
||||||
this.spatializationBehavior = spatializationBehavior;
|
this.spatializationBehavior = spatializationBehavior;
|
||||||
return this;
|
return this;
|
||||||
|
@ -35,6 +35,7 @@ import androidx.annotation.Nullable;
|
|||||||
import com.google.android.exoplayer2.Bundleable;
|
import com.google.android.exoplayer2.Bundleable;
|
||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
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;
|
||||||
@ -621,6 +622,7 @@ public final class Cue implements Bundleable {
|
|||||||
*
|
*
|
||||||
* @see Cue#text
|
* @see Cue#text
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setText(CharSequence text) {
|
public Builder setText(CharSequence text) {
|
||||||
this.text = text;
|
this.text = text;
|
||||||
return this;
|
return this;
|
||||||
@ -642,6 +644,7 @@ public final class Cue implements Bundleable {
|
|||||||
*
|
*
|
||||||
* @see Cue#bitmap
|
* @see Cue#bitmap
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setBitmap(Bitmap bitmap) {
|
public Builder setBitmap(Bitmap bitmap) {
|
||||||
this.bitmap = bitmap;
|
this.bitmap = bitmap;
|
||||||
return this;
|
return this;
|
||||||
@ -665,6 +668,7 @@ public final class Cue implements Bundleable {
|
|||||||
*
|
*
|
||||||
* @see Cue#textAlignment
|
* @see Cue#textAlignment
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setTextAlignment(@Nullable Layout.Alignment textAlignment) {
|
public Builder setTextAlignment(@Nullable Layout.Alignment textAlignment) {
|
||||||
this.textAlignment = textAlignment;
|
this.textAlignment = textAlignment;
|
||||||
return this;
|
return this;
|
||||||
@ -688,6 +692,7 @@ public final class Cue implements Bundleable {
|
|||||||
*
|
*
|
||||||
* @see Cue#multiRowAlignment
|
* @see Cue#multiRowAlignment
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMultiRowAlignment(@Nullable Layout.Alignment multiRowAlignment) {
|
public Builder setMultiRowAlignment(@Nullable Layout.Alignment multiRowAlignment) {
|
||||||
this.multiRowAlignment = multiRowAlignment;
|
this.multiRowAlignment = multiRowAlignment;
|
||||||
return this;
|
return this;
|
||||||
@ -700,6 +705,7 @@ public final class Cue implements Bundleable {
|
|||||||
* @see Cue#line
|
* @see Cue#line
|
||||||
* @see Cue#lineType
|
* @see Cue#lineType
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setLine(float line, @LineType int lineType) {
|
public Builder setLine(float line, @LineType int lineType) {
|
||||||
this.line = line;
|
this.line = line;
|
||||||
this.lineType = lineType;
|
this.lineType = lineType;
|
||||||
@ -732,6 +738,7 @@ public final class Cue implements Bundleable {
|
|||||||
*
|
*
|
||||||
* @see Cue#lineAnchor
|
* @see Cue#lineAnchor
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setLineAnchor(@AnchorType int lineAnchor) {
|
public Builder setLineAnchor(@AnchorType int lineAnchor) {
|
||||||
this.lineAnchor = lineAnchor;
|
this.lineAnchor = lineAnchor;
|
||||||
return this;
|
return this;
|
||||||
@ -753,6 +760,7 @@ public final class Cue implements Bundleable {
|
|||||||
*
|
*
|
||||||
* @see Cue#position
|
* @see Cue#position
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPosition(float position) {
|
public Builder setPosition(float position) {
|
||||||
this.position = position;
|
this.position = position;
|
||||||
return this;
|
return this;
|
||||||
@ -774,6 +782,7 @@ public final class Cue implements Bundleable {
|
|||||||
*
|
*
|
||||||
* @see Cue#positionAnchor
|
* @see Cue#positionAnchor
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPositionAnchor(@AnchorType int positionAnchor) {
|
public Builder setPositionAnchor(@AnchorType int positionAnchor) {
|
||||||
this.positionAnchor = positionAnchor;
|
this.positionAnchor = positionAnchor;
|
||||||
return this;
|
return this;
|
||||||
@ -795,6 +804,7 @@ public final class Cue implements Bundleable {
|
|||||||
* @see Cue#textSize
|
* @see Cue#textSize
|
||||||
* @see Cue#textSizeType
|
* @see Cue#textSizeType
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setTextSize(float textSize, @TextSizeType int textSizeType) {
|
public Builder setTextSize(float textSize, @TextSizeType int textSizeType) {
|
||||||
this.textSize = textSize;
|
this.textSize = textSize;
|
||||||
this.textSizeType = textSizeType;
|
this.textSizeType = textSizeType;
|
||||||
@ -827,6 +837,7 @@ public final class Cue implements Bundleable {
|
|||||||
*
|
*
|
||||||
* @see Cue#size
|
* @see Cue#size
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSize(float size) {
|
public Builder setSize(float size) {
|
||||||
this.size = size;
|
this.size = size;
|
||||||
return this;
|
return this;
|
||||||
@ -848,6 +859,7 @@ public final class Cue implements Bundleable {
|
|||||||
*
|
*
|
||||||
* @see Cue#bitmapHeight
|
* @see Cue#bitmapHeight
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setBitmapHeight(float bitmapHeight) {
|
public Builder setBitmapHeight(float bitmapHeight) {
|
||||||
this.bitmapHeight = bitmapHeight;
|
this.bitmapHeight = bitmapHeight;
|
||||||
return this;
|
return this;
|
||||||
@ -871,6 +883,7 @@ public final class Cue implements Bundleable {
|
|||||||
* @see Cue#windowColor
|
* @see Cue#windowColor
|
||||||
* @see Cue#windowColorSet
|
* @see Cue#windowColorSet
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setWindowColor(@ColorInt int windowColor) {
|
public Builder setWindowColor(@ColorInt int windowColor) {
|
||||||
this.windowColor = windowColor;
|
this.windowColor = windowColor;
|
||||||
this.windowColorSet = true;
|
this.windowColorSet = true;
|
||||||
@ -878,6 +891,7 @@ public final class Cue implements Bundleable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Sets {@link Cue#windowColorSet} to false. */
|
/** Sets {@link Cue#windowColorSet} to false. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder clearWindowColor() {
|
public Builder clearWindowColor() {
|
||||||
this.windowColorSet = false;
|
this.windowColorSet = false;
|
||||||
return this;
|
return this;
|
||||||
@ -908,12 +922,14 @@ public final class Cue implements Bundleable {
|
|||||||
*
|
*
|
||||||
* @see Cue#verticalType
|
* @see Cue#verticalType
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setVerticalType(@VerticalType int verticalType) {
|
public Builder setVerticalType(@VerticalType int verticalType) {
|
||||||
this.verticalType = verticalType;
|
this.verticalType = verticalType;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the shear angle for this Cue. */
|
/** Sets the shear angle for this Cue. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setShearDegrees(float shearDegrees) {
|
public Builder setShearDegrees(float shearDegrees) {
|
||||||
this.shearDegrees = shearDegrees;
|
this.shearDegrees = shearDegrees;
|
||||||
return this;
|
return this;
|
||||||
|
@ -36,6 +36,7 @@ import com.google.common.collect.ImmutableList;
|
|||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.primitives.Ints;
|
import com.google.common.primitives.Ints;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
@ -306,6 +307,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Overrides the value of the builder with the value of {@link TrackSelectionParameters}. */
|
/** Overrides the value of the builder with the value of {@link TrackSelectionParameters}. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
protected Builder set(TrackSelectionParameters parameters) {
|
protected Builder set(TrackSelectionParameters parameters) {
|
||||||
init(parameters);
|
init(parameters);
|
||||||
return this;
|
return this;
|
||||||
@ -318,6 +320,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
*
|
*
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMaxVideoSizeSd() {
|
public Builder setMaxVideoSizeSd() {
|
||||||
return setMaxVideoSize(1279, 719);
|
return setMaxVideoSize(1279, 719);
|
||||||
}
|
}
|
||||||
@ -327,6 +330,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
*
|
*
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder clearVideoSizeConstraints() {
|
public Builder clearVideoSizeConstraints() {
|
||||||
return setMaxVideoSize(Integer.MAX_VALUE, Integer.MAX_VALUE);
|
return setMaxVideoSize(Integer.MAX_VALUE, Integer.MAX_VALUE);
|
||||||
}
|
}
|
||||||
@ -338,6 +342,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
* @param maxVideoHeight Maximum allowed video height in pixels.
|
* @param maxVideoHeight Maximum allowed video height in pixels.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMaxVideoSize(int maxVideoWidth, int maxVideoHeight) {
|
public Builder setMaxVideoSize(int maxVideoWidth, int maxVideoHeight) {
|
||||||
this.maxVideoWidth = maxVideoWidth;
|
this.maxVideoWidth = maxVideoWidth;
|
||||||
this.maxVideoHeight = maxVideoHeight;
|
this.maxVideoHeight = maxVideoHeight;
|
||||||
@ -350,6 +355,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
* @param maxVideoFrameRate Maximum allowed video frame rate in hertz.
|
* @param maxVideoFrameRate Maximum allowed video frame rate in hertz.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMaxVideoFrameRate(int maxVideoFrameRate) {
|
public Builder setMaxVideoFrameRate(int maxVideoFrameRate) {
|
||||||
this.maxVideoFrameRate = maxVideoFrameRate;
|
this.maxVideoFrameRate = maxVideoFrameRate;
|
||||||
return this;
|
return this;
|
||||||
@ -361,6 +367,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
* @param maxVideoBitrate Maximum allowed video bitrate in bits per second.
|
* @param maxVideoBitrate Maximum allowed video bitrate in bits per second.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMaxVideoBitrate(int maxVideoBitrate) {
|
public Builder setMaxVideoBitrate(int maxVideoBitrate) {
|
||||||
this.maxVideoBitrate = maxVideoBitrate;
|
this.maxVideoBitrate = maxVideoBitrate;
|
||||||
return this;
|
return this;
|
||||||
@ -373,6 +380,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
* @param minVideoHeight Minimum allowed video height in pixels.
|
* @param minVideoHeight Minimum allowed video height in pixels.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMinVideoSize(int minVideoWidth, int minVideoHeight) {
|
public Builder setMinVideoSize(int minVideoWidth, int minVideoHeight) {
|
||||||
this.minVideoWidth = minVideoWidth;
|
this.minVideoWidth = minVideoWidth;
|
||||||
this.minVideoHeight = minVideoHeight;
|
this.minVideoHeight = minVideoHeight;
|
||||||
@ -385,6 +393,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
* @param minVideoFrameRate Minimum allowed video frame rate in hertz.
|
* @param minVideoFrameRate Minimum allowed video frame rate in hertz.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMinVideoFrameRate(int minVideoFrameRate) {
|
public Builder setMinVideoFrameRate(int minVideoFrameRate) {
|
||||||
this.minVideoFrameRate = minVideoFrameRate;
|
this.minVideoFrameRate = minVideoFrameRate;
|
||||||
return this;
|
return this;
|
||||||
@ -396,6 +405,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
* @param minVideoBitrate Minimum allowed video bitrate in bits per second.
|
* @param minVideoBitrate Minimum allowed video bitrate in bits per second.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMinVideoBitrate(int minVideoBitrate) {
|
public Builder setMinVideoBitrate(int minVideoBitrate) {
|
||||||
this.minVideoBitrate = minVideoBitrate;
|
this.minVideoBitrate = minVideoBitrate;
|
||||||
return this;
|
return this;
|
||||||
@ -410,6 +420,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
* playback.
|
* playback.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setViewportSizeToPhysicalDisplaySize(
|
public Builder setViewportSizeToPhysicalDisplaySize(
|
||||||
Context context, boolean viewportOrientationMayChange) {
|
Context context, boolean viewportOrientationMayChange) {
|
||||||
// Assume the viewport is fullscreen.
|
// Assume the viewport is fullscreen.
|
||||||
@ -423,6 +434,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
*
|
*
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder clearViewportSizeConstraints() {
|
public Builder clearViewportSizeConstraints() {
|
||||||
return setViewportSize(Integer.MAX_VALUE, Integer.MAX_VALUE, true);
|
return setViewportSize(Integer.MAX_VALUE, Integer.MAX_VALUE, true);
|
||||||
}
|
}
|
||||||
@ -437,6 +449,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
* playback.
|
* playback.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setViewportSize(
|
public Builder setViewportSize(
|
||||||
int viewportWidth, int viewportHeight, boolean viewportOrientationMayChange) {
|
int viewportWidth, int viewportHeight, boolean viewportOrientationMayChange) {
|
||||||
this.viewportWidth = viewportWidth;
|
this.viewportWidth = viewportWidth;
|
||||||
@ -463,6 +476,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
* empty list for no preference.
|
* empty list for no preference.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPreferredVideoMimeTypes(String... mimeTypes) {
|
public Builder setPreferredVideoMimeTypes(String... mimeTypes) {
|
||||||
preferredVideoMimeTypes = ImmutableList.copyOf(mimeTypes);
|
preferredVideoMimeTypes = ImmutableList.copyOf(mimeTypes);
|
||||||
return this;
|
return this;
|
||||||
@ -474,6 +488,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
* @param preferredVideoRoleFlags Preferred video role flags.
|
* @param preferredVideoRoleFlags Preferred video role flags.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPreferredVideoRoleFlags(@C.RoleFlags int preferredVideoRoleFlags) {
|
public Builder setPreferredVideoRoleFlags(@C.RoleFlags int preferredVideoRoleFlags) {
|
||||||
this.preferredVideoRoleFlags = preferredVideoRoleFlags;
|
this.preferredVideoRoleFlags = preferredVideoRoleFlags;
|
||||||
return this;
|
return this;
|
||||||
@ -502,6 +517,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
* there's no default.
|
* there's no default.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPreferredAudioLanguages(String... preferredAudioLanguages) {
|
public Builder setPreferredAudioLanguages(String... preferredAudioLanguages) {
|
||||||
this.preferredAudioLanguages = normalizeLanguageCodes(preferredAudioLanguages);
|
this.preferredAudioLanguages = normalizeLanguageCodes(preferredAudioLanguages);
|
||||||
return this;
|
return this;
|
||||||
@ -513,6 +529,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
* @param preferredAudioRoleFlags Preferred audio role flags.
|
* @param preferredAudioRoleFlags Preferred audio role flags.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPreferredAudioRoleFlags(@C.RoleFlags int preferredAudioRoleFlags) {
|
public Builder setPreferredAudioRoleFlags(@C.RoleFlags int preferredAudioRoleFlags) {
|
||||||
this.preferredAudioRoleFlags = preferredAudioRoleFlags;
|
this.preferredAudioRoleFlags = preferredAudioRoleFlags;
|
||||||
return this;
|
return this;
|
||||||
@ -524,6 +541,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
* @param maxAudioChannelCount Maximum allowed audio channel count.
|
* @param maxAudioChannelCount Maximum allowed audio channel count.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMaxAudioChannelCount(int maxAudioChannelCount) {
|
public Builder setMaxAudioChannelCount(int maxAudioChannelCount) {
|
||||||
this.maxAudioChannelCount = maxAudioChannelCount;
|
this.maxAudioChannelCount = maxAudioChannelCount;
|
||||||
return this;
|
return this;
|
||||||
@ -535,6 +553,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
* @param maxAudioBitrate Maximum allowed audio bitrate in bits per second.
|
* @param maxAudioBitrate Maximum allowed audio bitrate in bits per second.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMaxAudioBitrate(int maxAudioBitrate) {
|
public Builder setMaxAudioBitrate(int maxAudioBitrate) {
|
||||||
this.maxAudioBitrate = maxAudioBitrate;
|
this.maxAudioBitrate = maxAudioBitrate;
|
||||||
return this;
|
return this;
|
||||||
@ -558,6 +577,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
* empty list for no preference.
|
* empty list for no preference.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPreferredAudioMimeTypes(String... mimeTypes) {
|
public Builder setPreferredAudioMimeTypes(String... mimeTypes) {
|
||||||
preferredAudioMimeTypes = ImmutableList.copyOf(mimeTypes);
|
preferredAudioMimeTypes = ImmutableList.copyOf(mimeTypes);
|
||||||
return this;
|
return this;
|
||||||
@ -574,6 +594,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
* @param context A {@link Context}.
|
* @param context A {@link Context}.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPreferredTextLanguageAndRoleFlagsToCaptioningManagerSettings(
|
public Builder setPreferredTextLanguageAndRoleFlagsToCaptioningManagerSettings(
|
||||||
Context context) {
|
Context context) {
|
||||||
if (Util.SDK_INT >= 19) {
|
if (Util.SDK_INT >= 19) {
|
||||||
@ -603,6 +624,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
* track otherwise.
|
* track otherwise.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPreferredTextLanguages(String... preferredTextLanguages) {
|
public Builder setPreferredTextLanguages(String... preferredTextLanguages) {
|
||||||
this.preferredTextLanguages = normalizeLanguageCodes(preferredTextLanguages);
|
this.preferredTextLanguages = normalizeLanguageCodes(preferredTextLanguages);
|
||||||
return this;
|
return this;
|
||||||
@ -614,6 +636,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
* @param preferredTextRoleFlags Preferred text role flags.
|
* @param preferredTextRoleFlags Preferred text role flags.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPreferredTextRoleFlags(@C.RoleFlags int preferredTextRoleFlags) {
|
public Builder setPreferredTextRoleFlags(@C.RoleFlags int preferredTextRoleFlags) {
|
||||||
this.preferredTextRoleFlags = preferredTextRoleFlags;
|
this.preferredTextRoleFlags = preferredTextRoleFlags;
|
||||||
return this;
|
return this;
|
||||||
@ -626,6 +649,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
* text track selections.
|
* text track selections.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setIgnoredTextSelectionFlags(@C.SelectionFlags int ignoredTextSelectionFlags) {
|
public Builder setIgnoredTextSelectionFlags(@C.SelectionFlags int ignoredTextSelectionFlags) {
|
||||||
this.ignoredTextSelectionFlags = ignoredTextSelectionFlags;
|
this.ignoredTextSelectionFlags = ignoredTextSelectionFlags;
|
||||||
return this;
|
return this;
|
||||||
@ -640,6 +664,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
* be selected if no preferred language track is available.
|
* be selected if no preferred language track is available.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSelectUndeterminedTextLanguage(boolean selectUndeterminedTextLanguage) {
|
public Builder setSelectUndeterminedTextLanguage(boolean selectUndeterminedTextLanguage) {
|
||||||
this.selectUndeterminedTextLanguage = selectUndeterminedTextLanguage;
|
this.selectUndeterminedTextLanguage = selectUndeterminedTextLanguage;
|
||||||
return this;
|
return this;
|
||||||
@ -655,6 +680,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
* video tracks.
|
* video tracks.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setForceLowestBitrate(boolean forceLowestBitrate) {
|
public Builder setForceLowestBitrate(boolean forceLowestBitrate) {
|
||||||
this.forceLowestBitrate = forceLowestBitrate;
|
this.forceLowestBitrate = forceLowestBitrate;
|
||||||
return this;
|
return this;
|
||||||
@ -668,18 +694,21 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
* and video tracks.
|
* and video tracks.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setForceHighestSupportedBitrate(boolean forceHighestSupportedBitrate) {
|
public Builder setForceHighestSupportedBitrate(boolean forceHighestSupportedBitrate) {
|
||||||
this.forceHighestSupportedBitrate = forceHighestSupportedBitrate;
|
this.forceHighestSupportedBitrate = forceHighestSupportedBitrate;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Adds an override, replacing any override for the same {@link TrackGroup}. */
|
/** Adds an override, replacing any override for the same {@link TrackGroup}. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder addOverride(TrackSelectionOverride override) {
|
public Builder addOverride(TrackSelectionOverride override) {
|
||||||
overrides.put(override.mediaTrackGroup, override);
|
overrides.put(override.mediaTrackGroup, override);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets an override, replacing all existing overrides with the same track type. */
|
/** Sets an override, replacing all existing overrides with the same track type. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setOverrideForType(TrackSelectionOverride override) {
|
public Builder setOverrideForType(TrackSelectionOverride override) {
|
||||||
clearOverridesOfType(override.getType());
|
clearOverridesOfType(override.getType());
|
||||||
overrides.put(override.mediaTrackGroup, override);
|
overrides.put(override.mediaTrackGroup, override);
|
||||||
@ -687,12 +716,14 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Removes the override for the provided media {@link TrackGroup}, if there is one. */
|
/** Removes the override for the provided media {@link TrackGroup}, if there is one. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder clearOverride(TrackGroup mediaTrackGroup) {
|
public Builder clearOverride(TrackGroup mediaTrackGroup) {
|
||||||
overrides.remove(mediaTrackGroup);
|
overrides.remove(mediaTrackGroup);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Removes all overrides of the provided track type. */
|
/** Removes all overrides of the provided track type. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder clearOverridesOfType(@C.TrackType int trackType) {
|
public Builder clearOverridesOfType(@C.TrackType int trackType) {
|
||||||
Iterator<TrackSelectionOverride> it = overrides.values().iterator();
|
Iterator<TrackSelectionOverride> it = overrides.values().iterator();
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
@ -705,6 +736,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Removes all overrides. */
|
/** Removes all overrides. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder clearOverrides() {
|
public Builder clearOverrides() {
|
||||||
overrides.clear();
|
overrides.clear();
|
||||||
return this;
|
return this;
|
||||||
@ -718,6 +750,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @deprecated Use {@link #setTrackTypeDisabled(int, boolean)}.
|
* @deprecated Use {@link #setTrackTypeDisabled(int, boolean)}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setDisabledTrackTypes(Set<@C.TrackType Integer> disabledTrackTypes) {
|
public Builder setDisabledTrackTypes(Set<@C.TrackType Integer> disabledTrackTypes) {
|
||||||
this.disabledTrackTypes.clear();
|
this.disabledTrackTypes.clear();
|
||||||
@ -733,6 +766,7 @@ public class TrackSelectionParameters implements Bundleable {
|
|||||||
* @param disabled Whether the track type should be disabled.
|
* @param disabled Whether the track type should be disabled.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setTrackTypeDisabled(@C.TrackType int trackType, boolean disabled) {
|
public Builder setTrackTypeDisabled(@C.TrackType int trackType, boolean disabled) {
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
disabledTrackTypes.add(trackType);
|
disabledTrackTypes.add(trackType);
|
||||||
|
@ -24,6 +24,7 @@ import static java.lang.annotation.ElementType.TYPE_USE;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import androidx.annotation.IntDef;
|
import androidx.annotation.IntDef;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
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;
|
||||||
@ -76,6 +77,7 @@ public final class AdOverlayInfo {
|
|||||||
*
|
*
|
||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setDetailedReason(@Nullable String detailedReason) {
|
public Builder setDetailedReason(@Nullable String detailedReason) {
|
||||||
this.detailedReason = detailedReason;
|
this.detailedReason = detailedReason;
|
||||||
return this;
|
return this;
|
||||||
|
@ -20,6 +20,7 @@ import static com.google.android.exoplayer2.util.Assertions.checkState;
|
|||||||
|
|
||||||
import android.util.SparseBooleanArray;
|
import android.util.SparseBooleanArray;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A set of integer flags.
|
* A set of integer flags.
|
||||||
@ -50,6 +51,7 @@ public final class FlagSet {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder add(int flag) {
|
public Builder add(int flag) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
flags.append(flag, /* value= */ true);
|
flags.append(flag, /* value= */ true);
|
||||||
@ -64,6 +66,7 @@ public final class FlagSet {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder addIf(int flag, boolean condition) {
|
public Builder addIf(int flag, boolean condition) {
|
||||||
if (condition) {
|
if (condition) {
|
||||||
return add(flag);
|
return add(flag);
|
||||||
@ -78,6 +81,7 @@ public final class FlagSet {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder addAll(int... flags) {
|
public Builder addAll(int... flags) {
|
||||||
for (int flag : flags) {
|
for (int flag : flags) {
|
||||||
add(flag);
|
add(flag);
|
||||||
@ -92,6 +96,7 @@ public final class FlagSet {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder addAll(FlagSet flags) {
|
public Builder addAll(FlagSet flags) {
|
||||||
for (int i = 0; i < flags.size(); i++) {
|
for (int i = 0; i < flags.size(); i++) {
|
||||||
add(flags.get(i));
|
add(flags.get(i));
|
||||||
@ -106,6 +111,7 @@ public final class FlagSet {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder remove(int flag) {
|
public Builder remove(int flag) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
flags.delete(flag);
|
flags.delete(flag);
|
||||||
@ -120,6 +126,7 @@ public final class FlagSet {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder removeIf(int flag, boolean condition) {
|
public Builder removeIf(int flag, boolean condition) {
|
||||||
if (condition) {
|
if (condition) {
|
||||||
return remove(flag);
|
return remove(flag);
|
||||||
@ -134,6 +141,7 @@ public final class FlagSet {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder removeAll(int... flags) {
|
public Builder removeAll(int... flags) {
|
||||||
for (int flag : flags) {
|
for (int flag : flags) {
|
||||||
remove(flag);
|
remove(flag);
|
||||||
|
@ -21,6 +21,7 @@ import android.os.Handler;
|
|||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import androidx.annotation.GuardedBy;
|
import androidx.annotation.GuardedBy;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -136,6 +137,7 @@ import java.util.List;
|
|||||||
@Nullable private android.os.Message message;
|
@Nullable private android.os.Message message;
|
||||||
@Nullable private SystemHandlerWrapper handler;
|
@Nullable private SystemHandlerWrapper handler;
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public SystemMessage setMessage(android.os.Message message, SystemHandlerWrapper handler) {
|
public SystemMessage setMessage(android.os.Message message, SystemHandlerWrapper handler) {
|
||||||
this.message = message;
|
this.message = message;
|
||||||
this.handler = handler;
|
this.handler = handler;
|
||||||
|
@ -23,6 +23,7 @@ import android.os.SystemClock;
|
|||||||
import com.google.android.exoplayer2.MediaItem.LiveConfiguration;
|
import com.google.android.exoplayer2.MediaItem.LiveConfiguration;
|
||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@link LivePlaybackSpeedControl} that adjusts the playback speed using a proportional
|
* A {@link LivePlaybackSpeedControl} that adjusts the playback speed using a proportional
|
||||||
@ -122,6 +123,7 @@ public final class DefaultLivePlaybackSpeedControl implements LivePlaybackSpeedC
|
|||||||
* @param fallbackMinPlaybackSpeed The fallback minimum factor by which playback can be sped up.
|
* @param fallbackMinPlaybackSpeed The fallback minimum factor by which playback can be sped up.
|
||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setFallbackMinPlaybackSpeed(float fallbackMinPlaybackSpeed) {
|
public Builder setFallbackMinPlaybackSpeed(float fallbackMinPlaybackSpeed) {
|
||||||
Assertions.checkArgument(0 < fallbackMinPlaybackSpeed && fallbackMinPlaybackSpeed <= 1f);
|
Assertions.checkArgument(0 < fallbackMinPlaybackSpeed && fallbackMinPlaybackSpeed <= 1f);
|
||||||
this.fallbackMinPlaybackSpeed = fallbackMinPlaybackSpeed;
|
this.fallbackMinPlaybackSpeed = fallbackMinPlaybackSpeed;
|
||||||
@ -137,6 +139,7 @@ public final class DefaultLivePlaybackSpeedControl implements LivePlaybackSpeedC
|
|||||||
* @param fallbackMaxPlaybackSpeed The fallback maximum factor by which playback can be sped up.
|
* @param fallbackMaxPlaybackSpeed The fallback maximum factor by which playback can be sped up.
|
||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setFallbackMaxPlaybackSpeed(float fallbackMaxPlaybackSpeed) {
|
public Builder setFallbackMaxPlaybackSpeed(float fallbackMaxPlaybackSpeed) {
|
||||||
Assertions.checkArgument(fallbackMaxPlaybackSpeed >= 1f);
|
Assertions.checkArgument(fallbackMaxPlaybackSpeed >= 1f);
|
||||||
this.fallbackMaxPlaybackSpeed = fallbackMaxPlaybackSpeed;
|
this.fallbackMaxPlaybackSpeed = fallbackMaxPlaybackSpeed;
|
||||||
@ -152,6 +155,7 @@ public final class DefaultLivePlaybackSpeedControl implements LivePlaybackSpeedC
|
|||||||
* milliseconds.
|
* milliseconds.
|
||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMinUpdateIntervalMs(long minUpdateIntervalMs) {
|
public Builder setMinUpdateIntervalMs(long minUpdateIntervalMs) {
|
||||||
Assertions.checkArgument(minUpdateIntervalMs > 0);
|
Assertions.checkArgument(minUpdateIntervalMs > 0);
|
||||||
this.minUpdateIntervalMs = minUpdateIntervalMs;
|
this.minUpdateIntervalMs = minUpdateIntervalMs;
|
||||||
@ -170,6 +174,7 @@ public final class DefaultLivePlaybackSpeedControl implements LivePlaybackSpeedC
|
|||||||
* speed.
|
* speed.
|
||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setProportionalControlFactor(float proportionalControlFactor) {
|
public Builder setProportionalControlFactor(float proportionalControlFactor) {
|
||||||
Assertions.checkArgument(proportionalControlFactor > 0);
|
Assertions.checkArgument(proportionalControlFactor > 0);
|
||||||
this.proportionalControlFactorUs = proportionalControlFactor / C.MICROS_PER_SECOND;
|
this.proportionalControlFactorUs = proportionalControlFactor / C.MICROS_PER_SECOND;
|
||||||
@ -186,6 +191,7 @@ public final class DefaultLivePlaybackSpeedControl implements LivePlaybackSpeedC
|
|||||||
* used, in milliseconds.
|
* used, in milliseconds.
|
||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMaxLiveOffsetErrorMsForUnitSpeed(long maxLiveOffsetErrorMsForUnitSpeed) {
|
public Builder setMaxLiveOffsetErrorMsForUnitSpeed(long maxLiveOffsetErrorMsForUnitSpeed) {
|
||||||
Assertions.checkArgument(maxLiveOffsetErrorMsForUnitSpeed > 0);
|
Assertions.checkArgument(maxLiveOffsetErrorMsForUnitSpeed > 0);
|
||||||
this.maxLiveOffsetErrorUsForUnitSpeed = Util.msToUs(maxLiveOffsetErrorMsForUnitSpeed);
|
this.maxLiveOffsetErrorUsForUnitSpeed = Util.msToUs(maxLiveOffsetErrorMsForUnitSpeed);
|
||||||
@ -200,6 +206,7 @@ public final class DefaultLivePlaybackSpeedControl implements LivePlaybackSpeedC
|
|||||||
* when the player is rebuffering, in milliseconds
|
* when the player is rebuffering, in milliseconds
|
||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setTargetLiveOffsetIncrementOnRebufferMs(
|
public Builder setTargetLiveOffsetIncrementOnRebufferMs(
|
||||||
long targetLiveOffsetIncrementOnRebufferMs) {
|
long targetLiveOffsetIncrementOnRebufferMs) {
|
||||||
Assertions.checkArgument(targetLiveOffsetIncrementOnRebufferMs >= 0);
|
Assertions.checkArgument(targetLiveOffsetIncrementOnRebufferMs >= 0);
|
||||||
@ -222,6 +229,7 @@ public final class DefaultLivePlaybackSpeedControl implements LivePlaybackSpeedC
|
|||||||
* @param minPossibleLiveOffsetSmoothingFactor The smoothing factor. Must be ≥ 0 and < 1.
|
* @param minPossibleLiveOffsetSmoothingFactor The smoothing factor. Must be ≥ 0 and < 1.
|
||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMinPossibleLiveOffsetSmoothingFactor(
|
public Builder setMinPossibleLiveOffsetSmoothingFactor(
|
||||||
float minPossibleLiveOffsetSmoothingFactor) {
|
float minPossibleLiveOffsetSmoothingFactor) {
|
||||||
Assertions.checkArgument(
|
Assertions.checkArgument(
|
||||||
|
@ -27,6 +27,7 @@ import com.google.android.exoplayer2.upstream.DefaultAllocator;
|
|||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
import com.google.android.exoplayer2.util.Log;
|
import com.google.android.exoplayer2.util.Log;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
|
|
||||||
/** The default {@link LoadControl} implementation. */
|
/** The default {@link LoadControl} implementation. */
|
||||||
public class DefaultLoadControl implements LoadControl {
|
public class DefaultLoadControl implements LoadControl {
|
||||||
@ -130,6 +131,7 @@ public class DefaultLoadControl implements LoadControl {
|
|||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAllocator(DefaultAllocator allocator) {
|
public Builder setAllocator(DefaultAllocator allocator) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
this.allocator = allocator;
|
this.allocator = allocator;
|
||||||
@ -151,6 +153,7 @@ public class DefaultLoadControl implements LoadControl {
|
|||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setBufferDurationsMs(
|
public Builder setBufferDurationsMs(
|
||||||
int minBufferMs,
|
int minBufferMs,
|
||||||
int maxBufferMs,
|
int maxBufferMs,
|
||||||
@ -182,6 +185,7 @@ public class DefaultLoadControl implements LoadControl {
|
|||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setTargetBufferBytes(int targetBufferBytes) {
|
public Builder setTargetBufferBytes(int targetBufferBytes) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
this.targetBufferBytes = targetBufferBytes;
|
this.targetBufferBytes = targetBufferBytes;
|
||||||
@ -197,6 +201,7 @@ public class DefaultLoadControl implements LoadControl {
|
|||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPrioritizeTimeOverSizeThresholds(boolean prioritizeTimeOverSizeThresholds) {
|
public Builder setPrioritizeTimeOverSizeThresholds(boolean prioritizeTimeOverSizeThresholds) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
this.prioritizeTimeOverSizeThresholds = prioritizeTimeOverSizeThresholds;
|
this.prioritizeTimeOverSizeThresholds = prioritizeTimeOverSizeThresholds;
|
||||||
@ -213,6 +218,7 @@ public class DefaultLoadControl implements LoadControl {
|
|||||||
* @return This builder, for convenience.
|
* @return This builder, for convenience.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setBackBuffer(int backBufferDurationMs, boolean retainBackBufferFromKeyframe) {
|
public Builder setBackBuffer(int backBufferDurationMs, boolean retainBackBufferFromKeyframe) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
assertGreaterOrEqual(backBufferDurationMs, 0, "backBufferDurationMs", "0");
|
assertGreaterOrEqual(backBufferDurationMs, 0, "backBufferDurationMs", "0");
|
||||||
|
@ -41,6 +41,7 @@ import com.google.android.exoplayer2.util.Log;
|
|||||||
import com.google.android.exoplayer2.video.MediaCodecVideoRenderer;
|
import com.google.android.exoplayer2.video.MediaCodecVideoRenderer;
|
||||||
import com.google.android.exoplayer2.video.VideoRendererEventListener;
|
import com.google.android.exoplayer2.video.VideoRendererEventListener;
|
||||||
import com.google.android.exoplayer2.video.spherical.CameraMotionRenderer;
|
import com.google.android.exoplayer2.video.spherical.CameraMotionRenderer;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
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;
|
||||||
@ -122,6 +123,7 @@ public class DefaultRenderersFactory implements RenderersFactory {
|
|||||||
* @param extensionRendererMode The extension renderer mode.
|
* @param extensionRendererMode The extension renderer mode.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DefaultRenderersFactory setExtensionRendererMode(
|
public DefaultRenderersFactory setExtensionRendererMode(
|
||||||
@ExtensionRendererMode int extensionRendererMode) {
|
@ExtensionRendererMode int extensionRendererMode) {
|
||||||
this.extensionRendererMode = extensionRendererMode;
|
this.extensionRendererMode = extensionRendererMode;
|
||||||
@ -137,6 +139,7 @@ public class DefaultRenderersFactory implements RenderersFactory {
|
|||||||
*
|
*
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DefaultRenderersFactory forceEnableMediaCodecAsynchronousQueueing() {
|
public DefaultRenderersFactory forceEnableMediaCodecAsynchronousQueueing() {
|
||||||
codecAdapterFactory.forceEnableAsynchronous();
|
codecAdapterFactory.forceEnableAsynchronous();
|
||||||
return this;
|
return this;
|
||||||
@ -149,6 +152,7 @@ public class DefaultRenderersFactory implements RenderersFactory {
|
|||||||
*
|
*
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DefaultRenderersFactory forceDisableMediaCodecAsynchronousQueueing() {
|
public DefaultRenderersFactory forceDisableMediaCodecAsynchronousQueueing() {
|
||||||
codecAdapterFactory.forceDisableAsynchronous();
|
codecAdapterFactory.forceDisableAsynchronous();
|
||||||
return this;
|
return this;
|
||||||
@ -163,6 +167,7 @@ public class DefaultRenderersFactory implements RenderersFactory {
|
|||||||
* queueing.
|
* queueing.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DefaultRenderersFactory experimentalSetSynchronizeCodecInteractionsWithQueueingEnabled(
|
public DefaultRenderersFactory experimentalSetSynchronizeCodecInteractionsWithQueueingEnabled(
|
||||||
boolean enabled) {
|
boolean enabled) {
|
||||||
codecAdapterFactory.experimentalSetSynchronizeCodecInteractionsWithQueueingEnabled(enabled);
|
codecAdapterFactory.experimentalSetSynchronizeCodecInteractionsWithQueueingEnabled(enabled);
|
||||||
@ -177,6 +182,7 @@ public class DefaultRenderersFactory implements RenderersFactory {
|
|||||||
* initialization fails.
|
* initialization fails.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DefaultRenderersFactory setEnableDecoderFallback(boolean enableDecoderFallback) {
|
public DefaultRenderersFactory setEnableDecoderFallback(boolean enableDecoderFallback) {
|
||||||
this.enableDecoderFallback = enableDecoderFallback;
|
this.enableDecoderFallback = enableDecoderFallback;
|
||||||
return this;
|
return this;
|
||||||
@ -190,6 +196,7 @@ public class DefaultRenderersFactory implements RenderersFactory {
|
|||||||
* @param mediaCodecSelector The {@link MediaCodecSelector}.
|
* @param mediaCodecSelector The {@link MediaCodecSelector}.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DefaultRenderersFactory setMediaCodecSelector(MediaCodecSelector mediaCodecSelector) {
|
public DefaultRenderersFactory setMediaCodecSelector(MediaCodecSelector mediaCodecSelector) {
|
||||||
this.mediaCodecSelector = mediaCodecSelector;
|
this.mediaCodecSelector = mediaCodecSelector;
|
||||||
return this;
|
return this;
|
||||||
@ -206,6 +213,7 @@ public class DefaultRenderersFactory implements RenderersFactory {
|
|||||||
* @param enableFloatOutput Whether to enable use of floating point audio output, if available.
|
* @param enableFloatOutput Whether to enable use of floating point audio output, if available.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DefaultRenderersFactory setEnableAudioFloatOutput(boolean enableFloatOutput) {
|
public DefaultRenderersFactory setEnableAudioFloatOutput(boolean enableFloatOutput) {
|
||||||
this.enableFloatOutput = enableFloatOutput;
|
this.enableFloatOutput = enableFloatOutput;
|
||||||
return this;
|
return this;
|
||||||
@ -228,6 +236,7 @@ public class DefaultRenderersFactory implements RenderersFactory {
|
|||||||
* available.
|
* available.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DefaultRenderersFactory setEnableAudioOffload(boolean enableOffload) {
|
public DefaultRenderersFactory setEnableAudioOffload(boolean enableOffload) {
|
||||||
this.enableOffload = enableOffload;
|
this.enableOffload = enableOffload;
|
||||||
return this;
|
return this;
|
||||||
@ -251,6 +260,7 @@ public class DefaultRenderersFactory implements RenderersFactory {
|
|||||||
* android.media.AudioTrack#setPlaybackParams(PlaybackParams)}.
|
* android.media.AudioTrack#setPlaybackParams(PlaybackParams)}.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DefaultRenderersFactory setEnableAudioTrackPlaybackParams(
|
public DefaultRenderersFactory setEnableAudioTrackPlaybackParams(
|
||||||
boolean enableAudioTrackPlaybackParams) {
|
boolean enableAudioTrackPlaybackParams) {
|
||||||
this.enableAudioTrackPlaybackParams = enableAudioTrackPlaybackParams;
|
this.enableAudioTrackPlaybackParams = enableAudioTrackPlaybackParams;
|
||||||
@ -267,6 +277,7 @@ public class DefaultRenderersFactory implements RenderersFactory {
|
|||||||
* seamlessly join an ongoing playback, in milliseconds.
|
* seamlessly join an ongoing playback, in milliseconds.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DefaultRenderersFactory setAllowedVideoJoiningTimeMs(long allowedVideoJoiningTimeMs) {
|
public DefaultRenderersFactory setAllowedVideoJoiningTimeMs(long allowedVideoJoiningTimeMs) {
|
||||||
this.allowedVideoJoiningTimeMs = allowedVideoJoiningTimeMs;
|
this.allowedVideoJoiningTimeMs = allowedVideoJoiningTimeMs;
|
||||||
return this;
|
return this;
|
||||||
|
@ -63,6 +63,7 @@ import com.google.android.exoplayer2.video.VideoSize;
|
|||||||
import com.google.android.exoplayer2.video.spherical.CameraMotionListener;
|
import com.google.android.exoplayer2.video.spherical.CameraMotionListener;
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
import com.google.common.base.Supplier;
|
import com.google.common.base.Supplier;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -667,6 +668,7 @@ public interface ExoPlayer extends Player {
|
|||||||
*
|
*
|
||||||
* @param timeoutMs The time limit in milliseconds.
|
* @param timeoutMs The time limit in milliseconds.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder experimentalSetForegroundModeTimeoutMs(long timeoutMs) {
|
public Builder experimentalSetForegroundModeTimeoutMs(long timeoutMs) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
foregroundModeTimeoutMs = timeoutMs;
|
foregroundModeTimeoutMs = timeoutMs;
|
||||||
@ -680,6 +682,7 @@ public interface ExoPlayer extends Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setRenderersFactory(RenderersFactory renderersFactory) {
|
public Builder setRenderersFactory(RenderersFactory renderersFactory) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
checkNotNull(renderersFactory);
|
checkNotNull(renderersFactory);
|
||||||
@ -694,6 +697,7 @@ public interface ExoPlayer extends Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMediaSourceFactory(MediaSource.Factory mediaSourceFactory) {
|
public Builder setMediaSourceFactory(MediaSource.Factory mediaSourceFactory) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
checkNotNull(mediaSourceFactory);
|
checkNotNull(mediaSourceFactory);
|
||||||
@ -708,6 +712,7 @@ public interface ExoPlayer extends Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setTrackSelector(TrackSelector trackSelector) {
|
public Builder setTrackSelector(TrackSelector trackSelector) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
checkNotNull(trackSelector);
|
checkNotNull(trackSelector);
|
||||||
@ -722,6 +727,7 @@ public interface ExoPlayer extends Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setLoadControl(LoadControl loadControl) {
|
public Builder setLoadControl(LoadControl loadControl) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
checkNotNull(loadControl);
|
checkNotNull(loadControl);
|
||||||
@ -736,6 +742,7 @@ public interface ExoPlayer extends Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setBandwidthMeter(BandwidthMeter bandwidthMeter) {
|
public Builder setBandwidthMeter(BandwidthMeter bandwidthMeter) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
checkNotNull(bandwidthMeter);
|
checkNotNull(bandwidthMeter);
|
||||||
@ -751,6 +758,7 @@ public interface ExoPlayer extends Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setLooper(Looper looper) {
|
public Builder setLooper(Looper looper) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
checkNotNull(looper);
|
checkNotNull(looper);
|
||||||
@ -765,6 +773,7 @@ public interface ExoPlayer extends Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAnalyticsCollector(AnalyticsCollector analyticsCollector) {
|
public Builder setAnalyticsCollector(AnalyticsCollector analyticsCollector) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
checkNotNull(analyticsCollector);
|
checkNotNull(analyticsCollector);
|
||||||
@ -781,6 +790,7 @@ public interface ExoPlayer extends Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPriorityTaskManager(@Nullable PriorityTaskManager priorityTaskManager) {
|
public Builder setPriorityTaskManager(@Nullable PriorityTaskManager priorityTaskManager) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
this.priorityTaskManager = priorityTaskManager;
|
this.priorityTaskManager = priorityTaskManager;
|
||||||
@ -800,6 +810,7 @@ public interface ExoPlayer extends Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAudioAttributes(AudioAttributes audioAttributes, boolean handleAudioFocus) {
|
public Builder setAudioAttributes(AudioAttributes audioAttributes, boolean handleAudioFocus) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
this.audioAttributes = checkNotNull(audioAttributes);
|
this.audioAttributes = checkNotNull(audioAttributes);
|
||||||
@ -824,6 +835,7 @@ public interface ExoPlayer extends Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setWakeMode(@C.WakeMode int wakeMode) {
|
public Builder setWakeMode(@C.WakeMode int wakeMode) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
this.wakeMode = wakeMode;
|
this.wakeMode = wakeMode;
|
||||||
@ -841,6 +853,7 @@ public interface ExoPlayer extends Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setHandleAudioBecomingNoisy(boolean handleAudioBecomingNoisy) {
|
public Builder setHandleAudioBecomingNoisy(boolean handleAudioBecomingNoisy) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
this.handleAudioBecomingNoisy = handleAudioBecomingNoisy;
|
this.handleAudioBecomingNoisy = handleAudioBecomingNoisy;
|
||||||
@ -854,6 +867,7 @@ public interface ExoPlayer extends Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSkipSilenceEnabled(boolean skipSilenceEnabled) {
|
public Builder setSkipSilenceEnabled(boolean skipSilenceEnabled) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
this.skipSilenceEnabled = skipSilenceEnabled;
|
this.skipSilenceEnabled = skipSilenceEnabled;
|
||||||
@ -870,6 +884,7 @@ public interface ExoPlayer extends Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setVideoScalingMode(@C.VideoScalingMode int videoScalingMode) {
|
public Builder setVideoScalingMode(@C.VideoScalingMode int videoScalingMode) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
this.videoScalingMode = videoScalingMode;
|
this.videoScalingMode = videoScalingMode;
|
||||||
@ -890,6 +905,7 @@ public interface ExoPlayer extends Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setVideoChangeFrameRateStrategy(
|
public Builder setVideoChangeFrameRateStrategy(
|
||||||
@C.VideoChangeFrameRateStrategy int videoChangeFrameRateStrategy) {
|
@C.VideoChangeFrameRateStrategy int videoChangeFrameRateStrategy) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
@ -908,6 +924,7 @@ public interface ExoPlayer extends Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setUseLazyPreparation(boolean useLazyPreparation) {
|
public Builder setUseLazyPreparation(boolean useLazyPreparation) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
this.useLazyPreparation = useLazyPreparation;
|
this.useLazyPreparation = useLazyPreparation;
|
||||||
@ -921,6 +938,7 @@ public interface ExoPlayer extends Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSeekParameters(SeekParameters seekParameters) {
|
public Builder setSeekParameters(SeekParameters seekParameters) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
this.seekParameters = checkNotNull(seekParameters);
|
this.seekParameters = checkNotNull(seekParameters);
|
||||||
@ -935,6 +953,7 @@ public interface ExoPlayer extends Player {
|
|||||||
* @throws IllegalArgumentException If {@code seekBackIncrementMs} is non-positive.
|
* @throws IllegalArgumentException If {@code seekBackIncrementMs} is non-positive.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSeekBackIncrementMs(@IntRange(from = 1) long seekBackIncrementMs) {
|
public Builder setSeekBackIncrementMs(@IntRange(from = 1) long seekBackIncrementMs) {
|
||||||
checkArgument(seekBackIncrementMs > 0);
|
checkArgument(seekBackIncrementMs > 0);
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
@ -950,6 +969,7 @@ public interface ExoPlayer extends Player {
|
|||||||
* @throws IllegalArgumentException If {@code seekForwardIncrementMs} is non-positive.
|
* @throws IllegalArgumentException If {@code seekForwardIncrementMs} is non-positive.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSeekForwardIncrementMs(@IntRange(from = 1) long seekForwardIncrementMs) {
|
public Builder setSeekForwardIncrementMs(@IntRange(from = 1) long seekForwardIncrementMs) {
|
||||||
checkArgument(seekForwardIncrementMs > 0);
|
checkArgument(seekForwardIncrementMs > 0);
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
@ -968,6 +988,7 @@ public interface ExoPlayer extends Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setReleaseTimeoutMs(long releaseTimeoutMs) {
|
public Builder setReleaseTimeoutMs(long releaseTimeoutMs) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
this.releaseTimeoutMs = releaseTimeoutMs;
|
this.releaseTimeoutMs = releaseTimeoutMs;
|
||||||
@ -985,6 +1006,7 @@ public interface ExoPlayer extends Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setDetachSurfaceTimeoutMs(long detachSurfaceTimeoutMs) {
|
public Builder setDetachSurfaceTimeoutMs(long detachSurfaceTimeoutMs) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
this.detachSurfaceTimeoutMs = detachSurfaceTimeoutMs;
|
this.detachSurfaceTimeoutMs = detachSurfaceTimeoutMs;
|
||||||
@ -1003,6 +1025,7 @@ public interface ExoPlayer extends Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPauseAtEndOfMediaItems(boolean pauseAtEndOfMediaItems) {
|
public Builder setPauseAtEndOfMediaItems(boolean pauseAtEndOfMediaItems) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
this.pauseAtEndOfMediaItems = pauseAtEndOfMediaItems;
|
this.pauseAtEndOfMediaItems = pauseAtEndOfMediaItems;
|
||||||
@ -1017,6 +1040,7 @@ public interface ExoPlayer extends Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setLivePlaybackSpeedControl(LivePlaybackSpeedControl livePlaybackSpeedControl) {
|
public Builder setLivePlaybackSpeedControl(LivePlaybackSpeedControl livePlaybackSpeedControl) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
this.livePlaybackSpeedControl = checkNotNull(livePlaybackSpeedControl);
|
this.livePlaybackSpeedControl = checkNotNull(livePlaybackSpeedControl);
|
||||||
@ -1038,6 +1062,7 @@ public interface ExoPlayer extends Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setUsePlatformDiagnostics(boolean usePlatformDiagnostics) {
|
public Builder setUsePlatformDiagnostics(boolean usePlatformDiagnostics) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
this.usePlatformDiagnostics = usePlatformDiagnostics;
|
this.usePlatformDiagnostics = usePlatformDiagnostics;
|
||||||
@ -1052,6 +1077,7 @@ public interface ExoPlayer extends Player {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @throws IllegalStateException If {@link #build()} has already been called.
|
* @throws IllegalStateException If {@link #build()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
public Builder setClock(Clock clock) {
|
public Builder setClock(Clock clock) {
|
||||||
checkState(!buildCalled);
|
checkState(!buildCalled);
|
||||||
|
@ -94,6 +94,7 @@ import com.google.android.exoplayer2.video.VideoSize;
|
|||||||
import com.google.android.exoplayer2.video.spherical.CameraMotionListener;
|
import com.google.android.exoplayer2.video.spherical.CameraMotionListener;
|
||||||
import com.google.android.exoplayer2.video.spherical.SphericalGLSurfaceView;
|
import com.google.android.exoplayer2.video.spherical.SphericalGLSurfaceView;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -386,6 +387,7 @@ import java.util.concurrent.TimeoutException;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@SuppressWarnings("deprecation") // Returning deprecated class.
|
@SuppressWarnings("deprecation") // Returning deprecated class.
|
||||||
@Override
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ -394,6 +396,7 @@ import java.util.concurrent.TimeoutException;
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@SuppressWarnings("deprecation") // Returning deprecated class.
|
@SuppressWarnings("deprecation") // Returning deprecated class.
|
||||||
@Override
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ -402,6 +405,7 @@ import java.util.concurrent.TimeoutException;
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@SuppressWarnings("deprecation") // Returning deprecated class.
|
@SuppressWarnings("deprecation") // Returning deprecated class.
|
||||||
@Override
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ -410,6 +414,7 @@ import java.util.concurrent.TimeoutException;
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@SuppressWarnings("deprecation") // Returning deprecated class.
|
@SuppressWarnings("deprecation") // Returning deprecated class.
|
||||||
@Override
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -21,6 +21,7 @@ import androidx.annotation.Nullable;
|
|||||||
import com.google.android.exoplayer2.Renderer.MessageType;
|
import com.google.android.exoplayer2.Renderer.MessageType;
|
||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
import com.google.android.exoplayer2.util.Clock;
|
import com.google.android.exoplayer2.util.Clock;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.util.concurrent.TimeoutException;
|
import java.util.concurrent.TimeoutException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -118,6 +119,7 @@ public final class PlayerMessage {
|
|||||||
* @return This message.
|
* @return This message.
|
||||||
* @throws IllegalStateException If {@link #send()} has already been called.
|
* @throws IllegalStateException If {@link #send()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public PlayerMessage setType(int messageType) {
|
public PlayerMessage setType(int messageType) {
|
||||||
Assertions.checkState(!isSent);
|
Assertions.checkState(!isSent);
|
||||||
this.type = messageType;
|
this.type = messageType;
|
||||||
@ -136,6 +138,7 @@ public final class PlayerMessage {
|
|||||||
* @return This message.
|
* @return This message.
|
||||||
* @throws IllegalStateException If {@link #send()} has already been called.
|
* @throws IllegalStateException If {@link #send()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public PlayerMessage setPayload(@Nullable Object payload) {
|
public PlayerMessage setPayload(@Nullable Object payload) {
|
||||||
Assertions.checkState(!isSent);
|
Assertions.checkState(!isSent);
|
||||||
this.payload = payload;
|
this.payload = payload;
|
||||||
@ -151,6 +154,7 @@ public final class PlayerMessage {
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link #setLooper(Looper)} instead.
|
* @deprecated Use {@link #setLooper(Looper)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public PlayerMessage setHandler(Handler handler) {
|
public PlayerMessage setHandler(Handler handler) {
|
||||||
return setLooper(handler.getLooper());
|
return setLooper(handler.getLooper());
|
||||||
@ -163,6 +167,7 @@ public final class PlayerMessage {
|
|||||||
* @return This message.
|
* @return This message.
|
||||||
* @throws IllegalStateException If {@link #send()} has already been called.
|
* @throws IllegalStateException If {@link #send()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public PlayerMessage setLooper(Looper looper) {
|
public PlayerMessage setLooper(Looper looper) {
|
||||||
Assertions.checkState(!isSent);
|
Assertions.checkState(!isSent);
|
||||||
this.looper = looper;
|
this.looper = looper;
|
||||||
@ -193,6 +198,7 @@ public final class PlayerMessage {
|
|||||||
* @return This message.
|
* @return This message.
|
||||||
* @throws IllegalStateException If {@link #send()} has already been called.
|
* @throws IllegalStateException If {@link #send()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public PlayerMessage setPosition(long positionMs) {
|
public PlayerMessage setPosition(long positionMs) {
|
||||||
Assertions.checkState(!isSent);
|
Assertions.checkState(!isSent);
|
||||||
this.positionMs = positionMs;
|
this.positionMs = positionMs;
|
||||||
@ -211,6 +217,7 @@ public final class PlayerMessage {
|
|||||||
* empty and the provided media item index is not within the bounds of the timeline.
|
* empty and the provided media item index is not within the bounds of the timeline.
|
||||||
* @throws IllegalStateException If {@link #send()} has already been called.
|
* @throws IllegalStateException If {@link #send()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public PlayerMessage setPosition(int mediaItemIndex, long positionMs) {
|
public PlayerMessage setPosition(int mediaItemIndex, long positionMs) {
|
||||||
Assertions.checkState(!isSent);
|
Assertions.checkState(!isSent);
|
||||||
Assertions.checkArgument(positionMs != C.TIME_UNSET);
|
Assertions.checkArgument(positionMs != C.TIME_UNSET);
|
||||||
@ -237,6 +244,7 @@ public final class PlayerMessage {
|
|||||||
* @return This message.
|
* @return This message.
|
||||||
* @throws IllegalStateException If {@link #send()} has already been called.
|
* @throws IllegalStateException If {@link #send()} has already been called.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public PlayerMessage setDeleteAfterDelivery(boolean deleteAfterDelivery) {
|
public PlayerMessage setDeleteAfterDelivery(boolean deleteAfterDelivery) {
|
||||||
Assertions.checkState(!isSent);
|
Assertions.checkState(!isSent);
|
||||||
this.deleteAfterDelivery = deleteAfterDelivery;
|
this.deleteAfterDelivery = deleteAfterDelivery;
|
||||||
@ -255,6 +263,7 @@ public final class PlayerMessage {
|
|||||||
* @return This message.
|
* @return This message.
|
||||||
* @throws IllegalStateException If this message has already been sent.
|
* @throws IllegalStateException If this message has already been sent.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public PlayerMessage send() {
|
public PlayerMessage send() {
|
||||||
Assertions.checkState(!isSent);
|
Assertions.checkState(!isSent);
|
||||||
if (positionMs == C.TIME_UNSET) {
|
if (positionMs == C.TIME_UNSET) {
|
||||||
@ -271,6 +280,7 @@ public final class PlayerMessage {
|
|||||||
* @return This message.
|
* @return This message.
|
||||||
* @throws IllegalStateException If this method is called before {@link #send()}.
|
* @throws IllegalStateException If this method is called before {@link #send()}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public synchronized PlayerMessage cancel() {
|
public synchronized PlayerMessage cancel() {
|
||||||
Assertions.checkState(isSent);
|
Assertions.checkState(isSent);
|
||||||
isCanceled = true;
|
isCanceled = true;
|
||||||
|
@ -45,6 +45,7 @@ import com.google.android.exoplayer2.util.PriorityTaskManager;
|
|||||||
import com.google.android.exoplayer2.video.VideoFrameMetadataListener;
|
import com.google.android.exoplayer2.video.VideoFrameMetadataListener;
|
||||||
import com.google.android.exoplayer2.video.VideoSize;
|
import com.google.android.exoplayer2.video.VideoSize;
|
||||||
import com.google.android.exoplayer2.video.spherical.CameraMotionListener;
|
import com.google.android.exoplayer2.video.spherical.CameraMotionListener;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -135,6 +136,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
* @deprecated Use {@link ExoPlayer.Builder#experimentalSetForegroundModeTimeoutMs(long)}
|
* @deprecated Use {@link ExoPlayer.Builder#experimentalSetForegroundModeTimeoutMs(long)}
|
||||||
* instead.
|
* instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder experimentalSetForegroundModeTimeoutMs(long timeoutMs) {
|
public Builder experimentalSetForegroundModeTimeoutMs(long timeoutMs) {
|
||||||
wrappedBuilder.experimentalSetForegroundModeTimeoutMs(timeoutMs);
|
wrappedBuilder.experimentalSetForegroundModeTimeoutMs(timeoutMs);
|
||||||
@ -144,6 +146,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link ExoPlayer.Builder#setTrackSelector(TrackSelector)} instead.
|
* @deprecated Use {@link ExoPlayer.Builder#setTrackSelector(TrackSelector)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setTrackSelector(TrackSelector trackSelector) {
|
public Builder setTrackSelector(TrackSelector trackSelector) {
|
||||||
wrappedBuilder.setTrackSelector(trackSelector);
|
wrappedBuilder.setTrackSelector(trackSelector);
|
||||||
@ -153,6 +156,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link ExoPlayer.Builder#setMediaSourceFactory(MediaSource.Factory)} instead.
|
* @deprecated Use {@link ExoPlayer.Builder#setMediaSourceFactory(MediaSource.Factory)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setMediaSourceFactory(MediaSource.Factory mediaSourceFactory) {
|
public Builder setMediaSourceFactory(MediaSource.Factory mediaSourceFactory) {
|
||||||
wrappedBuilder.setMediaSourceFactory(mediaSourceFactory);
|
wrappedBuilder.setMediaSourceFactory(mediaSourceFactory);
|
||||||
@ -162,6 +166,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link ExoPlayer.Builder#setLoadControl(LoadControl)} instead.
|
* @deprecated Use {@link ExoPlayer.Builder#setLoadControl(LoadControl)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setLoadControl(LoadControl loadControl) {
|
public Builder setLoadControl(LoadControl loadControl) {
|
||||||
wrappedBuilder.setLoadControl(loadControl);
|
wrappedBuilder.setLoadControl(loadControl);
|
||||||
@ -171,6 +176,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link ExoPlayer.Builder#setBandwidthMeter(BandwidthMeter)} instead.
|
* @deprecated Use {@link ExoPlayer.Builder#setBandwidthMeter(BandwidthMeter)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setBandwidthMeter(BandwidthMeter bandwidthMeter) {
|
public Builder setBandwidthMeter(BandwidthMeter bandwidthMeter) {
|
||||||
wrappedBuilder.setBandwidthMeter(bandwidthMeter);
|
wrappedBuilder.setBandwidthMeter(bandwidthMeter);
|
||||||
@ -180,6 +186,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link ExoPlayer.Builder#setLooper(Looper)} instead.
|
* @deprecated Use {@link ExoPlayer.Builder#setLooper(Looper)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setLooper(Looper looper) {
|
public Builder setLooper(Looper looper) {
|
||||||
wrappedBuilder.setLooper(looper);
|
wrappedBuilder.setLooper(looper);
|
||||||
@ -189,6 +196,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link ExoPlayer.Builder#setAnalyticsCollector(AnalyticsCollector)} instead.
|
* @deprecated Use {@link ExoPlayer.Builder#setAnalyticsCollector(AnalyticsCollector)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setAnalyticsCollector(AnalyticsCollector analyticsCollector) {
|
public Builder setAnalyticsCollector(AnalyticsCollector analyticsCollector) {
|
||||||
wrappedBuilder.setAnalyticsCollector(analyticsCollector);
|
wrappedBuilder.setAnalyticsCollector(analyticsCollector);
|
||||||
@ -199,6 +207,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
* @deprecated Use {@link ExoPlayer.Builder#setPriorityTaskManager(PriorityTaskManager)}
|
* @deprecated Use {@link ExoPlayer.Builder#setPriorityTaskManager(PriorityTaskManager)}
|
||||||
* instead.
|
* instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setPriorityTaskManager(@Nullable PriorityTaskManager priorityTaskManager) {
|
public Builder setPriorityTaskManager(@Nullable PriorityTaskManager priorityTaskManager) {
|
||||||
wrappedBuilder.setPriorityTaskManager(priorityTaskManager);
|
wrappedBuilder.setPriorityTaskManager(priorityTaskManager);
|
||||||
@ -209,6 +218,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
* @deprecated Use {@link ExoPlayer.Builder#setAudioAttributes(AudioAttributes, boolean)}
|
* @deprecated Use {@link ExoPlayer.Builder#setAudioAttributes(AudioAttributes, boolean)}
|
||||||
* instead.
|
* instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setAudioAttributes(AudioAttributes audioAttributes, boolean handleAudioFocus) {
|
public Builder setAudioAttributes(AudioAttributes audioAttributes, boolean handleAudioFocus) {
|
||||||
wrappedBuilder.setAudioAttributes(audioAttributes, handleAudioFocus);
|
wrappedBuilder.setAudioAttributes(audioAttributes, handleAudioFocus);
|
||||||
@ -218,6 +228,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link ExoPlayer.Builder#setWakeMode(int)} instead.
|
* @deprecated Use {@link ExoPlayer.Builder#setWakeMode(int)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setWakeMode(@C.WakeMode int wakeMode) {
|
public Builder setWakeMode(@C.WakeMode int wakeMode) {
|
||||||
wrappedBuilder.setWakeMode(wakeMode);
|
wrappedBuilder.setWakeMode(wakeMode);
|
||||||
@ -227,6 +238,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link ExoPlayer.Builder#setHandleAudioBecomingNoisy(boolean)} instead.
|
* @deprecated Use {@link ExoPlayer.Builder#setHandleAudioBecomingNoisy(boolean)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setHandleAudioBecomingNoisy(boolean handleAudioBecomingNoisy) {
|
public Builder setHandleAudioBecomingNoisy(boolean handleAudioBecomingNoisy) {
|
||||||
wrappedBuilder.setHandleAudioBecomingNoisy(handleAudioBecomingNoisy);
|
wrappedBuilder.setHandleAudioBecomingNoisy(handleAudioBecomingNoisy);
|
||||||
@ -236,6 +248,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link ExoPlayer.Builder#setSkipSilenceEnabled(boolean)} instead.
|
* @deprecated Use {@link ExoPlayer.Builder#setSkipSilenceEnabled(boolean)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setSkipSilenceEnabled(boolean skipSilenceEnabled) {
|
public Builder setSkipSilenceEnabled(boolean skipSilenceEnabled) {
|
||||||
wrappedBuilder.setSkipSilenceEnabled(skipSilenceEnabled);
|
wrappedBuilder.setSkipSilenceEnabled(skipSilenceEnabled);
|
||||||
@ -245,6 +258,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link ExoPlayer.Builder#setVideoScalingMode(int)} instead.
|
* @deprecated Use {@link ExoPlayer.Builder#setVideoScalingMode(int)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setVideoScalingMode(@C.VideoScalingMode int videoScalingMode) {
|
public Builder setVideoScalingMode(@C.VideoScalingMode int videoScalingMode) {
|
||||||
wrappedBuilder.setVideoScalingMode(videoScalingMode);
|
wrappedBuilder.setVideoScalingMode(videoScalingMode);
|
||||||
@ -254,6 +268,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link ExoPlayer.Builder#setVideoChangeFrameRateStrategy(int)} instead.
|
* @deprecated Use {@link ExoPlayer.Builder#setVideoChangeFrameRateStrategy(int)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setVideoChangeFrameRateStrategy(
|
public Builder setVideoChangeFrameRateStrategy(
|
||||||
@C.VideoChangeFrameRateStrategy int videoChangeFrameRateStrategy) {
|
@C.VideoChangeFrameRateStrategy int videoChangeFrameRateStrategy) {
|
||||||
@ -264,6 +279,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link ExoPlayer.Builder#setUseLazyPreparation(boolean)} instead.
|
* @deprecated Use {@link ExoPlayer.Builder#setUseLazyPreparation(boolean)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setUseLazyPreparation(boolean useLazyPreparation) {
|
public Builder setUseLazyPreparation(boolean useLazyPreparation) {
|
||||||
wrappedBuilder.setUseLazyPreparation(useLazyPreparation);
|
wrappedBuilder.setUseLazyPreparation(useLazyPreparation);
|
||||||
@ -273,6 +289,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link ExoPlayer.Builder#setSeekParameters(SeekParameters)} instead.
|
* @deprecated Use {@link ExoPlayer.Builder#setSeekParameters(SeekParameters)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setSeekParameters(SeekParameters seekParameters) {
|
public Builder setSeekParameters(SeekParameters seekParameters) {
|
||||||
wrappedBuilder.setSeekParameters(seekParameters);
|
wrappedBuilder.setSeekParameters(seekParameters);
|
||||||
@ -282,6 +299,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link ExoPlayer.Builder#setSeekBackIncrementMs(long)} instead.
|
* @deprecated Use {@link ExoPlayer.Builder#setSeekBackIncrementMs(long)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setSeekBackIncrementMs(@IntRange(from = 1) long seekBackIncrementMs) {
|
public Builder setSeekBackIncrementMs(@IntRange(from = 1) long seekBackIncrementMs) {
|
||||||
wrappedBuilder.setSeekBackIncrementMs(seekBackIncrementMs);
|
wrappedBuilder.setSeekBackIncrementMs(seekBackIncrementMs);
|
||||||
@ -291,6 +309,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link ExoPlayer.Builder#setSeekForwardIncrementMs(long)} instead.
|
* @deprecated Use {@link ExoPlayer.Builder#setSeekForwardIncrementMs(long)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setSeekForwardIncrementMs(@IntRange(from = 1) long seekForwardIncrementMs) {
|
public Builder setSeekForwardIncrementMs(@IntRange(from = 1) long seekForwardIncrementMs) {
|
||||||
wrappedBuilder.setSeekForwardIncrementMs(seekForwardIncrementMs);
|
wrappedBuilder.setSeekForwardIncrementMs(seekForwardIncrementMs);
|
||||||
@ -300,6 +319,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link ExoPlayer.Builder#setReleaseTimeoutMs(long)} instead.
|
* @deprecated Use {@link ExoPlayer.Builder#setReleaseTimeoutMs(long)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setReleaseTimeoutMs(long releaseTimeoutMs) {
|
public Builder setReleaseTimeoutMs(long releaseTimeoutMs) {
|
||||||
wrappedBuilder.setReleaseTimeoutMs(releaseTimeoutMs);
|
wrappedBuilder.setReleaseTimeoutMs(releaseTimeoutMs);
|
||||||
@ -309,6 +329,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link ExoPlayer.Builder#setDetachSurfaceTimeoutMs(long)} instead.
|
* @deprecated Use {@link ExoPlayer.Builder#setDetachSurfaceTimeoutMs(long)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setDetachSurfaceTimeoutMs(long detachSurfaceTimeoutMs) {
|
public Builder setDetachSurfaceTimeoutMs(long detachSurfaceTimeoutMs) {
|
||||||
wrappedBuilder.setDetachSurfaceTimeoutMs(detachSurfaceTimeoutMs);
|
wrappedBuilder.setDetachSurfaceTimeoutMs(detachSurfaceTimeoutMs);
|
||||||
@ -318,6 +339,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link ExoPlayer.Builder#setPauseAtEndOfMediaItems(boolean)} instead.
|
* @deprecated Use {@link ExoPlayer.Builder#setPauseAtEndOfMediaItems(boolean)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setPauseAtEndOfMediaItems(boolean pauseAtEndOfMediaItems) {
|
public Builder setPauseAtEndOfMediaItems(boolean pauseAtEndOfMediaItems) {
|
||||||
wrappedBuilder.setPauseAtEndOfMediaItems(pauseAtEndOfMediaItems);
|
wrappedBuilder.setPauseAtEndOfMediaItems(pauseAtEndOfMediaItems);
|
||||||
@ -328,6 +350,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
* @deprecated Use {@link
|
* @deprecated Use {@link
|
||||||
* ExoPlayer.Builder#setLivePlaybackSpeedControl(LivePlaybackSpeedControl)} instead.
|
* ExoPlayer.Builder#setLivePlaybackSpeedControl(LivePlaybackSpeedControl)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setLivePlaybackSpeedControl(LivePlaybackSpeedControl livePlaybackSpeedControl) {
|
public Builder setLivePlaybackSpeedControl(LivePlaybackSpeedControl livePlaybackSpeedControl) {
|
||||||
wrappedBuilder.setLivePlaybackSpeedControl(livePlaybackSpeedControl);
|
wrappedBuilder.setLivePlaybackSpeedControl(livePlaybackSpeedControl);
|
||||||
@ -337,6 +360,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link ExoPlayer.Builder#setClock(Clock)} instead.
|
* @deprecated Use {@link ExoPlayer.Builder#setClock(Clock)} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
public Builder setClock(Clock clock) {
|
public Builder setClock(Clock clock) {
|
||||||
|
@ -48,6 +48,7 @@ import com.google.android.exoplayer2.util.ConditionVariable;
|
|||||||
import com.google.android.exoplayer2.util.Log;
|
import com.google.android.exoplayer2.util.Log;
|
||||||
import com.google.android.exoplayer2.util.MimeTypes;
|
import com.google.android.exoplayer2.util.MimeTypes;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import com.google.errorprone.annotations.InlineMe;
|
import com.google.errorprone.annotations.InlineMe;
|
||||||
import com.google.errorprone.annotations.InlineMeValidationDisabled;
|
import com.google.errorprone.annotations.InlineMeValidationDisabled;
|
||||||
import java.lang.annotation.Documented;
|
import java.lang.annotation.Documented;
|
||||||
@ -277,6 +278,7 @@ public final class DefaultAudioSink implements AudioSink {
|
|||||||
*
|
*
|
||||||
* <p>Default is {@link AudioCapabilities#DEFAULT_AUDIO_CAPABILITIES}.
|
* <p>Default is {@link AudioCapabilities#DEFAULT_AUDIO_CAPABILITIES}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAudioCapabilities(AudioCapabilities audioCapabilities) {
|
public Builder setAudioCapabilities(AudioCapabilities audioCapabilities) {
|
||||||
checkNotNull(audioCapabilities);
|
checkNotNull(audioCapabilities);
|
||||||
this.audioCapabilities = audioCapabilities;
|
this.audioCapabilities = audioCapabilities;
|
||||||
@ -290,6 +292,7 @@ public final class DefaultAudioSink implements AudioSink {
|
|||||||
*
|
*
|
||||||
* <p>The default value is an empty array.
|
* <p>The default value is an empty array.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAudioProcessors(AudioProcessor[] audioProcessors) {
|
public Builder setAudioProcessors(AudioProcessor[] audioProcessors) {
|
||||||
checkNotNull(audioProcessors);
|
checkNotNull(audioProcessors);
|
||||||
return setAudioProcessorChain(new DefaultAudioProcessorChain(audioProcessors));
|
return setAudioProcessorChain(new DefaultAudioProcessorChain(audioProcessors));
|
||||||
@ -302,6 +305,7 @@ public final class DefaultAudioSink implements AudioSink {
|
|||||||
*
|
*
|
||||||
* <p>By default, no processing will be applied.
|
* <p>By default, no processing will be applied.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAudioProcessorChain(AudioProcessorChain audioProcessorChain) {
|
public Builder setAudioProcessorChain(AudioProcessorChain audioProcessorChain) {
|
||||||
checkNotNull(audioProcessorChain);
|
checkNotNull(audioProcessorChain);
|
||||||
this.audioProcessorChain = audioProcessorChain;
|
this.audioProcessorChain = audioProcessorChain;
|
||||||
@ -316,6 +320,7 @@ public final class DefaultAudioSink implements AudioSink {
|
|||||||
*
|
*
|
||||||
* <p>The default value is {@code false}.
|
* <p>The default value is {@code false}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setEnableFloatOutput(boolean enableFloatOutput) {
|
public Builder setEnableFloatOutput(boolean enableFloatOutput) {
|
||||||
this.enableFloatOutput = enableFloatOutput;
|
this.enableFloatOutput = enableFloatOutput;
|
||||||
return this;
|
return this;
|
||||||
@ -329,6 +334,7 @@ public final class DefaultAudioSink implements AudioSink {
|
|||||||
*
|
*
|
||||||
* <p>The default value is {@code false}.
|
* <p>The default value is {@code false}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setEnableAudioTrackPlaybackParams(boolean enableAudioTrackPlaybackParams) {
|
public Builder setEnableAudioTrackPlaybackParams(boolean enableAudioTrackPlaybackParams) {
|
||||||
this.enableAudioTrackPlaybackParams = enableAudioTrackPlaybackParams;
|
this.enableAudioTrackPlaybackParams = enableAudioTrackPlaybackParams;
|
||||||
return this;
|
return this;
|
||||||
@ -344,6 +350,7 @@ public final class DefaultAudioSink implements AudioSink {
|
|||||||
*
|
*
|
||||||
* <p>The default value is {@link #OFFLOAD_MODE_DISABLED}.
|
* <p>The default value is {@link #OFFLOAD_MODE_DISABLED}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setOffloadMode(@OffloadMode int offloadMode) {
|
public Builder setOffloadMode(@OffloadMode int offloadMode) {
|
||||||
this.offloadMode = offloadMode;
|
this.offloadMode = offloadMode;
|
||||||
return this;
|
return this;
|
||||||
@ -355,6 +362,7 @@ public final class DefaultAudioSink implements AudioSink {
|
|||||||
*
|
*
|
||||||
* <p>The default value is {@link AudioTrackBufferSizeProvider#DEFAULT}.
|
* <p>The default value is {@link AudioTrackBufferSizeProvider#DEFAULT}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAudioTrackBufferSizeProvider(
|
public Builder setAudioTrackBufferSizeProvider(
|
||||||
AudioTrackBufferSizeProvider audioTrackBufferSizeProvider) {
|
AudioTrackBufferSizeProvider audioTrackBufferSizeProvider) {
|
||||||
this.audioTrackBufferSizeProvider = audioTrackBufferSizeProvider;
|
this.audioTrackBufferSizeProvider = audioTrackBufferSizeProvider;
|
||||||
|
@ -26,6 +26,7 @@ import android.media.AudioTrack;
|
|||||||
import com.google.android.exoplayer2.C;
|
import com.google.android.exoplayer2.C;
|
||||||
import com.google.android.exoplayer2.Format;
|
import com.google.android.exoplayer2.Format;
|
||||||
import com.google.android.exoplayer2.audio.DefaultAudioSink.OutputMode;
|
import com.google.android.exoplayer2.audio.DefaultAudioSink.OutputMode;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
|
|
||||||
/** Provide the buffer size to use when creating an {@link AudioTrack}. */
|
/** Provide the buffer size to use when creating an {@link AudioTrack}. */
|
||||||
public class DefaultAudioTrackBufferSizeProvider
|
public class DefaultAudioTrackBufferSizeProvider
|
||||||
@ -71,6 +72,7 @@ public class DefaultAudioTrackBufferSizeProvider
|
|||||||
* Sets the minimum length for PCM {@link AudioTrack} buffers, in microseconds. Default is
|
* Sets the minimum length for PCM {@link AudioTrack} buffers, in microseconds. Default is
|
||||||
* {@value #MIN_PCM_BUFFER_DURATION_US}.
|
* {@value #MIN_PCM_BUFFER_DURATION_US}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMinPcmBufferDurationUs(int minPcmBufferDurationUs) {
|
public Builder setMinPcmBufferDurationUs(int minPcmBufferDurationUs) {
|
||||||
this.minPcmBufferDurationUs = minPcmBufferDurationUs;
|
this.minPcmBufferDurationUs = minPcmBufferDurationUs;
|
||||||
return this;
|
return this;
|
||||||
@ -80,6 +82,7 @@ public class DefaultAudioTrackBufferSizeProvider
|
|||||||
* Sets the maximum length for PCM {@link AudioTrack} buffers, in microseconds. Default is
|
* Sets the maximum length for PCM {@link AudioTrack} buffers, in microseconds. Default is
|
||||||
* {@value #MAX_PCM_BUFFER_DURATION_US}.
|
* {@value #MAX_PCM_BUFFER_DURATION_US}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMaxPcmBufferDurationUs(int maxPcmBufferDurationUs) {
|
public Builder setMaxPcmBufferDurationUs(int maxPcmBufferDurationUs) {
|
||||||
this.maxPcmBufferDurationUs = maxPcmBufferDurationUs;
|
this.maxPcmBufferDurationUs = maxPcmBufferDurationUs;
|
||||||
return this;
|
return this;
|
||||||
@ -89,6 +92,7 @@ public class DefaultAudioTrackBufferSizeProvider
|
|||||||
* Sets the multiplication factor to apply to the minimum buffer size requested. Default is
|
* Sets the multiplication factor to apply to the minimum buffer size requested. Default is
|
||||||
* {@value #PCM_BUFFER_MULTIPLICATION_FACTOR}.
|
* {@value #PCM_BUFFER_MULTIPLICATION_FACTOR}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPcmBufferMultiplicationFactor(int pcmBufferMultiplicationFactor) {
|
public Builder setPcmBufferMultiplicationFactor(int pcmBufferMultiplicationFactor) {
|
||||||
this.pcmBufferMultiplicationFactor = pcmBufferMultiplicationFactor;
|
this.pcmBufferMultiplicationFactor = pcmBufferMultiplicationFactor;
|
||||||
return this;
|
return this;
|
||||||
@ -98,6 +102,7 @@ public class DefaultAudioTrackBufferSizeProvider
|
|||||||
* Sets the length for passthrough {@link AudioTrack} buffers, in microseconds. Default is
|
* Sets the length for passthrough {@link AudioTrack} buffers, in microseconds. Default is
|
||||||
* {@value #PASSTHROUGH_BUFFER_DURATION_US}.
|
* {@value #PASSTHROUGH_BUFFER_DURATION_US}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPassthroughBufferDurationUs(int passthroughBufferDurationUs) {
|
public Builder setPassthroughBufferDurationUs(int passthroughBufferDurationUs) {
|
||||||
this.passthroughBufferDurationUs = passthroughBufferDurationUs;
|
this.passthroughBufferDurationUs = passthroughBufferDurationUs;
|
||||||
return this;
|
return this;
|
||||||
@ -107,6 +112,7 @@ public class DefaultAudioTrackBufferSizeProvider
|
|||||||
* The length for offload {@link AudioTrack} buffers, in microseconds. Default is {@value
|
* The length for offload {@link AudioTrack} buffers, in microseconds. Default is {@value
|
||||||
* #OFFLOAD_BUFFER_DURATION_US}.
|
* #OFFLOAD_BUFFER_DURATION_US}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setOffloadBufferDurationUs(int offloadBufferDurationUs) {
|
public Builder setOffloadBufferDurationUs(int offloadBufferDurationUs) {
|
||||||
this.offloadBufferDurationUs = offloadBufferDurationUs;
|
this.offloadBufferDurationUs = offloadBufferDurationUs;
|
||||||
return this;
|
return this;
|
||||||
@ -116,6 +122,7 @@ public class DefaultAudioTrackBufferSizeProvider
|
|||||||
* Sets the multiplication factor to apply to the passthrough buffer for AC3 to avoid underruns
|
* Sets the multiplication factor to apply to the passthrough buffer for AC3 to avoid underruns
|
||||||
* on some devices (e.g., Broadcom 7271). Default is {@value #AC3_BUFFER_MULTIPLICATION_FACTOR}.
|
* on some devices (e.g., Broadcom 7271). Default is {@value #AC3_BUFFER_MULTIPLICATION_FACTOR}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAc3BufferMultiplicationFactor(int ac3BufferMultiplicationFactor) {
|
public Builder setAc3BufferMultiplicationFactor(int ac3BufferMultiplicationFactor) {
|
||||||
this.ac3BufferMultiplicationFactor = ac3BufferMultiplicationFactor;
|
this.ac3BufferMultiplicationFactor = ac3BufferMultiplicationFactor;
|
||||||
return this;
|
return this;
|
||||||
|
@ -45,6 +45,7 @@ import com.google.android.exoplayer2.util.Util;
|
|||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
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;
|
||||||
@ -118,6 +119,7 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
|
|||||||
* @param keyRequestParameters A map with parameters.
|
* @param keyRequestParameters A map with parameters.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setKeyRequestParameters(@Nullable Map<String, String> keyRequestParameters) {
|
public Builder setKeyRequestParameters(@Nullable Map<String, String> keyRequestParameters) {
|
||||||
this.keyRequestParameters.clear();
|
this.keyRequestParameters.clear();
|
||||||
if (keyRequestParameters != null) {
|
if (keyRequestParameters != null) {
|
||||||
@ -133,6 +135,7 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
|
|||||||
* @param exoMediaDrmProvider The {@link ExoMediaDrm.Provider}.
|
* @param exoMediaDrmProvider The {@link ExoMediaDrm.Provider}.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setUuidAndExoMediaDrmProvider(
|
public Builder setUuidAndExoMediaDrmProvider(
|
||||||
UUID uuid, ExoMediaDrm.Provider exoMediaDrmProvider) {
|
UUID uuid, ExoMediaDrm.Provider exoMediaDrmProvider) {
|
||||||
this.uuid = checkNotNull(uuid);
|
this.uuid = checkNotNull(uuid);
|
||||||
@ -150,6 +153,7 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
|
|||||||
* sessions.
|
* sessions.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMultiSession(boolean multiSession) {
|
public Builder setMultiSession(boolean multiSession) {
|
||||||
this.multiSession = multiSession;
|
this.multiSession = multiSession;
|
||||||
return this;
|
return this;
|
||||||
@ -169,6 +173,7 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
|
|||||||
* @throws IllegalArgumentException If {@code useDrmSessionsForClearContentTrackTypes} contains
|
* @throws IllegalArgumentException If {@code useDrmSessionsForClearContentTrackTypes} contains
|
||||||
* track types other than {@link C#TRACK_TYPE_AUDIO} and {@link C#TRACK_TYPE_VIDEO}.
|
* track types other than {@link C#TRACK_TYPE_AUDIO} and {@link C#TRACK_TYPE_VIDEO}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setUseDrmSessionsForClearContent(
|
public Builder setUseDrmSessionsForClearContent(
|
||||||
@C.TrackType int... useDrmSessionsForClearContentTrackTypes) {
|
@C.TrackType int... useDrmSessionsForClearContentTrackTypes) {
|
||||||
for (@C.TrackType int trackType : useDrmSessionsForClearContentTrackTypes) {
|
for (@C.TrackType int trackType : useDrmSessionsForClearContentTrackTypes) {
|
||||||
@ -187,6 +192,7 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
|
|||||||
* played when keys for the encrypted part of the content have yet to be loaded.
|
* played when keys for the encrypted part of the content have yet to be loaded.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPlayClearSamplesWithoutKeys(boolean playClearSamplesWithoutKeys) {
|
public Builder setPlayClearSamplesWithoutKeys(boolean playClearSamplesWithoutKeys) {
|
||||||
this.playClearSamplesWithoutKeys = playClearSamplesWithoutKeys;
|
this.playClearSamplesWithoutKeys = playClearSamplesWithoutKeys;
|
||||||
return this;
|
return this;
|
||||||
@ -198,6 +204,7 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
|
|||||||
* @param loadErrorHandlingPolicy A {@link LoadErrorHandlingPolicy}.
|
* @param loadErrorHandlingPolicy A {@link LoadErrorHandlingPolicy}.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy) {
|
public Builder setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy) {
|
||||||
this.loadErrorHandlingPolicy = checkNotNull(loadErrorHandlingPolicy);
|
this.loadErrorHandlingPolicy = checkNotNull(loadErrorHandlingPolicy);
|
||||||
return this;
|
return this;
|
||||||
@ -218,6 +225,7 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
|
|||||||
* in milliseconds. Must be > 0 or {@link C#TIME_UNSET} to disable keep-alive.
|
* in milliseconds. Must be > 0 or {@link C#TIME_UNSET} to disable keep-alive.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSessionKeepaliveMs(long sessionKeepaliveMs) {
|
public Builder setSessionKeepaliveMs(long sessionKeepaliveMs) {
|
||||||
checkArgument(sessionKeepaliveMs > 0 || sessionKeepaliveMs == C.TIME_UNSET);
|
checkArgument(sessionKeepaliveMs > 0 || sessionKeepaliveMs == C.TIME_UNSET);
|
||||||
this.sessionKeepaliveMs = sessionKeepaliveMs;
|
this.sessionKeepaliveMs = sessionKeepaliveMs;
|
||||||
|
@ -21,6 +21,7 @@ import androidx.annotation.IntDef;
|
|||||||
import com.google.android.exoplayer2.util.Log;
|
import com.google.android.exoplayer2.util.Log;
|
||||||
import com.google.android.exoplayer2.util.MimeTypes;
|
import com.google.android.exoplayer2.util.MimeTypes;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
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;
|
||||||
@ -64,6 +65,7 @@ public final class DefaultMediaCodecAdapterFactory implements MediaCodecAdapter.
|
|||||||
*
|
*
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DefaultMediaCodecAdapterFactory forceEnableAsynchronous() {
|
public DefaultMediaCodecAdapterFactory forceEnableAsynchronous() {
|
||||||
asynchronousMode = MODE_ENABLED;
|
asynchronousMode = MODE_ENABLED;
|
||||||
return this;
|
return this;
|
||||||
@ -74,6 +76,7 @@ public final class DefaultMediaCodecAdapterFactory implements MediaCodecAdapter.
|
|||||||
*
|
*
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DefaultMediaCodecAdapterFactory forceDisableAsynchronous() {
|
public DefaultMediaCodecAdapterFactory forceDisableAsynchronous() {
|
||||||
asynchronousMode = MODE_DISABLED;
|
asynchronousMode = MODE_DISABLED;
|
||||||
return this;
|
return this;
|
||||||
|
@ -26,6 +26,7 @@ import com.google.android.exoplayer2.MediaItem;
|
|||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -55,30 +56,35 @@ public final class DownloadRequest implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the {@link DownloadRequest#mimeType}. */
|
/** Sets the {@link DownloadRequest#mimeType}. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMimeType(@Nullable String mimeType) {
|
public Builder setMimeType(@Nullable String mimeType) {
|
||||||
this.mimeType = mimeType;
|
this.mimeType = mimeType;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the {@link DownloadRequest#streamKeys}. */
|
/** Sets the {@link DownloadRequest#streamKeys}. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setStreamKeys(@Nullable List<StreamKey> streamKeys) {
|
public Builder setStreamKeys(@Nullable List<StreamKey> streamKeys) {
|
||||||
this.streamKeys = streamKeys;
|
this.streamKeys = streamKeys;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the {@link DownloadRequest#keySetId}. */
|
/** Sets the {@link DownloadRequest#keySetId}. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setKeySetId(@Nullable byte[] keySetId) {
|
public Builder setKeySetId(@Nullable byte[] keySetId) {
|
||||||
this.keySetId = keySetId;
|
this.keySetId = keySetId;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the {@link DownloadRequest#customCacheKey}. */
|
/** Sets the {@link DownloadRequest#customCacheKey}. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setCustomCacheKey(@Nullable String customCacheKey) {
|
public Builder setCustomCacheKey(@Nullable String customCacheKey) {
|
||||||
this.customCacheKey = customCacheKey;
|
this.customCacheKey = customCacheKey;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the {@link DownloadRequest#data}. */
|
/** Sets the {@link DownloadRequest#data}. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setData(@Nullable byte[] data) {
|
public Builder setData(@Nullable byte[] data) {
|
||||||
this.data = data;
|
this.data = data;
|
||||||
return this;
|
return this;
|
||||||
|
@ -50,6 +50,7 @@ import com.google.android.exoplayer2.util.Util;
|
|||||||
import com.google.common.base.Supplier;
|
import com.google.common.base.Supplier;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.primitives.Ints;
|
import com.google.common.primitives.Ints;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@ -190,6 +191,7 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory {
|
|||||||
* should be used for subtitles instead of {@link SingleSampleMediaSource}.
|
* should be used for subtitles instead of {@link SingleSampleMediaSource}.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DefaultMediaSourceFactory experimentalUseProgressiveMediaSourceForSubtitles(
|
public DefaultMediaSourceFactory experimentalUseProgressiveMediaSourceForSubtitles(
|
||||||
boolean useProgressiveMediaSourceForSubtitles) {
|
boolean useProgressiveMediaSourceForSubtitles) {
|
||||||
this.useProgressiveMediaSourceForSubtitles = useProgressiveMediaSourceForSubtitles;
|
this.useProgressiveMediaSourceForSubtitles = useProgressiveMediaSourceForSubtitles;
|
||||||
@ -208,6 +210,7 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory {
|
|||||||
* @deprecated Use {@link #setLocalAdInsertionComponents(AdsLoader.Provider, AdViewProvider)}
|
* @deprecated Use {@link #setLocalAdInsertionComponents(AdsLoader.Provider, AdViewProvider)}
|
||||||
* instead.
|
* instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public DefaultMediaSourceFactory setAdsLoaderProvider(
|
public DefaultMediaSourceFactory setAdsLoaderProvider(
|
||||||
@Nullable AdsLoader.Provider adsLoaderProvider) {
|
@Nullable AdsLoader.Provider adsLoaderProvider) {
|
||||||
@ -226,6 +229,7 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory {
|
|||||||
* @deprecated Use {@link #setLocalAdInsertionComponents(AdsLoader.Provider, AdViewProvider)}
|
* @deprecated Use {@link #setLocalAdInsertionComponents(AdsLoader.Provider, AdViewProvider)}
|
||||||
* instead.
|
* instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public DefaultMediaSourceFactory setAdViewProvider(@Nullable AdViewProvider adViewProvider) {
|
public DefaultMediaSourceFactory setAdViewProvider(@Nullable AdViewProvider adViewProvider) {
|
||||||
this.adViewProvider = adViewProvider;
|
this.adViewProvider = adViewProvider;
|
||||||
@ -243,6 +247,7 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory {
|
|||||||
* @param adViewProvider A provider for information about views for the ad playback UI.
|
* @param adViewProvider A provider for information about views for the ad playback UI.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DefaultMediaSourceFactory setLocalAdInsertionComponents(
|
public DefaultMediaSourceFactory setLocalAdInsertionComponents(
|
||||||
AdsLoader.Provider adsLoaderProvider, AdViewProvider adViewProvider) {
|
AdsLoader.Provider adsLoaderProvider, AdViewProvider adViewProvider) {
|
||||||
this.adsLoaderProvider = checkNotNull(adsLoaderProvider);
|
this.adsLoaderProvider = checkNotNull(adsLoaderProvider);
|
||||||
@ -259,6 +264,7 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory {
|
|||||||
*
|
*
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DefaultMediaSourceFactory clearLocalAdInsertionComponents() {
|
public DefaultMediaSourceFactory clearLocalAdInsertionComponents() {
|
||||||
this.adsLoaderProvider = null;
|
this.adsLoaderProvider = null;
|
||||||
this.adViewProvider = null;
|
this.adViewProvider = null;
|
||||||
@ -272,6 +278,7 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory {
|
|||||||
* @param dataSourceFactory The {@link DataSource.Factory}.
|
* @param dataSourceFactory The {@link DataSource.Factory}.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DefaultMediaSourceFactory setDataSourceFactory(DataSource.Factory dataSourceFactory) {
|
public DefaultMediaSourceFactory setDataSourceFactory(DataSource.Factory dataSourceFactory) {
|
||||||
this.dataSourceFactory = dataSourceFactory;
|
this.dataSourceFactory = dataSourceFactory;
|
||||||
delegateFactoryLoader.setDataSourceFactory(dataSourceFactory);
|
delegateFactoryLoader.setDataSourceFactory(dataSourceFactory);
|
||||||
@ -288,6 +295,7 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory {
|
|||||||
* content, or {@code null} to remove a previously set {@link MediaSource.Factory}.
|
* content, or {@code null} to remove a previously set {@link MediaSource.Factory}.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DefaultMediaSourceFactory setServerSideAdInsertionMediaSourceFactory(
|
public DefaultMediaSourceFactory setServerSideAdInsertionMediaSourceFactory(
|
||||||
@Nullable MediaSource.Factory serverSideAdInsertionMediaSourceFactory) {
|
@Nullable MediaSource.Factory serverSideAdInsertionMediaSourceFactory) {
|
||||||
this.serverSideAdInsertionMediaSourceFactory = serverSideAdInsertionMediaSourceFactory;
|
this.serverSideAdInsertionMediaSourceFactory = serverSideAdInsertionMediaSourceFactory;
|
||||||
@ -301,6 +309,7 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory {
|
|||||||
* use the media-defined default.
|
* use the media-defined default.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DefaultMediaSourceFactory setLiveTargetOffsetMs(long liveTargetOffsetMs) {
|
public DefaultMediaSourceFactory setLiveTargetOffsetMs(long liveTargetOffsetMs) {
|
||||||
this.liveTargetOffsetMs = liveTargetOffsetMs;
|
this.liveTargetOffsetMs = liveTargetOffsetMs;
|
||||||
return this;
|
return this;
|
||||||
@ -313,6 +322,7 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory {
|
|||||||
* C#TIME_UNSET} to use the media-defined default.
|
* C#TIME_UNSET} to use the media-defined default.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DefaultMediaSourceFactory setLiveMinOffsetMs(long liveMinOffsetMs) {
|
public DefaultMediaSourceFactory setLiveMinOffsetMs(long liveMinOffsetMs) {
|
||||||
this.liveMinOffsetMs = liveMinOffsetMs;
|
this.liveMinOffsetMs = liveMinOffsetMs;
|
||||||
return this;
|
return this;
|
||||||
@ -325,6 +335,7 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory {
|
|||||||
* C#TIME_UNSET} to use the media-defined default.
|
* C#TIME_UNSET} to use the media-defined default.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DefaultMediaSourceFactory setLiveMaxOffsetMs(long liveMaxOffsetMs) {
|
public DefaultMediaSourceFactory setLiveMaxOffsetMs(long liveMaxOffsetMs) {
|
||||||
this.liveMaxOffsetMs = liveMaxOffsetMs;
|
this.liveMaxOffsetMs = liveMaxOffsetMs;
|
||||||
return this;
|
return this;
|
||||||
@ -337,6 +348,7 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory {
|
|||||||
* C#RATE_UNSET} to use the media-defined default.
|
* C#RATE_UNSET} to use the media-defined default.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DefaultMediaSourceFactory setLiveMinSpeed(float minSpeed) {
|
public DefaultMediaSourceFactory setLiveMinSpeed(float minSpeed) {
|
||||||
this.liveMinSpeed = minSpeed;
|
this.liveMinSpeed = minSpeed;
|
||||||
return this;
|
return this;
|
||||||
@ -349,11 +361,13 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory {
|
|||||||
* C#RATE_UNSET} to use the media-defined default.
|
* C#RATE_UNSET} to use the media-defined default.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DefaultMediaSourceFactory setLiveMaxSpeed(float maxSpeed) {
|
public DefaultMediaSourceFactory setLiveMaxSpeed(float maxSpeed) {
|
||||||
this.liveMaxSpeed = maxSpeed;
|
this.liveMaxSpeed = maxSpeed;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public DefaultMediaSourceFactory setDrmSessionManagerProvider(
|
public DefaultMediaSourceFactory setDrmSessionManagerProvider(
|
||||||
DrmSessionManagerProvider drmSessionManagerProvider) {
|
DrmSessionManagerProvider drmSessionManagerProvider) {
|
||||||
@ -366,6 +380,7 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public DefaultMediaSourceFactory setLoadErrorHandlingPolicy(
|
public DefaultMediaSourceFactory setLoadErrorHandlingPolicy(
|
||||||
LoadErrorHandlingPolicy loadErrorHandlingPolicy) {
|
LoadErrorHandlingPolicy loadErrorHandlingPolicy) {
|
||||||
|
@ -34,6 +34,7 @@ import com.google.android.exoplayer2.upstream.DataSource;
|
|||||||
import com.google.android.exoplayer2.upstream.DefaultLoadErrorHandlingPolicy;
|
import com.google.android.exoplayer2.upstream.DefaultLoadErrorHandlingPolicy;
|
||||||
import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy;
|
import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy;
|
||||||
import com.google.android.exoplayer2.upstream.TransferListener;
|
import com.google.android.exoplayer2.upstream.TransferListener;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides one period that loads data from a {@link Uri} and extracted using an {@link Extractor}.
|
* Provides one period that loads data from a {@link Uri} and extracted using an {@link Extractor}.
|
||||||
@ -153,6 +154,7 @@ public final class ProgressiveMediaSource extends BaseMediaSource
|
|||||||
this.continueLoadingCheckIntervalBytes = continueLoadingCheckIntervalBytes;
|
this.continueLoadingCheckIntervalBytes = continueLoadingCheckIntervalBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy) {
|
public Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy) {
|
||||||
this.loadErrorHandlingPolicy =
|
this.loadErrorHandlingPolicy =
|
||||||
@ -174,11 +176,13 @@ public final class ProgressiveMediaSource extends BaseMediaSource
|
|||||||
* MediaPeriod.Callback#onContinueLoadingRequested(SequenceableLoader)}.
|
* MediaPeriod.Callback#onContinueLoadingRequested(SequenceableLoader)}.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setContinueLoadingCheckIntervalBytes(int continueLoadingCheckIntervalBytes) {
|
public Factory setContinueLoadingCheckIntervalBytes(int continueLoadingCheckIntervalBytes) {
|
||||||
this.continueLoadingCheckIntervalBytes = continueLoadingCheckIntervalBytes;
|
this.continueLoadingCheckIntervalBytes = continueLoadingCheckIntervalBytes;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Factory setDrmSessionManagerProvider(
|
public Factory setDrmSessionManagerProvider(
|
||||||
DrmSessionManagerProvider drmSessionManagerProvider) {
|
DrmSessionManagerProvider drmSessionManagerProvider) {
|
||||||
|
@ -33,6 +33,7 @@ import com.google.android.exoplayer2.upstream.TransferListener;
|
|||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
import com.google.android.exoplayer2.util.MimeTypes;
|
import com.google.android.exoplayer2.util.MimeTypes;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import org.checkerframework.checker.nullness.compatqual.NullableType;
|
import org.checkerframework.checker.nullness.compatqual.NullableType;
|
||||||
|
|
||||||
@ -51,6 +52,7 @@ public final class SilenceMediaSource extends BaseMediaSource {
|
|||||||
* @param durationUs The duration of silent audio to output, in microseconds.
|
* @param durationUs The duration of silent audio to output, in microseconds.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setDurationUs(@IntRange(from = 1) long durationUs) {
|
public Factory setDurationUs(@IntRange(from = 1) long durationUs) {
|
||||||
this.durationUs = durationUs;
|
this.durationUs = durationUs;
|
||||||
return this;
|
return this;
|
||||||
@ -63,6 +65,7 @@ public final class SilenceMediaSource extends BaseMediaSource {
|
|||||||
* @param tag A tag for the media source.
|
* @param tag A tag for the media source.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setTag(@Nullable Object tag) {
|
public Factory setTag(@Nullable Object tag) {
|
||||||
this.tag = tag;
|
this.tag = tag;
|
||||||
return this;
|
return this;
|
||||||
|
@ -31,6 +31,7 @@ import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy;
|
|||||||
import com.google.android.exoplayer2.upstream.TransferListener;
|
import com.google.android.exoplayer2.upstream.TransferListener;
|
||||||
import com.google.android.exoplayer2.util.MimeTypes;
|
import com.google.android.exoplayer2.util.MimeTypes;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads data at a given {@link Uri} as a single sample belonging to a single {@link MediaPeriod}.
|
* Loads data at a given {@link Uri} as a single sample belonging to a single {@link MediaPeriod}.
|
||||||
@ -66,6 +67,7 @@ public final class SingleSampleMediaSource extends BaseMediaSource {
|
|||||||
* @param tag A tag for the media source.
|
* @param tag A tag for the media source.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setTag(@Nullable Object tag) {
|
public Factory setTag(@Nullable Object tag) {
|
||||||
this.tag = tag;
|
this.tag = tag;
|
||||||
return this;
|
return this;
|
||||||
@ -77,6 +79,7 @@ public final class SingleSampleMediaSource extends BaseMediaSource {
|
|||||||
* #createMediaSource(MediaItem.SubtitleConfiguration, long)}). {@code trackId} will only be
|
* #createMediaSource(MediaItem.SubtitleConfiguration, long)}). {@code trackId} will only be
|
||||||
* used if {@link MediaItem.SubtitleConfiguration#id} is {@code null}.
|
* used if {@link MediaItem.SubtitleConfiguration#id} is {@code null}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Factory setTrackId(@Nullable String trackId) {
|
public Factory setTrackId(@Nullable String trackId) {
|
||||||
this.trackId = trackId;
|
this.trackId = trackId;
|
||||||
@ -90,6 +93,7 @@ public final class SingleSampleMediaSource extends BaseMediaSource {
|
|||||||
* @param loadErrorHandlingPolicy A {@link LoadErrorHandlingPolicy}.
|
* @param loadErrorHandlingPolicy A {@link LoadErrorHandlingPolicy}.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setLoadErrorHandlingPolicy(
|
public Factory setLoadErrorHandlingPolicy(
|
||||||
@Nullable LoadErrorHandlingPolicy loadErrorHandlingPolicy) {
|
@Nullable LoadErrorHandlingPolicy loadErrorHandlingPolicy) {
|
||||||
this.loadErrorHandlingPolicy =
|
this.loadErrorHandlingPolicy =
|
||||||
@ -108,6 +112,7 @@ public final class SingleSampleMediaSource extends BaseMediaSource {
|
|||||||
* normally by {@link SampleStream#maybeThrowError()}.
|
* normally by {@link SampleStream#maybeThrowError()}.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setTreatLoadErrorsAsEndOfStream(boolean treatLoadErrorsAsEndOfStream) {
|
public Factory setTreatLoadErrorsAsEndOfStream(boolean treatLoadErrorsAsEndOfStream) {
|
||||||
this.treatLoadErrorsAsEndOfStream = treatLoadErrorsAsEndOfStream;
|
this.treatLoadErrorsAsEndOfStream = treatLoadErrorsAsEndOfStream;
|
||||||
return this;
|
return this;
|
||||||
|
@ -63,6 +63,7 @@ import com.google.common.collect.ComparisonChain;
|
|||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.Ordering;
|
import com.google.common.collect.Ordering;
|
||||||
import com.google.common.primitives.Ints;
|
import com.google.common.primitives.Ints;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
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;
|
||||||
@ -141,6 +142,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
delegate = new Parameters.Builder(context);
|
delegate = new Parameters.Builder(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
protected ParametersBuilder set(TrackSelectionParameters parameters) {
|
protected ParametersBuilder set(TrackSelectionParameters parameters) {
|
||||||
delegate.set(parameters);
|
delegate.set(parameters);
|
||||||
@ -149,18 +151,21 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
|
|
||||||
// Video
|
// Video
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public DefaultTrackSelector.ParametersBuilder setMaxVideoSizeSd() {
|
public DefaultTrackSelector.ParametersBuilder setMaxVideoSizeSd() {
|
||||||
delegate.setMaxVideoSizeSd();
|
delegate.setMaxVideoSizeSd();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public DefaultTrackSelector.ParametersBuilder clearVideoSizeConstraints() {
|
public DefaultTrackSelector.ParametersBuilder clearVideoSizeConstraints() {
|
||||||
delegate.clearVideoSizeConstraints();
|
delegate.clearVideoSizeConstraints();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public DefaultTrackSelector.ParametersBuilder setMaxVideoSize(
|
public DefaultTrackSelector.ParametersBuilder setMaxVideoSize(
|
||||||
int maxVideoWidth, int maxVideoHeight) {
|
int maxVideoWidth, int maxVideoHeight) {
|
||||||
@ -168,18 +173,21 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public DefaultTrackSelector.ParametersBuilder setMaxVideoFrameRate(int maxVideoFrameRate) {
|
public DefaultTrackSelector.ParametersBuilder setMaxVideoFrameRate(int maxVideoFrameRate) {
|
||||||
delegate.setMaxVideoFrameRate(maxVideoFrameRate);
|
delegate.setMaxVideoFrameRate(maxVideoFrameRate);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public DefaultTrackSelector.ParametersBuilder setMaxVideoBitrate(int maxVideoBitrate) {
|
public DefaultTrackSelector.ParametersBuilder setMaxVideoBitrate(int maxVideoBitrate) {
|
||||||
delegate.setMaxVideoBitrate(maxVideoBitrate);
|
delegate.setMaxVideoBitrate(maxVideoBitrate);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public DefaultTrackSelector.ParametersBuilder setMinVideoSize(
|
public DefaultTrackSelector.ParametersBuilder setMinVideoSize(
|
||||||
int minVideoWidth, int minVideoHeight) {
|
int minVideoWidth, int minVideoHeight) {
|
||||||
@ -187,12 +195,14 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public DefaultTrackSelector.ParametersBuilder setMinVideoFrameRate(int minVideoFrameRate) {
|
public DefaultTrackSelector.ParametersBuilder setMinVideoFrameRate(int minVideoFrameRate) {
|
||||||
delegate.setMinVideoFrameRate(minVideoFrameRate);
|
delegate.setMinVideoFrameRate(minVideoFrameRate);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public DefaultTrackSelector.ParametersBuilder setMinVideoBitrate(int minVideoBitrate) {
|
public DefaultTrackSelector.ParametersBuilder setMinVideoBitrate(int minVideoBitrate) {
|
||||||
delegate.setMinVideoBitrate(minVideoBitrate);
|
delegate.setMinVideoBitrate(minVideoBitrate);
|
||||||
@ -207,6 +217,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* selection can be made otherwise.
|
* selection can be made otherwise.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ParametersBuilder setExceedVideoConstraintsIfNecessary(
|
public ParametersBuilder setExceedVideoConstraintsIfNecessary(
|
||||||
boolean exceedVideoConstraintsIfNecessary) {
|
boolean exceedVideoConstraintsIfNecessary) {
|
||||||
delegate.setExceedVideoConstraintsIfNecessary(exceedVideoConstraintsIfNecessary);
|
delegate.setExceedVideoConstraintsIfNecessary(exceedVideoConstraintsIfNecessary);
|
||||||
@ -224,6 +235,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* containing mixed MIME types.
|
* containing mixed MIME types.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ParametersBuilder setAllowVideoMixedMimeTypeAdaptiveness(
|
public ParametersBuilder setAllowVideoMixedMimeTypeAdaptiveness(
|
||||||
boolean allowVideoMixedMimeTypeAdaptiveness) {
|
boolean allowVideoMixedMimeTypeAdaptiveness) {
|
||||||
delegate.setAllowVideoMixedMimeTypeAdaptiveness(allowVideoMixedMimeTypeAdaptiveness);
|
delegate.setAllowVideoMixedMimeTypeAdaptiveness(allowVideoMixedMimeTypeAdaptiveness);
|
||||||
@ -238,6 +250,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* adaptation may not be completely seamless.
|
* adaptation may not be completely seamless.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ParametersBuilder setAllowVideoNonSeamlessAdaptiveness(
|
public ParametersBuilder setAllowVideoNonSeamlessAdaptiveness(
|
||||||
boolean allowVideoNonSeamlessAdaptiveness) {
|
boolean allowVideoNonSeamlessAdaptiveness) {
|
||||||
delegate.setAllowVideoNonSeamlessAdaptiveness(allowVideoNonSeamlessAdaptiveness);
|
delegate.setAllowVideoNonSeamlessAdaptiveness(allowVideoNonSeamlessAdaptiveness);
|
||||||
@ -253,6 +266,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* with mixed levels of decoder and hardware acceleration support.
|
* with mixed levels of decoder and hardware acceleration support.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ParametersBuilder setAllowVideoMixedDecoderSupportAdaptiveness(
|
public ParametersBuilder setAllowVideoMixedDecoderSupportAdaptiveness(
|
||||||
boolean allowVideoMixedDecoderSupportAdaptiveness) {
|
boolean allowVideoMixedDecoderSupportAdaptiveness) {
|
||||||
delegate.setAllowVideoMixedDecoderSupportAdaptiveness(
|
delegate.setAllowVideoMixedDecoderSupportAdaptiveness(
|
||||||
@ -260,6 +274,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public ParametersBuilder setViewportSizeToPhysicalDisplaySize(
|
public ParametersBuilder setViewportSizeToPhysicalDisplaySize(
|
||||||
Context context, boolean viewportOrientationMayChange) {
|
Context context, boolean viewportOrientationMayChange) {
|
||||||
@ -267,12 +282,14 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public ParametersBuilder clearViewportSizeConstraints() {
|
public ParametersBuilder clearViewportSizeConstraints() {
|
||||||
delegate.clearViewportSizeConstraints();
|
delegate.clearViewportSizeConstraints();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public ParametersBuilder setViewportSize(
|
public ParametersBuilder setViewportSize(
|
||||||
int viewportWidth, int viewportHeight, boolean viewportOrientationMayChange) {
|
int viewportWidth, int viewportHeight, boolean viewportOrientationMayChange) {
|
||||||
@ -280,18 +297,21 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public ParametersBuilder setPreferredVideoMimeType(@Nullable String mimeType) {
|
public ParametersBuilder setPreferredVideoMimeType(@Nullable String mimeType) {
|
||||||
delegate.setPreferredVideoMimeType(mimeType);
|
delegate.setPreferredVideoMimeType(mimeType);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public ParametersBuilder setPreferredVideoMimeTypes(String... mimeTypes) {
|
public ParametersBuilder setPreferredVideoMimeTypes(String... mimeTypes) {
|
||||||
delegate.setPreferredVideoMimeTypes(mimeTypes);
|
delegate.setPreferredVideoMimeTypes(mimeTypes);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public DefaultTrackSelector.ParametersBuilder setPreferredVideoRoleFlags(
|
public DefaultTrackSelector.ParametersBuilder setPreferredVideoRoleFlags(
|
||||||
@RoleFlags int preferredVideoRoleFlags) {
|
@RoleFlags int preferredVideoRoleFlags) {
|
||||||
@ -301,30 +321,35 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
|
|
||||||
// Audio
|
// Audio
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public ParametersBuilder setPreferredAudioLanguage(@Nullable String preferredAudioLanguage) {
|
public ParametersBuilder setPreferredAudioLanguage(@Nullable String preferredAudioLanguage) {
|
||||||
delegate.setPreferredAudioLanguage(preferredAudioLanguage);
|
delegate.setPreferredAudioLanguage(preferredAudioLanguage);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public ParametersBuilder setPreferredAudioLanguages(String... preferredAudioLanguages) {
|
public ParametersBuilder setPreferredAudioLanguages(String... preferredAudioLanguages) {
|
||||||
delegate.setPreferredAudioLanguages(preferredAudioLanguages);
|
delegate.setPreferredAudioLanguages(preferredAudioLanguages);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public ParametersBuilder setPreferredAudioRoleFlags(@C.RoleFlags int preferredAudioRoleFlags) {
|
public ParametersBuilder setPreferredAudioRoleFlags(@C.RoleFlags int preferredAudioRoleFlags) {
|
||||||
delegate.setPreferredAudioRoleFlags(preferredAudioRoleFlags);
|
delegate.setPreferredAudioRoleFlags(preferredAudioRoleFlags);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public ParametersBuilder setMaxAudioChannelCount(int maxAudioChannelCount) {
|
public ParametersBuilder setMaxAudioChannelCount(int maxAudioChannelCount) {
|
||||||
delegate.setMaxAudioChannelCount(maxAudioChannelCount);
|
delegate.setMaxAudioChannelCount(maxAudioChannelCount);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public ParametersBuilder setMaxAudioBitrate(int maxAudioBitrate) {
|
public ParametersBuilder setMaxAudioBitrate(int maxAudioBitrate) {
|
||||||
delegate.setMaxAudioBitrate(maxAudioBitrate);
|
delegate.setMaxAudioBitrate(maxAudioBitrate);
|
||||||
@ -339,6 +364,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* selection can be made otherwise.
|
* selection can be made otherwise.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ParametersBuilder setExceedAudioConstraintsIfNecessary(
|
public ParametersBuilder setExceedAudioConstraintsIfNecessary(
|
||||||
boolean exceedAudioConstraintsIfNecessary) {
|
boolean exceedAudioConstraintsIfNecessary) {
|
||||||
delegate.setExceedAudioConstraintsIfNecessary(exceedAudioConstraintsIfNecessary);
|
delegate.setExceedAudioConstraintsIfNecessary(exceedAudioConstraintsIfNecessary);
|
||||||
@ -354,6 +380,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* containing mixed MIME types.
|
* containing mixed MIME types.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ParametersBuilder setAllowAudioMixedMimeTypeAdaptiveness(
|
public ParametersBuilder setAllowAudioMixedMimeTypeAdaptiveness(
|
||||||
boolean allowAudioMixedMimeTypeAdaptiveness) {
|
boolean allowAudioMixedMimeTypeAdaptiveness) {
|
||||||
delegate.setAllowAudioMixedMimeTypeAdaptiveness(allowAudioMixedMimeTypeAdaptiveness);
|
delegate.setAllowAudioMixedMimeTypeAdaptiveness(allowAudioMixedMimeTypeAdaptiveness);
|
||||||
@ -369,6 +396,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* containing mixed sample rates.
|
* containing mixed sample rates.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ParametersBuilder setAllowAudioMixedSampleRateAdaptiveness(
|
public ParametersBuilder setAllowAudioMixedSampleRateAdaptiveness(
|
||||||
boolean allowAudioMixedSampleRateAdaptiveness) {
|
boolean allowAudioMixedSampleRateAdaptiveness) {
|
||||||
delegate.setAllowAudioMixedSampleRateAdaptiveness(allowAudioMixedSampleRateAdaptiveness);
|
delegate.setAllowAudioMixedSampleRateAdaptiveness(allowAudioMixedSampleRateAdaptiveness);
|
||||||
@ -384,6 +412,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* containing mixed channel counts.
|
* containing mixed channel counts.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ParametersBuilder setAllowAudioMixedChannelCountAdaptiveness(
|
public ParametersBuilder setAllowAudioMixedChannelCountAdaptiveness(
|
||||||
boolean allowAudioMixedChannelCountAdaptiveness) {
|
boolean allowAudioMixedChannelCountAdaptiveness) {
|
||||||
delegate.setAllowAudioMixedChannelCountAdaptiveness(allowAudioMixedChannelCountAdaptiveness);
|
delegate.setAllowAudioMixedChannelCountAdaptiveness(allowAudioMixedChannelCountAdaptiveness);
|
||||||
@ -399,6 +428,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* with mixed levels of decoder and hardware acceleration support.
|
* with mixed levels of decoder and hardware acceleration support.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ParametersBuilder setAllowAudioMixedDecoderSupportAdaptiveness(
|
public ParametersBuilder setAllowAudioMixedDecoderSupportAdaptiveness(
|
||||||
boolean allowAudioMixedDecoderSupportAdaptiveness) {
|
boolean allowAudioMixedDecoderSupportAdaptiveness) {
|
||||||
delegate.setAllowAudioMixedDecoderSupportAdaptiveness(
|
delegate.setAllowAudioMixedDecoderSupportAdaptiveness(
|
||||||
@ -406,12 +436,14 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public ParametersBuilder setPreferredAudioMimeType(@Nullable String mimeType) {
|
public ParametersBuilder setPreferredAudioMimeType(@Nullable String mimeType) {
|
||||||
delegate.setPreferredAudioMimeType(mimeType);
|
delegate.setPreferredAudioMimeType(mimeType);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public ParametersBuilder setPreferredAudioMimeTypes(String... mimeTypes) {
|
public ParametersBuilder setPreferredAudioMimeTypes(String... mimeTypes) {
|
||||||
delegate.setPreferredAudioMimeTypes(mimeTypes);
|
delegate.setPreferredAudioMimeTypes(mimeTypes);
|
||||||
@ -420,6 +452,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
|
|
||||||
// Text
|
// Text
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public ParametersBuilder setPreferredTextLanguageAndRoleFlagsToCaptioningManagerSettings(
|
public ParametersBuilder setPreferredTextLanguageAndRoleFlagsToCaptioningManagerSettings(
|
||||||
Context context) {
|
Context context) {
|
||||||
@ -427,24 +460,28 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public ParametersBuilder setPreferredTextLanguage(@Nullable String preferredTextLanguage) {
|
public ParametersBuilder setPreferredTextLanguage(@Nullable String preferredTextLanguage) {
|
||||||
delegate.setPreferredTextLanguage(preferredTextLanguage);
|
delegate.setPreferredTextLanguage(preferredTextLanguage);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public ParametersBuilder setPreferredTextLanguages(String... preferredTextLanguages) {
|
public ParametersBuilder setPreferredTextLanguages(String... preferredTextLanguages) {
|
||||||
delegate.setPreferredTextLanguages(preferredTextLanguages);
|
delegate.setPreferredTextLanguages(preferredTextLanguages);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public ParametersBuilder setPreferredTextRoleFlags(@C.RoleFlags int preferredTextRoleFlags) {
|
public ParametersBuilder setPreferredTextRoleFlags(@C.RoleFlags int preferredTextRoleFlags) {
|
||||||
delegate.setPreferredTextRoleFlags(preferredTextRoleFlags);
|
delegate.setPreferredTextRoleFlags(preferredTextRoleFlags);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public ParametersBuilder setIgnoredTextSelectionFlags(
|
public ParametersBuilder setIgnoredTextSelectionFlags(
|
||||||
@C.SelectionFlags int ignoredTextSelectionFlags) {
|
@C.SelectionFlags int ignoredTextSelectionFlags) {
|
||||||
@ -452,6 +489,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public ParametersBuilder setSelectUndeterminedTextLanguage(
|
public ParametersBuilder setSelectUndeterminedTextLanguage(
|
||||||
boolean selectUndeterminedTextLanguage) {
|
boolean selectUndeterminedTextLanguage) {
|
||||||
@ -462,6 +500,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link #setIgnoredTextSelectionFlags}.
|
* @deprecated Use {@link #setIgnoredTextSelectionFlags}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public ParametersBuilder setDisabledTextTrackSelectionFlags(
|
public ParametersBuilder setDisabledTextTrackSelectionFlags(
|
||||||
@C.SelectionFlags int disabledTextTrackSelectionFlags) {
|
@C.SelectionFlags int disabledTextTrackSelectionFlags) {
|
||||||
@ -471,42 +510,49 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
|
|
||||||
// General
|
// General
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public ParametersBuilder setForceLowestBitrate(boolean forceLowestBitrate) {
|
public ParametersBuilder setForceLowestBitrate(boolean forceLowestBitrate) {
|
||||||
delegate.setForceLowestBitrate(forceLowestBitrate);
|
delegate.setForceLowestBitrate(forceLowestBitrate);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public ParametersBuilder setForceHighestSupportedBitrate(boolean forceHighestSupportedBitrate) {
|
public ParametersBuilder setForceHighestSupportedBitrate(boolean forceHighestSupportedBitrate) {
|
||||||
delegate.setForceHighestSupportedBitrate(forceHighestSupportedBitrate);
|
delegate.setForceHighestSupportedBitrate(forceHighestSupportedBitrate);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public ParametersBuilder addOverride(TrackSelectionOverride override) {
|
public ParametersBuilder addOverride(TrackSelectionOverride override) {
|
||||||
delegate.addOverride(override);
|
delegate.addOverride(override);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public ParametersBuilder clearOverride(TrackGroup trackGroup) {
|
public ParametersBuilder clearOverride(TrackGroup trackGroup) {
|
||||||
delegate.clearOverride(trackGroup);
|
delegate.clearOverride(trackGroup);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public ParametersBuilder setOverrideForType(TrackSelectionOverride override) {
|
public ParametersBuilder setOverrideForType(TrackSelectionOverride override) {
|
||||||
delegate.setOverrideForType(override);
|
delegate.setOverrideForType(override);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public ParametersBuilder clearOverridesOfType(@C.TrackType int trackType) {
|
public ParametersBuilder clearOverridesOfType(@C.TrackType int trackType) {
|
||||||
delegate.clearOverridesOfType(trackType);
|
delegate.clearOverridesOfType(trackType);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public ParametersBuilder clearOverrides() {
|
public ParametersBuilder clearOverrides() {
|
||||||
delegate.clearOverrides();
|
delegate.clearOverrides();
|
||||||
@ -516,6 +562,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link #setTrackTypeDisabled(int, boolean)}.
|
* @deprecated Use {@link #setTrackTypeDisabled(int, boolean)}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@ -524,6 +571,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public ParametersBuilder setTrackTypeDisabled(@C.TrackType int trackType, boolean disabled) {
|
public ParametersBuilder setTrackTypeDisabled(@C.TrackType int trackType, boolean disabled) {
|
||||||
delegate.setTrackTypeDisabled(trackType, disabled);
|
delegate.setTrackTypeDisabled(trackType, disabled);
|
||||||
@ -542,6 +590,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* selection can be made otherwise.
|
* selection can be made otherwise.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ParametersBuilder setExceedRendererCapabilitiesIfNecessary(
|
public ParametersBuilder setExceedRendererCapabilitiesIfNecessary(
|
||||||
boolean exceedRendererCapabilitiesIfNecessary) {
|
boolean exceedRendererCapabilitiesIfNecessary) {
|
||||||
delegate.setExceedRendererCapabilitiesIfNecessary(exceedRendererCapabilitiesIfNecessary);
|
delegate.setExceedRendererCapabilitiesIfNecessary(exceedRendererCapabilitiesIfNecessary);
|
||||||
@ -562,6 +611,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* @param tunnelingEnabled Whether to enable tunneling if possible.
|
* @param tunnelingEnabled Whether to enable tunneling if possible.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ParametersBuilder setTunnelingEnabled(boolean tunnelingEnabled) {
|
public ParametersBuilder setTunnelingEnabled(boolean tunnelingEnabled) {
|
||||||
delegate.setTunnelingEnabled(tunnelingEnabled);
|
delegate.setTunnelingEnabled(tunnelingEnabled);
|
||||||
return this;
|
return this;
|
||||||
@ -573,6 +623,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* @param allowMultipleAdaptiveSelections Whether multiple adaptive selections are allowed.
|
* @param allowMultipleAdaptiveSelections Whether multiple adaptive selections are allowed.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ParametersBuilder setAllowMultipleAdaptiveSelections(
|
public ParametersBuilder setAllowMultipleAdaptiveSelections(
|
||||||
boolean allowMultipleAdaptiveSelections) {
|
boolean allowMultipleAdaptiveSelections) {
|
||||||
delegate.setAllowMultipleAdaptiveSelections(allowMultipleAdaptiveSelections);
|
delegate.setAllowMultipleAdaptiveSelections(allowMultipleAdaptiveSelections);
|
||||||
@ -589,6 +640,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* @param disabled Whether the renderer is disabled.
|
* @param disabled Whether the renderer is disabled.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ParametersBuilder setRendererDisabled(int rendererIndex, boolean disabled) {
|
public ParametersBuilder setRendererDisabled(int rendererIndex, boolean disabled) {
|
||||||
delegate.setRendererDisabled(rendererIndex, disabled);
|
delegate.setRendererDisabled(rendererIndex, disabled);
|
||||||
return this;
|
return this;
|
||||||
@ -618,6 +670,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @deprecated Use {@link TrackSelectionParameters.Builder#addOverride(TrackSelectionOverride)}.
|
* @deprecated Use {@link TrackSelectionParameters.Builder#addOverride(TrackSelectionOverride)}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public ParametersBuilder setSelectionOverride(
|
public ParametersBuilder setSelectionOverride(
|
||||||
int rendererIndex, TrackGroupArray groups, @Nullable SelectionOverride override) {
|
int rendererIndex, TrackGroupArray groups, @Nullable SelectionOverride override) {
|
||||||
@ -633,6 +686,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @deprecated Use {@link TrackSelectionParameters.Builder#clearOverride(TrackGroup)}.
|
* @deprecated Use {@link TrackSelectionParameters.Builder#clearOverride(TrackGroup)}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public ParametersBuilder clearSelectionOverride(int rendererIndex, TrackGroupArray groups) {
|
public ParametersBuilder clearSelectionOverride(int rendererIndex, TrackGroupArray groups) {
|
||||||
delegate.clearSelectionOverride(rendererIndex, groups);
|
delegate.clearSelectionOverride(rendererIndex, groups);
|
||||||
@ -646,6 +700,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @deprecated Use {@link TrackSelectionParameters.Builder#clearOverridesOfType(int)}.
|
* @deprecated Use {@link TrackSelectionParameters.Builder#clearOverridesOfType(int)}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public ParametersBuilder clearSelectionOverrides(int rendererIndex) {
|
public ParametersBuilder clearSelectionOverrides(int rendererIndex) {
|
||||||
delegate.clearSelectionOverrides(rendererIndex);
|
delegate.clearSelectionOverrides(rendererIndex);
|
||||||
@ -658,6 +713,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @deprecated Use {@link TrackSelectionParameters.Builder#clearOverrides()}.
|
* @deprecated Use {@link TrackSelectionParameters.Builder#clearOverrides()}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public ParametersBuilder clearSelectionOverrides() {
|
public ParametersBuilder clearSelectionOverrides() {
|
||||||
delegate.clearSelectionOverrides();
|
delegate.clearSelectionOverrides();
|
||||||
@ -832,6 +888,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
Parameters.keyForField(Parameters.FIELD_RENDERER_DISABLED_INDICES)));
|
Parameters.keyForField(Parameters.FIELD_RENDERER_DISABLED_INDICES)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
protected Builder set(TrackSelectionParameters parameters) {
|
protected Builder set(TrackSelectionParameters parameters) {
|
||||||
super.set(parameters);
|
super.set(parameters);
|
||||||
@ -840,48 +897,56 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
|
|
||||||
// Video
|
// Video
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setMaxVideoSizeSd() {
|
public Builder setMaxVideoSizeSd() {
|
||||||
super.setMaxVideoSizeSd();
|
super.setMaxVideoSizeSd();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder clearVideoSizeConstraints() {
|
public Builder clearVideoSizeConstraints() {
|
||||||
super.clearVideoSizeConstraints();
|
super.clearVideoSizeConstraints();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setMaxVideoSize(int maxVideoWidth, int maxVideoHeight) {
|
public Builder setMaxVideoSize(int maxVideoWidth, int maxVideoHeight) {
|
||||||
super.setMaxVideoSize(maxVideoWidth, maxVideoHeight);
|
super.setMaxVideoSize(maxVideoWidth, maxVideoHeight);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setMaxVideoFrameRate(int maxVideoFrameRate) {
|
public Builder setMaxVideoFrameRate(int maxVideoFrameRate) {
|
||||||
super.setMaxVideoFrameRate(maxVideoFrameRate);
|
super.setMaxVideoFrameRate(maxVideoFrameRate);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setMaxVideoBitrate(int maxVideoBitrate) {
|
public Builder setMaxVideoBitrate(int maxVideoBitrate) {
|
||||||
super.setMaxVideoBitrate(maxVideoBitrate);
|
super.setMaxVideoBitrate(maxVideoBitrate);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setMinVideoSize(int minVideoWidth, int minVideoHeight) {
|
public Builder setMinVideoSize(int minVideoWidth, int minVideoHeight) {
|
||||||
super.setMinVideoSize(minVideoWidth, minVideoHeight);
|
super.setMinVideoSize(minVideoWidth, minVideoHeight);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setMinVideoFrameRate(int minVideoFrameRate) {
|
public Builder setMinVideoFrameRate(int minVideoFrameRate) {
|
||||||
super.setMinVideoFrameRate(minVideoFrameRate);
|
super.setMinVideoFrameRate(minVideoFrameRate);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setMinVideoBitrate(int minVideoBitrate) {
|
public Builder setMinVideoBitrate(int minVideoBitrate) {
|
||||||
super.setMinVideoBitrate(minVideoBitrate);
|
super.setMinVideoBitrate(minVideoBitrate);
|
||||||
@ -896,6 +961,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* selection can be made otherwise.
|
* selection can be made otherwise.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setExceedVideoConstraintsIfNecessary(
|
public Builder setExceedVideoConstraintsIfNecessary(
|
||||||
boolean exceedVideoConstraintsIfNecessary) {
|
boolean exceedVideoConstraintsIfNecessary) {
|
||||||
this.exceedVideoConstraintsIfNecessary = exceedVideoConstraintsIfNecessary;
|
this.exceedVideoConstraintsIfNecessary = exceedVideoConstraintsIfNecessary;
|
||||||
@ -913,6 +979,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* containing mixed MIME types.
|
* containing mixed MIME types.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAllowVideoMixedMimeTypeAdaptiveness(
|
public Builder setAllowVideoMixedMimeTypeAdaptiveness(
|
||||||
boolean allowVideoMixedMimeTypeAdaptiveness) {
|
boolean allowVideoMixedMimeTypeAdaptiveness) {
|
||||||
this.allowVideoMixedMimeTypeAdaptiveness = allowVideoMixedMimeTypeAdaptiveness;
|
this.allowVideoMixedMimeTypeAdaptiveness = allowVideoMixedMimeTypeAdaptiveness;
|
||||||
@ -927,6 +994,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* adaptation may not be completely seamless.
|
* adaptation may not be completely seamless.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAllowVideoNonSeamlessAdaptiveness(
|
public Builder setAllowVideoNonSeamlessAdaptiveness(
|
||||||
boolean allowVideoNonSeamlessAdaptiveness) {
|
boolean allowVideoNonSeamlessAdaptiveness) {
|
||||||
this.allowVideoNonSeamlessAdaptiveness = allowVideoNonSeamlessAdaptiveness;
|
this.allowVideoNonSeamlessAdaptiveness = allowVideoNonSeamlessAdaptiveness;
|
||||||
@ -942,12 +1010,14 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* with mixed levels of decoder and hardware acceleration support.
|
* with mixed levels of decoder and hardware acceleration support.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAllowVideoMixedDecoderSupportAdaptiveness(
|
public Builder setAllowVideoMixedDecoderSupportAdaptiveness(
|
||||||
boolean allowVideoMixedDecoderSupportAdaptiveness) {
|
boolean allowVideoMixedDecoderSupportAdaptiveness) {
|
||||||
this.allowVideoMixedDecoderSupportAdaptiveness = allowVideoMixedDecoderSupportAdaptiveness;
|
this.allowVideoMixedDecoderSupportAdaptiveness = allowVideoMixedDecoderSupportAdaptiveness;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setViewportSizeToPhysicalDisplaySize(
|
public Builder setViewportSizeToPhysicalDisplaySize(
|
||||||
Context context, boolean viewportOrientationMayChange) {
|
Context context, boolean viewportOrientationMayChange) {
|
||||||
@ -955,12 +1025,14 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder clearViewportSizeConstraints() {
|
public Builder clearViewportSizeConstraints() {
|
||||||
super.clearViewportSizeConstraints();
|
super.clearViewportSizeConstraints();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setViewportSize(
|
public Builder setViewportSize(
|
||||||
int viewportWidth, int viewportHeight, boolean viewportOrientationMayChange) {
|
int viewportWidth, int viewportHeight, boolean viewportOrientationMayChange) {
|
||||||
@ -968,18 +1040,21 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setPreferredVideoMimeType(@Nullable String mimeType) {
|
public Builder setPreferredVideoMimeType(@Nullable String mimeType) {
|
||||||
super.setPreferredVideoMimeType(mimeType);
|
super.setPreferredVideoMimeType(mimeType);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setPreferredVideoMimeTypes(String... mimeTypes) {
|
public Builder setPreferredVideoMimeTypes(String... mimeTypes) {
|
||||||
super.setPreferredVideoMimeTypes(mimeTypes);
|
super.setPreferredVideoMimeTypes(mimeTypes);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setPreferredVideoRoleFlags(@RoleFlags int preferredVideoRoleFlags) {
|
public Builder setPreferredVideoRoleFlags(@RoleFlags int preferredVideoRoleFlags) {
|
||||||
super.setPreferredVideoRoleFlags(preferredVideoRoleFlags);
|
super.setPreferredVideoRoleFlags(preferredVideoRoleFlags);
|
||||||
@ -988,30 +1063,35 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
|
|
||||||
// Audio
|
// Audio
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setPreferredAudioLanguage(@Nullable String preferredAudioLanguage) {
|
public Builder setPreferredAudioLanguage(@Nullable String preferredAudioLanguage) {
|
||||||
super.setPreferredAudioLanguage(preferredAudioLanguage);
|
super.setPreferredAudioLanguage(preferredAudioLanguage);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setPreferredAudioLanguages(String... preferredAudioLanguages) {
|
public Builder setPreferredAudioLanguages(String... preferredAudioLanguages) {
|
||||||
super.setPreferredAudioLanguages(preferredAudioLanguages);
|
super.setPreferredAudioLanguages(preferredAudioLanguages);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setPreferredAudioRoleFlags(@C.RoleFlags int preferredAudioRoleFlags) {
|
public Builder setPreferredAudioRoleFlags(@C.RoleFlags int preferredAudioRoleFlags) {
|
||||||
super.setPreferredAudioRoleFlags(preferredAudioRoleFlags);
|
super.setPreferredAudioRoleFlags(preferredAudioRoleFlags);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setMaxAudioChannelCount(int maxAudioChannelCount) {
|
public Builder setMaxAudioChannelCount(int maxAudioChannelCount) {
|
||||||
super.setMaxAudioChannelCount(maxAudioChannelCount);
|
super.setMaxAudioChannelCount(maxAudioChannelCount);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setMaxAudioBitrate(int maxAudioBitrate) {
|
public Builder setMaxAudioBitrate(int maxAudioBitrate) {
|
||||||
super.setMaxAudioBitrate(maxAudioBitrate);
|
super.setMaxAudioBitrate(maxAudioBitrate);
|
||||||
@ -1026,6 +1106,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* selection can be made otherwise.
|
* selection can be made otherwise.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setExceedAudioConstraintsIfNecessary(
|
public Builder setExceedAudioConstraintsIfNecessary(
|
||||||
boolean exceedAudioConstraintsIfNecessary) {
|
boolean exceedAudioConstraintsIfNecessary) {
|
||||||
this.exceedAudioConstraintsIfNecessary = exceedAudioConstraintsIfNecessary;
|
this.exceedAudioConstraintsIfNecessary = exceedAudioConstraintsIfNecessary;
|
||||||
@ -1041,6 +1122,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* containing mixed MIME types.
|
* containing mixed MIME types.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAllowAudioMixedMimeTypeAdaptiveness(
|
public Builder setAllowAudioMixedMimeTypeAdaptiveness(
|
||||||
boolean allowAudioMixedMimeTypeAdaptiveness) {
|
boolean allowAudioMixedMimeTypeAdaptiveness) {
|
||||||
this.allowAudioMixedMimeTypeAdaptiveness = allowAudioMixedMimeTypeAdaptiveness;
|
this.allowAudioMixedMimeTypeAdaptiveness = allowAudioMixedMimeTypeAdaptiveness;
|
||||||
@ -1056,6 +1138,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* containing mixed sample rates.
|
* containing mixed sample rates.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAllowAudioMixedSampleRateAdaptiveness(
|
public Builder setAllowAudioMixedSampleRateAdaptiveness(
|
||||||
boolean allowAudioMixedSampleRateAdaptiveness) {
|
boolean allowAudioMixedSampleRateAdaptiveness) {
|
||||||
this.allowAudioMixedSampleRateAdaptiveness = allowAudioMixedSampleRateAdaptiveness;
|
this.allowAudioMixedSampleRateAdaptiveness = allowAudioMixedSampleRateAdaptiveness;
|
||||||
@ -1071,6 +1154,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* containing mixed channel counts.
|
* containing mixed channel counts.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAllowAudioMixedChannelCountAdaptiveness(
|
public Builder setAllowAudioMixedChannelCountAdaptiveness(
|
||||||
boolean allowAudioMixedChannelCountAdaptiveness) {
|
boolean allowAudioMixedChannelCountAdaptiveness) {
|
||||||
this.allowAudioMixedChannelCountAdaptiveness = allowAudioMixedChannelCountAdaptiveness;
|
this.allowAudioMixedChannelCountAdaptiveness = allowAudioMixedChannelCountAdaptiveness;
|
||||||
@ -1086,18 +1170,21 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* with mixed levels of decoder and hardware acceleration support.
|
* with mixed levels of decoder and hardware acceleration support.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAllowAudioMixedDecoderSupportAdaptiveness(
|
public Builder setAllowAudioMixedDecoderSupportAdaptiveness(
|
||||||
boolean allowAudioMixedDecoderSupportAdaptiveness) {
|
boolean allowAudioMixedDecoderSupportAdaptiveness) {
|
||||||
this.allowAudioMixedDecoderSupportAdaptiveness = allowAudioMixedDecoderSupportAdaptiveness;
|
this.allowAudioMixedDecoderSupportAdaptiveness = allowAudioMixedDecoderSupportAdaptiveness;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setPreferredAudioMimeType(@Nullable String mimeType) {
|
public Builder setPreferredAudioMimeType(@Nullable String mimeType) {
|
||||||
super.setPreferredAudioMimeType(mimeType);
|
super.setPreferredAudioMimeType(mimeType);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setPreferredAudioMimeTypes(String... mimeTypes) {
|
public Builder setPreferredAudioMimeTypes(String... mimeTypes) {
|
||||||
super.setPreferredAudioMimeTypes(mimeTypes);
|
super.setPreferredAudioMimeTypes(mimeTypes);
|
||||||
@ -1129,6 +1216,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* DefaultTrackSelector#DefaultTrackSelector(TrackSelectionParameters,
|
* DefaultTrackSelector#DefaultTrackSelector(TrackSelectionParameters,
|
||||||
* ExoTrackSelection.Factory)} constructor.
|
* ExoTrackSelection.Factory)} constructor.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setConstrainAudioChannelCountToDeviceCapabilities(boolean enabled) {
|
public Builder setConstrainAudioChannelCountToDeviceCapabilities(boolean enabled) {
|
||||||
constrainAudioChannelCountToDeviceCapabilities = enabled;
|
constrainAudioChannelCountToDeviceCapabilities = enabled;
|
||||||
return this;
|
return this;
|
||||||
@ -1136,6 +1224,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
|
|
||||||
// Text
|
// Text
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setPreferredTextLanguageAndRoleFlagsToCaptioningManagerSettings(
|
public Builder setPreferredTextLanguageAndRoleFlagsToCaptioningManagerSettings(
|
||||||
Context context) {
|
Context context) {
|
||||||
@ -1143,30 +1232,35 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setPreferredTextLanguage(@Nullable String preferredTextLanguage) {
|
public Builder setPreferredTextLanguage(@Nullable String preferredTextLanguage) {
|
||||||
super.setPreferredTextLanguage(preferredTextLanguage);
|
super.setPreferredTextLanguage(preferredTextLanguage);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setPreferredTextLanguages(String... preferredTextLanguages) {
|
public Builder setPreferredTextLanguages(String... preferredTextLanguages) {
|
||||||
super.setPreferredTextLanguages(preferredTextLanguages);
|
super.setPreferredTextLanguages(preferredTextLanguages);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setPreferredTextRoleFlags(@C.RoleFlags int preferredTextRoleFlags) {
|
public Builder setPreferredTextRoleFlags(@C.RoleFlags int preferredTextRoleFlags) {
|
||||||
super.setPreferredTextRoleFlags(preferredTextRoleFlags);
|
super.setPreferredTextRoleFlags(preferredTextRoleFlags);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setIgnoredTextSelectionFlags(@C.SelectionFlags int ignoredTextSelectionFlags) {
|
public Builder setIgnoredTextSelectionFlags(@C.SelectionFlags int ignoredTextSelectionFlags) {
|
||||||
super.setIgnoredTextSelectionFlags(ignoredTextSelectionFlags);
|
super.setIgnoredTextSelectionFlags(ignoredTextSelectionFlags);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setSelectUndeterminedTextLanguage(boolean selectUndeterminedTextLanguage) {
|
public Builder setSelectUndeterminedTextLanguage(boolean selectUndeterminedTextLanguage) {
|
||||||
super.setSelectUndeterminedTextLanguage(selectUndeterminedTextLanguage);
|
super.setSelectUndeterminedTextLanguage(selectUndeterminedTextLanguage);
|
||||||
@ -1176,6 +1270,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link #setIgnoredTextSelectionFlags}.
|
* @deprecated Use {@link #setIgnoredTextSelectionFlags}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setDisabledTextTrackSelectionFlags(
|
public Builder setDisabledTextTrackSelectionFlags(
|
||||||
@C.SelectionFlags int disabledTextTrackSelectionFlags) {
|
@C.SelectionFlags int disabledTextTrackSelectionFlags) {
|
||||||
@ -1184,42 +1279,49 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
|
|
||||||
// General
|
// General
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setForceLowestBitrate(boolean forceLowestBitrate) {
|
public Builder setForceLowestBitrate(boolean forceLowestBitrate) {
|
||||||
super.setForceLowestBitrate(forceLowestBitrate);
|
super.setForceLowestBitrate(forceLowestBitrate);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setForceHighestSupportedBitrate(boolean forceHighestSupportedBitrate) {
|
public Builder setForceHighestSupportedBitrate(boolean forceHighestSupportedBitrate) {
|
||||||
super.setForceHighestSupportedBitrate(forceHighestSupportedBitrate);
|
super.setForceHighestSupportedBitrate(forceHighestSupportedBitrate);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder addOverride(TrackSelectionOverride override) {
|
public Builder addOverride(TrackSelectionOverride override) {
|
||||||
super.addOverride(override);
|
super.addOverride(override);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder clearOverride(TrackGroup trackGroup) {
|
public Builder clearOverride(TrackGroup trackGroup) {
|
||||||
super.clearOverride(trackGroup);
|
super.clearOverride(trackGroup);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setOverrideForType(TrackSelectionOverride override) {
|
public Builder setOverrideForType(TrackSelectionOverride override) {
|
||||||
super.setOverrideForType(override);
|
super.setOverrideForType(override);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder clearOverridesOfType(@C.TrackType int trackType) {
|
public Builder clearOverridesOfType(@C.TrackType int trackType) {
|
||||||
super.clearOverridesOfType(trackType);
|
super.clearOverridesOfType(trackType);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder clearOverrides() {
|
public Builder clearOverrides() {
|
||||||
super.clearOverrides();
|
super.clearOverrides();
|
||||||
@ -1229,6 +1331,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link #setTrackTypeDisabled(int, boolean)}.
|
* @deprecated Use {@link #setTrackTypeDisabled(int, boolean)}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@ -1237,6 +1340,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Builder setTrackTypeDisabled(@C.TrackType int trackType, boolean disabled) {
|
public Builder setTrackTypeDisabled(@C.TrackType int trackType, boolean disabled) {
|
||||||
super.setTrackTypeDisabled(trackType, disabled);
|
super.setTrackTypeDisabled(trackType, disabled);
|
||||||
@ -1255,6 +1359,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* no selection can be made otherwise.
|
* no selection can be made otherwise.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setExceedRendererCapabilitiesIfNecessary(
|
public Builder setExceedRendererCapabilitiesIfNecessary(
|
||||||
boolean exceedRendererCapabilitiesIfNecessary) {
|
boolean exceedRendererCapabilitiesIfNecessary) {
|
||||||
this.exceedRendererCapabilitiesIfNecessary = exceedRendererCapabilitiesIfNecessary;
|
this.exceedRendererCapabilitiesIfNecessary = exceedRendererCapabilitiesIfNecessary;
|
||||||
@ -1275,6 +1380,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* @param tunnelingEnabled Whether to enable tunneling if possible.
|
* @param tunnelingEnabled Whether to enable tunneling if possible.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setTunnelingEnabled(boolean tunnelingEnabled) {
|
public Builder setTunnelingEnabled(boolean tunnelingEnabled) {
|
||||||
this.tunnelingEnabled = tunnelingEnabled;
|
this.tunnelingEnabled = tunnelingEnabled;
|
||||||
return this;
|
return this;
|
||||||
@ -1286,6 +1392,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* @param allowMultipleAdaptiveSelections Whether multiple adaptive selections are allowed.
|
* @param allowMultipleAdaptiveSelections Whether multiple adaptive selections are allowed.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAllowMultipleAdaptiveSelections(boolean allowMultipleAdaptiveSelections) {
|
public Builder setAllowMultipleAdaptiveSelections(boolean allowMultipleAdaptiveSelections) {
|
||||||
this.allowMultipleAdaptiveSelections = allowMultipleAdaptiveSelections;
|
this.allowMultipleAdaptiveSelections = allowMultipleAdaptiveSelections;
|
||||||
return this;
|
return this;
|
||||||
@ -1301,6 +1408,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* @param disabled Whether the renderer is disabled.
|
* @param disabled Whether the renderer is disabled.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setRendererDisabled(int rendererIndex, boolean disabled) {
|
public Builder setRendererDisabled(int rendererIndex, boolean disabled) {
|
||||||
if (rendererDisabledFlags.get(rendererIndex) == disabled) {
|
if (rendererDisabledFlags.get(rendererIndex) == disabled) {
|
||||||
// The disabled flag is unchanged.
|
// The disabled flag is unchanged.
|
||||||
@ -1340,6 +1448,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* @deprecated Use {@link
|
* @deprecated Use {@link
|
||||||
* TrackSelectionParameters.Builder#addOverride(TrackSelectionOverride)}.
|
* TrackSelectionParameters.Builder#addOverride(TrackSelectionOverride)}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setSelectionOverride(
|
public Builder setSelectionOverride(
|
||||||
int rendererIndex, TrackGroupArray groups, @Nullable SelectionOverride override) {
|
int rendererIndex, TrackGroupArray groups, @Nullable SelectionOverride override) {
|
||||||
@ -1365,6 +1474,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @deprecated Use {@link TrackSelectionParameters.Builder#clearOverride(TrackGroup)}.
|
* @deprecated Use {@link TrackSelectionParameters.Builder#clearOverride(TrackGroup)}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder clearSelectionOverride(int rendererIndex, TrackGroupArray groups) {
|
public Builder clearSelectionOverride(int rendererIndex, TrackGroupArray groups) {
|
||||||
Map<TrackGroupArray, @NullableType SelectionOverride> overrides =
|
Map<TrackGroupArray, @NullableType SelectionOverride> overrides =
|
||||||
@ -1387,6 +1497,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @deprecated Use {@link TrackSelectionParameters.Builder#clearOverridesOfType(int)}.
|
* @deprecated Use {@link TrackSelectionParameters.Builder#clearOverridesOfType(int)}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder clearSelectionOverrides(int rendererIndex) {
|
public Builder clearSelectionOverrides(int rendererIndex) {
|
||||||
Map<TrackGroupArray, @NullableType SelectionOverride> overrides =
|
Map<TrackGroupArray, @NullableType SelectionOverride> overrides =
|
||||||
@ -1405,6 +1516,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
* @return This builder.
|
* @return This builder.
|
||||||
* @deprecated Use {@link TrackSelectionParameters.Builder#clearOverrides()}.
|
* @deprecated Use {@link TrackSelectionParameters.Builder#clearOverrides()}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder clearSelectionOverrides() {
|
public Builder clearSelectionOverrides() {
|
||||||
if (selectionOverrides.size() == 0) {
|
if (selectionOverrides.size() == 0) {
|
||||||
|
@ -27,6 +27,7 @@ import com.google.android.exoplayer2.util.Util;
|
|||||||
import com.google.common.base.Ascii;
|
import com.google.common.base.Ascii;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -136,6 +137,7 @@ public final class DefaultBandwidthMeter implements BandwidthMeter, TransferList
|
|||||||
* @param slidingWindowMaxWeight The maximum weight for the sliding window.
|
* @param slidingWindowMaxWeight The maximum weight for the sliding window.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSlidingWindowMaxWeight(int slidingWindowMaxWeight) {
|
public Builder setSlidingWindowMaxWeight(int slidingWindowMaxWeight) {
|
||||||
this.slidingWindowMaxWeight = slidingWindowMaxWeight;
|
this.slidingWindowMaxWeight = slidingWindowMaxWeight;
|
||||||
return this;
|
return this;
|
||||||
@ -148,6 +150,7 @@ public final class DefaultBandwidthMeter implements BandwidthMeter, TransferList
|
|||||||
* @param initialBitrateEstimate The initial bitrate estimate in bits per second.
|
* @param initialBitrateEstimate The initial bitrate estimate in bits per second.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setInitialBitrateEstimate(long initialBitrateEstimate) {
|
public Builder setInitialBitrateEstimate(long initialBitrateEstimate) {
|
||||||
for (Integer networkType : initialBitrateEstimates.keySet()) {
|
for (Integer networkType : initialBitrateEstimates.keySet()) {
|
||||||
setInitialBitrateEstimate(networkType, initialBitrateEstimate);
|
setInitialBitrateEstimate(networkType, initialBitrateEstimate);
|
||||||
@ -163,6 +166,7 @@ public final class DefaultBandwidthMeter implements BandwidthMeter, TransferList
|
|||||||
* @param initialBitrateEstimate The initial bitrate estimate in bits per second.
|
* @param initialBitrateEstimate The initial bitrate estimate in bits per second.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setInitialBitrateEstimate(
|
public Builder setInitialBitrateEstimate(
|
||||||
@C.NetworkType int networkType, long initialBitrateEstimate) {
|
@C.NetworkType int networkType, long initialBitrateEstimate) {
|
||||||
initialBitrateEstimates.put(networkType, initialBitrateEstimate);
|
initialBitrateEstimates.put(networkType, initialBitrateEstimate);
|
||||||
@ -177,6 +181,7 @@ public final class DefaultBandwidthMeter implements BandwidthMeter, TransferList
|
|||||||
* estimates should be used.
|
* estimates should be used.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setInitialBitrateEstimate(String countryCode) {
|
public Builder setInitialBitrateEstimate(String countryCode) {
|
||||||
initialBitrateEstimates =
|
initialBitrateEstimates =
|
||||||
getInitialBitrateEstimatesForCountry(Ascii.toUpperCase(countryCode));
|
getInitialBitrateEstimatesForCountry(Ascii.toUpperCase(countryCode));
|
||||||
@ -190,6 +195,7 @@ public final class DefaultBandwidthMeter implements BandwidthMeter, TransferList
|
|||||||
* @param clock The clock used to estimate bandwidth from data transfers.
|
* @param clock The clock used to estimate bandwidth from data transfers.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setClock(Clock clock) {
|
public Builder setClock(Clock clock) {
|
||||||
this.clock = clock;
|
this.clock = clock;
|
||||||
return this;
|
return this;
|
||||||
@ -201,6 +207,7 @@ public final class DefaultBandwidthMeter implements BandwidthMeter, TransferList
|
|||||||
* @param resetOnNetworkTypeChange Whether to reset if the network type changes.
|
* @param resetOnNetworkTypeChange Whether to reset if the network type changes.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setResetOnNetworkTypeChange(boolean resetOnNetworkTypeChange) {
|
public Builder setResetOnNetworkTypeChange(boolean resetOnNetworkTypeChange) {
|
||||||
this.resetOnNetworkTypeChange = resetOnNetworkTypeChange;
|
this.resetOnNetworkTypeChange = resetOnNetworkTypeChange;
|
||||||
return this;
|
return this;
|
||||||
|
@ -155,6 +155,7 @@ import com.google.android.exoplayer2.util.Util;
|
|||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import com.google.common.collect.Range;
|
import com.google.common.collect.Range;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -12183,6 +12184,7 @@ public final class ExoPlayerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Call {@link Renderer.WakeupListener#onSleep()} on the next {@link #render(long, long)} */
|
/** Call {@link Renderer.WakeupListener#onSleep()} on the next {@link #render(long, long)} */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public FakeSleepRenderer sleepOnNextRender() {
|
public FakeSleepRenderer sleepOnNextRender() {
|
||||||
sleepOnNextRender.set(true);
|
sleepOnNextRender.set(true);
|
||||||
return this;
|
return this;
|
||||||
|
@ -25,6 +25,7 @@ android {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation project(modulePrefix + 'library-core')
|
implementation project(modulePrefix + 'library-core')
|
||||||
|
compileOnly 'com.google.errorprone:error_prone_annotations:' + errorProneVersion
|
||||||
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
|
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
|
||||||
compileOnly 'org.checkerframework:checker-compat-qual:' + checkerframeworkCompatVersion
|
compileOnly 'org.checkerframework:checker-compat-qual:' + checkerframeworkCompatVersion
|
||||||
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
|
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
|
||||||
|
@ -76,6 +76,7 @@ import com.google.android.exoplayer2.util.SntpClient;
|
|||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
import com.google.common.base.Charsets;
|
import com.google.common.base.Charsets;
|
||||||
import com.google.common.math.LongMath;
|
import com.google.common.math.LongMath;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
@ -156,6 +157,7 @@ public final class DashMediaSource extends BaseMediaSource {
|
|||||||
compositeSequenceableLoaderFactory = new DefaultCompositeSequenceableLoaderFactory();
|
compositeSequenceableLoaderFactory = new DefaultCompositeSequenceableLoaderFactory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Factory setDrmSessionManagerProvider(
|
public Factory setDrmSessionManagerProvider(
|
||||||
DrmSessionManagerProvider drmSessionManagerProvider) {
|
DrmSessionManagerProvider drmSessionManagerProvider) {
|
||||||
@ -168,6 +170,7 @@ public final class DashMediaSource extends BaseMediaSource {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy) {
|
public Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy) {
|
||||||
this.loadErrorHandlingPolicy =
|
this.loadErrorHandlingPolicy =
|
||||||
@ -188,6 +191,7 @@ public final class DashMediaSource extends BaseMediaSource {
|
|||||||
* @param fallbackTargetLiveOffsetMs The fallback live target offset in milliseconds.
|
* @param fallbackTargetLiveOffsetMs The fallback live target offset in milliseconds.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setFallbackTargetLiveOffsetMs(long fallbackTargetLiveOffsetMs) {
|
public Factory setFallbackTargetLiveOffsetMs(long fallbackTargetLiveOffsetMs) {
|
||||||
this.fallbackTargetLiveOffsetMs = fallbackTargetLiveOffsetMs;
|
this.fallbackTargetLiveOffsetMs = fallbackTargetLiveOffsetMs;
|
||||||
return this;
|
return this;
|
||||||
@ -199,6 +203,7 @@ public final class DashMediaSource extends BaseMediaSource {
|
|||||||
* @param manifestParser A parser for loaded manifest data.
|
* @param manifestParser A parser for loaded manifest data.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setManifestParser(
|
public Factory setManifestParser(
|
||||||
@Nullable ParsingLoadable.Parser<? extends DashManifest> manifestParser) {
|
@Nullable ParsingLoadable.Parser<? extends DashManifest> manifestParser) {
|
||||||
this.manifestParser = manifestParser;
|
this.manifestParser = manifestParser;
|
||||||
@ -215,6 +220,7 @@ public final class DashMediaSource extends BaseMediaSource {
|
|||||||
* audio etc...).
|
* audio etc...).
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setCompositeSequenceableLoaderFactory(
|
public Factory setCompositeSequenceableLoaderFactory(
|
||||||
CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory) {
|
CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory) {
|
||||||
this.compositeSequenceableLoaderFactory =
|
this.compositeSequenceableLoaderFactory =
|
||||||
|
@ -23,6 +23,7 @@ import androidx.annotation.Nullable;
|
|||||||
import com.google.android.exoplayer2.C;
|
import com.google.android.exoplayer2.C;
|
||||||
import com.google.android.exoplayer2.ExoPlayerLibraryInfo;
|
import com.google.android.exoplayer2.ExoPlayerLibraryInfo;
|
||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
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;
|
||||||
@ -87,6 +88,7 @@ public final class DataSpec {
|
|||||||
* @param uriString The {@link DataSpec#uri}.
|
* @param uriString The {@link DataSpec#uri}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setUri(String uriString) {
|
public Builder setUri(String uriString) {
|
||||||
this.uri = Uri.parse(uriString);
|
this.uri = Uri.parse(uriString);
|
||||||
return this;
|
return this;
|
||||||
@ -98,6 +100,7 @@ public final class DataSpec {
|
|||||||
* @param uri The {@link DataSpec#uri}.
|
* @param uri The {@link DataSpec#uri}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setUri(Uri uri) {
|
public Builder setUri(Uri uri) {
|
||||||
this.uri = uri;
|
this.uri = uri;
|
||||||
return this;
|
return this;
|
||||||
@ -109,6 +112,7 @@ public final class DataSpec {
|
|||||||
* @param uriPositionOffset The {@link DataSpec#uriPositionOffset}.
|
* @param uriPositionOffset The {@link DataSpec#uriPositionOffset}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setUriPositionOffset(long uriPositionOffset) {
|
public Builder setUriPositionOffset(long uriPositionOffset) {
|
||||||
this.uriPositionOffset = uriPositionOffset;
|
this.uriPositionOffset = uriPositionOffset;
|
||||||
return this;
|
return this;
|
||||||
@ -120,6 +124,7 @@ public final class DataSpec {
|
|||||||
* @param httpMethod The {@link DataSpec#httpMethod}.
|
* @param httpMethod The {@link DataSpec#httpMethod}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setHttpMethod(@HttpMethod int httpMethod) {
|
public Builder setHttpMethod(@HttpMethod int httpMethod) {
|
||||||
this.httpMethod = httpMethod;
|
this.httpMethod = httpMethod;
|
||||||
return this;
|
return this;
|
||||||
@ -131,6 +136,7 @@ public final class DataSpec {
|
|||||||
* @param httpBody The {@link DataSpec#httpBody}.
|
* @param httpBody The {@link DataSpec#httpBody}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setHttpBody(@Nullable byte[] httpBody) {
|
public Builder setHttpBody(@Nullable byte[] httpBody) {
|
||||||
this.httpBody = httpBody;
|
this.httpBody = httpBody;
|
||||||
return this;
|
return this;
|
||||||
@ -146,6 +152,7 @@ public final class DataSpec {
|
|||||||
* @param httpRequestHeaders The {@link DataSpec#httpRequestHeaders}.
|
* @param httpRequestHeaders The {@link DataSpec#httpRequestHeaders}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setHttpRequestHeaders(Map<String, String> httpRequestHeaders) {
|
public Builder setHttpRequestHeaders(Map<String, String> httpRequestHeaders) {
|
||||||
this.httpRequestHeaders = httpRequestHeaders;
|
this.httpRequestHeaders = httpRequestHeaders;
|
||||||
return this;
|
return this;
|
||||||
@ -157,6 +164,7 @@ public final class DataSpec {
|
|||||||
* @param position The {@link DataSpec#position}.
|
* @param position The {@link DataSpec#position}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPosition(long position) {
|
public Builder setPosition(long position) {
|
||||||
this.position = position;
|
this.position = position;
|
||||||
return this;
|
return this;
|
||||||
@ -168,6 +176,7 @@ public final class DataSpec {
|
|||||||
* @param length The {@link DataSpec#length}.
|
* @param length The {@link DataSpec#length}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setLength(long length) {
|
public Builder setLength(long length) {
|
||||||
this.length = length;
|
this.length = length;
|
||||||
return this;
|
return this;
|
||||||
@ -179,6 +188,7 @@ public final class DataSpec {
|
|||||||
* @param key The {@link DataSpec#key}.
|
* @param key The {@link DataSpec#key}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setKey(@Nullable String key) {
|
public Builder setKey(@Nullable String key) {
|
||||||
this.key = key;
|
this.key = key;
|
||||||
return this;
|
return this;
|
||||||
@ -190,6 +200,7 @@ public final class DataSpec {
|
|||||||
* @param flags The {@link DataSpec#flags}.
|
* @param flags The {@link DataSpec#flags}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setFlags(@Flags int flags) {
|
public Builder setFlags(@Flags int flags) {
|
||||||
this.flags = flags;
|
this.flags = flags;
|
||||||
return this;
|
return this;
|
||||||
@ -201,6 +212,7 @@ public final class DataSpec {
|
|||||||
* @param customData The {@link DataSpec#customData}.
|
* @param customData The {@link DataSpec#customData}.
|
||||||
* @return The builder.
|
* @return The builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setCustomData(@Nullable Object customData) {
|
public Builder setCustomData(@Nullable Object customData) {
|
||||||
this.customData = customData;
|
this.customData = customData;
|
||||||
return this;
|
return this;
|
||||||
|
@ -22,6 +22,7 @@ import androidx.annotation.Nullable;
|
|||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
import com.google.android.exoplayer2.util.Log;
|
import com.google.android.exoplayer2.util.Log;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -98,6 +99,7 @@ public final class DefaultDataSource implements DataSource {
|
|||||||
* @param transferListener The listener that will be used.
|
* @param transferListener The listener that will be used.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setTransferListener(@Nullable TransferListener transferListener) {
|
public Factory setTransferListener(@Nullable TransferListener transferListener) {
|
||||||
this.transferListener = transferListener;
|
this.transferListener = transferListener;
|
||||||
return this;
|
return this;
|
||||||
|
@ -33,6 +33,7 @@ import com.google.common.collect.ForwardingMap;
|
|||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import com.google.common.net.HttpHeaders;
|
import com.google.common.net.HttpHeaders;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InterruptedIOException;
|
import java.io.InterruptedIOException;
|
||||||
@ -81,6 +82,7 @@ public class DefaultHttpDataSource extends BaseDataSource implements HttpDataSou
|
|||||||
readTimeoutMs = DEFAULT_READ_TIMEOUT_MILLIS;
|
readTimeoutMs = DEFAULT_READ_TIMEOUT_MILLIS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public final Factory setDefaultRequestProperties(Map<String, String> defaultRequestProperties) {
|
public final Factory setDefaultRequestProperties(Map<String, String> defaultRequestProperties) {
|
||||||
this.defaultRequestProperties.clearAndSet(defaultRequestProperties);
|
this.defaultRequestProperties.clearAndSet(defaultRequestProperties);
|
||||||
@ -97,6 +99,7 @@ public class DefaultHttpDataSource extends BaseDataSource implements HttpDataSou
|
|||||||
* agent of the underlying platform.
|
* agent of the underlying platform.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setUserAgent(@Nullable String userAgent) {
|
public Factory setUserAgent(@Nullable String userAgent) {
|
||||||
this.userAgent = userAgent;
|
this.userAgent = userAgent;
|
||||||
return this;
|
return this;
|
||||||
@ -110,6 +113,7 @@ public class DefaultHttpDataSource extends BaseDataSource implements HttpDataSou
|
|||||||
* @param connectTimeoutMs The connect timeout, in milliseconds, that will be used.
|
* @param connectTimeoutMs The connect timeout, in milliseconds, that will be used.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setConnectTimeoutMs(int connectTimeoutMs) {
|
public Factory setConnectTimeoutMs(int connectTimeoutMs) {
|
||||||
this.connectTimeoutMs = connectTimeoutMs;
|
this.connectTimeoutMs = connectTimeoutMs;
|
||||||
return this;
|
return this;
|
||||||
@ -123,6 +127,7 @@ public class DefaultHttpDataSource extends BaseDataSource implements HttpDataSou
|
|||||||
* @param readTimeoutMs The connect timeout, in milliseconds, that will be used.
|
* @param readTimeoutMs The connect timeout, in milliseconds, that will be used.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setReadTimeoutMs(int readTimeoutMs) {
|
public Factory setReadTimeoutMs(int readTimeoutMs) {
|
||||||
this.readTimeoutMs = readTimeoutMs;
|
this.readTimeoutMs = readTimeoutMs;
|
||||||
return this;
|
return this;
|
||||||
@ -136,6 +141,7 @@ public class DefaultHttpDataSource extends BaseDataSource implements HttpDataSou
|
|||||||
* @param allowCrossProtocolRedirects Whether to allow cross protocol redirects.
|
* @param allowCrossProtocolRedirects Whether to allow cross protocol redirects.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setAllowCrossProtocolRedirects(boolean allowCrossProtocolRedirects) {
|
public Factory setAllowCrossProtocolRedirects(boolean allowCrossProtocolRedirects) {
|
||||||
this.allowCrossProtocolRedirects = allowCrossProtocolRedirects;
|
this.allowCrossProtocolRedirects = allowCrossProtocolRedirects;
|
||||||
return this;
|
return this;
|
||||||
@ -152,6 +158,7 @@ public class DefaultHttpDataSource extends BaseDataSource implements HttpDataSou
|
|||||||
* predicate that was previously set.
|
* predicate that was previously set.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setContentTypePredicate(@Nullable Predicate<String> contentTypePredicate) {
|
public Factory setContentTypePredicate(@Nullable Predicate<String> contentTypePredicate) {
|
||||||
this.contentTypePredicate = contentTypePredicate;
|
this.contentTypePredicate = contentTypePredicate;
|
||||||
return this;
|
return this;
|
||||||
@ -167,6 +174,7 @@ public class DefaultHttpDataSource extends BaseDataSource implements HttpDataSou
|
|||||||
* @param transferListener The listener that will be used.
|
* @param transferListener The listener that will be used.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setTransferListener(@Nullable TransferListener transferListener) {
|
public Factory setTransferListener(@Nullable TransferListener transferListener) {
|
||||||
this.transferListener = transferListener;
|
this.transferListener = transferListener;
|
||||||
return this;
|
return this;
|
||||||
@ -176,6 +184,7 @@ public class DefaultHttpDataSource extends BaseDataSource implements HttpDataSou
|
|||||||
* Sets whether we should keep the POST method and body when we have HTTP 302 redirects for a
|
* Sets whether we should keep the POST method and body when we have HTTP 302 redirects for a
|
||||||
* POST request.
|
* POST request.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setKeepPostFor302Redirects(boolean keepPostFor302Redirects) {
|
public Factory setKeepPostFor302Redirects(boolean keepPostFor302Redirects) {
|
||||||
this.keepPostFor302Redirects = keepPostFor302Redirects;
|
this.keepPostFor302Redirects = keepPostFor302Redirects;
|
||||||
return this;
|
return this;
|
||||||
|
@ -29,6 +29,7 @@ import com.google.android.exoplayer2.C;
|
|||||||
import com.google.android.exoplayer2.PlaybackException;
|
import com.google.android.exoplayer2.PlaybackException;
|
||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.RandomAccessFile;
|
import java.io.RandomAccessFile;
|
||||||
@ -80,6 +81,7 @@ public final class FileDataSource extends BaseDataSource {
|
|||||||
* @param listener The {@link TransferListener}.
|
* @param listener The {@link TransferListener}.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setListener(@Nullable TransferListener listener) {
|
public Factory setListener(@Nullable TransferListener listener) {
|
||||||
this.listener = listener;
|
this.listener = listener;
|
||||||
return this;
|
return this;
|
||||||
|
@ -24,6 +24,7 @@ import com.google.android.exoplayer2.PlaybackException;
|
|||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
import com.google.common.base.Ascii;
|
import com.google.common.base.Ascii;
|
||||||
import com.google.common.base.Predicate;
|
import com.google.common.base.Predicate;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InterruptedIOException;
|
import java.io.InterruptedIOException;
|
||||||
import java.lang.annotation.Documented;
|
import java.lang.annotation.Documented;
|
||||||
@ -152,6 +153,7 @@ public interface HttpDataSource extends DataSource {
|
|||||||
return createDataSourceInternal(defaultRequestProperties);
|
return createDataSourceInternal(defaultRequestProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public final Factory setDefaultRequestProperties(Map<String, String> defaultRequestProperties) {
|
public final Factory setDefaultRequestProperties(Map<String, String> defaultRequestProperties) {
|
||||||
this.defaultRequestProperties.clearAndSet(defaultRequestProperties);
|
this.defaultRequestProperties.clearAndSet(defaultRequestProperties);
|
||||||
|
@ -27,6 +27,7 @@ import com.google.android.exoplayer2.upstream.cache.Cache.CacheException;
|
|||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
import com.google.android.exoplayer2.util.Log;
|
import com.google.android.exoplayer2.util.Log;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -63,6 +64,7 @@ public final class CacheDataSink implements DataSink {
|
|||||||
* @param cache The cache to which data will be written.
|
* @param cache The cache to which data will be written.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setCache(Cache cache) {
|
public Factory setCache(Cache cache) {
|
||||||
this.cache = cache;
|
this.cache = cache;
|
||||||
return this;
|
return this;
|
||||||
@ -81,6 +83,7 @@ public final class CacheDataSink implements DataSink {
|
|||||||
* fragmentation.
|
* fragmentation.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setFragmentSize(long fragmentSize) {
|
public Factory setFragmentSize(long fragmentSize) {
|
||||||
this.fragmentSize = fragmentSize;
|
this.fragmentSize = fragmentSize;
|
||||||
return this;
|
return this;
|
||||||
@ -95,6 +98,7 @@ public final class CacheDataSink implements DataSink {
|
|||||||
* @param bufferSize The buffer size in bytes.
|
* @param bufferSize The buffer size in bytes.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setBufferSize(int bufferSize) {
|
public Factory setBufferSize(int bufferSize) {
|
||||||
this.bufferSize = bufferSize;
|
this.bufferSize = bufferSize;
|
||||||
return this;
|
return this;
|
||||||
|
@ -41,6 +41,7 @@ import com.google.android.exoplayer2.upstream.TransferListener;
|
|||||||
import com.google.android.exoplayer2.upstream.cache.Cache.CacheException;
|
import com.google.android.exoplayer2.upstream.cache.Cache.CacheException;
|
||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
import com.google.android.exoplayer2.util.PriorityTaskManager;
|
import com.google.android.exoplayer2.util.PriorityTaskManager;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InterruptedIOException;
|
import java.io.InterruptedIOException;
|
||||||
import java.lang.annotation.Documented;
|
import java.lang.annotation.Documented;
|
||||||
@ -86,6 +87,7 @@ public final class CacheDataSource implements DataSource {
|
|||||||
* @param cache The cache that will be used.
|
* @param cache The cache that will be used.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setCache(Cache cache) {
|
public Factory setCache(Cache cache) {
|
||||||
this.cache = cache;
|
this.cache = cache;
|
||||||
return this;
|
return this;
|
||||||
@ -109,6 +111,7 @@ public final class CacheDataSource implements DataSource {
|
|||||||
* @param cacheReadDataSourceFactory The {@link DataSource.Factory} for reading from the cache.
|
* @param cacheReadDataSourceFactory The {@link DataSource.Factory} for reading from the cache.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setCacheReadDataSourceFactory(DataSource.Factory cacheReadDataSourceFactory) {
|
public Factory setCacheReadDataSourceFactory(DataSource.Factory cacheReadDataSourceFactory) {
|
||||||
this.cacheReadDataSourceFactory = cacheReadDataSourceFactory;
|
this.cacheReadDataSourceFactory = cacheReadDataSourceFactory;
|
||||||
return this;
|
return this;
|
||||||
@ -124,6 +127,7 @@ public final class CacheDataSource implements DataSource {
|
|||||||
* DataSinks} for writing data to the cache, or {@code null} to disable writing.
|
* DataSinks} for writing data to the cache, or {@code null} to disable writing.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setCacheWriteDataSinkFactory(
|
public Factory setCacheWriteDataSinkFactory(
|
||||||
@Nullable DataSink.Factory cacheWriteDataSinkFactory) {
|
@Nullable DataSink.Factory cacheWriteDataSinkFactory) {
|
||||||
this.cacheWriteDataSinkFactory = cacheWriteDataSinkFactory;
|
this.cacheWriteDataSinkFactory = cacheWriteDataSinkFactory;
|
||||||
@ -139,6 +143,7 @@ public final class CacheDataSource implements DataSource {
|
|||||||
* @param cacheKeyFactory The {@link CacheKeyFactory}.
|
* @param cacheKeyFactory The {@link CacheKeyFactory}.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setCacheKeyFactory(CacheKeyFactory cacheKeyFactory) {
|
public Factory setCacheKeyFactory(CacheKeyFactory cacheKeyFactory) {
|
||||||
this.cacheKeyFactory = cacheKeyFactory;
|
this.cacheKeyFactory = cacheKeyFactory;
|
||||||
return this;
|
return this;
|
||||||
@ -160,6 +165,7 @@ public final class CacheDataSource implements DataSource {
|
|||||||
* cache, or {@code null} to cause failure in the case of a cache miss.
|
* cache, or {@code null} to cause failure in the case of a cache miss.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setUpstreamDataSourceFactory(
|
public Factory setUpstreamDataSourceFactory(
|
||||||
@Nullable DataSource.Factory upstreamDataSourceFactory) {
|
@Nullable DataSource.Factory upstreamDataSourceFactory) {
|
||||||
this.upstreamDataSourceFactory = upstreamDataSourceFactory;
|
this.upstreamDataSourceFactory = upstreamDataSourceFactory;
|
||||||
@ -184,6 +190,7 @@ public final class CacheDataSource implements DataSource {
|
|||||||
* @param upstreamPriorityTaskManager The upstream {@link PriorityTaskManager}.
|
* @param upstreamPriorityTaskManager The upstream {@link PriorityTaskManager}.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setUpstreamPriorityTaskManager(
|
public Factory setUpstreamPriorityTaskManager(
|
||||||
@Nullable PriorityTaskManager upstreamPriorityTaskManager) {
|
@Nullable PriorityTaskManager upstreamPriorityTaskManager) {
|
||||||
this.upstreamPriorityTaskManager = upstreamPriorityTaskManager;
|
this.upstreamPriorityTaskManager = upstreamPriorityTaskManager;
|
||||||
@ -208,6 +215,7 @@ public final class CacheDataSource implements DataSource {
|
|||||||
* @param upstreamPriority The priority to use when requesting data from upstream.
|
* @param upstreamPriority The priority to use when requesting data from upstream.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setUpstreamPriority(int upstreamPriority) {
|
public Factory setUpstreamPriority(int upstreamPriority) {
|
||||||
this.upstreamPriority = upstreamPriority;
|
this.upstreamPriority = upstreamPriority;
|
||||||
return this;
|
return this;
|
||||||
@ -221,6 +229,7 @@ public final class CacheDataSource implements DataSource {
|
|||||||
* @param flags The {@link CacheDataSource.Flags}.
|
* @param flags The {@link CacheDataSource.Flags}.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setFlags(@CacheDataSource.Flags int flags) {
|
public Factory setFlags(@CacheDataSource.Flags int flags) {
|
||||||
this.flags = flags;
|
this.flags = flags;
|
||||||
return this;
|
return this;
|
||||||
@ -234,6 +243,7 @@ public final class CacheDataSource implements DataSource {
|
|||||||
* @param eventListener The {@link EventListener}.
|
* @param eventListener The {@link EventListener}.
|
||||||
* @return This factory.
|
* @return This factory.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setEventListener(@Nullable EventListener eventListener) {
|
public Factory setEventListener(@Nullable EventListener eventListener) {
|
||||||
this.eventListener = eventListener;
|
this.eventListener = eventListener;
|
||||||
return this;
|
return this;
|
||||||
|
@ -19,6 +19,7 @@ import android.net.Uri;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import com.google.android.exoplayer2.C;
|
import com.google.android.exoplayer2.C;
|
||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -79,6 +80,7 @@ public class ContentMetadataMutations {
|
|||||||
* @param value The value to be set.
|
* @param value The value to be set.
|
||||||
* @return This instance, for convenience.
|
* @return This instance, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ContentMetadataMutations set(String name, String value) {
|
public ContentMetadataMutations set(String name, String value) {
|
||||||
return checkAndSet(name, value);
|
return checkAndSet(name, value);
|
||||||
}
|
}
|
||||||
@ -90,6 +92,7 @@ public class ContentMetadataMutations {
|
|||||||
* @param value The value to be set.
|
* @param value The value to be set.
|
||||||
* @return This instance, for convenience.
|
* @return This instance, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ContentMetadataMutations set(String name, long value) {
|
public ContentMetadataMutations set(String name, long value) {
|
||||||
return checkAndSet(name, value);
|
return checkAndSet(name, value);
|
||||||
}
|
}
|
||||||
@ -101,6 +104,7 @@ public class ContentMetadataMutations {
|
|||||||
* @param value The value to be set.
|
* @param value The value to be set.
|
||||||
* @return This instance, for convenience.
|
* @return This instance, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ContentMetadataMutations set(String name, byte[] value) {
|
public ContentMetadataMutations set(String name, byte[] value) {
|
||||||
return checkAndSet(name, Arrays.copyOf(value, value.length));
|
return checkAndSet(name, Arrays.copyOf(value, value.length));
|
||||||
}
|
}
|
||||||
@ -111,6 +115,7 @@ public class ContentMetadataMutations {
|
|||||||
* @param name The name of the metadata value.
|
* @param name The name of the metadata value.
|
||||||
* @return This instance, for convenience.
|
* @return This instance, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ContentMetadataMutations remove(String name) {
|
public ContentMetadataMutations remove(String name) {
|
||||||
removedValues.add(name);
|
removedValues.add(name);
|
||||||
editedValues.remove(name);
|
editedValues.remove(name);
|
||||||
@ -135,6 +140,7 @@ public class ContentMetadataMutations {
|
|||||||
return Collections.unmodifiableMap(hashMap);
|
return Collections.unmodifiableMap(hashMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
private ContentMetadataMutations checkAndSet(String name, Object value) {
|
private ContentMetadataMutations checkAndSet(String name, Object value) {
|
||||||
editedValues.put(Assertions.checkNotNull(name), Assertions.checkNotNull(value));
|
editedValues.put(Assertions.checkNotNull(name), Assertions.checkNotNull(value));
|
||||||
removedValues.remove(name);
|
removedValues.remove(name);
|
||||||
|
@ -28,6 +28,7 @@ dependencies {
|
|||||||
implementation project(modulePrefix + 'library-common')
|
implementation project(modulePrefix + 'library-common')
|
||||||
// TODO(b/203752187): Remove this dependency.
|
// TODO(b/203752187): Remove this dependency.
|
||||||
implementation project(modulePrefix + 'library-decoder')
|
implementation project(modulePrefix + 'library-decoder')
|
||||||
|
compileOnly 'com.google.errorprone:error_prone_annotations:' + errorProneVersion
|
||||||
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
|
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
|
||||||
compileOnly 'org.checkerframework:checker-compat-qual:' + checkerframeworkCompatVersion
|
compileOnly 'org.checkerframework:checker-compat-qual:' + checkerframeworkCompatVersion
|
||||||
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
|
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
|
||||||
|
@ -43,6 +43,7 @@ import com.google.android.exoplayer2.extractor.ts.TsPayloadReader;
|
|||||||
import com.google.android.exoplayer2.extractor.wav.WavExtractor;
|
import com.google.android.exoplayer2.extractor.wav.WavExtractor;
|
||||||
import com.google.android.exoplayer2.util.FileTypes;
|
import com.google.android.exoplayer2.util.FileTypes;
|
||||||
import com.google.android.exoplayer2.util.TimestampAdjuster;
|
import com.google.android.exoplayer2.util.TimestampAdjuster;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -143,6 +144,7 @@ public final class DefaultExtractorsFactory implements ExtractorsFactory {
|
|||||||
* assumption should be enabled for all extractors that support it.
|
* assumption should be enabled for all extractors that support it.
|
||||||
* @return The factory, for convenience.
|
* @return The factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public synchronized DefaultExtractorsFactory setConstantBitrateSeekingEnabled(
|
public synchronized DefaultExtractorsFactory setConstantBitrateSeekingEnabled(
|
||||||
boolean constantBitrateSeekingEnabled) {
|
boolean constantBitrateSeekingEnabled) {
|
||||||
this.constantBitrateSeekingEnabled = constantBitrateSeekingEnabled;
|
this.constantBitrateSeekingEnabled = constantBitrateSeekingEnabled;
|
||||||
@ -167,6 +169,7 @@ public final class DefaultExtractorsFactory implements ExtractorsFactory {
|
|||||||
* duration is unknown.
|
* duration is unknown.
|
||||||
* @return The factory, for convenience.
|
* @return The factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public synchronized DefaultExtractorsFactory setConstantBitrateSeekingAlwaysEnabled(
|
public synchronized DefaultExtractorsFactory setConstantBitrateSeekingAlwaysEnabled(
|
||||||
boolean constantBitrateSeekingAlwaysEnabled) {
|
boolean constantBitrateSeekingAlwaysEnabled) {
|
||||||
this.constantBitrateSeekingAlwaysEnabled = constantBitrateSeekingAlwaysEnabled;
|
this.constantBitrateSeekingAlwaysEnabled = constantBitrateSeekingAlwaysEnabled;
|
||||||
@ -180,6 +183,7 @@ public final class DefaultExtractorsFactory implements ExtractorsFactory {
|
|||||||
* @param flags The flags to use.
|
* @param flags The flags to use.
|
||||||
* @return The factory, for convenience.
|
* @return The factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public synchronized DefaultExtractorsFactory setAdtsExtractorFlags(
|
public synchronized DefaultExtractorsFactory setAdtsExtractorFlags(
|
||||||
@AdtsExtractor.Flags int flags) {
|
@AdtsExtractor.Flags int flags) {
|
||||||
this.adtsFlags = flags;
|
this.adtsFlags = flags;
|
||||||
@ -193,6 +197,7 @@ public final class DefaultExtractorsFactory implements ExtractorsFactory {
|
|||||||
* @param flags The flags to use.
|
* @param flags The flags to use.
|
||||||
* @return The factory, for convenience.
|
* @return The factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public synchronized DefaultExtractorsFactory setAmrExtractorFlags(@AmrExtractor.Flags int flags) {
|
public synchronized DefaultExtractorsFactory setAmrExtractorFlags(@AmrExtractor.Flags int flags) {
|
||||||
this.amrFlags = flags;
|
this.amrFlags = flags;
|
||||||
return this;
|
return this;
|
||||||
@ -207,6 +212,7 @@ public final class DefaultExtractorsFactory implements ExtractorsFactory {
|
|||||||
* @param flags The flags to use.
|
* @param flags The flags to use.
|
||||||
* @return The factory, for convenience.
|
* @return The factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public synchronized DefaultExtractorsFactory setFlacExtractorFlags(
|
public synchronized DefaultExtractorsFactory setFlacExtractorFlags(
|
||||||
@FlacExtractor.Flags int flags) {
|
@FlacExtractor.Flags int flags) {
|
||||||
this.flacFlags = flags;
|
this.flacFlags = flags;
|
||||||
@ -220,6 +226,7 @@ public final class DefaultExtractorsFactory implements ExtractorsFactory {
|
|||||||
* @param flags The flags to use.
|
* @param flags The flags to use.
|
||||||
* @return The factory, for convenience.
|
* @return The factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public synchronized DefaultExtractorsFactory setMatroskaExtractorFlags(
|
public synchronized DefaultExtractorsFactory setMatroskaExtractorFlags(
|
||||||
@MatroskaExtractor.Flags int flags) {
|
@MatroskaExtractor.Flags int flags) {
|
||||||
this.matroskaFlags = flags;
|
this.matroskaFlags = flags;
|
||||||
@ -233,6 +240,7 @@ public final class DefaultExtractorsFactory implements ExtractorsFactory {
|
|||||||
* @param flags The flags to use.
|
* @param flags The flags to use.
|
||||||
* @return The factory, for convenience.
|
* @return The factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public synchronized DefaultExtractorsFactory setMp4ExtractorFlags(@Mp4Extractor.Flags int flags) {
|
public synchronized DefaultExtractorsFactory setMp4ExtractorFlags(@Mp4Extractor.Flags int flags) {
|
||||||
this.mp4Flags = flags;
|
this.mp4Flags = flags;
|
||||||
return this;
|
return this;
|
||||||
@ -245,6 +253,7 @@ public final class DefaultExtractorsFactory implements ExtractorsFactory {
|
|||||||
* @param flags The flags to use.
|
* @param flags The flags to use.
|
||||||
* @return The factory, for convenience.
|
* @return The factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public synchronized DefaultExtractorsFactory setFragmentedMp4ExtractorFlags(
|
public synchronized DefaultExtractorsFactory setFragmentedMp4ExtractorFlags(
|
||||||
@FragmentedMp4Extractor.Flags int flags) {
|
@FragmentedMp4Extractor.Flags int flags) {
|
||||||
this.fragmentedMp4Flags = flags;
|
this.fragmentedMp4Flags = flags;
|
||||||
@ -258,6 +267,7 @@ public final class DefaultExtractorsFactory implements ExtractorsFactory {
|
|||||||
* @param flags The flags to use.
|
* @param flags The flags to use.
|
||||||
* @return The factory, for convenience.
|
* @return The factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public synchronized DefaultExtractorsFactory setMp3ExtractorFlags(@Mp3Extractor.Flags int flags) {
|
public synchronized DefaultExtractorsFactory setMp3ExtractorFlags(@Mp3Extractor.Flags int flags) {
|
||||||
mp3Flags = flags;
|
mp3Flags = flags;
|
||||||
return this;
|
return this;
|
||||||
@ -270,6 +280,7 @@ public final class DefaultExtractorsFactory implements ExtractorsFactory {
|
|||||||
* @param mode The mode to use.
|
* @param mode The mode to use.
|
||||||
* @return The factory, for convenience.
|
* @return The factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public synchronized DefaultExtractorsFactory setTsExtractorMode(@TsExtractor.Mode int mode) {
|
public synchronized DefaultExtractorsFactory setTsExtractorMode(@TsExtractor.Mode int mode) {
|
||||||
tsMode = mode;
|
tsMode = mode;
|
||||||
return this;
|
return this;
|
||||||
@ -283,6 +294,7 @@ public final class DefaultExtractorsFactory implements ExtractorsFactory {
|
|||||||
* @param flags The flags to use.
|
* @param flags The flags to use.
|
||||||
* @return The factory, for convenience.
|
* @return The factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public synchronized DefaultExtractorsFactory setTsExtractorFlags(
|
public synchronized DefaultExtractorsFactory setTsExtractorFlags(
|
||||||
@DefaultTsPayloadReaderFactory.Flags int flags) {
|
@DefaultTsPayloadReaderFactory.Flags int flags) {
|
||||||
tsFlags = flags;
|
tsFlags = flags;
|
||||||
@ -297,6 +309,7 @@ public final class DefaultExtractorsFactory implements ExtractorsFactory {
|
|||||||
* @param timestampSearchBytes The number of search bytes to use.
|
* @param timestampSearchBytes The number of search bytes to use.
|
||||||
* @return The factory, for convenience.
|
* @return The factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public synchronized DefaultExtractorsFactory setTsExtractorTimestampSearchBytes(
|
public synchronized DefaultExtractorsFactory setTsExtractorTimestampSearchBytes(
|
||||||
int timestampSearchBytes) {
|
int timestampSearchBytes) {
|
||||||
tsTimestampSearchBytes = timestampSearchBytes;
|
tsTimestampSearchBytes = timestampSearchBytes;
|
||||||
|
@ -22,6 +22,7 @@ import android.text.Layout;
|
|||||||
import androidx.annotation.IntDef;
|
import androidx.annotation.IntDef;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import com.google.android.exoplayer2.text.span.TextAnnotation;
|
import com.google.android.exoplayer2.text.span.TextAnnotation;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
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;
|
||||||
@ -125,6 +126,7 @@ import java.lang.annotation.Target;
|
|||||||
return linethrough == ON;
|
return linethrough == ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TtmlStyle setLinethrough(boolean linethrough) {
|
public TtmlStyle setLinethrough(boolean linethrough) {
|
||||||
this.linethrough = linethrough ? ON : OFF;
|
this.linethrough = linethrough ? ON : OFF;
|
||||||
return this;
|
return this;
|
||||||
@ -134,16 +136,19 @@ import java.lang.annotation.Target;
|
|||||||
return underline == ON;
|
return underline == ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TtmlStyle setUnderline(boolean underline) {
|
public TtmlStyle setUnderline(boolean underline) {
|
||||||
this.underline = underline ? ON : OFF;
|
this.underline = underline ? ON : OFF;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TtmlStyle setBold(boolean bold) {
|
public TtmlStyle setBold(boolean bold) {
|
||||||
this.bold = bold ? ON : OFF;
|
this.bold = bold ? ON : OFF;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TtmlStyle setItalic(boolean italic) {
|
public TtmlStyle setItalic(boolean italic) {
|
||||||
this.italic = italic ? ON : OFF;
|
this.italic = italic ? ON : OFF;
|
||||||
return this;
|
return this;
|
||||||
@ -154,6 +159,7 @@ import java.lang.annotation.Target;
|
|||||||
return fontFamily;
|
return fontFamily;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TtmlStyle setFontFamily(@Nullable String fontFamily) {
|
public TtmlStyle setFontFamily(@Nullable String fontFamily) {
|
||||||
this.fontFamily = fontFamily;
|
this.fontFamily = fontFamily;
|
||||||
return this;
|
return this;
|
||||||
@ -166,6 +172,7 @@ import java.lang.annotation.Target;
|
|||||||
return fontColor;
|
return fontColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TtmlStyle setFontColor(int fontColor) {
|
public TtmlStyle setFontColor(int fontColor) {
|
||||||
this.fontColor = fontColor;
|
this.fontColor = fontColor;
|
||||||
hasFontColor = true;
|
hasFontColor = true;
|
||||||
@ -183,6 +190,7 @@ import java.lang.annotation.Target;
|
|||||||
return backgroundColor;
|
return backgroundColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TtmlStyle setBackgroundColor(int backgroundColor) {
|
public TtmlStyle setBackgroundColor(int backgroundColor) {
|
||||||
this.backgroundColor = backgroundColor;
|
this.backgroundColor = backgroundColor;
|
||||||
hasBackgroundColor = true;
|
hasBackgroundColor = true;
|
||||||
@ -193,6 +201,7 @@ import java.lang.annotation.Target;
|
|||||||
return hasBackgroundColor;
|
return hasBackgroundColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TtmlStyle setShearPercentage(float shearPercentage) {
|
public TtmlStyle setShearPercentage(float shearPercentage) {
|
||||||
this.shearPercentage = shearPercentage;
|
this.shearPercentage = shearPercentage;
|
||||||
return this;
|
return this;
|
||||||
@ -208,6 +217,7 @@ import java.lang.annotation.Target;
|
|||||||
*
|
*
|
||||||
* @param ancestor the referential style to inherit from
|
* @param ancestor the referential style to inherit from
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TtmlStyle chain(@Nullable TtmlStyle ancestor) {
|
public TtmlStyle chain(@Nullable TtmlStyle ancestor) {
|
||||||
return inherit(ancestor, true);
|
return inherit(ancestor, true);
|
||||||
}
|
}
|
||||||
@ -219,10 +229,12 @@ import java.lang.annotation.Target;
|
|||||||
*
|
*
|
||||||
* @param ancestor the ancestor style to inherit from
|
* @param ancestor the ancestor style to inherit from
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TtmlStyle inherit(@Nullable TtmlStyle ancestor) {
|
public TtmlStyle inherit(@Nullable TtmlStyle ancestor) {
|
||||||
return inherit(ancestor, false);
|
return inherit(ancestor, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
private TtmlStyle inherit(@Nullable TtmlStyle ancestor, boolean chaining) {
|
private TtmlStyle inherit(@Nullable TtmlStyle ancestor, boolean chaining) {
|
||||||
if (ancestor != null) {
|
if (ancestor != null) {
|
||||||
if (!hasFontColor && ancestor.hasFontColor) {
|
if (!hasFontColor && ancestor.hasFontColor) {
|
||||||
@ -276,6 +288,7 @@ import java.lang.annotation.Target;
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TtmlStyle setId(@Nullable String id) {
|
public TtmlStyle setId(@Nullable String id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
@ -286,6 +299,7 @@ import java.lang.annotation.Target;
|
|||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TtmlStyle setRubyType(@RubyType int rubyType) {
|
public TtmlStyle setRubyType(@RubyType int rubyType) {
|
||||||
this.rubyType = rubyType;
|
this.rubyType = rubyType;
|
||||||
return this;
|
return this;
|
||||||
@ -295,6 +309,7 @@ import java.lang.annotation.Target;
|
|||||||
return rubyType;
|
return rubyType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TtmlStyle setRubyPosition(@TextAnnotation.Position int position) {
|
public TtmlStyle setRubyPosition(@TextAnnotation.Position int position) {
|
||||||
this.rubyPosition = position;
|
this.rubyPosition = position;
|
||||||
return this;
|
return this;
|
||||||
@ -309,6 +324,7 @@ import java.lang.annotation.Target;
|
|||||||
return textAlign;
|
return textAlign;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TtmlStyle setTextAlign(@Nullable Layout.Alignment textAlign) {
|
public TtmlStyle setTextAlign(@Nullable Layout.Alignment textAlign) {
|
||||||
this.textAlign = textAlign;
|
this.textAlign = textAlign;
|
||||||
return this;
|
return this;
|
||||||
@ -319,6 +335,7 @@ import java.lang.annotation.Target;
|
|||||||
return multiRowAlign;
|
return multiRowAlign;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TtmlStyle setMultiRowAlign(@Nullable Layout.Alignment multiRowAlign) {
|
public TtmlStyle setMultiRowAlign(@Nullable Layout.Alignment multiRowAlign) {
|
||||||
this.multiRowAlign = multiRowAlign;
|
this.multiRowAlign = multiRowAlign;
|
||||||
return this;
|
return this;
|
||||||
@ -329,6 +346,7 @@ import java.lang.annotation.Target;
|
|||||||
return textCombine == ON;
|
return textCombine == ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TtmlStyle setTextCombine(boolean combine) {
|
public TtmlStyle setTextCombine(boolean combine) {
|
||||||
this.textCombine = combine ? ON : OFF;
|
this.textCombine = combine ? ON : OFF;
|
||||||
return this;
|
return this;
|
||||||
@ -339,16 +357,19 @@ import java.lang.annotation.Target;
|
|||||||
return textEmphasis;
|
return textEmphasis;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TtmlStyle setTextEmphasis(@Nullable TextEmphasis textEmphasis) {
|
public TtmlStyle setTextEmphasis(@Nullable TextEmphasis textEmphasis) {
|
||||||
this.textEmphasis = textEmphasis;
|
this.textEmphasis = textEmphasis;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TtmlStyle setFontSize(float fontSize) {
|
public TtmlStyle setFontSize(float fontSize) {
|
||||||
this.fontSize = fontSize;
|
this.fontSize = fontSize;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TtmlStyle setFontSizeUnit(int fontSizeUnit) {
|
public TtmlStyle setFontSizeUnit(int fontSizeUnit) {
|
||||||
this.fontSizeUnit = fontSizeUnit;
|
this.fontSizeUnit = fontSizeUnit;
|
||||||
return this;
|
return this;
|
||||||
|
@ -24,6 +24,7 @@ import androidx.annotation.IntDef;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import com.google.android.exoplayer2.text.span.TextAnnotation;
|
import com.google.android.exoplayer2.text.span.TextAnnotation;
|
||||||
import com.google.common.base.Ascii;
|
import com.google.common.base.Ascii;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
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;
|
||||||
@ -195,6 +196,7 @@ public final class WebvttCssStyle {
|
|||||||
return linethrough == ON;
|
return linethrough == ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public WebvttCssStyle setLinethrough(boolean linethrough) {
|
public WebvttCssStyle setLinethrough(boolean linethrough) {
|
||||||
this.linethrough = linethrough ? ON : OFF;
|
this.linethrough = linethrough ? ON : OFF;
|
||||||
return this;
|
return this;
|
||||||
@ -204,16 +206,19 @@ public final class WebvttCssStyle {
|
|||||||
return underline == ON;
|
return underline == ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public WebvttCssStyle setUnderline(boolean underline) {
|
public WebvttCssStyle setUnderline(boolean underline) {
|
||||||
this.underline = underline ? ON : OFF;
|
this.underline = underline ? ON : OFF;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public WebvttCssStyle setBold(boolean bold) {
|
public WebvttCssStyle setBold(boolean bold) {
|
||||||
this.bold = bold ? ON : OFF;
|
this.bold = bold ? ON : OFF;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public WebvttCssStyle setItalic(boolean italic) {
|
public WebvttCssStyle setItalic(boolean italic) {
|
||||||
this.italic = italic ? ON : OFF;
|
this.italic = italic ? ON : OFF;
|
||||||
return this;
|
return this;
|
||||||
@ -224,6 +229,7 @@ public final class WebvttCssStyle {
|
|||||||
return fontFamily;
|
return fontFamily;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public WebvttCssStyle setFontFamily(@Nullable String fontFamily) {
|
public WebvttCssStyle setFontFamily(@Nullable String fontFamily) {
|
||||||
this.fontFamily = fontFamily == null ? null : Ascii.toLowerCase(fontFamily);
|
this.fontFamily = fontFamily == null ? null : Ascii.toLowerCase(fontFamily);
|
||||||
return this;
|
return this;
|
||||||
@ -236,6 +242,7 @@ public final class WebvttCssStyle {
|
|||||||
return fontColor;
|
return fontColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public WebvttCssStyle setFontColor(int color) {
|
public WebvttCssStyle setFontColor(int color) {
|
||||||
this.fontColor = color;
|
this.fontColor = color;
|
||||||
hasFontColor = true;
|
hasFontColor = true;
|
||||||
@ -253,6 +260,7 @@ public final class WebvttCssStyle {
|
|||||||
return backgroundColor;
|
return backgroundColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public WebvttCssStyle setBackgroundColor(int backgroundColor) {
|
public WebvttCssStyle setBackgroundColor(int backgroundColor) {
|
||||||
this.backgroundColor = backgroundColor;
|
this.backgroundColor = backgroundColor;
|
||||||
hasBackgroundColor = true;
|
hasBackgroundColor = true;
|
||||||
@ -263,11 +271,13 @@ public final class WebvttCssStyle {
|
|||||||
return hasBackgroundColor;
|
return hasBackgroundColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public WebvttCssStyle setFontSize(float fontSize) {
|
public WebvttCssStyle setFontSize(float fontSize) {
|
||||||
this.fontSize = fontSize;
|
this.fontSize = fontSize;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public WebvttCssStyle setFontSizeUnit(@FontSizeUnit int unit) {
|
public WebvttCssStyle setFontSizeUnit(@FontSizeUnit int unit) {
|
||||||
this.fontSizeUnit = unit;
|
this.fontSizeUnit = unit;
|
||||||
return this;
|
return this;
|
||||||
@ -281,6 +291,7 @@ public final class WebvttCssStyle {
|
|||||||
return fontSize;
|
return fontSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public WebvttCssStyle setRubyPosition(@TextAnnotation.Position int rubyPosition) {
|
public WebvttCssStyle setRubyPosition(@TextAnnotation.Position int rubyPosition) {
|
||||||
this.rubyPosition = rubyPosition;
|
this.rubyPosition = rubyPosition;
|
||||||
return this;
|
return this;
|
||||||
@ -290,6 +301,7 @@ public final class WebvttCssStyle {
|
|||||||
return rubyPosition;
|
return rubyPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public WebvttCssStyle setCombineUpright(boolean enabled) {
|
public WebvttCssStyle setCombineUpright(boolean enabled) {
|
||||||
this.combineUpright = enabled;
|
this.combineUpright = enabled;
|
||||||
return this;
|
return this;
|
||||||
|
@ -25,6 +25,7 @@ android {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion
|
implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion
|
||||||
|
compileOnly 'com.google.errorprone:error_prone_annotations:' + errorProneVersion
|
||||||
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
|
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
|
||||||
compileOnly 'org.checkerframework:checker-compat-qual:' + checkerframeworkCompatVersion
|
compileOnly 'org.checkerframework:checker-compat-qual:' + checkerframeworkCompatVersion
|
||||||
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
|
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
|
||||||
|
@ -55,6 +55,7 @@ import com.google.android.exoplayer2.upstream.DefaultLoadErrorHandlingPolicy;
|
|||||||
import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy;
|
import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy;
|
||||||
import com.google.android.exoplayer2.upstream.TransferListener;
|
import com.google.android.exoplayer2.upstream.TransferListener;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
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;
|
||||||
@ -169,12 +170,14 @@ public final class HlsMediaSource extends BaseMediaSource
|
|||||||
* segments.
|
* segments.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setExtractorFactory(@Nullable HlsExtractorFactory extractorFactory) {
|
public Factory setExtractorFactory(@Nullable HlsExtractorFactory extractorFactory) {
|
||||||
this.extractorFactory =
|
this.extractorFactory =
|
||||||
extractorFactory != null ? extractorFactory : HlsExtractorFactory.DEFAULT;
|
extractorFactory != null ? extractorFactory : HlsExtractorFactory.DEFAULT;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy) {
|
public Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy) {
|
||||||
this.loadErrorHandlingPolicy =
|
this.loadErrorHandlingPolicy =
|
||||||
@ -192,6 +195,7 @@ public final class HlsMediaSource extends BaseMediaSource
|
|||||||
* @param playlistParserFactory An {@link HlsPlaylistParserFactory}.
|
* @param playlistParserFactory An {@link HlsPlaylistParserFactory}.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setPlaylistParserFactory(HlsPlaylistParserFactory playlistParserFactory) {
|
public Factory setPlaylistParserFactory(HlsPlaylistParserFactory playlistParserFactory) {
|
||||||
this.playlistParserFactory =
|
this.playlistParserFactory =
|
||||||
checkNotNull(
|
checkNotNull(
|
||||||
@ -208,6 +212,7 @@ public final class HlsMediaSource extends BaseMediaSource
|
|||||||
* @param playlistTrackerFactory A factory for {@link HlsPlaylistTracker} instances.
|
* @param playlistTrackerFactory A factory for {@link HlsPlaylistTracker} instances.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setPlaylistTrackerFactory(HlsPlaylistTracker.Factory playlistTrackerFactory) {
|
public Factory setPlaylistTrackerFactory(HlsPlaylistTracker.Factory playlistTrackerFactory) {
|
||||||
this.playlistTrackerFactory =
|
this.playlistTrackerFactory =
|
||||||
checkNotNull(
|
checkNotNull(
|
||||||
@ -227,6 +232,7 @@ public final class HlsMediaSource extends BaseMediaSource
|
|||||||
* audio etc...).
|
* audio etc...).
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setCompositeSequenceableLoaderFactory(
|
public Factory setCompositeSequenceableLoaderFactory(
|
||||||
CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory) {
|
CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory) {
|
||||||
this.compositeSequenceableLoaderFactory =
|
this.compositeSequenceableLoaderFactory =
|
||||||
@ -246,6 +252,7 @@ public final class HlsMediaSource extends BaseMediaSource
|
|||||||
* @param allowChunklessPreparation Whether chunkless preparation is allowed.
|
* @param allowChunklessPreparation Whether chunkless preparation is allowed.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setAllowChunklessPreparation(boolean allowChunklessPreparation) {
|
public Factory setAllowChunklessPreparation(boolean allowChunklessPreparation) {
|
||||||
this.allowChunklessPreparation = allowChunklessPreparation;
|
this.allowChunklessPreparation = allowChunklessPreparation;
|
||||||
return this;
|
return this;
|
||||||
@ -270,6 +277,7 @@ public final class HlsMediaSource extends BaseMediaSource
|
|||||||
* @param metadataType The type of metadata to extract.
|
* @param metadataType The type of metadata to extract.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setMetadataType(@MetadataType int metadataType) {
|
public Factory setMetadataType(@MetadataType int metadataType) {
|
||||||
this.metadataType = metadataType;
|
this.metadataType = metadataType;
|
||||||
return this;
|
return this;
|
||||||
@ -284,11 +292,13 @@ public final class HlsMediaSource extends BaseMediaSource
|
|||||||
* @param useSessionKeys Whether to use #EXT-X-SESSION-KEY tags.
|
* @param useSessionKeys Whether to use #EXT-X-SESSION-KEY tags.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setUseSessionKeys(boolean useSessionKeys) {
|
public Factory setUseSessionKeys(boolean useSessionKeys) {
|
||||||
this.useSessionKeys = useSessionKeys;
|
this.useSessionKeys = useSessionKeys;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Factory setDrmSessionManagerProvider(
|
public Factory setDrmSessionManagerProvider(
|
||||||
DrmSessionManagerProvider drmSessionManagerProvider) {
|
DrmSessionManagerProvider drmSessionManagerProvider) {
|
||||||
@ -309,6 +319,7 @@ public final class HlsMediaSource extends BaseMediaSource
|
|||||||
* the time since the Unix epoch, in milliseconds.
|
* the time since the Unix epoch, in milliseconds.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
/* package */ Factory setElapsedRealTimeOffsetMs(long elapsedRealTimeOffsetMs) {
|
/* package */ Factory setElapsedRealTimeOffsetMs(long elapsedRealTimeOffsetMs) {
|
||||||
this.elapsedRealTimeOffsetMs = elapsedRealTimeOffsetMs;
|
this.elapsedRealTimeOffsetMs = elapsedRealTimeOffsetMs;
|
||||||
|
@ -25,6 +25,7 @@ android {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion
|
implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion
|
||||||
|
compileOnly 'com.google.errorprone:error_prone_annotations:' + errorProneVersion
|
||||||
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
|
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
|
||||||
compileOnly 'org.checkerframework:checker-compat-qual:' + checkerframeworkCompatVersion
|
compileOnly 'org.checkerframework:checker-compat-qual:' + checkerframeworkCompatVersion
|
||||||
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
|
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
|
||||||
|
@ -29,6 +29,7 @@ import com.google.android.exoplayer2.Format;
|
|||||||
import com.google.android.exoplayer2.ParserException;
|
import com.google.android.exoplayer2.ParserException;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
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;
|
||||||
@ -147,6 +148,7 @@ import java.util.HashMap;
|
|||||||
* @param mediaTitle The assigned media title.
|
* @param mediaTitle The assigned media title.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMediaTitle(String mediaTitle) {
|
public Builder setMediaTitle(String mediaTitle) {
|
||||||
this.mediaTitle = mediaTitle;
|
this.mediaTitle = mediaTitle;
|
||||||
return this;
|
return this;
|
||||||
@ -158,6 +160,7 @@ import java.util.HashMap;
|
|||||||
* @param connection The connection parameter.
|
* @param connection The connection parameter.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setConnection(String connection) {
|
public Builder setConnection(String connection) {
|
||||||
this.connection = connection;
|
this.connection = connection;
|
||||||
return this;
|
return this;
|
||||||
@ -169,6 +172,7 @@ import java.util.HashMap;
|
|||||||
* @param bitrate The estimated bitrate measured in bits per second.
|
* @param bitrate The estimated bitrate measured in bits per second.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setBitrate(int bitrate) {
|
public Builder setBitrate(int bitrate) {
|
||||||
this.bitrate = bitrate;
|
this.bitrate = bitrate;
|
||||||
return this;
|
return this;
|
||||||
@ -180,6 +184,7 @@ import java.util.HashMap;
|
|||||||
* @param key The encryption parameter.
|
* @param key The encryption parameter.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setKey(String key) {
|
public Builder setKey(String key) {
|
||||||
this.key = key;
|
this.key = key;
|
||||||
return this;
|
return this;
|
||||||
@ -194,6 +199,7 @@ import java.util.HashMap;
|
|||||||
* @param attributeValue The value of the attribute, or "" if the attribute bears no value.
|
* @param attributeValue The value of the attribute, or "" if the attribute bears no value.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder addAttribute(String attributeName, String attributeValue) {
|
public Builder addAttribute(String attributeName, String attributeValue) {
|
||||||
attributes.put(attributeName, attributeValue);
|
attributes.put(attributeName, attributeValue);
|
||||||
return this;
|
return this;
|
||||||
|
@ -24,6 +24,7 @@ import com.google.android.exoplayer2.C;
|
|||||||
import com.google.android.exoplayer2.util.ParsableByteArray;
|
import com.google.android.exoplayer2.util.ParsableByteArray;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
import com.google.common.math.IntMath;
|
import com.google.common.math.IntMath;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -69,24 +70,28 @@ public final class RtpPacket {
|
|||||||
private byte[] payloadData = EMPTY;
|
private byte[] payloadData = EMPTY;
|
||||||
|
|
||||||
/** Sets the {@link RtpPacket#padding}. The default is false. */
|
/** Sets the {@link RtpPacket#padding}. The default is false. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPadding(boolean padding) {
|
public Builder setPadding(boolean padding) {
|
||||||
this.padding = padding;
|
this.padding = padding;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets {@link RtpPacket#marker}. The default is false. */
|
/** Sets {@link RtpPacket#marker}. The default is false. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMarker(boolean marker) {
|
public Builder setMarker(boolean marker) {
|
||||||
this.marker = marker;
|
this.marker = marker;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets {@link RtpPacket#payloadType}. The default is 0. */
|
/** Sets {@link RtpPacket#payloadType}. The default is 0. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPayloadType(byte payloadType) {
|
public Builder setPayloadType(byte payloadType) {
|
||||||
this.payloadType = payloadType;
|
this.payloadType = payloadType;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets {@link RtpPacket#sequenceNumber}. The default is 0. */
|
/** Sets {@link RtpPacket#sequenceNumber}. The default is 0. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSequenceNumber(int sequenceNumber) {
|
public Builder setSequenceNumber(int sequenceNumber) {
|
||||||
checkArgument(sequenceNumber >= MIN_SEQUENCE_NUMBER && sequenceNumber <= MAX_SEQUENCE_NUMBER);
|
checkArgument(sequenceNumber >= MIN_SEQUENCE_NUMBER && sequenceNumber <= MAX_SEQUENCE_NUMBER);
|
||||||
this.sequenceNumber = sequenceNumber & 0xFFFF;
|
this.sequenceNumber = sequenceNumber & 0xFFFF;
|
||||||
@ -94,18 +99,21 @@ public final class RtpPacket {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Sets {@link RtpPacket#timestamp}. The default is 0. */
|
/** Sets {@link RtpPacket#timestamp}. The default is 0. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setTimestamp(long timestamp) {
|
public Builder setTimestamp(long timestamp) {
|
||||||
this.timestamp = timestamp;
|
this.timestamp = timestamp;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets {@link RtpPacket#ssrc}. The default is 0. */
|
/** Sets {@link RtpPacket#ssrc}. The default is 0. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSsrc(int ssrc) {
|
public Builder setSsrc(int ssrc) {
|
||||||
this.ssrc = ssrc;
|
this.ssrc = ssrc;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets {@link RtpPacket#csrc}. The default is an empty byte array. */
|
/** Sets {@link RtpPacket#csrc}. The default is an empty byte array. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setCsrc(byte[] csrc) {
|
public Builder setCsrc(byte[] csrc) {
|
||||||
checkNotNull(csrc);
|
checkNotNull(csrc);
|
||||||
this.csrc = csrc;
|
this.csrc = csrc;
|
||||||
@ -113,6 +121,7 @@ public final class RtpPacket {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Sets {@link RtpPacket#payloadData}. The default is an empty byte array. */
|
/** Sets {@link RtpPacket#payloadData}. The default is an empty byte array. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPayloadData(byte[] payloadData) {
|
public Builder setPayloadData(byte[] payloadData) {
|
||||||
checkNotNull(payloadData);
|
checkNotNull(payloadData);
|
||||||
this.payloadData = payloadData;
|
this.payloadData = payloadData;
|
||||||
|
@ -22,6 +22,7 @@ import com.google.common.base.Ascii;
|
|||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableListMultimap;
|
import com.google.common.collect.ImmutableListMultimap;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -113,6 +114,7 @@ import java.util.Map;
|
|||||||
* @param headerValue The value of the header.
|
* @param headerValue The value of the header.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder add(String headerName, String headerValue) {
|
public Builder add(String headerName, String headerValue) {
|
||||||
namesAndValuesBuilder.put(convertToStandardHeaderName(headerName.trim()), headerValue.trim());
|
namesAndValuesBuilder.put(convertToStandardHeaderName(headerName.trim()), headerValue.trim());
|
||||||
return this;
|
return this;
|
||||||
@ -125,6 +127,7 @@ import java.util.Map;
|
|||||||
* <headerValue>
|
* <headerValue>
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder addAll(List<String> headers) {
|
public Builder addAll(List<String> headers) {
|
||||||
for (int i = 0; i < headers.size(); i++) {
|
for (int i = 0; i < headers.size(); i++) {
|
||||||
String[] header = Util.splitAtFirst(headers.get(i), ":\\s?");
|
String[] header = Util.splitAtFirst(headers.get(i), ":\\s?");
|
||||||
@ -142,6 +145,7 @@ import java.util.Map;
|
|||||||
* header values.
|
* header values.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder addAll(Map<String, String> headers) {
|
public Builder addAll(Map<String, String> headers) {
|
||||||
for (Map.Entry<String, String> header : headers.entrySet()) {
|
for (Map.Entry<String, String> header : headers.entrySet()) {
|
||||||
add(header.getKey(), header.getValue());
|
add(header.getKey(), header.getValue());
|
||||||
|
@ -38,6 +38,7 @@ import com.google.android.exoplayer2.upstream.Allocator;
|
|||||||
import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy;
|
import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy;
|
||||||
import com.google.android.exoplayer2.upstream.TransferListener;
|
import com.google.android.exoplayer2.upstream.TransferListener;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import javax.net.SocketFactory;
|
import javax.net.SocketFactory;
|
||||||
|
|
||||||
@ -87,6 +88,7 @@ public final class RtspMediaSource extends BaseMediaSource {
|
|||||||
* @param forceUseRtpTcp Whether force to use TCP for streaming.
|
* @param forceUseRtpTcp Whether force to use TCP for streaming.
|
||||||
* @return This Factory, for convenience.
|
* @return This Factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setForceUseRtpTcp(boolean forceUseRtpTcp) {
|
public Factory setForceUseRtpTcp(boolean forceUseRtpTcp) {
|
||||||
this.forceUseRtpTcp = forceUseRtpTcp;
|
this.forceUseRtpTcp = forceUseRtpTcp;
|
||||||
return this;
|
return this;
|
||||||
@ -98,6 +100,7 @@ public final class RtspMediaSource extends BaseMediaSource {
|
|||||||
* @param userAgent The user agent.
|
* @param userAgent The user agent.
|
||||||
* @return This Factory, for convenience.
|
* @return This Factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setUserAgent(String userAgent) {
|
public Factory setUserAgent(String userAgent) {
|
||||||
this.userAgent = userAgent;
|
this.userAgent = userAgent;
|
||||||
return this;
|
return this;
|
||||||
@ -110,6 +113,7 @@ public final class RtspMediaSource extends BaseMediaSource {
|
|||||||
* @param socketFactory A socket factory.
|
* @param socketFactory A socket factory.
|
||||||
* @return This Factory, for convenience.
|
* @return This Factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setSocketFactory(SocketFactory socketFactory) {
|
public Factory setSocketFactory(SocketFactory socketFactory) {
|
||||||
this.socketFactory = socketFactory;
|
this.socketFactory = socketFactory;
|
||||||
return this;
|
return this;
|
||||||
@ -124,6 +128,7 @@ public final class RtspMediaSource extends BaseMediaSource {
|
|||||||
* @param debugLoggingEnabled Whether to log RTSP messages.
|
* @param debugLoggingEnabled Whether to log RTSP messages.
|
||||||
* @return This Factory, for convenience.
|
* @return This Factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setDebugLoggingEnabled(boolean debugLoggingEnabled) {
|
public Factory setDebugLoggingEnabled(boolean debugLoggingEnabled) {
|
||||||
this.debugLoggingEnabled = debugLoggingEnabled;
|
this.debugLoggingEnabled = debugLoggingEnabled;
|
||||||
return this;
|
return this;
|
||||||
@ -138,6 +143,7 @@ public final class RtspMediaSource extends BaseMediaSource {
|
|||||||
* @param timeoutMs The timeout measured in milliseconds.
|
* @param timeoutMs The timeout measured in milliseconds.
|
||||||
* @return This Factory, for convenience.
|
* @return This Factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setTimeoutMs(@IntRange(from = 1) long timeoutMs) {
|
public Factory setTimeoutMs(@IntRange(from = 1) long timeoutMs) {
|
||||||
checkArgument(timeoutMs > 0);
|
checkArgument(timeoutMs > 0);
|
||||||
this.timeoutMs = timeoutMs;
|
this.timeoutMs = timeoutMs;
|
||||||
|
@ -24,6 +24,7 @@ import com.google.android.exoplayer2.Format;
|
|||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -64,6 +65,7 @@ import java.util.HashMap;
|
|||||||
* @param sessionName The {@link SessionDescription#sessionName}.
|
* @param sessionName The {@link SessionDescription#sessionName}.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSessionName(String sessionName) {
|
public Builder setSessionName(String sessionName) {
|
||||||
this.sessionName = sessionName;
|
this.sessionName = sessionName;
|
||||||
return this;
|
return this;
|
||||||
@ -75,6 +77,7 @@ import java.util.HashMap;
|
|||||||
* @param sessionInfo The {@link SessionDescription#sessionInfo}.
|
* @param sessionInfo The {@link SessionDescription#sessionInfo}.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSessionInfo(String sessionInfo) {
|
public Builder setSessionInfo(String sessionInfo) {
|
||||||
this.sessionInfo = sessionInfo;
|
this.sessionInfo = sessionInfo;
|
||||||
return this;
|
return this;
|
||||||
@ -86,6 +89,7 @@ import java.util.HashMap;
|
|||||||
* @param uri The {@link SessionDescription#uri}.
|
* @param uri The {@link SessionDescription#uri}.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setUri(Uri uri) {
|
public Builder setUri(Uri uri) {
|
||||||
this.uri = uri;
|
this.uri = uri;
|
||||||
return this;
|
return this;
|
||||||
@ -99,6 +103,7 @@ import java.util.HashMap;
|
|||||||
* @param origin The {@link SessionDescription#origin}.
|
* @param origin The {@link SessionDescription#origin}.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setOrigin(String origin) {
|
public Builder setOrigin(String origin) {
|
||||||
this.origin = origin;
|
this.origin = origin;
|
||||||
return this;
|
return this;
|
||||||
@ -110,6 +115,7 @@ import java.util.HashMap;
|
|||||||
* @param connection The {@link SessionDescription#connection}.
|
* @param connection The {@link SessionDescription#connection}.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setConnection(String connection) {
|
public Builder setConnection(String connection) {
|
||||||
this.connection = connection;
|
this.connection = connection;
|
||||||
return this;
|
return this;
|
||||||
@ -121,6 +127,7 @@ import java.util.HashMap;
|
|||||||
* @param bitrate The {@link SessionDescription#bitrate} in bits per second.
|
* @param bitrate The {@link SessionDescription#bitrate} in bits per second.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setBitrate(int bitrate) {
|
public Builder setBitrate(int bitrate) {
|
||||||
this.bitrate = bitrate;
|
this.bitrate = bitrate;
|
||||||
return this;
|
return this;
|
||||||
@ -134,6 +141,7 @@ import java.util.HashMap;
|
|||||||
* @param timing The {@link SessionDescription#timing}.
|
* @param timing The {@link SessionDescription#timing}.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setTiming(String timing) {
|
public Builder setTiming(String timing) {
|
||||||
this.timing = timing;
|
this.timing = timing;
|
||||||
return this;
|
return this;
|
||||||
@ -145,6 +153,7 @@ import java.util.HashMap;
|
|||||||
* @param key The {@link SessionDescription#key}.
|
* @param key The {@link SessionDescription#key}.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setKey(String key) {
|
public Builder setKey(String key) {
|
||||||
this.key = key;
|
this.key = key;
|
||||||
return this;
|
return this;
|
||||||
@ -156,6 +165,7 @@ import java.util.HashMap;
|
|||||||
* @param emailAddress The {@link SessionDescription#emailAddress}.
|
* @param emailAddress The {@link SessionDescription#emailAddress}.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setEmailAddress(String emailAddress) {
|
public Builder setEmailAddress(String emailAddress) {
|
||||||
this.emailAddress = emailAddress;
|
this.emailAddress = emailAddress;
|
||||||
return this;
|
return this;
|
||||||
@ -167,6 +177,7 @@ import java.util.HashMap;
|
|||||||
* @param phoneNumber The {@link SessionDescription#phoneNumber}.
|
* @param phoneNumber The {@link SessionDescription#phoneNumber}.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPhoneNumber(String phoneNumber) {
|
public Builder setPhoneNumber(String phoneNumber) {
|
||||||
this.phoneNumber = phoneNumber;
|
this.phoneNumber = phoneNumber;
|
||||||
return this;
|
return this;
|
||||||
@ -179,6 +190,7 @@ import java.util.HashMap;
|
|||||||
* @param attributeValue The value of the attribute.
|
* @param attributeValue The value of the attribute.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder addAttribute(String attributeName, String attributeValue) {
|
public Builder addAttribute(String attributeName, String attributeValue) {
|
||||||
attributes.put(attributeName, attributeValue);
|
attributes.put(attributeName, attributeValue);
|
||||||
return this;
|
return this;
|
||||||
@ -190,6 +202,7 @@ import java.util.HashMap;
|
|||||||
* @param mediaDescription The {@link MediaDescription}.
|
* @param mediaDescription The {@link MediaDescription}.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder addMediaDescription(MediaDescription mediaDescription) {
|
public Builder addMediaDescription(MediaDescription mediaDescription) {
|
||||||
mediaDescriptionListBuilder.add(mediaDescription);
|
mediaDescriptionListBuilder.add(mediaDescription);
|
||||||
return this;
|
return this;
|
||||||
|
@ -25,6 +25,7 @@ android {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation project(modulePrefix + 'library-core')
|
implementation project(modulePrefix + 'library-core')
|
||||||
|
compileOnly 'com.google.errorprone:error_prone_annotations:' + errorProneVersion
|
||||||
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
|
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
|
||||||
compileOnly 'org.checkerframework:checker-compat-qual:' + checkerframeworkCompatVersion
|
compileOnly 'org.checkerframework:checker-compat-qual:' + checkerframeworkCompatVersion
|
||||||
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
|
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
|
||||||
|
@ -63,6 +63,7 @@ import com.google.android.exoplayer2.util.Assertions;
|
|||||||
import com.google.android.exoplayer2.util.MimeTypes;
|
import com.google.android.exoplayer2.util.MimeTypes;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -134,6 +135,7 @@ public final class SsMediaSource extends BaseMediaSource
|
|||||||
compositeSequenceableLoaderFactory = new DefaultCompositeSequenceableLoaderFactory();
|
compositeSequenceableLoaderFactory = new DefaultCompositeSequenceableLoaderFactory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy) {
|
public Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy) {
|
||||||
this.loadErrorHandlingPolicy =
|
this.loadErrorHandlingPolicy =
|
||||||
@ -154,6 +156,7 @@ public final class SsMediaSource extends BaseMediaSource
|
|||||||
* default start position should precede the end of the live window.
|
* default start position should precede the end of the live window.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setLivePresentationDelayMs(long livePresentationDelayMs) {
|
public Factory setLivePresentationDelayMs(long livePresentationDelayMs) {
|
||||||
this.livePresentationDelayMs = livePresentationDelayMs;
|
this.livePresentationDelayMs = livePresentationDelayMs;
|
||||||
return this;
|
return this;
|
||||||
@ -165,6 +168,7 @@ public final class SsMediaSource extends BaseMediaSource
|
|||||||
* @param manifestParser A parser for loaded manifest data.
|
* @param manifestParser A parser for loaded manifest data.
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setManifestParser(
|
public Factory setManifestParser(
|
||||||
@Nullable ParsingLoadable.Parser<? extends SsManifest> manifestParser) {
|
@Nullable ParsingLoadable.Parser<? extends SsManifest> manifestParser) {
|
||||||
this.manifestParser = manifestParser;
|
this.manifestParser = manifestParser;
|
||||||
@ -180,6 +184,7 @@ public final class SsMediaSource extends BaseMediaSource
|
|||||||
* audio etc.).
|
* audio etc.).
|
||||||
* @return This factory, for convenience.
|
* @return This factory, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Factory setCompositeSequenceableLoaderFactory(
|
public Factory setCompositeSequenceableLoaderFactory(
|
||||||
CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory) {
|
CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory) {
|
||||||
this.compositeSequenceableLoaderFactory =
|
this.compositeSequenceableLoaderFactory =
|
||||||
@ -191,6 +196,7 @@ public final class SsMediaSource extends BaseMediaSource
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Override
|
@Override
|
||||||
public Factory setDrmSessionManagerProvider(
|
public Factory setDrmSessionManagerProvider(
|
||||||
DrmSessionManagerProvider drmSessionManagerProvider) {
|
DrmSessionManagerProvider drmSessionManagerProvider) {
|
||||||
|
@ -17,6 +17,7 @@ package com.google.android.exoplayer2.transformer;
|
|||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import com.google.android.exoplayer2.C;
|
import com.google.android.exoplayer2.C;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
@ -49,6 +50,7 @@ public class TransformationTestResult {
|
|||||||
* @param filePath The path.
|
* @param filePath The path.
|
||||||
* @return This {@link Builder}.
|
* @return This {@link Builder}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setFilePath(@Nullable String filePath) {
|
public Builder setFilePath(@Nullable String filePath) {
|
||||||
this.filePath = filePath;
|
this.filePath = filePath;
|
||||||
return this;
|
return this;
|
||||||
@ -63,6 +65,7 @@ public class TransformationTestResult {
|
|||||||
* @param elapsedTimeMs The time, in ms.
|
* @param elapsedTimeMs The time, in ms.
|
||||||
* @return This {@link Builder}.
|
* @return This {@link Builder}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setElapsedTimeMs(long elapsedTimeMs) {
|
public Builder setElapsedTimeMs(long elapsedTimeMs) {
|
||||||
this.elapsedTimeMs = elapsedTimeMs;
|
this.elapsedTimeMs = elapsedTimeMs;
|
||||||
return this;
|
return this;
|
||||||
@ -76,6 +79,7 @@ public class TransformationTestResult {
|
|||||||
* @param ssim The structural similarity index.
|
* @param ssim The structural similarity index.
|
||||||
* @return This {@link Builder}.
|
* @return This {@link Builder}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSsim(double ssim) {
|
public Builder setSsim(double ssim) {
|
||||||
this.ssim = ssim;
|
this.ssim = ssim;
|
||||||
return this;
|
return this;
|
||||||
@ -89,6 +93,7 @@ public class TransformationTestResult {
|
|||||||
* @param analysisException The {@link Exception} thrown during analysis.
|
* @param analysisException The {@link Exception} thrown during analysis.
|
||||||
* @return This {@link Builder}.
|
* @return This {@link Builder}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAnalysisException(@Nullable Exception analysisException) {
|
public Builder setAnalysisException(@Nullable Exception analysisException) {
|
||||||
this.analysisException = analysisException;
|
this.analysisException = analysisException;
|
||||||
return this;
|
return this;
|
||||||
|
@ -28,6 +28,7 @@ import com.google.android.exoplayer2.util.Log;
|
|||||||
import com.google.android.exoplayer2.util.SystemClock;
|
import com.google.android.exoplayer2.util.SystemClock;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
import com.google.common.base.Ascii;
|
import com.google.common.base.Ascii;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -77,6 +78,7 @@ public class TransformerAndroidTestRunner {
|
|||||||
* @param timeoutSeconds The timeout.
|
* @param timeoutSeconds The timeout.
|
||||||
* @return This {@link Builder}.
|
* @return This {@link Builder}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setTimeoutSeconds(int timeoutSeconds) {
|
public Builder setTimeoutSeconds(int timeoutSeconds) {
|
||||||
this.timeoutSeconds = timeoutSeconds;
|
this.timeoutSeconds = timeoutSeconds;
|
||||||
return this;
|
return this;
|
||||||
@ -96,6 +98,7 @@ public class TransformerAndroidTestRunner {
|
|||||||
* @param maybeCalculateSsim Whether to try to calculate SSIM.
|
* @param maybeCalculateSsim Whether to try to calculate SSIM.
|
||||||
* @return This {@link Builder}.
|
* @return This {@link Builder}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMaybeCalculateSsim(boolean maybeCalculateSsim) {
|
public Builder setMaybeCalculateSsim(boolean maybeCalculateSsim) {
|
||||||
this.maybeCalculateSsim = maybeCalculateSsim;
|
this.maybeCalculateSsim = maybeCalculateSsim;
|
||||||
return this;
|
return this;
|
||||||
@ -115,6 +118,7 @@ public class TransformerAndroidTestRunner {
|
|||||||
* @param suppressAnalysisExceptions Whether to suppress analysis exceptions.
|
* @param suppressAnalysisExceptions Whether to suppress analysis exceptions.
|
||||||
* @return This {@link Builder}.
|
* @return This {@link Builder}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSuppressAnalysisExceptions(boolean suppressAnalysisExceptions) {
|
public Builder setSuppressAnalysisExceptions(boolean suppressAnalysisExceptions) {
|
||||||
this.suppressAnalysisExceptions = suppressAnalysisExceptions;
|
this.suppressAnalysisExceptions = suppressAnalysisExceptions;
|
||||||
return this;
|
return this;
|
||||||
@ -130,6 +134,7 @@ public class TransformerAndroidTestRunner {
|
|||||||
* @param inputValues A {@link Map} of values to be written to the transformation summary.
|
* @param inputValues A {@link Map} of values to be written to the transformation summary.
|
||||||
* @return This {@link Builder}.
|
* @return This {@link Builder}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setInputValues(@Nullable Map<String, Object> inputValues) {
|
public Builder setInputValues(@Nullable Map<String, Object> inputValues) {
|
||||||
this.inputValues = inputValues;
|
this.inputValues = inputValues;
|
||||||
return this;
|
return this;
|
||||||
|
@ -37,6 +37,7 @@ import com.google.android.exoplayer2.util.MimeTypes;
|
|||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
import com.google.android.exoplayer2.video.ColorInfo;
|
import com.google.android.exoplayer2.video.ColorInfo;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||||
@ -69,6 +70,7 @@ public final class DefaultEncoderFactory implements Codec.EncoderFactory {
|
|||||||
*
|
*
|
||||||
* <p>The default value is {@link EncoderSelector#DEFAULT}.
|
* <p>The default value is {@link EncoderSelector#DEFAULT}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setVideoEncoderSelector(EncoderSelector encoderSelector) {
|
public Builder setVideoEncoderSelector(EncoderSelector encoderSelector) {
|
||||||
this.encoderSelector = encoderSelector;
|
this.encoderSelector = encoderSelector;
|
||||||
return this;
|
return this;
|
||||||
@ -91,6 +93,7 @@ public final class DefaultEncoderFactory implements Codec.EncoderFactory {
|
|||||||
*
|
*
|
||||||
* <p>The default value is {@link VideoEncoderSettings#DEFAULT}.
|
* <p>The default value is {@link VideoEncoderSettings#DEFAULT}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setRequestedVideoEncoderSettings(
|
public Builder setRequestedVideoEncoderSettings(
|
||||||
VideoEncoderSettings requestedVideoEncoderSettings) {
|
VideoEncoderSettings requestedVideoEncoderSettings) {
|
||||||
this.requestedVideoEncoderSettings = requestedVideoEncoderSettings;
|
this.requestedVideoEncoderSettings = requestedVideoEncoderSettings;
|
||||||
@ -108,6 +111,7 @@ public final class DefaultEncoderFactory implements Codec.EncoderFactory {
|
|||||||
*
|
*
|
||||||
* <p>The default value is {@code true}.
|
* <p>The default value is {@code true}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setEnableFallback(boolean enableFallback) {
|
public Builder setEnableFallback(boolean enableFallback) {
|
||||||
this.enableFallback = enableFallback;
|
this.enableFallback = enableFallback;
|
||||||
return this;
|
return this;
|
||||||
|
@ -23,6 +23,7 @@ import static java.lang.Math.min;
|
|||||||
import android.graphics.Matrix;
|
import android.graphics.Matrix;
|
||||||
import android.util.Size;
|
import android.util.Size;
|
||||||
import com.google.android.exoplayer2.util.GlUtil;
|
import com.google.android.exoplayer2.util.GlUtil;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -59,6 +60,7 @@ public final class ScaleToFitTransformation implements MatrixTransformation {
|
|||||||
* @param scaleY The multiplier by which the frame will scale vertically, along the y-axis.
|
* @param scaleY The multiplier by which the frame will scale vertically, along the y-axis.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setScale(float scaleX, float scaleY) {
|
public Builder setScale(float scaleX, float scaleY) {
|
||||||
this.scaleX = scaleX;
|
this.scaleX = scaleX;
|
||||||
this.scaleY = scaleY;
|
this.scaleY = scaleY;
|
||||||
@ -73,6 +75,7 @@ public final class ScaleToFitTransformation implements MatrixTransformation {
|
|||||||
* @param rotationDegrees The counterclockwise rotation, in degrees.
|
* @param rotationDegrees The counterclockwise rotation, in degrees.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setRotationDegrees(float rotationDegrees) {
|
public Builder setRotationDegrees(float rotationDegrees) {
|
||||||
this.rotationDegrees = rotationDegrees;
|
this.rotationDegrees = rotationDegrees;
|
||||||
return this;
|
return this;
|
||||||
|
@ -24,6 +24,7 @@ import com.google.android.exoplayer2.extractor.mp4.Mp4Extractor;
|
|||||||
import com.google.android.exoplayer2.source.MediaSource;
|
import com.google.android.exoplayer2.source.MediaSource;
|
||||||
import com.google.android.exoplayer2.util.MimeTypes;
|
import com.google.android.exoplayer2.util.MimeTypes;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
|
|
||||||
/** A media transformation request. */
|
/** A media transformation request. */
|
||||||
public final class TransformationRequest {
|
public final class TransformationRequest {
|
||||||
@ -94,6 +95,7 @@ public final class TransformationRequest {
|
|||||||
* @param flattenForSlowMotion Whether to flatten for slow motion.
|
* @param flattenForSlowMotion Whether to flatten for slow motion.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setFlattenForSlowMotion(boolean flattenForSlowMotion) {
|
public Builder setFlattenForSlowMotion(boolean flattenForSlowMotion) {
|
||||||
this.flattenForSlowMotion = flattenForSlowMotion;
|
this.flattenForSlowMotion = flattenForSlowMotion;
|
||||||
return this;
|
return this;
|
||||||
@ -110,6 +112,7 @@ public final class TransformationRequest {
|
|||||||
* @param scaleY The multiplier by which the frame will scale vertically, along the y-axis.
|
* @param scaleY The multiplier by which the frame will scale vertically, along the y-axis.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setScale(float scaleX, float scaleY) {
|
public Builder setScale(float scaleX, float scaleY) {
|
||||||
this.scaleX = scaleX;
|
this.scaleX = scaleX;
|
||||||
this.scaleY = scaleY;
|
this.scaleY = scaleY;
|
||||||
@ -128,6 +131,7 @@ public final class TransformationRequest {
|
|||||||
* @param rotationDegrees The counterclockwise rotation, in degrees.
|
* @param rotationDegrees The counterclockwise rotation, in degrees.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setRotationDegrees(float rotationDegrees) {
|
public Builder setRotationDegrees(float rotationDegrees) {
|
||||||
this.rotationDegrees = rotationDegrees;
|
this.rotationDegrees = rotationDegrees;
|
||||||
return this;
|
return this;
|
||||||
@ -148,6 +152,7 @@ public final class TransformationRequest {
|
|||||||
* @param outputHeight The output height of the displayed video, in pixels.
|
* @param outputHeight The output height of the displayed video, in pixels.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setResolution(int outputHeight) {
|
public Builder setResolution(int outputHeight) {
|
||||||
this.outputHeight = outputHeight;
|
this.outputHeight = outputHeight;
|
||||||
return this;
|
return this;
|
||||||
@ -171,6 +176,7 @@ public final class TransformationRequest {
|
|||||||
* @throws IllegalArgumentException If the {@code videoMimeType} is non-null but not a video
|
* @throws IllegalArgumentException If the {@code videoMimeType} is non-null but not a video
|
||||||
* {@linkplain MimeTypes MIME type}.
|
* {@linkplain MimeTypes MIME type}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setVideoMimeType(@Nullable String videoMimeType) {
|
public Builder setVideoMimeType(@Nullable String videoMimeType) {
|
||||||
checkArgument(
|
checkArgument(
|
||||||
videoMimeType == null || MimeTypes.isVideo(videoMimeType),
|
videoMimeType == null || MimeTypes.isVideo(videoMimeType),
|
||||||
@ -196,6 +202,7 @@ public final class TransformationRequest {
|
|||||||
* @throws IllegalArgumentException If the {@code audioMimeType} is non-null but not an audio
|
* @throws IllegalArgumentException If the {@code audioMimeType} is non-null but not an audio
|
||||||
* {@linkplain MimeTypes MIME type}.
|
* {@linkplain MimeTypes MIME type}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAudioMimeType(@Nullable String audioMimeType) {
|
public Builder setAudioMimeType(@Nullable String audioMimeType) {
|
||||||
checkArgument(
|
checkArgument(
|
||||||
audioMimeType == null || MimeTypes.isAudio(audioMimeType),
|
audioMimeType == null || MimeTypes.isAudio(audioMimeType),
|
||||||
@ -215,6 +222,7 @@ public final class TransformationRequest {
|
|||||||
* @param enableRequestSdrToneMapping Whether to request tone-mapping down to SDR.
|
* @param enableRequestSdrToneMapping Whether to request tone-mapping down to SDR.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setEnableRequestSdrToneMapping(boolean enableRequestSdrToneMapping) {
|
public Builder setEnableRequestSdrToneMapping(boolean enableRequestSdrToneMapping) {
|
||||||
this.enableRequestSdrToneMapping = enableRequestSdrToneMapping;
|
this.enableRequestSdrToneMapping = enableRequestSdrToneMapping;
|
||||||
return this;
|
return this;
|
||||||
@ -233,6 +241,7 @@ public final class TransformationRequest {
|
|||||||
* dynamic range (HDR) signal.
|
* dynamic range (HDR) signal.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder experimental_setEnableHdrEditing(boolean enableHdrEditing) {
|
public Builder experimental_setEnableHdrEditing(boolean enableHdrEditing) {
|
||||||
this.enableHdrEditing = enableHdrEditing;
|
this.enableHdrEditing = enableHdrEditing;
|
||||||
return this;
|
return this;
|
||||||
|
@ -19,6 +19,7 @@ import static com.google.android.exoplayer2.util.Assertions.checkArgument;
|
|||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import com.google.android.exoplayer2.C;
|
import com.google.android.exoplayer2.C;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
|
|
||||||
/** Information about the result of a successful transformation. */
|
/** Information about the result of a successful transformation. */
|
||||||
public final class TransformationResult {
|
public final class TransformationResult {
|
||||||
@ -43,6 +44,7 @@ public final class TransformationResult {
|
|||||||
*
|
*
|
||||||
* <p>Input must be positive or {@link C#TIME_UNSET}.
|
* <p>Input must be positive or {@link C#TIME_UNSET}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setDurationMs(long durationMs) {
|
public Builder setDurationMs(long durationMs) {
|
||||||
checkArgument(durationMs > 0 || durationMs == C.TIME_UNSET);
|
checkArgument(durationMs > 0 || durationMs == C.TIME_UNSET);
|
||||||
this.durationMs = durationMs;
|
this.durationMs = durationMs;
|
||||||
@ -54,6 +56,7 @@ public final class TransformationResult {
|
|||||||
*
|
*
|
||||||
* <p>Input must be positive or {@link C#LENGTH_UNSET}.
|
* <p>Input must be positive or {@link C#LENGTH_UNSET}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setFileSizeBytes(long fileSizeBytes) {
|
public Builder setFileSizeBytes(long fileSizeBytes) {
|
||||||
checkArgument(fileSizeBytes > 0 || fileSizeBytes == C.LENGTH_UNSET);
|
checkArgument(fileSizeBytes > 0 || fileSizeBytes == C.LENGTH_UNSET);
|
||||||
this.fileSizeBytes = fileSizeBytes;
|
this.fileSizeBytes = fileSizeBytes;
|
||||||
@ -65,6 +68,7 @@ public final class TransformationResult {
|
|||||||
*
|
*
|
||||||
* <p>Input must be positive or {@link C#RATE_UNSET_INT}.
|
* <p>Input must be positive or {@link C#RATE_UNSET_INT}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAverageAudioBitrate(int averageAudioBitrate) {
|
public Builder setAverageAudioBitrate(int averageAudioBitrate) {
|
||||||
checkArgument(averageAudioBitrate > 0 || averageAudioBitrate == C.RATE_UNSET_INT);
|
checkArgument(averageAudioBitrate > 0 || averageAudioBitrate == C.RATE_UNSET_INT);
|
||||||
this.averageAudioBitrate = averageAudioBitrate;
|
this.averageAudioBitrate = averageAudioBitrate;
|
||||||
@ -76,6 +80,7 @@ public final class TransformationResult {
|
|||||||
*
|
*
|
||||||
* <p>Input must be positive or {@link C#RATE_UNSET_INT}.
|
* <p>Input must be positive or {@link C#RATE_UNSET_INT}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAverageVideoBitrate(int averageVideoBitrate) {
|
public Builder setAverageVideoBitrate(int averageVideoBitrate) {
|
||||||
checkArgument(averageVideoBitrate > 0 || averageVideoBitrate == C.RATE_UNSET_INT);
|
checkArgument(averageVideoBitrate > 0 || averageVideoBitrate == C.RATE_UNSET_INT);
|
||||||
this.averageVideoBitrate = averageVideoBitrate;
|
this.averageVideoBitrate = averageVideoBitrate;
|
||||||
@ -87,6 +92,7 @@ public final class TransformationResult {
|
|||||||
*
|
*
|
||||||
* <p>Input must be positive or {@code 0}.
|
* <p>Input must be positive or {@code 0}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setVideoFrameCount(int videoFrameCount) {
|
public Builder setVideoFrameCount(int videoFrameCount) {
|
||||||
checkArgument(videoFrameCount >= 0);
|
checkArgument(videoFrameCount >= 0);
|
||||||
this.videoFrameCount = videoFrameCount;
|
this.videoFrameCount = videoFrameCount;
|
||||||
|
@ -58,6 +58,7 @@ import com.google.android.exoplayer2.util.MimeTypes;
|
|||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
import com.google.android.exoplayer2.video.VideoRendererEventListener;
|
import com.google.android.exoplayer2.video.VideoRendererEventListener;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.lang.annotation.Documented;
|
import java.lang.annotation.Documented;
|
||||||
@ -155,6 +156,7 @@ public final class Transformer {
|
|||||||
* @param transformationRequest The {@link TransformationRequest}.
|
* @param transformationRequest The {@link TransformationRequest}.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setTransformationRequest(TransformationRequest transformationRequest) {
|
public Builder setTransformationRequest(TransformationRequest transformationRequest) {
|
||||||
this.transformationRequest = transformationRequest;
|
this.transformationRequest = transformationRequest;
|
||||||
return this;
|
return this;
|
||||||
@ -173,6 +175,7 @@ public final class Transformer {
|
|||||||
* @param effects The {@linkplain GlEffect effects} to apply to each video frame.
|
* @param effects The {@linkplain GlEffect effects} to apply to each video frame.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setVideoEffects(List<GlEffect> effects) {
|
public Builder setVideoEffects(List<GlEffect> effects) {
|
||||||
this.videoEffects = ImmutableList.copyOf(effects);
|
this.videoEffects = ImmutableList.copyOf(effects);
|
||||||
return this;
|
return this;
|
||||||
@ -187,6 +190,7 @@ public final class Transformer {
|
|||||||
* @param mediaSourceFactory A {@link MediaSource.Factory}.
|
* @param mediaSourceFactory A {@link MediaSource.Factory}.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMediaSourceFactory(MediaSource.Factory mediaSourceFactory) {
|
public Builder setMediaSourceFactory(MediaSource.Factory mediaSourceFactory) {
|
||||||
this.mediaSourceFactory = mediaSourceFactory;
|
this.mediaSourceFactory = mediaSourceFactory;
|
||||||
return this;
|
return this;
|
||||||
@ -203,6 +207,7 @@ public final class Transformer {
|
|||||||
* @param removeAudio Whether to remove the audio.
|
* @param removeAudio Whether to remove the audio.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setRemoveAudio(boolean removeAudio) {
|
public Builder setRemoveAudio(boolean removeAudio) {
|
||||||
this.removeAudio = removeAudio;
|
this.removeAudio = removeAudio;
|
||||||
return this;
|
return this;
|
||||||
@ -219,6 +224,7 @@ public final class Transformer {
|
|||||||
* @param removeVideo Whether to remove the video.
|
* @param removeVideo Whether to remove the video.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setRemoveVideo(boolean removeVideo) {
|
public Builder setRemoveVideo(boolean removeVideo) {
|
||||||
this.removeVideo = removeVideo;
|
this.removeVideo = removeVideo;
|
||||||
return this;
|
return this;
|
||||||
@ -228,6 +234,7 @@ public final class Transformer {
|
|||||||
* @deprecated Use {@link TransformationRequest.Builder#setFlattenForSlowMotion(boolean)}
|
* @deprecated Use {@link TransformationRequest.Builder#setFlattenForSlowMotion(boolean)}
|
||||||
* instead.
|
* instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setFlattenForSlowMotion(boolean flattenForSlowMotion) {
|
public Builder setFlattenForSlowMotion(boolean flattenForSlowMotion) {
|
||||||
transformationRequest =
|
transformationRequest =
|
||||||
@ -239,6 +246,7 @@ public final class Transformer {
|
|||||||
* @deprecated This feature will be removed in a following release and the MIME type of the
|
* @deprecated This feature will be removed in a following release and the MIME type of the
|
||||||
* output will always be MP4.
|
* output will always be MP4.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setOutputMimeType(String outputMimeType) {
|
public Builder setOutputMimeType(String outputMimeType) {
|
||||||
this.containerMimeType = outputMimeType;
|
this.containerMimeType = outputMimeType;
|
||||||
@ -249,6 +257,7 @@ public final class Transformer {
|
|||||||
* @deprecated Use {@link #addListener(Listener)}, {@link #removeListener(Listener)} or {@link
|
* @deprecated Use {@link #addListener(Listener)}, {@link #removeListener(Listener)} or {@link
|
||||||
* #removeAllListeners()} instead.
|
* #removeAllListeners()} instead.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Builder setListener(Transformer.Listener listener) {
|
public Builder setListener(Transformer.Listener listener) {
|
||||||
this.listeners.clear();
|
this.listeners.clear();
|
||||||
@ -264,6 +273,7 @@ public final class Transformer {
|
|||||||
* @param listener A {@link Transformer.Listener}.
|
* @param listener A {@link Transformer.Listener}.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder addListener(Transformer.Listener listener) {
|
public Builder addListener(Transformer.Listener listener) {
|
||||||
this.listeners.add(listener);
|
this.listeners.add(listener);
|
||||||
return this;
|
return this;
|
||||||
@ -277,6 +287,7 @@ public final class Transformer {
|
|||||||
* @param listener A {@link Transformer.Listener}.
|
* @param listener A {@link Transformer.Listener}.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder removeListener(Transformer.Listener listener) {
|
public Builder removeListener(Transformer.Listener listener) {
|
||||||
this.listeners.remove(listener);
|
this.listeners.remove(listener);
|
||||||
return this;
|
return this;
|
||||||
@ -289,6 +300,7 @@ public final class Transformer {
|
|||||||
*
|
*
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder removeAllListeners() {
|
public Builder removeAllListeners() {
|
||||||
this.listeners.clear();
|
this.listeners.clear();
|
||||||
return this;
|
return this;
|
||||||
@ -304,6 +316,7 @@ public final class Transformer {
|
|||||||
* @param looper A {@link Looper}.
|
* @param looper A {@link Looper}.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setLooper(Looper looper) {
|
public Builder setLooper(Looper looper) {
|
||||||
this.looper = looper;
|
this.looper = looper;
|
||||||
this.listeners = listeners.copy(looper, (listener, flags) -> {});
|
this.listeners = listeners.copy(looper, (listener, flags) -> {});
|
||||||
@ -318,6 +331,7 @@ public final class Transformer {
|
|||||||
* @param encoderFactory The {@link Codec.EncoderFactory} instance.
|
* @param encoderFactory The {@link Codec.EncoderFactory} instance.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setEncoderFactory(Codec.EncoderFactory encoderFactory) {
|
public Builder setEncoderFactory(Codec.EncoderFactory encoderFactory) {
|
||||||
this.encoderFactory = encoderFactory;
|
this.encoderFactory = encoderFactory;
|
||||||
return this;
|
return this;
|
||||||
@ -331,6 +345,7 @@ public final class Transformer {
|
|||||||
* @param decoderFactory The {@link Codec.DecoderFactory} instance.
|
* @param decoderFactory The {@link Codec.DecoderFactory} instance.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setDecoderFactory(Codec.DecoderFactory decoderFactory) {
|
public Builder setDecoderFactory(Codec.DecoderFactory decoderFactory) {
|
||||||
this.decoderFactory = decoderFactory;
|
this.decoderFactory = decoderFactory;
|
||||||
return this;
|
return this;
|
||||||
@ -348,6 +363,7 @@ public final class Transformer {
|
|||||||
* @param debugViewProvider Provider for debug views.
|
* @param debugViewProvider Provider for debug views.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setDebugViewProvider(DebugViewProvider debugViewProvider) {
|
public Builder setDebugViewProvider(DebugViewProvider debugViewProvider) {
|
||||||
this.debugViewProvider = debugViewProvider;
|
this.debugViewProvider = debugViewProvider;
|
||||||
return this;
|
return this;
|
||||||
@ -361,6 +377,7 @@ public final class Transformer {
|
|||||||
* @param clock The {@link Clock} instance.
|
* @param clock The {@link Clock} instance.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
/* package */ Builder setClock(Clock clock) {
|
/* package */ Builder setClock(Clock clock) {
|
||||||
this.clock = clock;
|
this.clock = clock;
|
||||||
@ -376,6 +393,7 @@ public final class Transformer {
|
|||||||
* @param muxerFactory A {@link Muxer.Factory}.
|
* @param muxerFactory A {@link Muxer.Factory}.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
/* package */ Builder setMuxerFactory(Muxer.Factory muxerFactory) {
|
/* package */ Builder setMuxerFactory(Muxer.Factory muxerFactory) {
|
||||||
this.muxerFactory = muxerFactory;
|
this.muxerFactory = muxerFactory;
|
||||||
|
@ -29,6 +29,7 @@ import androidx.annotation.IntDef;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.annotation.VisibleForTesting;
|
import androidx.annotation.VisibleForTesting;
|
||||||
import com.google.android.exoplayer2.Format;
|
import com.google.android.exoplayer2.Format;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
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;
|
||||||
@ -104,6 +105,7 @@ public final class VideoEncoderSettings {
|
|||||||
* @param bitrate The {@link VideoEncoderSettings#bitrate}.
|
* @param bitrate The {@link VideoEncoderSettings#bitrate}.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setBitrate(int bitrate) {
|
public Builder setBitrate(int bitrate) {
|
||||||
this.bitrate = bitrate;
|
this.bitrate = bitrate;
|
||||||
return this;
|
return this;
|
||||||
@ -118,6 +120,7 @@ public final class VideoEncoderSettings {
|
|||||||
* @param bitrateMode The {@link VideoEncoderSettings#bitrateMode}.
|
* @param bitrateMode The {@link VideoEncoderSettings#bitrateMode}.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setBitrateMode(@BitrateMode int bitrateMode) {
|
public Builder setBitrateMode(@BitrateMode int bitrateMode) {
|
||||||
checkArgument(bitrateMode == BITRATE_MODE_VBR || bitrateMode == BITRATE_MODE_CBR);
|
checkArgument(bitrateMode == BITRATE_MODE_VBR || bitrateMode == BITRATE_MODE_CBR);
|
||||||
this.bitrateMode = bitrateMode;
|
this.bitrateMode = bitrateMode;
|
||||||
@ -138,6 +141,7 @@ public final class VideoEncoderSettings {
|
|||||||
* @param encodingLevel The {@link VideoEncoderSettings#level}.
|
* @param encodingLevel The {@link VideoEncoderSettings#level}.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setEncodingProfileLevel(int encodingProfile, int encodingLevel) {
|
public Builder setEncodingProfileLevel(int encodingProfile, int encodingLevel) {
|
||||||
this.profile = encodingProfile;
|
this.profile = encodingProfile;
|
||||||
this.level = encodingLevel;
|
this.level = encodingLevel;
|
||||||
@ -151,6 +155,7 @@ public final class VideoEncoderSettings {
|
|||||||
* @param iFrameIntervalSeconds The {@link VideoEncoderSettings#iFrameIntervalSeconds}.
|
* @param iFrameIntervalSeconds The {@link VideoEncoderSettings#iFrameIntervalSeconds}.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setiFrameIntervalSeconds(float iFrameIntervalSeconds) {
|
public Builder setiFrameIntervalSeconds(float iFrameIntervalSeconds) {
|
||||||
this.iFrameIntervalSeconds = iFrameIntervalSeconds;
|
this.iFrameIntervalSeconds = iFrameIntervalSeconds;
|
||||||
return this;
|
return this;
|
||||||
@ -164,6 +169,7 @@ public final class VideoEncoderSettings {
|
|||||||
* @param priority The {@link MediaFormat#KEY_PRIORITY priority}.
|
* @param priority The {@link MediaFormat#KEY_PRIORITY priority}.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
public Builder setEncoderPerformanceParameters(int operatingRate, int priority) {
|
public Builder setEncoderPerformanceParameters(int operatingRate, int priority) {
|
||||||
this.operatingRate = operatingRate;
|
this.operatingRate = operatingRate;
|
||||||
@ -180,6 +186,7 @@ public final class VideoEncoderSettings {
|
|||||||
*
|
*
|
||||||
* <p>Can not be enabled alongside setting a custom bitrate with {@link #setBitrate(int)}.
|
* <p>Can not be enabled alongside setting a custom bitrate with {@link #setBitrate(int)}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setEnableHighQualityTargeting(boolean enableHighQualityTargeting) {
|
public Builder setEnableHighQualityTargeting(boolean enableHighQualityTargeting) {
|
||||||
this.enableHighQualityTargeting = enableHighQualityTargeting;
|
this.enableHighQualityTargeting = enableHighQualityTargeting;
|
||||||
return this;
|
return this;
|
||||||
|
@ -59,6 +59,7 @@ import com.google.android.exoplayer2.util.Assertions;
|
|||||||
import com.google.android.exoplayer2.util.Log;
|
import com.google.android.exoplayer2.util.Log;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
import com.google.common.primitives.Ints;
|
import com.google.common.primitives.Ints;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -128,16 +129,19 @@ import java.util.List;
|
|||||||
this.activity = activity;
|
this.activity = activity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DashTestRunner setStreamName(String streamName) {
|
public DashTestRunner setStreamName(String streamName) {
|
||||||
this.streamName = streamName;
|
this.streamName = streamName;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DashTestRunner setFullPlaybackNoSeeking(boolean fullPlaybackNoSeeking) {
|
public DashTestRunner setFullPlaybackNoSeeking(boolean fullPlaybackNoSeeking) {
|
||||||
this.fullPlaybackNoSeeking = fullPlaybackNoSeeking;
|
this.fullPlaybackNoSeeking = fullPlaybackNoSeeking;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DashTestRunner setCanIncludeAdditionalVideoFormats(
|
public DashTestRunner setCanIncludeAdditionalVideoFormats(
|
||||||
boolean canIncludeAdditionalVideoFormats) {
|
boolean canIncludeAdditionalVideoFormats) {
|
||||||
this.canIncludeAdditionalVideoFormats =
|
this.canIncludeAdditionalVideoFormats =
|
||||||
@ -145,27 +149,32 @@ import java.util.List;
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DashTestRunner setActionSchedule(ActionSchedule actionSchedule) {
|
public DashTestRunner setActionSchedule(ActionSchedule actionSchedule) {
|
||||||
this.actionSchedule = actionSchedule;
|
this.actionSchedule = actionSchedule;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DashTestRunner setOfflineLicenseKeySetId(byte[] offlineLicenseKeySetId) {
|
public DashTestRunner setOfflineLicenseKeySetId(byte[] offlineLicenseKeySetId) {
|
||||||
this.offlineLicenseKeySetId = offlineLicenseKeySetId;
|
this.offlineLicenseKeySetId = offlineLicenseKeySetId;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DashTestRunner setAudioVideoFormats(String audioFormat, String... videoFormats) {
|
public DashTestRunner setAudioVideoFormats(String audioFormat, String... videoFormats) {
|
||||||
this.audioFormat = audioFormat;
|
this.audioFormat = audioFormat;
|
||||||
this.videoFormats = videoFormats;
|
this.videoFormats = videoFormats;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DashTestRunner setManifestUrl(String manifestUrl) {
|
public DashTestRunner setManifestUrl(String manifestUrl) {
|
||||||
this.manifestUrl = manifestUrl;
|
this.manifestUrl = manifestUrl;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DashTestRunner setWidevineInfo(String mimeType, boolean videoIdRequiredInLicenseUrl) {
|
public DashTestRunner setWidevineInfo(String mimeType, boolean videoIdRequiredInLicenseUrl) {
|
||||||
this.useL1Widevine = isL1WidevineAvailable(mimeType);
|
this.useL1Widevine = isL1WidevineAvailable(mimeType);
|
||||||
this.widevineLicenseUrl =
|
this.widevineLicenseUrl =
|
||||||
@ -173,6 +182,7 @@ import java.util.List;
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DashTestRunner setDataSourceFactory(DataSource.Factory dataSourceFactory) {
|
public DashTestRunner setDataSourceFactory(DataSource.Factory dataSourceFactory) {
|
||||||
this.dataSourceFactory = dataSourceFactory;
|
this.dataSourceFactory = dataSourceFactory;
|
||||||
return this;
|
return this;
|
||||||
|
@ -56,6 +56,7 @@ import com.google.android.exoplayer2.testutil.Action.WaitForTimelineChanged;
|
|||||||
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
|
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
|
||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
import com.google.android.exoplayer2.util.HandlerWrapper;
|
import com.google.android.exoplayer2.util.HandlerWrapper;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||||
|
|
||||||
/** Schedules a sequence of {@link Action}s for execution during a test. */
|
/** Schedules a sequence of {@link Action}s for execution during a test. */
|
||||||
@ -127,6 +128,7 @@ public final class ActionSchedule {
|
|||||||
* @param delayMs The delay in milliseconds.
|
* @param delayMs The delay in milliseconds.
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder delay(long delayMs) {
|
public Builder delay(long delayMs) {
|
||||||
currentDelayMs += delayMs;
|
currentDelayMs += delayMs;
|
||||||
return this;
|
return this;
|
||||||
@ -138,6 +140,7 @@ public final class ActionSchedule {
|
|||||||
* @param action The action to schedule.
|
* @param action The action to schedule.
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder apply(Action action) {
|
public Builder apply(Action action) {
|
||||||
return appendActionNode(new ActionNode(action, currentDelayMs));
|
return appendActionNode(new ActionNode(action, currentDelayMs));
|
||||||
}
|
}
|
||||||
@ -149,6 +152,7 @@ public final class ActionSchedule {
|
|||||||
* @param intervalMs The interval between each repetition in milliseconds.
|
* @param intervalMs The interval between each repetition in milliseconds.
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder repeat(Action action, long intervalMs) {
|
public Builder repeat(Action action, long intervalMs) {
|
||||||
return appendActionNode(new ActionNode(action, currentDelayMs, intervalMs));
|
return appendActionNode(new ActionNode(action, currentDelayMs, intervalMs));
|
||||||
}
|
}
|
||||||
@ -159,6 +163,7 @@ public final class ActionSchedule {
|
|||||||
* @param positionMs The seek position.
|
* @param positionMs The seek position.
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder seek(long positionMs) {
|
public Builder seek(long positionMs) {
|
||||||
return apply(new Seek(tag, positionMs));
|
return apply(new Seek(tag, positionMs));
|
||||||
}
|
}
|
||||||
@ -170,6 +175,7 @@ public final class ActionSchedule {
|
|||||||
* @param positionMs The seek position.
|
* @param positionMs The seek position.
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder seek(int mediaItemIndex, long positionMs) {
|
public Builder seek(int mediaItemIndex, long positionMs) {
|
||||||
return apply(
|
return apply(
|
||||||
new Seek(tag, mediaItemIndex, positionMs, /* catchIllegalSeekException= */ false));
|
new Seek(tag, mediaItemIndex, positionMs, /* catchIllegalSeekException= */ false));
|
||||||
@ -183,6 +189,7 @@ public final class ActionSchedule {
|
|||||||
* @param catchIllegalSeekException Whether an illegal seek position should be caught or not.
|
* @param catchIllegalSeekException Whether an illegal seek position should be caught or not.
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder seek(int mediaItemIndex, long positionMs, boolean catchIllegalSeekException) {
|
public Builder seek(int mediaItemIndex, long positionMs, boolean catchIllegalSeekException) {
|
||||||
return apply(new Seek(tag, mediaItemIndex, positionMs, catchIllegalSeekException));
|
return apply(new Seek(tag, mediaItemIndex, positionMs, catchIllegalSeekException));
|
||||||
}
|
}
|
||||||
@ -206,6 +213,7 @@ public final class ActionSchedule {
|
|||||||
*
|
*
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder waitForPendingPlayerCommands() {
|
public Builder waitForPendingPlayerCommands() {
|
||||||
return apply(new WaitForPendingPlayerCommands(tag));
|
return apply(new WaitForPendingPlayerCommands(tag));
|
||||||
}
|
}
|
||||||
@ -217,6 +225,7 @@ public final class ActionSchedule {
|
|||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
* @see Player#setPlaybackParameters(PlaybackParameters)
|
* @see Player#setPlaybackParameters(PlaybackParameters)
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPlaybackParameters(PlaybackParameters playbackParameters) {
|
public Builder setPlaybackParameters(PlaybackParameters playbackParameters) {
|
||||||
return apply(new SetPlaybackParameters(tag, playbackParameters));
|
return apply(new SetPlaybackParameters(tag, playbackParameters));
|
||||||
}
|
}
|
||||||
@ -226,6 +235,7 @@ public final class ActionSchedule {
|
|||||||
*
|
*
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder stop() {
|
public Builder stop() {
|
||||||
return apply(new Stop(tag));
|
return apply(new Stop(tag));
|
||||||
}
|
}
|
||||||
@ -236,6 +246,7 @@ public final class ActionSchedule {
|
|||||||
* @param reset Whether the player should be reset.
|
* @param reset Whether the player should be reset.
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder stop(boolean reset) {
|
public Builder stop(boolean reset) {
|
||||||
return apply(new Stop(tag, reset));
|
return apply(new Stop(tag, reset));
|
||||||
}
|
}
|
||||||
@ -245,6 +256,7 @@ public final class ActionSchedule {
|
|||||||
*
|
*
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder play() {
|
public Builder play() {
|
||||||
return apply(new SetPlayWhenReady(tag, true));
|
return apply(new SetPlayWhenReady(tag, true));
|
||||||
}
|
}
|
||||||
@ -257,6 +269,7 @@ public final class ActionSchedule {
|
|||||||
* @param positionMs The position in that media item at which the player should be paused again.
|
* @param positionMs The position in that media item at which the player should be paused again.
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder playUntilPosition(int mediaItemIndex, long positionMs) {
|
public Builder playUntilPosition(int mediaItemIndex, long positionMs) {
|
||||||
return apply(new PlayUntilPosition(tag, mediaItemIndex, positionMs));
|
return apply(new PlayUntilPosition(tag, mediaItemIndex, positionMs));
|
||||||
}
|
}
|
||||||
@ -268,6 +281,7 @@ public final class ActionSchedule {
|
|||||||
* @param mediaItemIndex The media item index at which the player should be paused again.
|
* @param mediaItemIndex The media item index at which the player should be paused again.
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder playUntilStartOfMediaItem(int mediaItemIndex) {
|
public Builder playUntilStartOfMediaItem(int mediaItemIndex) {
|
||||||
return apply(new PlayUntilPosition(tag, mediaItemIndex, /* positionMs= */ 0));
|
return apply(new PlayUntilPosition(tag, mediaItemIndex, /* positionMs= */ 0));
|
||||||
}
|
}
|
||||||
@ -277,6 +291,7 @@ public final class ActionSchedule {
|
|||||||
*
|
*
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder pause() {
|
public Builder pause() {
|
||||||
return apply(new SetPlayWhenReady(tag, false));
|
return apply(new SetPlayWhenReady(tag, false));
|
||||||
}
|
}
|
||||||
@ -286,6 +301,7 @@ public final class ActionSchedule {
|
|||||||
*
|
*
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder enableRenderer(int index) {
|
public Builder enableRenderer(int index) {
|
||||||
return apply(new SetRendererDisabled(tag, index, false));
|
return apply(new SetRendererDisabled(tag, index, false));
|
||||||
}
|
}
|
||||||
@ -295,6 +311,7 @@ public final class ActionSchedule {
|
|||||||
*
|
*
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder disableRenderer(int index) {
|
public Builder disableRenderer(int index) {
|
||||||
return apply(new SetRendererDisabled(tag, index, true));
|
return apply(new SetRendererDisabled(tag, index, true));
|
||||||
}
|
}
|
||||||
@ -304,6 +321,7 @@ public final class ActionSchedule {
|
|||||||
*
|
*
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder clearVideoSurface() {
|
public Builder clearVideoSurface() {
|
||||||
return apply(new ClearVideoSurface(tag));
|
return apply(new ClearVideoSurface(tag));
|
||||||
}
|
}
|
||||||
@ -313,6 +331,7 @@ public final class ActionSchedule {
|
|||||||
*
|
*
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setVideoSurface() {
|
public Builder setVideoSurface() {
|
||||||
return apply(new SetVideoSurface(tag));
|
return apply(new SetVideoSurface(tag));
|
||||||
}
|
}
|
||||||
@ -322,6 +341,7 @@ public final class ActionSchedule {
|
|||||||
*
|
*
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAudioAttributes(AudioAttributes audioAttributes, boolean handleAudioFocus) {
|
public Builder setAudioAttributes(AudioAttributes audioAttributes, boolean handleAudioFocus) {
|
||||||
return apply(new SetAudioAttributes(tag, audioAttributes, handleAudioFocus));
|
return apply(new SetAudioAttributes(tag, audioAttributes, handleAudioFocus));
|
||||||
}
|
}
|
||||||
@ -337,6 +357,7 @@ public final class ActionSchedule {
|
|||||||
* parameter is ignored.
|
* parameter is ignored.
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMediaSources(int mediaItemIndex, long positionMs, MediaSource... sources) {
|
public Builder setMediaSources(int mediaItemIndex, long positionMs, MediaSource... sources) {
|
||||||
return apply(new Action.SetMediaItems(tag, mediaItemIndex, positionMs, sources));
|
return apply(new Action.SetMediaItems(tag, mediaItemIndex, positionMs, sources));
|
||||||
}
|
}
|
||||||
@ -347,6 +368,7 @@ public final class ActionSchedule {
|
|||||||
* @param resetPosition Whether the playback position should be reset.
|
* @param resetPosition Whether the playback position should be reset.
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMediaSources(boolean resetPosition, MediaSource... sources) {
|
public Builder setMediaSources(boolean resetPosition, MediaSource... sources) {
|
||||||
return apply(new Action.SetMediaItemsResetPosition(tag, resetPosition, sources));
|
return apply(new Action.SetMediaItemsResetPosition(tag, resetPosition, sources));
|
||||||
}
|
}
|
||||||
@ -357,6 +379,7 @@ public final class ActionSchedule {
|
|||||||
* @param mediaSources The media sources to add.
|
* @param mediaSources The media sources to add.
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMediaSources(MediaSource... mediaSources) {
|
public Builder setMediaSources(MediaSource... mediaSources) {
|
||||||
return apply(
|
return apply(
|
||||||
new Action.SetMediaItems(
|
new Action.SetMediaItems(
|
||||||
@ -371,6 +394,7 @@ public final class ActionSchedule {
|
|||||||
* @param mediaSources The media sources to add.
|
* @param mediaSources The media sources to add.
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder addMediaSources(MediaSource... mediaSources) {
|
public Builder addMediaSources(MediaSource... mediaSources) {
|
||||||
return apply(new Action.AddMediaItems(tag, mediaSources));
|
return apply(new Action.AddMediaItems(tag, mediaSources));
|
||||||
}
|
}
|
||||||
@ -382,6 +406,7 @@ public final class ActionSchedule {
|
|||||||
* @param newIndex The index after the item has been moved.
|
* @param newIndex The index after the item has been moved.
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder moveMediaItem(int currentIndex, int newIndex) {
|
public Builder moveMediaItem(int currentIndex, int newIndex) {
|
||||||
return apply(new Action.MoveMediaItem(tag, currentIndex, newIndex));
|
return apply(new Action.MoveMediaItem(tag, currentIndex, newIndex));
|
||||||
}
|
}
|
||||||
@ -392,6 +417,7 @@ public final class ActionSchedule {
|
|||||||
* @param index The index of the media item to be removed.
|
* @param index The index of the media item to be removed.
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder removeMediaItem(int index) {
|
public Builder removeMediaItem(int index) {
|
||||||
return apply(new Action.RemoveMediaItem(tag, index));
|
return apply(new Action.RemoveMediaItem(tag, index));
|
||||||
}
|
}
|
||||||
@ -403,6 +429,7 @@ public final class ActionSchedule {
|
|||||||
* @param toIndex The end of the range of media items to be removed (exclusive).
|
* @param toIndex The end of the range of media items to be removed (exclusive).
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder removeMediaItems(int fromIndex, int toIndex) {
|
public Builder removeMediaItems(int fromIndex, int toIndex) {
|
||||||
return apply(new Action.RemoveMediaItems(tag, fromIndex, toIndex));
|
return apply(new Action.RemoveMediaItems(tag, fromIndex, toIndex));
|
||||||
}
|
}
|
||||||
@ -412,6 +439,7 @@ public final class ActionSchedule {
|
|||||||
*
|
*
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder prepare() {
|
public Builder prepare() {
|
||||||
return apply(new Action.Prepare(tag));
|
return apply(new Action.Prepare(tag));
|
||||||
}
|
}
|
||||||
@ -421,6 +449,7 @@ public final class ActionSchedule {
|
|||||||
*
|
*
|
||||||
* @return The builder. for convenience,
|
* @return The builder. for convenience,
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder clearMediaItems() {
|
public Builder clearMediaItems() {
|
||||||
return apply(new Action.ClearMediaItems(tag));
|
return apply(new Action.ClearMediaItems(tag));
|
||||||
}
|
}
|
||||||
@ -430,6 +459,7 @@ public final class ActionSchedule {
|
|||||||
*
|
*
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setRepeatMode(@Player.RepeatMode int repeatMode) {
|
public Builder setRepeatMode(@Player.RepeatMode int repeatMode) {
|
||||||
return apply(new SetRepeatMode(tag, repeatMode));
|
return apply(new SetRepeatMode(tag, repeatMode));
|
||||||
}
|
}
|
||||||
@ -440,6 +470,7 @@ public final class ActionSchedule {
|
|||||||
* @param shuffleOrder The shuffle order.
|
* @param shuffleOrder The shuffle order.
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setShuffleOrder(ShuffleOrder shuffleOrder) {
|
public Builder setShuffleOrder(ShuffleOrder shuffleOrder) {
|
||||||
return apply(new SetShuffleOrder(tag, shuffleOrder));
|
return apply(new SetShuffleOrder(tag, shuffleOrder));
|
||||||
}
|
}
|
||||||
@ -449,6 +480,7 @@ public final class ActionSchedule {
|
|||||||
*
|
*
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setShuffleModeEnabled(boolean shuffleModeEnabled) {
|
public Builder setShuffleModeEnabled(boolean shuffleModeEnabled) {
|
||||||
return apply(new SetShuffleModeEnabled(tag, shuffleModeEnabled));
|
return apply(new SetShuffleModeEnabled(tag, shuffleModeEnabled));
|
||||||
}
|
}
|
||||||
@ -460,6 +492,7 @@ public final class ActionSchedule {
|
|||||||
* in milliseconds.
|
* in milliseconds.
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder sendMessage(Target target, long positionMs) {
|
public Builder sendMessage(Target target, long positionMs) {
|
||||||
return apply(new SendMessages(tag, target, positionMs));
|
return apply(new SendMessages(tag, target, positionMs));
|
||||||
}
|
}
|
||||||
@ -472,6 +505,7 @@ public final class ActionSchedule {
|
|||||||
* @param positionMs The position at which the message should be sent, in milliseconds.
|
* @param positionMs The position at which the message should be sent, in milliseconds.
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder sendMessage(Target target, int mediaItemIndex, long positionMs) {
|
public Builder sendMessage(Target target, int mediaItemIndex, long positionMs) {
|
||||||
return apply(
|
return apply(
|
||||||
new SendMessages(
|
new SendMessages(
|
||||||
@ -487,6 +521,7 @@ public final class ActionSchedule {
|
|||||||
* @param deleteAfterDelivery Whether the message will be deleted after delivery.
|
* @param deleteAfterDelivery Whether the message will be deleted after delivery.
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder sendMessage(
|
public Builder sendMessage(
|
||||||
Target target, int mediaItemIndex, long positionMs, boolean deleteAfterDelivery) {
|
Target target, int mediaItemIndex, long positionMs, boolean deleteAfterDelivery) {
|
||||||
return apply(new SendMessages(tag, target, mediaItemIndex, positionMs, deleteAfterDelivery));
|
return apply(new SendMessages(tag, target, mediaItemIndex, positionMs, deleteAfterDelivery));
|
||||||
@ -497,6 +532,7 @@ public final class ActionSchedule {
|
|||||||
*
|
*
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder waitForTimelineChanged() {
|
public Builder waitForTimelineChanged() {
|
||||||
return apply(new WaitForTimelineChanged(tag));
|
return apply(new WaitForTimelineChanged(tag));
|
||||||
}
|
}
|
||||||
@ -508,6 +544,7 @@ public final class ActionSchedule {
|
|||||||
* @param expectedReason The expected reason of the timeline change.
|
* @param expectedReason The expected reason of the timeline change.
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder waitForTimelineChanged(
|
public Builder waitForTimelineChanged(
|
||||||
Timeline expectedTimeline, @Player.TimelineChangeReason int expectedReason) {
|
Timeline expectedTimeline, @Player.TimelineChangeReason int expectedReason) {
|
||||||
return apply(new WaitForTimelineChanged(tag, expectedTimeline, expectedReason));
|
return apply(new WaitForTimelineChanged(tag, expectedTimeline, expectedReason));
|
||||||
@ -518,6 +555,7 @@ public final class ActionSchedule {
|
|||||||
*
|
*
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder waitForPositionDiscontinuity() {
|
public Builder waitForPositionDiscontinuity() {
|
||||||
return apply(new WaitForPositionDiscontinuity(tag));
|
return apply(new WaitForPositionDiscontinuity(tag));
|
||||||
}
|
}
|
||||||
@ -528,6 +566,7 @@ public final class ActionSchedule {
|
|||||||
* @param targetPlayWhenReady The target playWhenReady value.
|
* @param targetPlayWhenReady The target playWhenReady value.
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder waitForPlayWhenReady(boolean targetPlayWhenReady) {
|
public Builder waitForPlayWhenReady(boolean targetPlayWhenReady) {
|
||||||
return apply(new WaitForPlayWhenReady(tag, targetPlayWhenReady));
|
return apply(new WaitForPlayWhenReady(tag, targetPlayWhenReady));
|
||||||
}
|
}
|
||||||
@ -538,6 +577,7 @@ public final class ActionSchedule {
|
|||||||
* @param targetPlaybackState The target playback state.
|
* @param targetPlaybackState The target playback state.
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder waitForPlaybackState(@Player.State int targetPlaybackState) {
|
public Builder waitForPlaybackState(@Player.State int targetPlaybackState) {
|
||||||
return apply(new WaitForPlaybackState(tag, targetPlaybackState));
|
return apply(new WaitForPlaybackState(tag, targetPlaybackState));
|
||||||
}
|
}
|
||||||
@ -548,6 +588,7 @@ public final class ActionSchedule {
|
|||||||
* @param targetIsLoading The target value of {@code player.isLoading()}.
|
* @param targetIsLoading The target value of {@code player.isLoading()}.
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder waitForIsLoading(boolean targetIsLoading) {
|
public Builder waitForIsLoading(boolean targetIsLoading) {
|
||||||
return apply(new WaitForIsLoading(tag, targetIsLoading));
|
return apply(new WaitForIsLoading(tag, targetIsLoading));
|
||||||
}
|
}
|
||||||
@ -558,6 +599,7 @@ public final class ActionSchedule {
|
|||||||
* @param playerTarget The target to observe.
|
* @param playerTarget The target to observe.
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder waitForMessage(PlayerTarget playerTarget) {
|
public Builder waitForMessage(PlayerTarget playerTarget) {
|
||||||
return apply(new WaitForMessage(tag, playerTarget));
|
return apply(new WaitForMessage(tag, playerTarget));
|
||||||
}
|
}
|
||||||
@ -567,6 +609,7 @@ public final class ActionSchedule {
|
|||||||
*
|
*
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder executeRunnable(Runnable runnable) {
|
public Builder executeRunnable(Runnable runnable) {
|
||||||
return apply(new ExecuteRunnable(tag, runnable));
|
return apply(new ExecuteRunnable(tag, runnable));
|
||||||
}
|
}
|
||||||
@ -577,6 +620,7 @@ public final class ActionSchedule {
|
|||||||
* @param exception The exception to throw.
|
* @param exception The exception to throw.
|
||||||
* @return The builder, for convenience.
|
* @return The builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder throwPlaybackException(ExoPlaybackException exception) {
|
public Builder throwPlaybackException(ExoPlaybackException exception) {
|
||||||
return apply(new ThrowPlaybackException(tag, exception));
|
return apply(new ThrowPlaybackException(tag, exception));
|
||||||
}
|
}
|
||||||
@ -588,6 +632,7 @@ public final class ActionSchedule {
|
|||||||
return new ActionSchedule(rootNode, callbackAction);
|
return new ActionSchedule(rootNode, callbackAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
private Builder appendActionNode(ActionNode actionNode) {
|
private Builder appendActionNode(ActionNode actionNode) {
|
||||||
previousNode.setNext(actionNode);
|
previousNode.setNext(actionNode);
|
||||||
previousNode = actionNode;
|
previousNode = actionNode;
|
||||||
|
@ -29,6 +29,7 @@ import com.google.android.exoplayer2.upstream.cache.Cache;
|
|||||||
import com.google.android.exoplayer2.upstream.cache.CacheDataSource;
|
import com.google.android.exoplayer2.upstream.cache.CacheDataSource;
|
||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
@ -50,6 +51,7 @@ public final class CacheAsserts {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public RequestSet subset(String... uriStrings) {
|
public RequestSet subset(String... uriStrings) {
|
||||||
dataSpecs = new DataSpec[uriStrings.length];
|
dataSpecs = new DataSpec[uriStrings.length];
|
||||||
for (int i = 0; i < dataSpecs.length; i++) {
|
for (int i = 0; i < dataSpecs.length; i++) {
|
||||||
@ -58,6 +60,7 @@ public final class CacheAsserts {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public RequestSet subset(Uri... uris) {
|
public RequestSet subset(Uri... uris) {
|
||||||
dataSpecs = new DataSpec[uris.length];
|
dataSpecs = new DataSpec[uris.length];
|
||||||
for (int i = 0; i < dataSpecs.length; i++) {
|
for (int i = 0; i < dataSpecs.length; i++) {
|
||||||
@ -66,6 +69,7 @@ public final class CacheAsserts {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public RequestSet subset(DataSpec... dataSpecs) {
|
public RequestSet subset(DataSpec... dataSpecs) {
|
||||||
this.dataSpecs = dataSpecs;
|
this.dataSpecs = dataSpecs;
|
||||||
return this;
|
return this;
|
||||||
@ -83,6 +87,7 @@ public final class CacheAsserts {
|
|||||||
return dataSpecs[i];
|
return dataSpecs[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public RequestSet useBoundedDataSpecFor(String uriString) {
|
public RequestSet useBoundedDataSpecFor(String uriString) {
|
||||||
FakeData data = Assertions.checkStateNotNull(fakeDataSet.getData(uriString));
|
FakeData data = Assertions.checkStateNotNull(fakeDataSet.getData(uriString));
|
||||||
for (int i = 0; i < dataSpecs.length; i++) {
|
for (int i = 0; i < dataSpecs.length; i++) {
|
||||||
|
@ -42,6 +42,7 @@ import com.google.android.exoplayer2.util.Assertions;
|
|||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
import com.google.common.base.Ascii;
|
import com.google.common.base.Ascii;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -662,17 +663,20 @@ public abstract class DataSourceContractTest {
|
|||||||
/**
|
/**
|
||||||
* Sets a human-readable name for this resource which will be shown in test failure messages.
|
* Sets a human-readable name for this resource which will be shown in test failure messages.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setName(String name) {
|
public Builder setName(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the URI where this resource is located. */
|
/** Sets the URI where this resource is located. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setUri(String uri) {
|
public Builder setUri(String uri) {
|
||||||
return setUri(Uri.parse(uri));
|
return setUri(Uri.parse(uri));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the URI where this resource is located. */
|
/** Sets the URI where this resource is located. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setUri(Uri uri) {
|
public Builder setUri(Uri uri) {
|
||||||
this.uri = uri;
|
this.uri = uri;
|
||||||
return this;
|
return this;
|
||||||
@ -683,6 +687,7 @@ public abstract class DataSourceContractTest {
|
|||||||
*
|
*
|
||||||
* <p>Must be at least 5 bytes.
|
* <p>Must be at least 5 bytes.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setExpectedBytes(byte[] expectedBytes) {
|
public Builder setExpectedBytes(byte[] expectedBytes) {
|
||||||
checkArgument(expectedBytes.length >= 5);
|
checkArgument(expectedBytes.length >= 5);
|
||||||
this.expectedBytes = expectedBytes;
|
this.expectedBytes = expectedBytes;
|
||||||
|
@ -22,6 +22,7 @@ import com.google.android.exoplayer2.offline.Download;
|
|||||||
import com.google.android.exoplayer2.offline.DownloadProgress;
|
import com.google.android.exoplayer2.offline.DownloadProgress;
|
||||||
import com.google.android.exoplayer2.offline.DownloadRequest;
|
import com.google.android.exoplayer2.offline.DownloadRequest;
|
||||||
import com.google.android.exoplayer2.offline.StreamKey;
|
import com.google.android.exoplayer2.offline.StreamKey;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -109,6 +110,7 @@ public final class DownloadBuilder {
|
|||||||
/**
|
/**
|
||||||
* @see DownloadRequest#uri
|
* @see DownloadRequest#uri
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DownloadBuilder setUri(String uri) {
|
public DownloadBuilder setUri(String uri) {
|
||||||
this.uri = Uri.parse(uri);
|
this.uri = Uri.parse(uri);
|
||||||
return this;
|
return this;
|
||||||
@ -117,6 +119,7 @@ public final class DownloadBuilder {
|
|||||||
/**
|
/**
|
||||||
* @see DownloadRequest#uri
|
* @see DownloadRequest#uri
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DownloadBuilder setUri(Uri uri) {
|
public DownloadBuilder setUri(Uri uri) {
|
||||||
this.uri = uri;
|
this.uri = uri;
|
||||||
return this;
|
return this;
|
||||||
@ -125,6 +128,7 @@ public final class DownloadBuilder {
|
|||||||
/**
|
/**
|
||||||
* @see DownloadRequest#mimeType
|
* @see DownloadRequest#mimeType
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DownloadBuilder setMimeType(String mimeType) {
|
public DownloadBuilder setMimeType(String mimeType) {
|
||||||
this.mimeType = mimeType;
|
this.mimeType = mimeType;
|
||||||
return this;
|
return this;
|
||||||
@ -133,6 +137,7 @@ public final class DownloadBuilder {
|
|||||||
/**
|
/**
|
||||||
* @see DownloadRequest#keySetId
|
* @see DownloadRequest#keySetId
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DownloadBuilder setKeySetId(byte[] keySetId) {
|
public DownloadBuilder setKeySetId(byte[] keySetId) {
|
||||||
this.keySetId = keySetId;
|
this.keySetId = keySetId;
|
||||||
return this;
|
return this;
|
||||||
@ -141,6 +146,7 @@ public final class DownloadBuilder {
|
|||||||
/**
|
/**
|
||||||
* @see DownloadRequest#customCacheKey
|
* @see DownloadRequest#customCacheKey
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DownloadBuilder setCacheKey(@Nullable String cacheKey) {
|
public DownloadBuilder setCacheKey(@Nullable String cacheKey) {
|
||||||
this.cacheKey = cacheKey;
|
this.cacheKey = cacheKey;
|
||||||
return this;
|
return this;
|
||||||
@ -149,6 +155,7 @@ public final class DownloadBuilder {
|
|||||||
/**
|
/**
|
||||||
* @see Download#state
|
* @see Download#state
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DownloadBuilder setState(@Download.State int state) {
|
public DownloadBuilder setState(@Download.State int state) {
|
||||||
this.state = state;
|
this.state = state;
|
||||||
return this;
|
return this;
|
||||||
@ -157,6 +164,7 @@ public final class DownloadBuilder {
|
|||||||
/**
|
/**
|
||||||
* @see DownloadProgress#percentDownloaded
|
* @see DownloadProgress#percentDownloaded
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DownloadBuilder setPercentDownloaded(float percentDownloaded) {
|
public DownloadBuilder setPercentDownloaded(float percentDownloaded) {
|
||||||
progress.percentDownloaded = percentDownloaded;
|
progress.percentDownloaded = percentDownloaded;
|
||||||
return this;
|
return this;
|
||||||
@ -165,6 +173,7 @@ public final class DownloadBuilder {
|
|||||||
/**
|
/**
|
||||||
* @see DownloadProgress#bytesDownloaded
|
* @see DownloadProgress#bytesDownloaded
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DownloadBuilder setBytesDownloaded(long bytesDownloaded) {
|
public DownloadBuilder setBytesDownloaded(long bytesDownloaded) {
|
||||||
progress.bytesDownloaded = bytesDownloaded;
|
progress.bytesDownloaded = bytesDownloaded;
|
||||||
return this;
|
return this;
|
||||||
@ -173,6 +182,7 @@ public final class DownloadBuilder {
|
|||||||
/**
|
/**
|
||||||
* @see Download#contentLength
|
* @see Download#contentLength
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DownloadBuilder setContentLength(long contentLength) {
|
public DownloadBuilder setContentLength(long contentLength) {
|
||||||
this.contentLength = contentLength;
|
this.contentLength = contentLength;
|
||||||
return this;
|
return this;
|
||||||
@ -181,6 +191,7 @@ public final class DownloadBuilder {
|
|||||||
/**
|
/**
|
||||||
* @see Download#failureReason
|
* @see Download#failureReason
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DownloadBuilder setFailureReason(int failureReason) {
|
public DownloadBuilder setFailureReason(int failureReason) {
|
||||||
this.failureReason = failureReason;
|
this.failureReason = failureReason;
|
||||||
return this;
|
return this;
|
||||||
@ -189,6 +200,7 @@ public final class DownloadBuilder {
|
|||||||
/**
|
/**
|
||||||
* @see Download#stopReason
|
* @see Download#stopReason
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DownloadBuilder setStopReason(int stopReason) {
|
public DownloadBuilder setStopReason(int stopReason) {
|
||||||
this.stopReason = stopReason;
|
this.stopReason = stopReason;
|
||||||
return this;
|
return this;
|
||||||
@ -197,6 +209,7 @@ public final class DownloadBuilder {
|
|||||||
/**
|
/**
|
||||||
* @see Download#startTimeMs
|
* @see Download#startTimeMs
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DownloadBuilder setStartTimeMs(long startTimeMs) {
|
public DownloadBuilder setStartTimeMs(long startTimeMs) {
|
||||||
this.startTimeMs = startTimeMs;
|
this.startTimeMs = startTimeMs;
|
||||||
return this;
|
return this;
|
||||||
@ -205,6 +218,7 @@ public final class DownloadBuilder {
|
|||||||
/**
|
/**
|
||||||
* @see Download#updateTimeMs
|
* @see Download#updateTimeMs
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DownloadBuilder setUpdateTimeMs(long updateTimeMs) {
|
public DownloadBuilder setUpdateTimeMs(long updateTimeMs) {
|
||||||
this.updateTimeMs = updateTimeMs;
|
this.updateTimeMs = updateTimeMs;
|
||||||
return this;
|
return this;
|
||||||
@ -213,6 +227,7 @@ public final class DownloadBuilder {
|
|||||||
/**
|
/**
|
||||||
* @see DownloadRequest#streamKeys
|
* @see DownloadRequest#streamKeys
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DownloadBuilder setStreamKeys(StreamKey... streamKeys) {
|
public DownloadBuilder setStreamKeys(StreamKey... streamKeys) {
|
||||||
this.streamKeys = Arrays.asList(streamKeys);
|
this.streamKeys = Arrays.asList(streamKeys);
|
||||||
return this;
|
return this;
|
||||||
@ -221,6 +236,7 @@ public final class DownloadBuilder {
|
|||||||
/**
|
/**
|
||||||
* @see DownloadRequest#data
|
* @see DownloadRequest#data
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public DownloadBuilder setCustomMetadata(byte[] customMetadata) {
|
public DownloadBuilder setCustomMetadata(byte[] customMetadata) {
|
||||||
this.customMetadata = customMetadata;
|
this.customMetadata = customMetadata;
|
||||||
return this;
|
return this;
|
||||||
|
@ -17,6 +17,7 @@ package com.google.android.exoplayer2.testutil;
|
|||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import com.google.android.exoplayer2.C;
|
import com.google.android.exoplayer2.C;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
@ -42,15 +43,18 @@ public final class Dumper {
|
|||||||
sb = new StringBuilder();
|
sb = new StringBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Dumper add(String field, @Nullable Object value) {
|
public Dumper add(String field, @Nullable Object value) {
|
||||||
return addString(field + " = " + value + '\n');
|
return addString(field + " = " + value + '\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Dumper add(Dumpable object) {
|
public Dumper add(Dumpable object) {
|
||||||
object.dump(this);
|
object.dump(this);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Dumper add(String field, @Nullable byte[] value) {
|
public Dumper add(String field, @Nullable byte[] value) {
|
||||||
String string =
|
String string =
|
||||||
String.format(
|
String.format(
|
||||||
@ -62,16 +66,19 @@ public final class Dumper {
|
|||||||
return addString(string);
|
return addString(string);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Dumper addTime(String field, long time) {
|
public Dumper addTime(String field, long time) {
|
||||||
return add(field, time == C.TIME_UNSET ? "UNSET TIME" : time);
|
return add(field, time == C.TIME_UNSET ? "UNSET TIME" : time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Dumper startBlock(String name) {
|
public Dumper startBlock(String name) {
|
||||||
addString(name + ":\n");
|
addString(name + ":\n");
|
||||||
indent += INDENT_SIZE_IN_SPACES;
|
indent += INDENT_SIZE_IN_SPACES;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Dumper endBlock() {
|
public Dumper endBlock() {
|
||||||
indent -= INDENT_SIZE_IN_SPACES;
|
indent -= INDENT_SIZE_IN_SPACES;
|
||||||
return this;
|
return this;
|
||||||
@ -82,6 +89,7 @@ public final class Dumper {
|
|||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
private Dumper addString(String string) {
|
private Dumper addString(String string) {
|
||||||
for (int i = 0; i < indent; i++) {
|
for (int i = 0; i < indent; i++) {
|
||||||
sb.append(' ');
|
sb.append(' ');
|
||||||
|
@ -43,6 +43,7 @@ import com.google.android.exoplayer2.util.Clock;
|
|||||||
import com.google.android.exoplayer2.util.HandlerWrapper;
|
import com.google.android.exoplayer2.util.HandlerWrapper;
|
||||||
import com.google.android.exoplayer2.util.MimeTypes;
|
import com.google.android.exoplayer2.util.MimeTypes;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -109,6 +110,7 @@ public final class ExoPlayerTestRunner implements Player.Listener, ActionSchedul
|
|||||||
* runner.
|
* runner.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setTimeline(Timeline timeline) {
|
public Builder setTimeline(Timeline timeline) {
|
||||||
assertThat(mediaSources).isEmpty();
|
assertThat(mediaSources).isEmpty();
|
||||||
assertFalse(skipSettingMediaSources);
|
assertFalse(skipSettingMediaSources);
|
||||||
@ -124,6 +126,7 @@ public final class ExoPlayerTestRunner implements Player.Listener, ActionSchedul
|
|||||||
* @param manifest A manifest to be used by a {@link FakeMediaSource} in the test runner.
|
* @param manifest A manifest to be used by a {@link FakeMediaSource} in the test runner.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setManifest(Object manifest) {
|
public Builder setManifest(Object manifest) {
|
||||||
assertThat(mediaSources).isEmpty();
|
assertThat(mediaSources).isEmpty();
|
||||||
assertFalse(skipSettingMediaSources);
|
assertFalse(skipSettingMediaSources);
|
||||||
@ -138,6 +141,7 @@ public final class ExoPlayerTestRunner implements Player.Listener, ActionSchedul
|
|||||||
* @param positionMs The position in milliseconds to seek to.
|
* @param positionMs The position in milliseconds to seek to.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder initialSeek(int mediaItemIndex, long positionMs) {
|
public Builder initialSeek(int mediaItemIndex, long positionMs) {
|
||||||
this.initialMediaItemIndex = mediaItemIndex;
|
this.initialMediaItemIndex = mediaItemIndex;
|
||||||
this.initialPositionMs = positionMs;
|
this.initialPositionMs = positionMs;
|
||||||
@ -154,6 +158,7 @@ public final class ExoPlayerTestRunner implements Player.Listener, ActionSchedul
|
|||||||
* @param mediaSources The {@link MediaSource}s to be used by the test runner.
|
* @param mediaSources The {@link MediaSource}s to be used by the test runner.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMediaSources(MediaSource... mediaSources) {
|
public Builder setMediaSources(MediaSource... mediaSources) {
|
||||||
assertThat(timeline).isNull();
|
assertThat(timeline).isNull();
|
||||||
assertThat(manifest).isNull();
|
assertThat(manifest).isNull();
|
||||||
@ -171,6 +176,7 @@ public final class ExoPlayerTestRunner implements Player.Listener, ActionSchedul
|
|||||||
* @param supportedFormats A list of supported {@link Format}s.
|
* @param supportedFormats A list of supported {@link Format}s.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSupportedFormats(Format... supportedFormats) {
|
public Builder setSupportedFormats(Format... supportedFormats) {
|
||||||
this.supportedFormats = supportedFormats;
|
this.supportedFormats = supportedFormats;
|
||||||
return this;
|
return this;
|
||||||
@ -183,6 +189,7 @@ public final class ExoPlayerTestRunner implements Player.Listener, ActionSchedul
|
|||||||
*
|
*
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder skipSettingMediaSources() {
|
public Builder skipSettingMediaSources() {
|
||||||
assertThat(timeline).isNull();
|
assertThat(timeline).isNull();
|
||||||
assertThat(manifest).isNull();
|
assertThat(manifest).isNull();
|
||||||
@ -195,6 +202,7 @@ public final class ExoPlayerTestRunner implements Player.Listener, ActionSchedul
|
|||||||
* @see TestExoPlayerBuilder#setUseLazyPreparation(boolean)
|
* @see TestExoPlayerBuilder#setUseLazyPreparation(boolean)
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setUseLazyPreparation(boolean useLazyPreparation) {
|
public Builder setUseLazyPreparation(boolean useLazyPreparation) {
|
||||||
testPlayerBuilder.setUseLazyPreparation(useLazyPreparation);
|
testPlayerBuilder.setUseLazyPreparation(useLazyPreparation);
|
||||||
return this;
|
return this;
|
||||||
@ -206,6 +214,7 @@ public final class ExoPlayerTestRunner implements Player.Listener, ActionSchedul
|
|||||||
* @param pauseAtEndOfMediaItems Whether to pause at the end of media items.
|
* @param pauseAtEndOfMediaItems Whether to pause at the end of media items.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPauseAtEndOfMediaItems(boolean pauseAtEndOfMediaItems) {
|
public Builder setPauseAtEndOfMediaItems(boolean pauseAtEndOfMediaItems) {
|
||||||
this.pauseAtEndOfMediaItems = pauseAtEndOfMediaItems;
|
this.pauseAtEndOfMediaItems = pauseAtEndOfMediaItems;
|
||||||
return this;
|
return this;
|
||||||
@ -215,6 +224,7 @@ public final class ExoPlayerTestRunner implements Player.Listener, ActionSchedul
|
|||||||
* @see TestExoPlayerBuilder#setTrackSelector(DefaultTrackSelector)
|
* @see TestExoPlayerBuilder#setTrackSelector(DefaultTrackSelector)
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setTrackSelector(DefaultTrackSelector trackSelector) {
|
public Builder setTrackSelector(DefaultTrackSelector trackSelector) {
|
||||||
testPlayerBuilder.setTrackSelector(trackSelector);
|
testPlayerBuilder.setTrackSelector(trackSelector);
|
||||||
return this;
|
return this;
|
||||||
@ -224,6 +234,7 @@ public final class ExoPlayerTestRunner implements Player.Listener, ActionSchedul
|
|||||||
* @see TestExoPlayerBuilder#setLoadControl(LoadControl)
|
* @see TestExoPlayerBuilder#setLoadControl(LoadControl)
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setLoadControl(LoadControl loadControl) {
|
public Builder setLoadControl(LoadControl loadControl) {
|
||||||
testPlayerBuilder.setLoadControl(loadControl);
|
testPlayerBuilder.setLoadControl(loadControl);
|
||||||
return this;
|
return this;
|
||||||
@ -233,6 +244,7 @@ public final class ExoPlayerTestRunner implements Player.Listener, ActionSchedul
|
|||||||
* @see TestExoPlayerBuilder#setBandwidthMeter(BandwidthMeter)
|
* @see TestExoPlayerBuilder#setBandwidthMeter(BandwidthMeter)
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setBandwidthMeter(BandwidthMeter bandwidthMeter) {
|
public Builder setBandwidthMeter(BandwidthMeter bandwidthMeter) {
|
||||||
this.testPlayerBuilder.setBandwidthMeter(bandwidthMeter);
|
this.testPlayerBuilder.setBandwidthMeter(bandwidthMeter);
|
||||||
return this;
|
return this;
|
||||||
@ -242,6 +254,7 @@ public final class ExoPlayerTestRunner implements Player.Listener, ActionSchedul
|
|||||||
* @see TestExoPlayerBuilder#setRenderers(Renderer...)
|
* @see TestExoPlayerBuilder#setRenderers(Renderer...)
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setRenderers(Renderer... renderers) {
|
public Builder setRenderers(Renderer... renderers) {
|
||||||
testPlayerBuilder.setRenderers(renderers);
|
testPlayerBuilder.setRenderers(renderers);
|
||||||
return this;
|
return this;
|
||||||
@ -251,6 +264,7 @@ public final class ExoPlayerTestRunner implements Player.Listener, ActionSchedul
|
|||||||
* @see TestExoPlayerBuilder#setRenderersFactory(RenderersFactory)
|
* @see TestExoPlayerBuilder#setRenderersFactory(RenderersFactory)
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setRenderersFactory(RenderersFactory renderersFactory) {
|
public Builder setRenderersFactory(RenderersFactory renderersFactory) {
|
||||||
testPlayerBuilder.setRenderersFactory(renderersFactory);
|
testPlayerBuilder.setRenderersFactory(renderersFactory);
|
||||||
return this;
|
return this;
|
||||||
@ -260,6 +274,7 @@ public final class ExoPlayerTestRunner implements Player.Listener, ActionSchedul
|
|||||||
* @see TestExoPlayerBuilder#setClock(Clock)
|
* @see TestExoPlayerBuilder#setClock(Clock)
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setClock(Clock clock) {
|
public Builder setClock(Clock clock) {
|
||||||
testPlayerBuilder.setClock(clock);
|
testPlayerBuilder.setClock(clock);
|
||||||
return this;
|
return this;
|
||||||
@ -272,6 +287,7 @@ public final class ExoPlayerTestRunner implements Player.Listener, ActionSchedul
|
|||||||
* @param actionSchedule An {@link ActionSchedule} to be used by the test runner.
|
* @param actionSchedule An {@link ActionSchedule} to be used by the test runner.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setActionSchedule(ActionSchedule actionSchedule) {
|
public Builder setActionSchedule(ActionSchedule actionSchedule) {
|
||||||
this.actionSchedule = actionSchedule;
|
this.actionSchedule = actionSchedule;
|
||||||
return this;
|
return this;
|
||||||
@ -283,6 +299,7 @@ public final class ExoPlayerTestRunner implements Player.Listener, ActionSchedul
|
|||||||
* @param surface The {@link Surface} to be used by the player.
|
* @param surface The {@link Surface} to be used by the player.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setVideoSurface(Surface surface) {
|
public Builder setVideoSurface(Surface surface) {
|
||||||
this.surface = surface;
|
this.surface = surface;
|
||||||
return this;
|
return this;
|
||||||
@ -295,6 +312,7 @@ public final class ExoPlayerTestRunner implements Player.Listener, ActionSchedul
|
|||||||
* to player events.
|
* to player events.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPlayerListener(Player.Listener playerListener) {
|
public Builder setPlayerListener(Player.Listener playerListener) {
|
||||||
this.playerListener = playerListener;
|
this.playerListener = playerListener;
|
||||||
return this;
|
return this;
|
||||||
@ -306,6 +324,7 @@ public final class ExoPlayerTestRunner implements Player.Listener, ActionSchedul
|
|||||||
* @param analyticsListener An {@link AnalyticsListener} to be registered.
|
* @param analyticsListener An {@link AnalyticsListener} to be registered.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setAnalyticsListener(AnalyticsListener analyticsListener) {
|
public Builder setAnalyticsListener(AnalyticsListener analyticsListener) {
|
||||||
this.analyticsListener = analyticsListener;
|
this.analyticsListener = analyticsListener;
|
||||||
return this;
|
return this;
|
||||||
@ -320,6 +339,7 @@ public final class ExoPlayerTestRunner implements Player.Listener, ActionSchedul
|
|||||||
* or idle state.
|
* or idle state.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setExpectedPlayerEndedCount(int expectedPlayerEndedCount) {
|
public Builder setExpectedPlayerEndedCount(int expectedPlayerEndedCount) {
|
||||||
this.expectedPlayerEndedCount = expectedPlayerEndedCount;
|
this.expectedPlayerEndedCount = expectedPlayerEndedCount;
|
||||||
return this;
|
return this;
|
||||||
@ -429,6 +449,7 @@ public final class ExoPlayerTestRunner implements Player.Listener, ActionSchedul
|
|||||||
*
|
*
|
||||||
* @return This test runner.
|
* @return This test runner.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ExoPlayerTestRunner start() {
|
public ExoPlayerTestRunner start() {
|
||||||
return start(/* doPrepare= */ true);
|
return start(/* doPrepare= */ true);
|
||||||
}
|
}
|
||||||
@ -440,6 +461,7 @@ public final class ExoPlayerTestRunner implements Player.Listener, ActionSchedul
|
|||||||
* @param doPrepare Whether the player should be prepared.
|
* @param doPrepare Whether the player should be prepared.
|
||||||
* @return This test runner.
|
* @return This test runner.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ExoPlayerTestRunner start(boolean doPrepare) {
|
public ExoPlayerTestRunner start(boolean doPrepare) {
|
||||||
handler.post(
|
handler.post(
|
||||||
() -> {
|
() -> {
|
||||||
@ -494,6 +516,7 @@ public final class ExoPlayerTestRunner implements Player.Listener, ActionSchedul
|
|||||||
* @return This test runner.
|
* @return This test runner.
|
||||||
* @throws Exception If any exception occurred during playback, release, or due to a timeout.
|
* @throws Exception If any exception occurred during playback, release, or due to a timeout.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ExoPlayerTestRunner blockUntilEnded(long timeoutMs) throws Exception {
|
public ExoPlayerTestRunner blockUntilEnded(long timeoutMs) throws Exception {
|
||||||
clock.onThreadBlocked();
|
clock.onThreadBlocked();
|
||||||
if (!endedCountDownLatch.await(timeoutMs, MILLISECONDS)) {
|
if (!endedCountDownLatch.await(timeoutMs, MILLISECONDS)) {
|
||||||
@ -516,6 +539,7 @@ public final class ExoPlayerTestRunner implements Player.Listener, ActionSchedul
|
|||||||
* @throws TimeoutException If the action schedule did not finish within the specified timeout.
|
* @throws TimeoutException If the action schedule did not finish within the specified timeout.
|
||||||
* @throws InterruptedException If the test thread gets interrupted while waiting.
|
* @throws InterruptedException If the test thread gets interrupted while waiting.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public ExoPlayerTestRunner blockUntilActionScheduleFinished(long timeoutMs)
|
public ExoPlayerTestRunner blockUntilActionScheduleFinished(long timeoutMs)
|
||||||
throws TimeoutException, InterruptedException {
|
throws TimeoutException, InterruptedException {
|
||||||
clock.onThreadBlocked();
|
clock.onThreadBlocked();
|
||||||
|
@ -32,6 +32,7 @@ import com.google.android.exoplayer2.util.Assertions;
|
|||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
import com.google.common.base.Joiner;
|
import com.google.common.base.Joiner;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -145,11 +146,13 @@ public final class ExtractorAsserts {
|
|||||||
private @MonotonicNonNull String dumpFilesPrefix;
|
private @MonotonicNonNull String dumpFilesPrefix;
|
||||||
private boolean deduplicateConsecutiveFormats;
|
private boolean deduplicateConsecutiveFormats;
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setDumpFilesPrefix(String dumpFilesPrefix) {
|
public Builder setDumpFilesPrefix(String dumpFilesPrefix) {
|
||||||
this.dumpFilesPrefix = dumpFilesPrefix;
|
this.dumpFilesPrefix = dumpFilesPrefix;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setDeduplicateConsecutiveFormats(boolean deduplicateConsecutiveFormats) {
|
public Builder setDeduplicateConsecutiveFormats(boolean deduplicateConsecutiveFormats) {
|
||||||
this.deduplicateConsecutiveFormats = deduplicateConsecutiveFormats;
|
this.deduplicateConsecutiveFormats = deduplicateConsecutiveFormats;
|
||||||
return this;
|
return this;
|
||||||
|
@ -20,6 +20,7 @@ import androidx.annotation.Nullable;
|
|||||||
import com.google.android.exoplayer2.C;
|
import com.google.android.exoplayer2.C;
|
||||||
import com.google.android.exoplayer2.upstream.DataSpec;
|
import com.google.android.exoplayer2.upstream.DataSpec;
|
||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -152,12 +153,14 @@ public class FakeDataSet {
|
|||||||
* the {@link DataSpec#length} of the argument, including the case where the length is equal to
|
* the {@link DataSpec#length} of the argument, including the case where the length is equal to
|
||||||
* {@link C#LENGTH_UNSET}.
|
* {@link C#LENGTH_UNSET}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public FakeData setSimulateUnknownLength(boolean simulateUnknownLength) {
|
public FakeData setSimulateUnknownLength(boolean simulateUnknownLength) {
|
||||||
this.simulateUnknownLength = simulateUnknownLength;
|
this.simulateUnknownLength = simulateUnknownLength;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Appends to the underlying data. */
|
/** Appends to the underlying data. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public FakeData appendReadData(byte[] data) {
|
public FakeData appendReadData(byte[] data) {
|
||||||
Assertions.checkState(data.length > 0);
|
Assertions.checkState(data.length > 0);
|
||||||
segments.add(new Segment(data, getLastSegment()));
|
segments.add(new Segment(data, getLastSegment()));
|
||||||
@ -168,6 +171,7 @@ public class FakeDataSet {
|
|||||||
* Appends a data segment of the specified length. No actual data is available and the {@link
|
* Appends a data segment of the specified length. No actual data is available and the {@link
|
||||||
* FakeDataSource} will perform no copy operations when this data is read.
|
* FakeDataSource} will perform no copy operations when this data is read.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public FakeData appendReadData(int length) {
|
public FakeData appendReadData(int length) {
|
||||||
Assertions.checkState(length > 0);
|
Assertions.checkState(length > 0);
|
||||||
segments.add(new Segment(length, getLastSegment()));
|
segments.add(new Segment(length, getLastSegment()));
|
||||||
@ -175,12 +179,14 @@ public class FakeDataSet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Appends an error in the underlying data. */
|
/** Appends an error in the underlying data. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public FakeData appendReadError(IOException exception) {
|
public FakeData appendReadError(IOException exception) {
|
||||||
segments.add(new Segment(exception, getLastSegment()));
|
segments.add(new Segment(exception, getLastSegment()));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Appends an action. */
|
/** Appends an action. */
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public FakeData appendReadAction(Runnable action) {
|
public FakeData appendReadAction(Runnable action) {
|
||||||
segments.add(new Segment(action, getLastSegment()));
|
segments.add(new Segment(action, getLastSegment()));
|
||||||
return this;
|
return this;
|
||||||
|
@ -30,6 +30,7 @@ import com.google.android.exoplayer2.upstream.DataSourceException;
|
|||||||
import com.google.android.exoplayer2.upstream.DataSpec;
|
import com.google.android.exoplayer2.upstream.DataSpec;
|
||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
@ -49,11 +50,13 @@ public class FakeDataSource extends BaseDataSource {
|
|||||||
fakeDataSet = new FakeDataSet();
|
fakeDataSet = new FakeDataSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public final Factory setFakeDataSet(FakeDataSet fakeDataSet) {
|
public final Factory setFakeDataSet(FakeDataSet fakeDataSet) {
|
||||||
this.fakeDataSet = fakeDataSet;
|
this.fakeDataSet = fakeDataSet;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public final Factory setIsNetwork(boolean isNetwork) {
|
public final Factory setIsNetwork(boolean isNetwork) {
|
||||||
this.isNetwork = isNetwork;
|
this.isNetwork = isNetwork;
|
||||||
return this;
|
return this;
|
||||||
|
@ -39,6 +39,7 @@ import com.google.common.collect.ImmutableList;
|
|||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.primitives.Bytes;
|
import com.google.common.primitives.Bytes;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -83,6 +84,7 @@ public final class FakeExoMediaDrm implements ExoMediaDrm {
|
|||||||
*
|
*
|
||||||
* <p>Defaults to true.
|
* <p>Defaults to true.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setEnforceValidKeyResponses(boolean enforceValidKeyResponses) {
|
public Builder setEnforceValidKeyResponses(boolean enforceValidKeyResponses) {
|
||||||
this.enforceValidKeyResponses = enforceValidKeyResponses;
|
this.enforceValidKeyResponses = enforceValidKeyResponses;
|
||||||
return this;
|
return this;
|
||||||
@ -98,6 +100,7 @@ public final class FakeExoMediaDrm implements ExoMediaDrm {
|
|||||||
*
|
*
|
||||||
* <p>Defaults to 0 (i.e. device is already provisioned).
|
* <p>Defaults to 0 (i.e. device is already provisioned).
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setProvisionsRequired(int provisionsRequired) {
|
public Builder setProvisionsRequired(int provisionsRequired) {
|
||||||
this.provisionsRequired = provisionsRequired;
|
this.provisionsRequired = provisionsRequired;
|
||||||
return this;
|
return this;
|
||||||
@ -108,6 +111,7 @@ public final class FakeExoMediaDrm implements ExoMediaDrm {
|
|||||||
* {@link #getKeyRequest(byte[], List, int, HashMap)} instead of the default behaviour of
|
* {@link #getKeyRequest(byte[], List, int, HashMap)} instead of the default behaviour of
|
||||||
* throwing from {@link #openSession()}.
|
* throwing from {@link #openSession()}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder throwNotProvisionedExceptionFromGetKeyRequest() {
|
public Builder throwNotProvisionedExceptionFromGetKeyRequest() {
|
||||||
this.throwNotProvisionedExceptionFromGetKeyRequest = true;
|
this.throwNotProvisionedExceptionFromGetKeyRequest = true;
|
||||||
return this;
|
return this;
|
||||||
@ -121,6 +125,7 @@ public final class FakeExoMediaDrm implements ExoMediaDrm {
|
|||||||
*
|
*
|
||||||
* <p>Defaults to {@link Integer#MAX_VALUE}.
|
* <p>Defaults to {@link Integer#MAX_VALUE}.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setMaxConcurrentSessions(int maxConcurrentSessions) {
|
public Builder setMaxConcurrentSessions(int maxConcurrentSessions) {
|
||||||
this.maxConcurrentSessions = maxConcurrentSessions;
|
this.maxConcurrentSessions = maxConcurrentSessions;
|
||||||
return this;
|
return this;
|
||||||
|
@ -22,6 +22,7 @@ import android.util.SparseBooleanArray;
|
|||||||
import com.google.android.exoplayer2.C;
|
import com.google.android.exoplayer2.C;
|
||||||
import com.google.android.exoplayer2.extractor.ExtractorInput;
|
import com.google.android.exoplayer2.extractor.ExtractorInput;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.io.EOFException;
|
import java.io.EOFException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@ -291,21 +292,25 @@ public final class FakeExtractorInput implements ExtractorInput {
|
|||||||
data = Util.EMPTY_BYTE_ARRAY;
|
data = Util.EMPTY_BYTE_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setData(byte[] data) {
|
public Builder setData(byte[] data) {
|
||||||
this.data = data;
|
this.data = data;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSimulateUnknownLength(boolean simulateUnknownLength) {
|
public Builder setSimulateUnknownLength(boolean simulateUnknownLength) {
|
||||||
this.simulateUnknownLength = simulateUnknownLength;
|
this.simulateUnknownLength = simulateUnknownLength;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSimulatePartialReads(boolean simulatePartialReads) {
|
public Builder setSimulatePartialReads(boolean simulatePartialReads) {
|
||||||
this.simulatePartialReads = simulatePartialReads;
|
this.simulatePartialReads = simulatePartialReads;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setSimulateIOErrors(boolean simulateIOErrors) {
|
public Builder setSimulateIOErrors(boolean simulateIOErrors) {
|
||||||
this.simulateIOErrors = simulateIOErrors;
|
this.simulateIOErrors = simulateIOErrors;
|
||||||
return this;
|
return this;
|
||||||
|
@ -33,6 +33,7 @@ import com.google.android.exoplayer2.upstream.BandwidthMeter;
|
|||||||
import com.google.android.exoplayer2.upstream.DefaultBandwidthMeter;
|
import com.google.android.exoplayer2.upstream.DefaultBandwidthMeter;
|
||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
import com.google.android.exoplayer2.util.Clock;
|
import com.google.android.exoplayer2.util.Clock;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||||
|
|
||||||
/** A builder of {@link ExoPlayer} instances for testing. */
|
/** A builder of {@link ExoPlayer} instances for testing. */
|
||||||
@ -71,6 +72,7 @@ public class TestExoPlayerBuilder {
|
|||||||
* @param useLazyPreparation Whether to use lazy preparation.
|
* @param useLazyPreparation Whether to use lazy preparation.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TestExoPlayerBuilder setUseLazyPreparation(boolean useLazyPreparation) {
|
public TestExoPlayerBuilder setUseLazyPreparation(boolean useLazyPreparation) {
|
||||||
this.useLazyPreparation = useLazyPreparation;
|
this.useLazyPreparation = useLazyPreparation;
|
||||||
return this;
|
return this;
|
||||||
@ -88,6 +90,7 @@ public class TestExoPlayerBuilder {
|
|||||||
* @param trackSelector The {@link DefaultTrackSelector} to be used by the player.
|
* @param trackSelector The {@link DefaultTrackSelector} to be used by the player.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TestExoPlayerBuilder setTrackSelector(DefaultTrackSelector trackSelector) {
|
public TestExoPlayerBuilder setTrackSelector(DefaultTrackSelector trackSelector) {
|
||||||
Assertions.checkNotNull(trackSelector);
|
Assertions.checkNotNull(trackSelector);
|
||||||
this.trackSelector = trackSelector;
|
this.trackSelector = trackSelector;
|
||||||
@ -106,6 +109,7 @@ public class TestExoPlayerBuilder {
|
|||||||
* @param loadControl The {@link LoadControl} to be used by the player.
|
* @param loadControl The {@link LoadControl} to be used by the player.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TestExoPlayerBuilder setLoadControl(LoadControl loadControl) {
|
public TestExoPlayerBuilder setLoadControl(LoadControl loadControl) {
|
||||||
this.loadControl = loadControl;
|
this.loadControl = loadControl;
|
||||||
return this;
|
return this;
|
||||||
@ -123,6 +127,7 @@ public class TestExoPlayerBuilder {
|
|||||||
* @param bandwidthMeter The {@link BandwidthMeter} to be used by the player.
|
* @param bandwidthMeter The {@link BandwidthMeter} to be used by the player.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TestExoPlayerBuilder setBandwidthMeter(BandwidthMeter bandwidthMeter) {
|
public TestExoPlayerBuilder setBandwidthMeter(BandwidthMeter bandwidthMeter) {
|
||||||
Assertions.checkNotNull(bandwidthMeter);
|
Assertions.checkNotNull(bandwidthMeter);
|
||||||
this.bandwidthMeter = bandwidthMeter;
|
this.bandwidthMeter = bandwidthMeter;
|
||||||
@ -142,6 +147,7 @@ public class TestExoPlayerBuilder {
|
|||||||
* @param renderers A list of {@link Renderer}s to be used by the player.
|
* @param renderers A list of {@link Renderer}s to be used by the player.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TestExoPlayerBuilder setRenderers(Renderer... renderers) {
|
public TestExoPlayerBuilder setRenderers(Renderer... renderers) {
|
||||||
assertThat(renderersFactory).isNull();
|
assertThat(renderersFactory).isNull();
|
||||||
this.renderers = renderers;
|
this.renderers = renderers;
|
||||||
@ -167,6 +173,7 @@ public class TestExoPlayerBuilder {
|
|||||||
* @param renderersFactory A {@link RenderersFactory} to be used by the player.
|
* @param renderersFactory A {@link RenderersFactory} to be used by the player.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TestExoPlayerBuilder setRenderersFactory(RenderersFactory renderersFactory) {
|
public TestExoPlayerBuilder setRenderersFactory(RenderersFactory renderersFactory) {
|
||||||
assertThat(renderers).isNull();
|
assertThat(renderers).isNull();
|
||||||
this.renderersFactory = renderersFactory;
|
this.renderersFactory = renderersFactory;
|
||||||
@ -189,6 +196,7 @@ public class TestExoPlayerBuilder {
|
|||||||
* @param clock A {@link Clock} to be used by the player.
|
* @param clock A {@link Clock} to be used by the player.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TestExoPlayerBuilder setClock(Clock clock) {
|
public TestExoPlayerBuilder setClock(Clock clock) {
|
||||||
assertThat(clock).isNotNull();
|
assertThat(clock).isNotNull();
|
||||||
this.clock = clock;
|
this.clock = clock;
|
||||||
@ -206,6 +214,7 @@ public class TestExoPlayerBuilder {
|
|||||||
* @param looper The {@link Looper} to be used by the player.
|
* @param looper The {@link Looper} to be used by the player.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TestExoPlayerBuilder setLooper(Looper looper) {
|
public TestExoPlayerBuilder setLooper(Looper looper) {
|
||||||
this.looper = looper;
|
this.looper = looper;
|
||||||
return this;
|
return this;
|
||||||
@ -235,6 +244,7 @@ public class TestExoPlayerBuilder {
|
|||||||
* @param mediaSourceFactory The {@link MediaSource.Factory} to be used by the player.
|
* @param mediaSourceFactory The {@link MediaSource.Factory} to be used by the player.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TestExoPlayerBuilder setMediaSourceFactory(MediaSource.Factory mediaSourceFactory) {
|
public TestExoPlayerBuilder setMediaSourceFactory(MediaSource.Factory mediaSourceFactory) {
|
||||||
this.mediaSourceFactory = mediaSourceFactory;
|
this.mediaSourceFactory = mediaSourceFactory;
|
||||||
return this;
|
return this;
|
||||||
@ -246,6 +256,7 @@ public class TestExoPlayerBuilder {
|
|||||||
* @param seekBackIncrementMs The seek back increment to be used by the player.
|
* @param seekBackIncrementMs The seek back increment to be used by the player.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TestExoPlayerBuilder setSeekBackIncrementMs(long seekBackIncrementMs) {
|
public TestExoPlayerBuilder setSeekBackIncrementMs(long seekBackIncrementMs) {
|
||||||
this.seekBackIncrementMs = seekBackIncrementMs;
|
this.seekBackIncrementMs = seekBackIncrementMs;
|
||||||
return this;
|
return this;
|
||||||
@ -262,6 +273,7 @@ public class TestExoPlayerBuilder {
|
|||||||
* @param seekForwardIncrementMs The seek forward increment to be used by the player.
|
* @param seekForwardIncrementMs The seek forward increment to be used by the player.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public TestExoPlayerBuilder setSeekForwardIncrementMs(long seekForwardIncrementMs) {
|
public TestExoPlayerBuilder setSeekForwardIncrementMs(long seekForwardIncrementMs) {
|
||||||
this.seekForwardIncrementMs = seekForwardIncrementMs;
|
this.seekForwardIncrementMs = seekForwardIncrementMs;
|
||||||
return this;
|
return this;
|
||||||
|
@ -32,6 +32,7 @@ import com.google.common.base.Strings;
|
|||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
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;
|
||||||
@ -118,6 +119,7 @@ public class WebServerDispatcher extends Dispatcher {
|
|||||||
*
|
*
|
||||||
* @return this builder, for convenience.
|
* @return this builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setPath(String path) {
|
public Builder setPath(String path) {
|
||||||
this.path = path.startsWith("/") ? path : "/" + path;
|
this.path = path.startsWith("/") ? path : "/" + path;
|
||||||
return this;
|
return this;
|
||||||
@ -128,6 +130,7 @@ public class WebServerDispatcher extends Dispatcher {
|
|||||||
*
|
*
|
||||||
* @return this builder, for convenience.
|
* @return this builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setData(byte[] data) {
|
public Builder setData(byte[] data) {
|
||||||
this.data = data;
|
this.data = data;
|
||||||
return this;
|
return this;
|
||||||
@ -138,6 +141,7 @@ public class WebServerDispatcher extends Dispatcher {
|
|||||||
*
|
*
|
||||||
* @return this builder, for convenience.
|
* @return this builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder supportsRangeRequests(boolean supportsRangeRequests) {
|
public Builder supportsRangeRequests(boolean supportsRangeRequests) {
|
||||||
this.supportsRangeRequests = supportsRangeRequests;
|
this.supportsRangeRequests = supportsRangeRequests;
|
||||||
return this;
|
return this;
|
||||||
@ -151,6 +155,7 @@ public class WebServerDispatcher extends Dispatcher {
|
|||||||
*
|
*
|
||||||
* @return this builder, for convenience.
|
* @return this builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder resolvesToUnknownLength(boolean resolvesToUnknownLength) {
|
public Builder resolvesToUnknownLength(boolean resolvesToUnknownLength) {
|
||||||
this.resolvesToUnknownLength = resolvesToUnknownLength;
|
this.resolvesToUnknownLength = resolvesToUnknownLength;
|
||||||
return this;
|
return this;
|
||||||
@ -162,6 +167,7 @@ public class WebServerDispatcher extends Dispatcher {
|
|||||||
*
|
*
|
||||||
* @return this builder, for convenience.
|
* @return this builder, for convenience.
|
||||||
*/
|
*/
|
||||||
|
@CanIgnoreReturnValue
|
||||||
public Builder setGzipSupport(@GzipSupport int gzipSupport) {
|
public Builder setGzipSupport(@GzipSupport int gzipSupport) {
|
||||||
this.gzipSupport = gzipSupport;
|
this.gzipSupport = gzipSupport;
|
||||||
return this;
|
return this;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user