mirror of
https://github.com/androidx/media.git
synced 2025-05-07 23:50:44 +08:00
Rename DEFAULT_WITHOUT_VIEWPORT to DEFAULT_WITHOUT_CONTEXT.
PiperOrigin-RevId: 270227069
This commit is contained in:
parent
852c3a53e7
commit
531c5638a2
@ -83,17 +83,32 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|||||||
*/
|
*/
|
||||||
public final class DownloadHelper {
|
public final class DownloadHelper {
|
||||||
|
|
||||||
/** Default track selection parameters for downloading, but without any viewport constraints. */
|
/**
|
||||||
public static final Parameters DEFAULT_TRACK_SELECTOR_PARAMETERS_WITHOUT_VIEWPORT =
|
* Default track selection parameters for downloading, but without any {@link Context}
|
||||||
Parameters.DEFAULT_WITHOUT_VIEWPORT.buildUpon().setForceHighestSupportedBitrate(true).build();
|
* constraints.
|
||||||
|
*
|
||||||
|
* <p>If possible, use {@link #getDefaultTrackSelectorParameters(Context)} instead.
|
||||||
|
*
|
||||||
|
* @see DefaultTrackSelector.Parameters#DEFAULT_WITHOUT_CONTEXT
|
||||||
|
*/
|
||||||
|
public static final Parameters DEFAULT_TRACK_SELECTOR_PARAMETERS_WITHOUT_CONTEXT =
|
||||||
|
Parameters.DEFAULT_WITHOUT_CONTEXT.buildUpon().setForceHighestSupportedBitrate(true).build();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated This instance does not have viewport constraints configured for the primary
|
* @deprecated This instance does not have {@link Context} constraints. Use {@link
|
||||||
* display. Use {@link #getDefaultTrackSelectorParameters(Context)} instead.
|
* #getDefaultTrackSelectorParameters(Context)} instead.
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
public static final Parameters DEFAULT_TRACK_SELECTOR_PARAMETERS_WITHOUT_VIEWPORT =
|
||||||
|
DEFAULT_TRACK_SELECTOR_PARAMETERS_WITHOUT_CONTEXT;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated This instance does not have {@link Context} constraints. Use {@link
|
||||||
|
* #getDefaultTrackSelectorParameters(Context)} instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public static final DefaultTrackSelector.Parameters DEFAULT_TRACK_SELECTOR_PARAMETERS =
|
public static final DefaultTrackSelector.Parameters DEFAULT_TRACK_SELECTOR_PARAMETERS =
|
||||||
DEFAULT_TRACK_SELECTOR_PARAMETERS_WITHOUT_VIEWPORT;
|
DEFAULT_TRACK_SELECTOR_PARAMETERS_WITHOUT_CONTEXT;
|
||||||
|
|
||||||
/** Returns the default parameters used for track selection for downloading. */
|
/** Returns the default parameters used for track selection for downloading. */
|
||||||
public static DefaultTrackSelector.Parameters getDefaultTrackSelectorParameters(Context context) {
|
public static DefaultTrackSelector.Parameters getDefaultTrackSelectorParameters(Context context) {
|
||||||
@ -606,7 +621,7 @@ public final class DownloadHelper {
|
|||||||
assertPreparedWithMedia();
|
assertPreparedWithMedia();
|
||||||
for (int periodIndex = 0; periodIndex < mappedTrackInfos.length; periodIndex++) {
|
for (int periodIndex = 0; periodIndex < mappedTrackInfos.length; periodIndex++) {
|
||||||
DefaultTrackSelector.ParametersBuilder parametersBuilder =
|
DefaultTrackSelector.ParametersBuilder parametersBuilder =
|
||||||
DEFAULT_TRACK_SELECTOR_PARAMETERS.buildUpon();
|
DEFAULT_TRACK_SELECTOR_PARAMETERS_WITHOUT_CONTEXT.buildUpon();
|
||||||
MappedTrackInfo mappedTrackInfo = mappedTrackInfos[periodIndex];
|
MappedTrackInfo mappedTrackInfo = mappedTrackInfos[periodIndex];
|
||||||
int rendererCount = mappedTrackInfo.getRendererCount();
|
int rendererCount = mappedTrackInfo.getRendererCount();
|
||||||
for (int rendererIndex = 0; rendererIndex < rendererCount; rendererIndex++) {
|
for (int rendererIndex = 0; rendererIndex < rendererCount; rendererIndex++) {
|
||||||
@ -636,7 +651,7 @@ public final class DownloadHelper {
|
|||||||
assertPreparedWithMedia();
|
assertPreparedWithMedia();
|
||||||
for (int periodIndex = 0; periodIndex < mappedTrackInfos.length; periodIndex++) {
|
for (int periodIndex = 0; periodIndex < mappedTrackInfos.length; periodIndex++) {
|
||||||
DefaultTrackSelector.ParametersBuilder parametersBuilder =
|
DefaultTrackSelector.ParametersBuilder parametersBuilder =
|
||||||
DEFAULT_TRACK_SELECTOR_PARAMETERS.buildUpon();
|
DEFAULT_TRACK_SELECTOR_PARAMETERS_WITHOUT_CONTEXT.buildUpon();
|
||||||
MappedTrackInfo mappedTrackInfo = mappedTrackInfos[periodIndex];
|
MappedTrackInfo mappedTrackInfo = mappedTrackInfos[periodIndex];
|
||||||
int rendererCount = mappedTrackInfo.getRendererCount();
|
int rendererCount = mappedTrackInfo.getRendererCount();
|
||||||
for (int rendererIndex = 0; rendererIndex < rendererCount; rendererIndex++) {
|
for (int rendererIndex = 0; rendererIndex < rendererCount; rendererIndex++) {
|
||||||
|
@ -187,12 +187,12 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
private final SparseBooleanArray rendererDisabledFlags;
|
private final SparseBooleanArray rendererDisabledFlags;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Initial viewport constraints will not be set based on the primary display when
|
* @deprecated {@link Context} constraints will not be set using this constructor. Use {@link
|
||||||
* using this constructor. Use {@link #ParametersBuilder(Context)} instead.
|
* #ParametersBuilder(Context)} instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public ParametersBuilder() {
|
public ParametersBuilder() {
|
||||||
this(Parameters.DEFAULT_WITHOUT_VIEWPORT);
|
this(Parameters.DEFAULT_WITHOUT_CONTEXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -747,18 +747,35 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
*/
|
*/
|
||||||
public static final class Parameters extends TrackSelectionParameters {
|
public static final class Parameters extends TrackSelectionParameters {
|
||||||
|
|
||||||
/** An instance with default values, except without any viewport constraints. */
|
/**
|
||||||
public static final Parameters DEFAULT_WITHOUT_VIEWPORT = new Parameters();
|
* An instance with default values, except those obtained from the {@link Context}.
|
||||||
|
*
|
||||||
|
* <p>If possible, use {@link #getDefaults(Context)} instead.
|
||||||
|
*
|
||||||
|
* <p>This instance will not have the following settings:
|
||||||
|
*
|
||||||
|
* <ul>
|
||||||
|
* <li>{@link ParametersBuilder#setViewportSizeToPhysicalDisplaySize(Context, boolean)
|
||||||
|
* Viewport constraints} configured for the primary display.
|
||||||
|
* </ul>
|
||||||
|
*/
|
||||||
|
public static final Parameters DEFAULT_WITHOUT_CONTEXT = new Parameters();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated This instance does not have viewport constraints configured for the primary
|
* @deprecated This instance does not have {@link Context} constraints configured. Use {@link
|
||||||
* display. Use {@link #getDefaults(Context)} instead.
|
* #getDefaults(Context)} instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated public static final Parameters DEFAULT = DEFAULT_WITHOUT_VIEWPORT;
|
@Deprecated public static final Parameters DEFAULT_WITHOUT_VIEWPORT = DEFAULT_WITHOUT_CONTEXT;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated This instance does not have {@link Context} constraints configured. Use {@link
|
||||||
|
* #getDefaults(Context)} instead.
|
||||||
|
*/
|
||||||
|
@Deprecated public static final Parameters DEFAULT = DEFAULT_WITHOUT_CONTEXT;
|
||||||
|
|
||||||
/** Returns an instance configured with default values. */
|
/** Returns an instance configured with default values. */
|
||||||
public static Parameters getDefaults(Context context) {
|
public static Parameters getDefaults(Context context) {
|
||||||
return DEFAULT_WITHOUT_VIEWPORT
|
return DEFAULT_WITHOUT_CONTEXT
|
||||||
.buildUpon()
|
.buildUpon()
|
||||||
.setViewportSizeToPhysicalDisplaySize(context, /* viewportOrientationMayChange= */ true)
|
.setViewportSizeToPhysicalDisplaySize(context, /* viewportOrientationMayChange= */ true)
|
||||||
.build();
|
.build();
|
||||||
@ -1429,7 +1446,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
|||||||
/** @deprecated Use {@link #DefaultTrackSelector(Context, TrackSelection.Factory)}. */
|
/** @deprecated Use {@link #DefaultTrackSelector(Context, TrackSelection.Factory)}. */
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public DefaultTrackSelector(TrackSelection.Factory trackSelectionFactory) {
|
public DefaultTrackSelector(TrackSelection.Factory trackSelectionFactory) {
|
||||||
this(Parameters.DEFAULT_WITHOUT_VIEWPORT, trackSelectionFactory);
|
this(Parameters.DEFAULT_WITHOUT_CONTEXT, trackSelectionFactory);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @param context Any {@link Context}. */
|
/** @param context Any {@link Context}. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user