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
57d90f30
authored
Oct 05, 2018
by
Brandon Davis
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
add test for setForceHighestSupportedBitrate
parent
7849a5eb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
library/core/src/test/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelectorTest.java
library/core/src/test/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelectorTest.java
View file @
57d90f30
...
@@ -1078,6 +1078,33 @@ public final class DefaultTrackSelectorTest {
...
@@ -1078,6 +1078,33 @@ public final class DefaultTrackSelectorTest {
assertThat
(
result
.
selections
.
get
(
0
).
getSelectedFormat
()).
isEqualTo
(
lowerBitrateFormat
);
assertThat
(
result
.
selections
.
get
(
0
).
getSelectedFormat
()).
isEqualTo
(
lowerBitrateFormat
);
}
}
/**
* Tests that track selector will select audio tracks with higher bitrate when {@link Parameters}
* indicate highest bitrate preference, even when tracks are within capabilities.
*/
@Test
public
void
testSelectTracksWithinCapabilitiesAndForceHighestBitrateSelectHigherBitrate
()
throws
Exception
{
trackSelector
.
setParameters
(
new
ParametersBuilder
().
setForceHighestSupportedBitrate
(
true
).
build
());
Format
lowerBitrateFormat
=
Format
.
createAudioSampleFormat
(
"audioFormat"
,
MimeTypes
.
AUDIO_AAC
,
null
,
15000
,
Format
.
NO_VALUE
,
2
,
44100
,
null
,
null
,
0
,
null
);
Format
higherBitrateFormat
=
Format
.
createAudioSampleFormat
(
"audioFormat"
,
MimeTypes
.
AUDIO_AAC
,
null
,
30000
,
Format
.
NO_VALUE
,
2
,
44100
,
null
,
null
,
0
,
null
);
TrackSelectorResult
result
=
trackSelector
.
selectTracks
(
new
RendererCapabilities
[]
{
ALL_AUDIO_FORMAT_SUPPORTED_RENDERER_CAPABILITIES
},
singleTrackGroup
(
lowerBitrateFormat
,
higherBitrateFormat
),
periodId
,
TIMELINE
);
assertThat
(
result
.
selections
.
get
(
0
).
getSelectedFormat
()).
isEqualTo
(
higherBitrateFormat
);
}
@Test
@Test
public
void
testSelectTracksWithMultipleAudioTracksReturnsAdaptiveTrackSelection
()
public
void
testSelectTracksWithMultipleAudioTracksReturnsAdaptiveTrackSelection
()
throws
Exception
{
throws
Exception
{
...
...
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