Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
531c5638
authored
Sep 20, 2019
by
tonihei
Committed by
Toni
Sep 20, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Rename DEFAULT_WITHOUT_VIEWPORT to DEFAULT_WITHOUT_CONTEXT.
PiperOrigin-RevId: 270227069
parent
852c3a53
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
17 deletions
library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadHelper.java
library/core/src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java
library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadHelper.java
View file @
531c5638
...
...
@@ -83,17 +83,32 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
*/
public
final
class
DownloadHelper
{
/** Default track selection parameters for downloading, but without any viewport constraints. */
/**
* Default track selection parameters for downloading, but without any {@link Context}
* 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 {@link Context} constraints. Use {@link
* #getDefaultTrackSelectorParameters(Context)} instead.
*/
@Deprecated
public
static
final
Parameters
DEFAULT_TRACK_SELECTOR_PARAMETERS_WITHOUT_VIEWPORT
=
Parameters
.
DEFAULT_WITHOUT_VIEWPORT
.
buildUpon
().
setForceHighestSupportedBitrate
(
true
).
build
()
;
DEFAULT_TRACK_SELECTOR_PARAMETERS_WITHOUT_CONTEXT
;
/**
* @deprecated This instance does not have
viewport constraints configured for the primary
*
display. Use {@link
#getDefaultTrackSelectorParameters(Context)} instead.
* @deprecated This instance does not have
{@link Context} constraints. Use {@link
* #getDefaultTrackSelectorParameters(Context)} instead.
*/
@Deprecated
public
static
final
DefaultTrackSelector
.
Parameters
DEFAULT_TRACK_SELECTOR_PARAMETERS
=
DEFAULT_TRACK_SELECTOR_PARAMETERS_WITHOUT_
VIEWPOR
T
;
DEFAULT_TRACK_SELECTOR_PARAMETERS_WITHOUT_
CONTEX
T
;
/** Returns the default parameters used for track selection for downloading. */
public
static
DefaultTrackSelector
.
Parameters
getDefaultTrackSelectorParameters
(
Context
context
)
{
...
...
@@ -606,7 +621,7 @@ public final class DownloadHelper {
assertPreparedWithMedia
();
for
(
int
periodIndex
=
0
;
periodIndex
<
mappedTrackInfos
.
length
;
periodIndex
++)
{
DefaultTrackSelector
.
ParametersBuilder
parametersBuilder
=
DEFAULT_TRACK_SELECTOR_PARAMETERS
.
buildUpon
();
DEFAULT_TRACK_SELECTOR_PARAMETERS
_WITHOUT_CONTEXT
.
buildUpon
();
MappedTrackInfo
mappedTrackInfo
=
mappedTrackInfos
[
periodIndex
];
int
rendererCount
=
mappedTrackInfo
.
getRendererCount
();
for
(
int
rendererIndex
=
0
;
rendererIndex
<
rendererCount
;
rendererIndex
++)
{
...
...
@@ -636,7 +651,7 @@ public final class DownloadHelper {
assertPreparedWithMedia
();
for
(
int
periodIndex
=
0
;
periodIndex
<
mappedTrackInfos
.
length
;
periodIndex
++)
{
DefaultTrackSelector
.
ParametersBuilder
parametersBuilder
=
DEFAULT_TRACK_SELECTOR_PARAMETERS
.
buildUpon
();
DEFAULT_TRACK_SELECTOR_PARAMETERS
_WITHOUT_CONTEXT
.
buildUpon
();
MappedTrackInfo
mappedTrackInfo
=
mappedTrackInfos
[
periodIndex
];
int
rendererCount
=
mappedTrackInfo
.
getRendererCount
();
for
(
int
rendererIndex
=
0
;
rendererIndex
<
rendererCount
;
rendererIndex
++)
{
...
...
library/core/src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java
View file @
531c5638
...
...
@@ -187,12 +187,12 @@ public class DefaultTrackSelector extends MappingTrackSelector {
private
final
SparseBooleanArray
rendererDisabledFlags
;
/**
* @deprecated
Initial viewport constraints will not be set based on the primary display when
*
using this constructor. Use {@link
#ParametersBuilder(Context)} instead.
* @deprecated
{@link Context} constraints will not be set using this constructor. Use {@link
* #ParametersBuilder(Context)} instead.
*/
@Deprecated
public
ParametersBuilder
()
{
this
(
Parameters
.
DEFAULT_WITHOUT_
VIEWPOR
T
);
this
(
Parameters
.
DEFAULT_WITHOUT_
CONTEX
T
);
}
/**
...
...
@@ -747,18 +747,35 @@ public class DefaultTrackSelector extends MappingTrackSelector {
*/
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 {@link Context} constraints configured. Use {@link
* #getDefaults(Context)} instead.
*/
@Deprecated
public
static
final
Parameters
DEFAULT_WITHOUT_VIEWPORT
=
DEFAULT_WITHOUT_CONTEXT
;
/**
* @deprecated This instance does not have
viewport constraints configured for the primary
*
display. Use {@link
#getDefaults(Context)} instead.
* @deprecated This instance does not have
{@link Context} constraints configured. Use {@link
* #getDefaults(Context)} instead.
*/
@Deprecated
public
static
final
Parameters
DEFAULT
=
DEFAULT_WITHOUT_
VIEWPOR
T
;
@Deprecated
public
static
final
Parameters
DEFAULT
=
DEFAULT_WITHOUT_
CONTEX
T
;
/** Returns an instance configured with default values. */
public
static
Parameters
getDefaults
(
Context
context
)
{
return
DEFAULT_WITHOUT_
VIEWPOR
T
return
DEFAULT_WITHOUT_
CONTEX
T
.
buildUpon
()
.
setViewportSizeToPhysicalDisplaySize
(
context
,
/* viewportOrientationMayChange= */
true
)
.
build
();
...
...
@@ -1429,7 +1446,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
/** @deprecated Use {@link #DefaultTrackSelector(Context, TrackSelection.Factory)}. */
@Deprecated
public
DefaultTrackSelector
(
TrackSelection
.
Factory
trackSelectionFactory
)
{
this
(
Parameters
.
DEFAULT_WITHOUT_
VIEWPOR
T
,
trackSelectionFactory
);
this
(
Parameters
.
DEFAULT_WITHOUT_
CONTEX
T
,
trackSelectionFactory
);
}
/** @param context Any {@link Context}. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment