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
861d6749
authored
May 08, 2015
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Remove ability to extend the default FormatEvaluator implementations.
parent
9f77c400
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
13 deletions
library/src/main/java/com/google/android/exoplayer/chunk/FormatEvaluator.java
library/src/main/java/com/google/android/exoplayer/chunk/FormatEvaluator.java
View file @
861d6749
...
...
@@ -84,7 +84,7 @@ public interface FormatEvaluator {
/**
* Always selects the first format.
*/
public
static
class
FixedEvaluator
implements
FormatEvaluator
{
public
static
final
class
FixedEvaluator
implements
FormatEvaluator
{
@Override
public
void
enable
()
{
...
...
@@ -107,7 +107,7 @@ public interface FormatEvaluator {
/**
* Selects randomly between the available formats.
*/
public
static
class
RandomEvaluator
implements
FormatEvaluator
{
public
static
final
class
RandomEvaluator
implements
FormatEvaluator
{
private
final
Random
random
;
...
...
@@ -145,7 +145,7 @@ public interface FormatEvaluator {
* reference implementation only. It is recommended that application developers implement their
* own adaptive evaluator to more precisely suit their use case.
*/
public
static
class
AdaptiveEvaluator
implements
FormatEvaluator
{
public
static
final
class
AdaptiveEvaluator
implements
FormatEvaluator
{
public
static
final
int
DEFAULT_MAX_INITIAL_BITRATE
=
800000
;
...
...
@@ -259,8 +259,9 @@ public interface FormatEvaluator {
/**
* Compute the ideal format ignoring buffer health.
*/
protected
Format
determineIdealFormat
(
Format
[]
formats
,
long
bitrateEstimate
)
{
long
effectiveBitrate
=
computeEffectiveBitrateEstimate
(
bitrateEstimate
);
private
Format
determineIdealFormat
(
Format
[]
formats
,
long
bitrateEstimate
)
{
long
effectiveBitrate
=
bitrateEstimate
==
BandwidthMeter
.
NO_ESTIMATE
?
maxInitialBitrate
:
(
long
)
(
bitrateEstimate
*
bandwidthFraction
);
for
(
int
i
=
0
;
i
<
formats
.
length
;
i
++)
{
Format
format
=
formats
[
i
];
if
(
format
.
bitrate
<=
effectiveBitrate
)
{
...
...
@@ -271,14 +272,6 @@ public interface FormatEvaluator {
return
formats
[
formats
.
length
-
1
];
}
/**
* Apply overhead factor, or default value in absence of estimate.
*/
protected
long
computeEffectiveBitrateEstimate
(
long
bitrateEstimate
)
{
return
bitrateEstimate
==
BandwidthMeter
.
NO_ESTIMATE
?
maxInitialBitrate
:
(
long
)
(
bitrateEstimate
*
bandwidthFraction
);
}
}
}
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