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
d97dd8d5
authored
Oct 15, 2020
by
ibaker
Committed by
Oliver Woodman
Oct 17, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add playback tests for existing FLAC assets
PiperOrigin-RevId: 337280116
parent
74ac9151
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
403 additions
and
0 deletions
library/core/src/test/java/com/google/android/exoplayer2/e2etest/FlacPlaybackTest.java
robolectricutils/src/main/java/com/google/android/exoplayer2/robolectric/ShadowMediaCodecConfig.java
testdata/src/test/assets/playbackdumps/flac/bear.flac.dump
testdata/src/test/assets/playbackdumps/flac/bear_no_min_max_frame_size.flac.dump
testdata/src/test/assets/playbackdumps/flac/bear_no_num_samples.flac.dump
testdata/src/test/assets/playbackdumps/flac/bear_no_seek_table_no_num_samples.flac.dump
testdata/src/test/assets/playbackdumps/flac/bear_one_metadata_block.flac.dump
testdata/src/test/assets/playbackdumps/flac/bear_uncommon_sample_rate.flac.dump
testdata/src/test/assets/playbackdumps/flac/bear_with_id3.flac.dump
testdata/src/test/assets/playbackdumps/flac/bear_with_picture.flac.dump
testdata/src/test/assets/playbackdumps/flac/bear_with_vorbis_comments.flac.dump
library/core/src/test/java/com/google/android/exoplayer2/e2etest/FlacPlaybackTest.java
0 → 100644
View file @
d97dd8d5
/*
* Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
e2etest
;
import
android.graphics.SurfaceTexture
;
import
android.view.Surface
;
import
androidx.test.core.app.ApplicationProvider
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.SimpleExoPlayer
;
import
com.google.android.exoplayer2.robolectric.PlaybackOutput
;
import
com.google.android.exoplayer2.robolectric.ShadowMediaCodecConfig
;
import
com.google.android.exoplayer2.robolectric.TestPlayerRunHelper
;
import
com.google.android.exoplayer2.testutil.AutoAdvancingFakeClock
;
import
com.google.android.exoplayer2.testutil.DumpFileAsserts
;
import
com.google.common.collect.ImmutableList
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.robolectric.ParameterizedRobolectricTestRunner
;
import
org.robolectric.ParameterizedRobolectricTestRunner.Parameter
;
import
org.robolectric.ParameterizedRobolectricTestRunner.Parameters
;
import
org.robolectric.annotation.Config
;
/** End-to-end tests using FLAC samples. */
// TODO(b/143232359): Remove once https://issuetracker.google.com/143232359 is resolved.
@Config
(
sdk
=
29
)
@RunWith
(
ParameterizedRobolectricTestRunner
.
class
)
public
class
FlacPlaybackTest
{
@Parameters
(
name
=
"{0}"
)
public
static
ImmutableList
<
String
[]>
params
()
{
return
ImmutableList
.
of
(
new
String
[]
{
"bear.flac"
},
new
String
[]
{
"bear_no_min_max_frame_size.flac"
},
new
String
[]
{
"bear_no_num_samples.flac"
},
new
String
[]
{
"bear_no_seek_table_no_num_samples.flac"
},
new
String
[]
{
"bear_one_metadata_block.flac"
},
new
String
[]
{
"bear_uncommon_sample_rate.flac"
},
new
String
[]
{
"bear_with_id3.flac"
},
new
String
[]
{
"bear_with_picture.flac"
},
new
String
[]
{
"bear_with_vorbis_comments.flac"
});
}
@Parameter
public
String
inputFile
;
@Rule
public
ShadowMediaCodecConfig
mediaCodecConfig
=
ShadowMediaCodecConfig
.
forAllSupportedMimeTypes
();
@Test
public
void
test
()
throws
Exception
{
SimpleExoPlayer
player
=
new
SimpleExoPlayer
.
Builder
(
ApplicationProvider
.
getApplicationContext
())
.
setClock
(
new
AutoAdvancingFakeClock
())
.
build
();
player
.
setVideoSurface
(
new
Surface
(
new
SurfaceTexture
(
/* texName= */
1
)));
PlaybackOutput
playbackOutput
=
PlaybackOutput
.
register
(
player
,
mediaCodecConfig
);
player
.
setMediaItem
(
MediaItem
.
fromUri
(
"asset:///media/flac/"
+
inputFile
));
player
.
prepare
();
player
.
play
();
TestPlayerRunHelper
.
runUntilPlaybackState
(
player
,
Player
.
STATE_ENDED
);
player
.
release
();
DumpFileAsserts
.
assertOutput
(
ApplicationProvider
.
getApplicationContext
(),
playbackOutput
,
"playbackdumps/flac/"
+
inputFile
+
".dump"
);
}
}
robolectricutils/src/main/java/com/google/android/exoplayer2/robolectric/ShadowMediaCodecConfig.java
View file @
d97dd8d5
...
@@ -76,6 +76,7 @@ public final class ShadowMediaCodecConfig extends ExternalResource {
...
@@ -76,6 +76,7 @@ public final class ShadowMediaCodecConfig extends ExternalResource {
// Audio codecs
// Audio codecs
configureCodec
(
"exotest.audio.aac"
,
MimeTypes
.
AUDIO_AAC
);
configureCodec
(
"exotest.audio.aac"
,
MimeTypes
.
AUDIO_AAC
);
configureCodec
(
"exotest.audio.flac"
,
MimeTypes
.
AUDIO_FLAC
);
configureCodec
(
"exotest.audio.mpeg"
,
MimeTypes
.
AUDIO_MPEG
);
configureCodec
(
"exotest.audio.mpeg"
,
MimeTypes
.
AUDIO_MPEG
);
configureCodec
(
"exotest.audio.mpegl2"
,
MimeTypes
.
AUDIO_MPEG_L2
);
configureCodec
(
"exotest.audio.mpegl2"
,
MimeTypes
.
AUDIO_MPEG_L2
);
}
}
...
...
testdata/src/test/assets/playbackdumps/flac/bear.flac.dump
0 → 100644
View file @
d97dd8d5
MediaCodec (audio/flac):
buffers.length = 34
buffers[0] = length 5030, hash D2B60530
buffers[1] = length 5066, hash 4C932A54
buffers[2] = length 5112, hash 7E5A7B61
buffers[3] = length 5044, hash 7EF93F13
buffers[4] = length 4943, hash DE7E27F8
buffers[5] = length 5121, hash 6D0D0B40
buffers[6] = length 5068, hash 9924644F
buffers[7] = length 5143, hash 6C34F0CE
buffers[8] = length 5109, hash E3B7BEFB
buffers[9] = length 5129, hash 44111D9B
buffers[10] = length 5031, hash 9D55EA53
buffers[11] = length 5119, hash E1CB9BA6
buffers[12] = length 5360, hash 17265C5D
buffers[13] = length 5340, hash A90FDDF1
buffers[14] = length 5162, hash 31F65AD5
buffers[15] = length 5168, hash F2394F2D
buffers[16] = length 5776, hash 58437AB3
buffers[17] = length 5394, hash EBAB20A8
buffers[18] = length 5168, hash BF37C7A5
buffers[19] = length 5324, hash 59546B7B
buffers[20] = length 5172, hash 6036EF0B
buffers[21] = length 5102, hash 5A131071
buffers[22] = length 5111, hash 3D9EBB3B
buffers[23] = length 5113, hash 61101D4F
buffers[24] = length 5229, hash D2E55742
buffers[25] = length 5162, hash 7F2E97FA
buffers[26] = length 5255, hash D92A782
buffers[27] = length 5196, hash 98FE5138
buffers[28] = length 5214, hash 3D35C38C
buffers[29] = length 5211, hash 7E25420F
buffers[30] = length 5230, hash 2AD96FBC
buffers[31] = length 3384, hash 938BCDD9
buffers[32] = length 445, hash A388E3D6
buffers[33] = length 0, hash 1
testdata/src/test/assets/playbackdumps/flac/bear_no_min_max_frame_size.flac.dump
0 → 100644
View file @
d97dd8d5
MediaCodec (audio/flac):
buffers.length = 34
buffers[0] = length 5030, hash D2B60530
buffers[1] = length 5066, hash 4C932A54
buffers[2] = length 5112, hash 7E5A7B61
buffers[3] = length 5044, hash 7EF93F13
buffers[4] = length 4943, hash DE7E27F8
buffers[5] = length 5121, hash 6D0D0B40
buffers[6] = length 5068, hash 9924644F
buffers[7] = length 5143, hash 6C34F0CE
buffers[8] = length 5109, hash E3B7BEFB
buffers[9] = length 5129, hash 44111D9B
buffers[10] = length 5031, hash 9D55EA53
buffers[11] = length 5119, hash E1CB9BA6
buffers[12] = length 5360, hash 17265C5D
buffers[13] = length 5340, hash A90FDDF1
buffers[14] = length 5162, hash 31F65AD5
buffers[15] = length 5168, hash F2394F2D
buffers[16] = length 5776, hash 58437AB3
buffers[17] = length 5394, hash EBAB20A8
buffers[18] = length 5168, hash BF37C7A5
buffers[19] = length 5324, hash 59546B7B
buffers[20] = length 5172, hash 6036EF0B
buffers[21] = length 5102, hash 5A131071
buffers[22] = length 5111, hash 3D9EBB3B
buffers[23] = length 5113, hash 61101D4F
buffers[24] = length 5229, hash D2E55742
buffers[25] = length 5162, hash 7F2E97FA
buffers[26] = length 5255, hash D92A782
buffers[27] = length 5196, hash 98FE5138
buffers[28] = length 5214, hash 3D35C38C
buffers[29] = length 5211, hash 7E25420F
buffers[30] = length 5230, hash 2AD96FBC
buffers[31] = length 3384, hash 938BCDD9
buffers[32] = length 445, hash A388E3D6
buffers[33] = length 0, hash 1
testdata/src/test/assets/playbackdumps/flac/bear_no_num_samples.flac.dump
0 → 100644
View file @
d97dd8d5
MediaCodec (audio/flac):
buffers.length = 34
buffers[0] = length 5030, hash D2B60530
buffers[1] = length 5066, hash 4C932A54
buffers[2] = length 5112, hash 7E5A7B61
buffers[3] = length 5044, hash 7EF93F13
buffers[4] = length 4943, hash DE7E27F8
buffers[5] = length 5121, hash 6D0D0B40
buffers[6] = length 5068, hash 9924644F
buffers[7] = length 5143, hash 6C34F0CE
buffers[8] = length 5109, hash E3B7BEFB
buffers[9] = length 5129, hash 44111D9B
buffers[10] = length 5031, hash 9D55EA53
buffers[11] = length 5119, hash E1CB9BA6
buffers[12] = length 5360, hash 17265C5D
buffers[13] = length 5340, hash A90FDDF1
buffers[14] = length 5162, hash 31F65AD5
buffers[15] = length 5168, hash F2394F2D
buffers[16] = length 5776, hash 58437AB3
buffers[17] = length 5394, hash EBAB20A8
buffers[18] = length 5168, hash BF37C7A5
buffers[19] = length 5324, hash 59546B7B
buffers[20] = length 5172, hash 6036EF0B
buffers[21] = length 5102, hash 5A131071
buffers[22] = length 5111, hash 3D9EBB3B
buffers[23] = length 5113, hash 61101D4F
buffers[24] = length 5229, hash D2E55742
buffers[25] = length 5162, hash 7F2E97FA
buffers[26] = length 5255, hash D92A782
buffers[27] = length 5196, hash 98FE5138
buffers[28] = length 5214, hash 3D35C38C
buffers[29] = length 5211, hash 7E25420F
buffers[30] = length 5230, hash 2AD96FBC
buffers[31] = length 3384, hash 938BCDD9
buffers[32] = length 445, hash A388E3D6
buffers[33] = length 0, hash 1
testdata/src/test/assets/playbackdumps/flac/bear_no_seek_table_no_num_samples.flac.dump
0 → 100644
View file @
d97dd8d5
MediaCodec (audio/flac):
buffers.length = 34
buffers[0] = length 5030, hash D2B60530
buffers[1] = length 5066, hash 4C932A54
buffers[2] = length 5112, hash 7E5A7B61
buffers[3] = length 5044, hash 7EF93F13
buffers[4] = length 4943, hash DE7E27F8
buffers[5] = length 5121, hash 6D0D0B40
buffers[6] = length 5068, hash 9924644F
buffers[7] = length 5143, hash 6C34F0CE
buffers[8] = length 5109, hash E3B7BEFB
buffers[9] = length 5129, hash 44111D9B
buffers[10] = length 5031, hash 9D55EA53
buffers[11] = length 5119, hash E1CB9BA6
buffers[12] = length 5360, hash 17265C5D
buffers[13] = length 5340, hash A90FDDF1
buffers[14] = length 5162, hash 31F65AD5
buffers[15] = length 5168, hash F2394F2D
buffers[16] = length 5776, hash 58437AB3
buffers[17] = length 5394, hash EBAB20A8
buffers[18] = length 5168, hash BF37C7A5
buffers[19] = length 5324, hash 59546B7B
buffers[20] = length 5172, hash 6036EF0B
buffers[21] = length 5102, hash 5A131071
buffers[22] = length 5111, hash 3D9EBB3B
buffers[23] = length 5113, hash 61101D4F
buffers[24] = length 5229, hash D2E55742
buffers[25] = length 5162, hash 7F2E97FA
buffers[26] = length 5255, hash D92A782
buffers[27] = length 5196, hash 98FE5138
buffers[28] = length 5214, hash 3D35C38C
buffers[29] = length 5211, hash 7E25420F
buffers[30] = length 5230, hash 2AD96FBC
buffers[31] = length 3384, hash 938BCDD9
buffers[32] = length 445, hash A388E3D6
buffers[33] = length 0, hash 1
testdata/src/test/assets/playbackdumps/flac/bear_one_metadata_block.flac.dump
0 → 100644
View file @
d97dd8d5
MediaCodec (audio/flac):
buffers.length = 34
buffers[0] = length 5030, hash D2B60530
buffers[1] = length 5066, hash 4C932A54
buffers[2] = length 5112, hash 7E5A7B61
buffers[3] = length 5044, hash 7EF93F13
buffers[4] = length 4943, hash DE7E27F8
buffers[5] = length 5121, hash 6D0D0B40
buffers[6] = length 5068, hash 9924644F
buffers[7] = length 5143, hash 6C34F0CE
buffers[8] = length 5109, hash E3B7BEFB
buffers[9] = length 5129, hash 44111D9B
buffers[10] = length 5031, hash 9D55EA53
buffers[11] = length 5119, hash E1CB9BA6
buffers[12] = length 5360, hash 17265C5D
buffers[13] = length 5340, hash A90FDDF1
buffers[14] = length 5162, hash 31F65AD5
buffers[15] = length 5168, hash F2394F2D
buffers[16] = length 5776, hash 58437AB3
buffers[17] = length 5394, hash EBAB20A8
buffers[18] = length 5168, hash BF37C7A5
buffers[19] = length 5324, hash 59546B7B
buffers[20] = length 5172, hash 6036EF0B
buffers[21] = length 5102, hash 5A131071
buffers[22] = length 5111, hash 3D9EBB3B
buffers[23] = length 5113, hash 61101D4F
buffers[24] = length 5229, hash D2E55742
buffers[25] = length 5162, hash 7F2E97FA
buffers[26] = length 5255, hash D92A782
buffers[27] = length 5196, hash 98FE5138
buffers[28] = length 5214, hash 3D35C38C
buffers[29] = length 5211, hash 7E25420F
buffers[30] = length 5230, hash 2AD96FBC
buffers[31] = length 3384, hash 938BCDD9
buffers[32] = length 445, hash A388E3D6
buffers[33] = length 0, hash 1
testdata/src/test/assets/playbackdumps/flac/bear_uncommon_sample_rate.flac.dump
0 → 100644
View file @
d97dd8d5
MediaCodec (audio/flac):
buffers.length = 28
buffers[0] = length 5415, hash 915DBC66
buffers[1] = length 5529, hash EFD564F7
buffers[2] = length 5480, hash ADA922FB
buffers[3] = length 5290, hash 7BCEA5FC
buffers[4] = length 5579, hash DBB36F37
buffers[5] = length 5423, hash AB53F799
buffers[6] = length 5583, hash 7243C284
buffers[7] = length 5547, hash 9DA9C99E
buffers[8] = length 5414, hash 90768345
buffers[9] = length 5531, hash 1CD2FF67
buffers[10] = length 5870, hash A9A5CAEE
buffers[11] = length 5667, hash 875566A1
buffers[12] = length 5614, hash 5573694C
buffers[13] = length 6456, hash 921F3DE7
buffers[14] = length 5817, hash EBECBD16
buffers[15] = length 5751, hash 4A7D4C6B
buffers[16] = length 5620, hash B78F8E8D
buffers[17] = length 5535, hash 8187C107
buffers[18] = length 5517, hash 79FF36CB
buffers[19] = length 5716, hash 349FC281
buffers[20] = length 5556, hash BE97B2CA
buffers[21] = length 5703, hash 531F9FE3
buffers[22] = length 5652, hash 1277485D
buffers[23] = length 5607, hash 14862CB6
buffers[24] = length 5829, hash FCAF2F1C
buffers[25] = length 2837, hash 10F1716E
buffers[26] = length 548, hash B46F603C
buffers[27] = length 0, hash 1
testdata/src/test/assets/playbackdumps/flac/bear_with_id3.flac.dump
0 → 100644
View file @
d97dd8d5
MediaCodec (audio/flac):
buffers.length = 34
buffers[0] = length 5030, hash D2B60530
buffers[1] = length 5066, hash 4C932A54
buffers[2] = length 5112, hash 7E5A7B61
buffers[3] = length 5044, hash 7EF93F13
buffers[4] = length 4943, hash DE7E27F8
buffers[5] = length 5121, hash 6D0D0B40
buffers[6] = length 5068, hash 9924644F
buffers[7] = length 5143, hash 6C34F0CE
buffers[8] = length 5109, hash E3B7BEFB
buffers[9] = length 5129, hash 44111D9B
buffers[10] = length 5031, hash 9D55EA53
buffers[11] = length 5119, hash E1CB9BA6
buffers[12] = length 5360, hash 17265C5D
buffers[13] = length 5340, hash A90FDDF1
buffers[14] = length 5162, hash 31F65AD5
buffers[15] = length 5168, hash F2394F2D
buffers[16] = length 5776, hash 58437AB3
buffers[17] = length 5394, hash EBAB20A8
buffers[18] = length 5168, hash BF37C7A5
buffers[19] = length 5324, hash 59546B7B
buffers[20] = length 5172, hash 6036EF0B
buffers[21] = length 5102, hash 5A131071
buffers[22] = length 5111, hash 3D9EBB3B
buffers[23] = length 5113, hash 61101D4F
buffers[24] = length 5229, hash D2E55742
buffers[25] = length 5162, hash 7F2E97FA
buffers[26] = length 5255, hash D92A782
buffers[27] = length 5196, hash 98FE5138
buffers[28] = length 5214, hash 3D35C38C
buffers[29] = length 5211, hash 7E25420F
buffers[30] = length 5230, hash 2AD96FBC
buffers[31] = length 3384, hash 938BCDD9
buffers[32] = length 445, hash A388E3D6
buffers[33] = length 0, hash 1
testdata/src/test/assets/playbackdumps/flac/bear_with_picture.flac.dump
0 → 100644
View file @
d97dd8d5
MediaCodec (audio/flac):
buffers.length = 34
buffers[0] = length 5030, hash D2B60530
buffers[1] = length 5066, hash 4C932A54
buffers[2] = length 5112, hash 7E5A7B61
buffers[3] = length 5044, hash 7EF93F13
buffers[4] = length 4943, hash DE7E27F8
buffers[5] = length 5121, hash 6D0D0B40
buffers[6] = length 5068, hash 9924644F
buffers[7] = length 5143, hash 6C34F0CE
buffers[8] = length 5109, hash E3B7BEFB
buffers[9] = length 5129, hash 44111D9B
buffers[10] = length 5031, hash 9D55EA53
buffers[11] = length 5119, hash E1CB9BA6
buffers[12] = length 5360, hash 17265C5D
buffers[13] = length 5340, hash A90FDDF1
buffers[14] = length 5162, hash 31F65AD5
buffers[15] = length 5168, hash F2394F2D
buffers[16] = length 5776, hash 58437AB3
buffers[17] = length 5394, hash EBAB20A8
buffers[18] = length 5168, hash BF37C7A5
buffers[19] = length 5324, hash 59546B7B
buffers[20] = length 5172, hash 6036EF0B
buffers[21] = length 5102, hash 5A131071
buffers[22] = length 5111, hash 3D9EBB3B
buffers[23] = length 5113, hash 61101D4F
buffers[24] = length 5229, hash D2E55742
buffers[25] = length 5162, hash 7F2E97FA
buffers[26] = length 5255, hash D92A782
buffers[27] = length 5196, hash 98FE5138
buffers[28] = length 5214, hash 3D35C38C
buffers[29] = length 5211, hash 7E25420F
buffers[30] = length 5230, hash 2AD96FBC
buffers[31] = length 3384, hash 938BCDD9
buffers[32] = length 445, hash A388E3D6
buffers[33] = length 0, hash 1
testdata/src/test/assets/playbackdumps/flac/bear_with_vorbis_comments.flac.dump
0 → 100644
View file @
d97dd8d5
MediaCodec (audio/flac):
buffers.length = 34
buffers[0] = length 5030, hash D2B60530
buffers[1] = length 5066, hash 4C932A54
buffers[2] = length 5112, hash 7E5A7B61
buffers[3] = length 5044, hash 7EF93F13
buffers[4] = length 4943, hash DE7E27F8
buffers[5] = length 5121, hash 6D0D0B40
buffers[6] = length 5068, hash 9924644F
buffers[7] = length 5143, hash 6C34F0CE
buffers[8] = length 5109, hash E3B7BEFB
buffers[9] = length 5129, hash 44111D9B
buffers[10] = length 5031, hash 9D55EA53
buffers[11] = length 5119, hash E1CB9BA6
buffers[12] = length 5360, hash 17265C5D
buffers[13] = length 5340, hash A90FDDF1
buffers[14] = length 5162, hash 31F65AD5
buffers[15] = length 5168, hash F2394F2D
buffers[16] = length 5776, hash 58437AB3
buffers[17] = length 5394, hash EBAB20A8
buffers[18] = length 5168, hash BF37C7A5
buffers[19] = length 5324, hash 59546B7B
buffers[20] = length 5172, hash 6036EF0B
buffers[21] = length 5102, hash 5A131071
buffers[22] = length 5111, hash 3D9EBB3B
buffers[23] = length 5113, hash 61101D4F
buffers[24] = length 5229, hash D2E55742
buffers[25] = length 5162, hash 7F2E97FA
buffers[26] = length 5255, hash D92A782
buffers[27] = length 5196, hash 98FE5138
buffers[28] = length 5214, hash 3D35C38C
buffers[29] = length 5211, hash 7E25420F
buffers[30] = length 5230, hash 2AD96FBC
buffers[31] = length 3384, hash 938BCDD9
buffers[32] = length 445, hash A388E3D6
buffers[33] = length 0, hash 1
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