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
30c79544
authored
Oct 11, 2018
by
Brandon Davis
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
add bitrate that is unsupported by renderer
parent
211a2dfd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 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 @
30c79544
...
...
@@ -1061,6 +1061,9 @@ public final class DefaultTrackSelectorTest {
throws
Exception
{
trackSelector
.
setParameters
(
new
ParametersBuilder
().
setForceLowestBitrate
(
true
).
build
());
Format
exceedsBitrateFormat
=
Format
.
createAudioSampleFormat
(
"exceedsBitrateFormat"
,
MimeTypes
.
AUDIO_AAC
,
null
,
5000
,
Format
.
NO_VALUE
,
2
,
44100
,
null
,
null
,
0
,
null
);
Format
lowerBitrateFormat
=
Format
.
createAudioSampleFormat
(
"lowerBitrateFormat"
,
MimeTypes
.
AUDIO_AAC
,
null
,
15000
,
Format
.
NO_VALUE
,
2
,
44100
,
null
,
null
,
0
,
null
);
...
...
@@ -1068,10 +1071,17 @@ public final class DefaultTrackSelectorTest {
Format
.
createAudioSampleFormat
(
"higherBitrateFormat"
,
MimeTypes
.
AUDIO_AAC
,
null
,
30000
,
Format
.
NO_VALUE
,
2
,
44100
,
null
,
null
,
0
,
null
);
Map
<
String
,
Integer
>
mappedCapabilities
=
new
HashMap
<>();
mappedCapabilities
.
put
(
exceedsBitrateFormat
.
id
,
FORMAT_EXCEEDS_CAPABILITIES
);
mappedCapabilities
.
put
(
lowerBitrateFormat
.
id
,
FORMAT_HANDLED
);
mappedCapabilities
.
put
(
higherBitrateFormat
.
id
,
FORMAT_HANDLED
);
RendererCapabilities
mappedAudioRendererCapabilities
=
new
FakeMappedRendererCapabilities
(
C
.
TRACK_TYPE_AUDIO
,
mappedCapabilities
);
TrackSelectorResult
result
=
trackSelector
.
selectTracks
(
new
RendererCapabilities
[]
{
ALL_AUDIO_FORMAT_SUPPORTED_RENDERER_CAPABILITIES
},
singleTrackGroup
(
lowerBitrateFormat
,
higherBitrateFormat
),
new
RendererCapabilities
[]
{
mappedAudioRendererCapabilities
},
singleTrackGroup
(
exceedsBitrateFormat
,
lowerBitrateFormat
,
higherBitrateFormat
),
periodId
,
TIMELINE
);
...
...
@@ -1094,11 +1104,21 @@ public final class DefaultTrackSelectorTest {
Format
higherBitrateFormat
=
Format
.
createAudioSampleFormat
(
"higherBitrateFormat"
,
MimeTypes
.
AUDIO_AAC
,
null
,
30000
,
Format
.
NO_VALUE
,
2
,
44100
,
null
,
null
,
0
,
null
);
Format
exceedsBitrateFormat
=
Format
.
createAudioSampleFormat
(
"exceedsBitrateFormat"
,
MimeTypes
.
AUDIO_AAC
,
null
,
45000
,
Format
.
NO_VALUE
,
2
,
44100
,
null
,
null
,
0
,
null
);
Map
<
String
,
Integer
>
mappedCapabilities
=
new
HashMap
<>();
mappedCapabilities
.
put
(
lowerBitrateFormat
.
id
,
FORMAT_HANDLED
);
mappedCapabilities
.
put
(
higherBitrateFormat
.
id
,
FORMAT_HANDLED
);
mappedCapabilities
.
put
(
exceedsBitrateFormat
.
id
,
FORMAT_EXCEEDS_CAPABILITIES
);
RendererCapabilities
mappedAudioRendererCapabilities
=
new
FakeMappedRendererCapabilities
(
C
.
TRACK_TYPE_AUDIO
,
mappedCapabilities
);
TrackSelectorResult
result
=
trackSelector
.
selectTracks
(
new
RendererCapabilities
[]
{
ALL_AUDIO_FORMAT_SUPPORTED_RENDERER_CAPABILITIES
},
singleTrackGroup
(
lowerBitrateFormat
,
higherBitrateFormat
),
new
RendererCapabilities
[]
{
mappedAudioRendererCapabilities
},
singleTrackGroup
(
lowerBitrateFormat
,
higherBitrateFormat
,
exceedsBitrateFormat
),
periodId
,
TIMELINE
);
...
...
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