mirror of
https://github.com/androidx/media.git
synced 2025-05-17 04:29:55 +08:00
add bitrate that is unsupported by renderer
This commit is contained in:
parent
211a2dfd7a
commit
30c7954482
@ -1061,6 +1061,9 @@ public final class DefaultTrackSelectorTest {
|
|||||||
throws Exception {
|
throws Exception {
|
||||||
trackSelector.setParameters(new ParametersBuilder().setForceLowestBitrate(true).build());
|
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 lowerBitrateFormat =
|
||||||
Format.createAudioSampleFormat("lowerBitrateFormat", MimeTypes.AUDIO_AAC, null, 15000,
|
Format.createAudioSampleFormat("lowerBitrateFormat", MimeTypes.AUDIO_AAC, null, 15000,
|
||||||
Format.NO_VALUE, 2, 44100, null, null, 0, null);
|
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.createAudioSampleFormat("higherBitrateFormat", MimeTypes.AUDIO_AAC, null, 30000,
|
||||||
Format.NO_VALUE, 2, 44100, null, null, 0, null);
|
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 =
|
TrackSelectorResult result =
|
||||||
trackSelector.selectTracks(
|
trackSelector.selectTracks(
|
||||||
new RendererCapabilities[] {ALL_AUDIO_FORMAT_SUPPORTED_RENDERER_CAPABILITIES},
|
new RendererCapabilities[] {mappedAudioRendererCapabilities},
|
||||||
singleTrackGroup(lowerBitrateFormat, higherBitrateFormat),
|
singleTrackGroup(exceedsBitrateFormat, lowerBitrateFormat, higherBitrateFormat),
|
||||||
periodId,
|
periodId,
|
||||||
TIMELINE);
|
TIMELINE);
|
||||||
|
|
||||||
@ -1094,11 +1104,21 @@ public final class DefaultTrackSelectorTest {
|
|||||||
Format higherBitrateFormat =
|
Format higherBitrateFormat =
|
||||||
Format.createAudioSampleFormat("higherBitrateFormat", MimeTypes.AUDIO_AAC, null, 30000,
|
Format.createAudioSampleFormat("higherBitrateFormat", MimeTypes.AUDIO_AAC, null, 30000,
|
||||||
Format.NO_VALUE, 2, 44100, null, null, 0, null);
|
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 =
|
TrackSelectorResult result =
|
||||||
trackSelector.selectTracks(
|
trackSelector.selectTracks(
|
||||||
new RendererCapabilities[] {ALL_AUDIO_FORMAT_SUPPORTED_RENDERER_CAPABILITIES},
|
new RendererCapabilities[] {mappedAudioRendererCapabilities},
|
||||||
singleTrackGroup(lowerBitrateFormat, higherBitrateFormat),
|
singleTrackGroup(lowerBitrateFormat, higherBitrateFormat, exceedsBitrateFormat),
|
||||||
periodId,
|
periodId,
|
||||||
TIMELINE);
|
TIMELINE);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user