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
265adf9a
authored
Apr 11, 2015
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Move chunk trigger constants into Chunk.
parent
a17ffa66
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
20 deletions
library/src/main/java/com/google/android/exoplayer/chunk/Chunk.java
library/src/main/java/com/google/android/exoplayer/chunk/FormatEvaluator.java
library/src/main/java/com/google/android/exoplayer/chunk/Chunk.java
View file @
265adf9a
...
@@ -35,6 +35,27 @@ import java.io.IOException;
...
@@ -35,6 +35,27 @@ import java.io.IOException;
public
abstract
class
Chunk
implements
Loadable
{
public
abstract
class
Chunk
implements
Loadable
{
/**
/**
* Value of {@link #trigger} for a load whose reason is unspecified.
*/
public
static
final
int
TRIGGER_UNSPECIFIED
=
0
;
/**
* Value of {@link #trigger} for a load triggered by an initial format selection.
*/
public
static
final
int
TRIGGER_INITIAL
=
1
;
/**
* Value of {@link #trigger} for a load triggered by a user initiated format selection.
*/
public
static
final
int
TRIGGER_MANUAL
=
2
;
/**
* Value of {@link #trigger} for a load triggered by an adaptive format selection.
*/
public
static
final
int
TRIGGER_ADAPTIVE
=
3
;
/**
* Implementations may define custom {@link #trigger} codes greater than or equal to this value.
*/
public
static
final
int
TRIGGER_CUSTOM_BASE
=
10000
;
/**
* The format associated with the data being loaded.
* The format associated with the data being loaded.
*/
*/
// TODO: Consider removing this and pushing it down into MediaChunk instead.
// TODO: Consider removing this and pushing it down into MediaChunk instead.
...
...
library/src/main/java/com/google/android/exoplayer/chunk/FormatEvaluator.java
View file @
265adf9a
...
@@ -26,23 +26,6 @@ import java.util.Random;
...
@@ -26,23 +26,6 @@ import java.util.Random;
public
interface
FormatEvaluator
{
public
interface
FormatEvaluator
{
/**
/**
* The trigger for the initial format selection.
*/
static
final
int
TRIGGER_INITIAL
=
0
;
/**
* The trigger for a format selection that was triggered by the user.
*/
static
final
int
TRIGGER_MANUAL
=
1
;
/**
* The trigger for an adaptive format selection.
*/
static
final
int
TRIGGER_ADAPTIVE
=
2
;
/**
* Implementations may define custom trigger codes greater than or equal to this value.
*/
static
final
int
TRIGGER_CUSTOM_BASE
=
10000
;
/**
* Enables the evaluator.
* Enables the evaluator.
*/
*/
void
enable
();
void
enable
();
...
@@ -93,7 +76,7 @@ public interface FormatEvaluator {
...
@@ -93,7 +76,7 @@ public interface FormatEvaluator {
public
Format
format
;
public
Format
format
;
public
Evaluation
()
{
public
Evaluation
()
{
trigger
=
TRIGGER_INITIAL
;
trigger
=
Chunk
.
TRIGGER_INITIAL
;
}
}
}
}
...
@@ -147,7 +130,7 @@ public interface FormatEvaluator {
...
@@ -147,7 +130,7 @@ public interface FormatEvaluator {
Format
[]
formats
,
Evaluation
evaluation
)
{
Format
[]
formats
,
Evaluation
evaluation
)
{
Format
newFormat
=
formats
[
random
.
nextInt
(
formats
.
length
)];
Format
newFormat
=
formats
[
random
.
nextInt
(
formats
.
length
)];
if
(
evaluation
.
format
!=
null
&&
!
evaluation
.
format
.
id
.
equals
(
newFormat
.
id
))
{
if
(
evaluation
.
format
!=
null
&&
!
evaluation
.
format
.
id
.
equals
(
newFormat
.
id
))
{
evaluation
.
trigger
=
TRIGGER_ADAPTIVE
;
evaluation
.
trigger
=
Chunk
.
TRIGGER_ADAPTIVE
;
}
}
evaluation
.
format
=
newFormat
;
evaluation
.
format
=
newFormat
;
}
}
...
@@ -268,7 +251,7 @@ public interface FormatEvaluator {
...
@@ -268,7 +251,7 @@ public interface FormatEvaluator {
ideal
=
current
;
ideal
=
current
;
}
}
if
(
current
!=
null
&&
ideal
!=
current
)
{
if
(
current
!=
null
&&
ideal
!=
current
)
{
evaluation
.
trigger
=
FormatEvaluator
.
TRIGGER_ADAPTIVE
;
evaluation
.
trigger
=
Chunk
.
TRIGGER_ADAPTIVE
;
}
}
evaluation
.
format
=
ideal
;
evaluation
.
format
=
ideal
;
}
}
...
...
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