mirror of
https://github.com/samsonjs/media.git
synced 2026-03-29 10:05:48 +00:00
Separate the dump files from the test assets
This allows us to more easily create different dumps derived from the same assets. This moves media/source files from `assets/` to `assets/media/` and dump files from `assets/` to `assets/extractordumps/` and `assets/audiosinkdumps/` as appropriate. I intend to add `assets/playbackdumps/` in a future CL. PiperOrigin-RevId: 326986283
This commit is contained in:
parent
333ccedf80
commit
f0ae8afd80
670 changed files with 411 additions and 313 deletions
|
|
@ -37,9 +37,10 @@ import org.junit.runner.RunWith;
|
|||
@RunWith(AndroidJUnit4.class)
|
||||
public final class FlacExtractorSeekTest {
|
||||
|
||||
private static final String TEST_FILE_SEEK_TABLE = "flac/bear.flac";
|
||||
private static final String TEST_FILE_BINARY_SEARCH = "flac/bear_one_metadata_block.flac";
|
||||
private static final String TEST_FILE_UNSEEKABLE = "flac/bear_no_seek_table_no_num_samples.flac";
|
||||
private static final String TEST_FILE_SEEK_TABLE = "media/flac/bear.flac";
|
||||
private static final String TEST_FILE_BINARY_SEARCH = "media/flac/bear_one_metadata_block.flac";
|
||||
private static final String TEST_FILE_UNSEEKABLE =
|
||||
"media/flac/bear_no_seek_table_no_num_samples.flac";
|
||||
private static final int DURATION_US = 2_741_000;
|
||||
|
||||
private FlacExtractor extractor = new FlacExtractor();
|
||||
|
|
|
|||
|
|
@ -39,78 +39,80 @@ public class FlacExtractorTest {
|
|||
@Test
|
||||
public void sample() throws Exception {
|
||||
ExtractorAsserts.assertAllBehaviors(
|
||||
FlacExtractor::new, /* file= */ "flac/bear.flac", /* dumpFilesPrefix= */ "flac/bear_raw");
|
||||
FlacExtractor::new,
|
||||
/* file= */ "media/flac/bear.flac",
|
||||
/* dumpFilesPrefix= */ "extractordumps/flac/bear_raw");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sampleWithId3HeaderAndId3Enabled() throws Exception {
|
||||
ExtractorAsserts.assertAllBehaviors(
|
||||
FlacExtractor::new,
|
||||
/* file= */ "flac/bear_with_id3.flac",
|
||||
/* dumpFilesPrefix= */ "flac/bear_with_id3_enabled_raw");
|
||||
/* file= */ "media/flac/bear_with_id3.flac",
|
||||
/* dumpFilesPrefix= */ "extractordumps/flac/bear_with_id3_enabled_raw");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sampleWithId3HeaderAndId3Disabled() throws Exception {
|
||||
ExtractorAsserts.assertAllBehaviors(
|
||||
() -> new FlacExtractor(FlacExtractor.FLAG_DISABLE_ID3_METADATA),
|
||||
/* file= */ "flac/bear_with_id3.flac",
|
||||
/* dumpFilesPrefix= */ "flac/bear_with_id3_disabled_raw");
|
||||
/* file= */ "media/flac/bear_with_id3.flac",
|
||||
/* dumpFilesPrefix= */ "extractordumps/flac/bear_with_id3_disabled_raw");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sampleUnseekable() throws Exception {
|
||||
ExtractorAsserts.assertAllBehaviors(
|
||||
FlacExtractor::new,
|
||||
/* file= */ "flac/bear_no_seek_table_no_num_samples.flac",
|
||||
/* dumpFilesPrefix= */ "flac/bear_no_seek_table_no_num_samples_raw");
|
||||
/* file= */ "media/flac/bear_no_seek_table_no_num_samples.flac",
|
||||
/* dumpFilesPrefix= */ "extractordumps/flac/bear_no_seek_table_no_num_samples_raw");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sampleWithVorbisComments() throws Exception {
|
||||
ExtractorAsserts.assertAllBehaviors(
|
||||
FlacExtractor::new,
|
||||
/* file= */ "flac/bear_with_vorbis_comments.flac",
|
||||
/* dumpFilesPrefix= */ "flac/bear_with_vorbis_comments_raw");
|
||||
/* file= */ "media/flac/bear_with_vorbis_comments.flac",
|
||||
/* dumpFilesPrefix= */ "extractordumps/flac/bear_with_vorbis_comments_raw");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sampleWithPicture() throws Exception {
|
||||
ExtractorAsserts.assertAllBehaviors(
|
||||
FlacExtractor::new,
|
||||
/* file= */ "flac/bear_with_picture.flac",
|
||||
/* dumpFilesPrefix= */ "flac/bear_with_picture_raw");
|
||||
/* file= */ "media/flac/bear_with_picture.flac",
|
||||
/* dumpFilesPrefix= */ "extractordumps/flac/bear_with_picture_raw");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void oneMetadataBlock() throws Exception {
|
||||
ExtractorAsserts.assertAllBehaviors(
|
||||
FlacExtractor::new,
|
||||
/* file= */ "flac/bear_one_metadata_block.flac",
|
||||
/* dumpFilesPrefix= */ "flac/bear_one_metadata_block_raw");
|
||||
/* file= */ "media/flac/bear_one_metadata_block.flac",
|
||||
/* dumpFilesPrefix= */ "extractordumps/flac/bear_one_metadata_block_raw");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void noMinMaxFrameSize() throws Exception {
|
||||
ExtractorAsserts.assertAllBehaviors(
|
||||
FlacExtractor::new,
|
||||
/* file= */ "flac/bear_no_min_max_frame_size.flac",
|
||||
/* dumpFilesPrefix= */ "flac/bear_no_min_max_frame_size_raw");
|
||||
/* file= */ "media/flac/bear_no_min_max_frame_size.flac",
|
||||
/* dumpFilesPrefix= */ "extractordumps/flac/bear_no_min_max_frame_size_raw");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void noNumSamples() throws Exception {
|
||||
ExtractorAsserts.assertAllBehaviors(
|
||||
FlacExtractor::new,
|
||||
/* file= */ "flac/bear_no_num_samples.flac",
|
||||
/* dumpFilesPrefix= */ "flac/bear_no_num_samples_raw");
|
||||
/* file= */ "media/flac/bear_no_num_samples.flac",
|
||||
/* dumpFilesPrefix= */ "extractordumps/flac/bear_no_num_samples_raw");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void uncommonSampleRate() throws Exception {
|
||||
ExtractorAsserts.assertAllBehaviors(
|
||||
FlacExtractor::new,
|
||||
/* file= */ "flac/bear_uncommon_sample_rate.flac",
|
||||
/* dumpFilesPrefix= */ "flac/bear_uncommon_sample_rate_raw");
|
||||
/* file= */ "media/flac/bear_uncommon_sample_rate.flac",
|
||||
/* dumpFilesPrefix= */ "extractordumps/flac/bear_uncommon_sample_rate_raw");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public class FlacPlaybackTest {
|
|||
|
||||
TestPlaybackRunnable testPlaybackRunnable =
|
||||
new TestPlaybackRunnable(
|
||||
Uri.parse("asset:///" + fileName),
|
||||
Uri.parse("asset:///media/" + fileName),
|
||||
ApplicationProvider.getApplicationContext(),
|
||||
audioSink);
|
||||
Thread thread = new Thread(testPlaybackRunnable);
|
||||
|
|
@ -82,7 +82,9 @@ public class FlacPlaybackTest {
|
|||
}
|
||||
|
||||
DumpFileAsserts.assertOutput(
|
||||
ApplicationProvider.getApplicationContext(), audioSink, fileName + ".audiosink.dump");
|
||||
ApplicationProvider.getApplicationContext(),
|
||||
audioSink,
|
||||
"audiosinkdumps/" + fileName + ".audiosink.dump");
|
||||
}
|
||||
|
||||
private static class TestPlaybackRunnable implements Player.EventListener, Runnable {
|
||||
|
|
|
|||
|
|
@ -39,9 +39,9 @@ import org.junit.runner.RunWith;
|
|||
@RunWith(AndroidJUnit4.class)
|
||||
public class OpusPlaybackTest {
|
||||
|
||||
private static final String BEAR_OPUS_URI = "asset:///mka/bear-opus.mka";
|
||||
private static final String BEAR_OPUS_URI = "asset:///media/mka/bear-opus.mka";
|
||||
private static final String BEAR_OPUS_NEGATIVE_GAIN_URI =
|
||||
"asset:///mka/bear-opus-negative-gain.mka";
|
||||
"asset:///media/mka/bear-opus-negative-gain.mka";
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
|
|
|
|||
|
|
@ -43,10 +43,11 @@ import org.junit.runner.RunWith;
|
|||
@RunWith(AndroidJUnit4.class)
|
||||
public class VpxPlaybackTest {
|
||||
|
||||
private static final String BEAR_URI = "asset:///vp9/bear-vp9.webm";
|
||||
private static final String BEAR_ODD_DIMENSIONS_URI = "asset:///vp9/bear-vp9-odd-dimensions.webm";
|
||||
private static final String ROADTRIP_10BIT_URI = "asset:///vp9/roadtrip-vp92-10bit.webm";
|
||||
private static final String INVALID_BITSTREAM_URI = "asset:///vp9/invalid-bitstream.webm";
|
||||
private static final String BEAR_URI = "asset:///media/vp9/bear-vp9.webm";
|
||||
private static final String BEAR_ODD_DIMENSIONS_URI =
|
||||
"asset:///media/vp9/bear-vp9-odd-dimensions.webm";
|
||||
private static final String ROADTRIP_10BIT_URI = "asset:///media/vp9/roadtrip-vp92-10bit.webm";
|
||||
private static final String INVALID_BITSTREAM_URI = "asset:///media/vp9/invalid-bitstream.webm";
|
||||
|
||||
private static final String TAG = "VpxPlaybackTest";
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ import org.junit.runner.RunWith;
|
|||
public final class ContentDataSourceTest {
|
||||
|
||||
private static final String AUTHORITY = "com.google.android.exoplayer2.core.test";
|
||||
private static final String DATA_PATH = "mp3/1024_incrementing_bytes.mp3";
|
||||
private static final String DATA_PATH = "media/mp3/1024_incrementing_bytes.mp3";
|
||||
|
||||
@Test
|
||||
public void read() throws Exception {
|
||||
|
|
|
|||
|
|
@ -33,9 +33,9 @@ import org.junit.runner.RunWith;
|
|||
@RunWith(AndroidJUnit4.class)
|
||||
public final class AppInfoTableDecoderTest {
|
||||
|
||||
private static final String TYPICAL_FILE = "dvbsi/ait_typical.bin";
|
||||
private static final String NO_URL_BASE_FILE = "dvbsi/ait_no_url_base.bin";
|
||||
private static final String NO_URL_PATH_FILE = "dvbsi/ait_no_url_path.bin";
|
||||
private static final String TYPICAL_FILE = "media/dvbsi/ait_typical.bin";
|
||||
private static final String NO_URL_BASE_FILE = "media/dvbsi/ait_no_url_base.bin";
|
||||
private static final String NO_URL_PATH_FILE = "media/dvbsi/ait_no_url_path.bin";
|
||||
|
||||
@Test
|
||||
public void decode_typical() throws Exception {
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public class ActionFileTest {
|
|||
|
||||
@Test
|
||||
public void loadNoDataThrowsIOException() throws Exception {
|
||||
ActionFile actionFile = getActionFile("offline/action_file_no_data.exi");
|
||||
ActionFile actionFile = getActionFile("media/offline/action_file_no_data.exi");
|
||||
try {
|
||||
actionFile.load();
|
||||
Assert.fail();
|
||||
|
|
@ -68,7 +68,7 @@ public class ActionFileTest {
|
|||
|
||||
@Test
|
||||
public void loadIncompleteHeaderThrowsIOException() throws Exception {
|
||||
ActionFile actionFile = getActionFile("offline/action_file_incomplete_header.exi");
|
||||
ActionFile actionFile = getActionFile("media/offline/action_file_incomplete_header.exi");
|
||||
try {
|
||||
actionFile.load();
|
||||
Assert.fail();
|
||||
|
|
@ -79,7 +79,7 @@ public class ActionFileTest {
|
|||
|
||||
@Test
|
||||
public void loadZeroActions() throws Exception {
|
||||
ActionFile actionFile = getActionFile("offline/action_file_zero_actions.exi");
|
||||
ActionFile actionFile = getActionFile("media/offline/action_file_zero_actions.exi");
|
||||
DownloadRequest[] actions = actionFile.load();
|
||||
assertThat(actions).isNotNull();
|
||||
assertThat(actions).hasLength(0);
|
||||
|
|
@ -87,7 +87,7 @@ public class ActionFileTest {
|
|||
|
||||
@Test
|
||||
public void loadOneAction() throws Exception {
|
||||
ActionFile actionFile = getActionFile("offline/action_file_one_action.exi");
|
||||
ActionFile actionFile = getActionFile("media/offline/action_file_one_action.exi");
|
||||
DownloadRequest[] actions = actionFile.load();
|
||||
assertThat(actions).hasLength(1);
|
||||
assertThat(actions[0]).isEqualTo(expectedAction1);
|
||||
|
|
@ -95,7 +95,7 @@ public class ActionFileTest {
|
|||
|
||||
@Test
|
||||
public void loadTwoActions() throws Exception {
|
||||
ActionFile actionFile = getActionFile("offline/action_file_two_actions.exi");
|
||||
ActionFile actionFile = getActionFile("media/offline/action_file_two_actions.exi");
|
||||
DownloadRequest[] actions = actionFile.load();
|
||||
assertThat(actions).hasLength(2);
|
||||
assertThat(actions[0]).isEqualTo(expectedAction1);
|
||||
|
|
@ -104,7 +104,7 @@ public class ActionFileTest {
|
|||
|
||||
@Test
|
||||
public void loadUnsupportedVersion() throws Exception {
|
||||
ActionFile actionFile = getActionFile("offline/action_file_unsupported_version.exi");
|
||||
ActionFile actionFile = getActionFile("media/offline/action_file_unsupported_version.exi");
|
||||
try {
|
||||
actionFile.load();
|
||||
Assert.fail();
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class ActionFileUpgradeUtilTest {
|
|||
byte[] actionFileBytes =
|
||||
TestUtil.getByteArray(
|
||||
ApplicationProvider.getApplicationContext(),
|
||||
"offline/action_file_for_download_index_upgrade_progressive.exi");
|
||||
"media/offline/action_file_for_download_index_upgrade_progressive.exi");
|
||||
try (FileOutputStream output = new FileOutputStream(tempFile)) {
|
||||
output.write(actionFileBytes);
|
||||
}
|
||||
|
|
@ -96,7 +96,7 @@ public class ActionFileUpgradeUtilTest {
|
|||
byte[] actionFileBytes =
|
||||
TestUtil.getByteArray(
|
||||
ApplicationProvider.getApplicationContext(),
|
||||
"offline/action_file_for_download_index_upgrade_dash.exi");
|
||||
"media/offline/action_file_for_download_index_upgrade_dash.exi");
|
||||
try (FileOutputStream output = new FileOutputStream(tempFile)) {
|
||||
output.write(actionFileBytes);
|
||||
}
|
||||
|
|
@ -135,7 +135,7 @@ public class ActionFileUpgradeUtilTest {
|
|||
byte[] actionFileBytes =
|
||||
TestUtil.getByteArray(
|
||||
ApplicationProvider.getApplicationContext(),
|
||||
"offline/action_file_for_download_index_upgrade_hls.exi");
|
||||
"media/offline/action_file_for_download_index_upgrade_hls.exi");
|
||||
try (FileOutputStream output = new FileOutputStream(tempFile)) {
|
||||
output.write(actionFileBytes);
|
||||
}
|
||||
|
|
@ -174,7 +174,7 @@ public class ActionFileUpgradeUtilTest {
|
|||
byte[] actionFileBytes =
|
||||
TestUtil.getByteArray(
|
||||
ApplicationProvider.getApplicationContext(),
|
||||
"offline/action_file_for_download_index_upgrade_ss.exi");
|
||||
"media/offline/action_file_for_download_index_upgrade_ss.exi");
|
||||
try (FileOutputStream output = new FileOutputStream(tempFile)) {
|
||||
output.write(actionFileBytes);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ public class DefaultDownloadIndexTest {
|
|||
Context context = ApplicationProvider.getApplicationContext();
|
||||
File databaseFile = context.getDatabasePath(ExoDatabaseProvider.DATABASE_NAME);
|
||||
try (FileOutputStream output = new FileOutputStream(databaseFile)) {
|
||||
output.write(TestUtil.getByteArray(context, "offline/exoplayer_internal_v2.db"));
|
||||
output.write(TestUtil.getByteArray(context, "media/offline/exoplayer_internal_v2.db"));
|
||||
}
|
||||
Download dashDownload =
|
||||
createDownload(
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public final class ProgressiveMediaPeriodTest {
|
|||
MediaPeriodId mediaPeriodId = new MediaPeriodId(/* periodUid= */ new Object());
|
||||
ProgressiveMediaPeriod mediaPeriod =
|
||||
new ProgressiveMediaPeriod(
|
||||
Uri.parse("asset://android_asset/mp4/sample.mp4"),
|
||||
Uri.parse("asset://android_asset/media/mp4/sample.mp4"),
|
||||
new AssetDataSource(ApplicationProvider.getApplicationContext()),
|
||||
() -> new Extractor[] {new Mp4Extractor()},
|
||||
DrmSessionManager.DUMMY,
|
||||
|
|
|
|||
|
|
@ -34,16 +34,16 @@ import org.junit.runner.RunWith;
|
|||
@RunWith(AndroidJUnit4.class)
|
||||
public final class SsaDecoderTest {
|
||||
|
||||
private static final String EMPTY = "ssa/empty";
|
||||
private static final String TYPICAL = "ssa/typical";
|
||||
private static final String TYPICAL_HEADER_ONLY = "ssa/typical_header";
|
||||
private static final String TYPICAL_DIALOGUE_ONLY = "ssa/typical_dialogue";
|
||||
private static final String TYPICAL_FORMAT_ONLY = "ssa/typical_format";
|
||||
private static final String OVERLAPPING_TIMECODES = "ssa/overlapping_timecodes";
|
||||
private static final String POSITIONS = "ssa/positioning";
|
||||
private static final String INVALID_TIMECODES = "ssa/invalid_timecodes";
|
||||
private static final String INVALID_POSITIONS = "ssa/invalid_positioning";
|
||||
private static final String POSITIONS_WITHOUT_PLAYRES = "ssa/positioning_without_playres";
|
||||
private static final String EMPTY = "media/ssa/empty";
|
||||
private static final String TYPICAL = "media/ssa/typical";
|
||||
private static final String TYPICAL_HEADER_ONLY = "media/ssa/typical_header";
|
||||
private static final String TYPICAL_DIALOGUE_ONLY = "media/ssa/typical_dialogue";
|
||||
private static final String TYPICAL_FORMAT_ONLY = "media/ssa/typical_format";
|
||||
private static final String OVERLAPPING_TIMECODES = "media/ssa/overlapping_timecodes";
|
||||
private static final String POSITIONS = "media/ssa/positioning";
|
||||
private static final String INVALID_TIMECODES = "media/ssa/invalid_timecodes";
|
||||
private static final String INVALID_POSITIONS = "media/ssa/invalid_positioning";
|
||||
private static final String POSITIONS_WITHOUT_PLAYRES = "media/ssa/positioning_without_playres";
|
||||
|
||||
@Test
|
||||
public void decodeEmpty() throws IOException {
|
||||
|
|
|
|||
|
|
@ -30,16 +30,19 @@ import org.junit.runner.RunWith;
|
|||
@RunWith(AndroidJUnit4.class)
|
||||
public final class SubripDecoderTest {
|
||||
|
||||
private static final String EMPTY_FILE = "subrip/empty";
|
||||
private static final String TYPICAL_FILE = "subrip/typical";
|
||||
private static final String TYPICAL_WITH_BYTE_ORDER_MARK = "subrip/typical_with_byte_order_mark";
|
||||
private static final String TYPICAL_EXTRA_BLANK_LINE = "subrip/typical_extra_blank_line";
|
||||
private static final String TYPICAL_MISSING_TIMECODE = "subrip/typical_missing_timecode";
|
||||
private static final String TYPICAL_MISSING_SEQUENCE = "subrip/typical_missing_sequence";
|
||||
private static final String TYPICAL_NEGATIVE_TIMESTAMPS = "subrip/typical_negative_timestamps";
|
||||
private static final String TYPICAL_UNEXPECTED_END = "subrip/typical_unexpected_end";
|
||||
private static final String TYPICAL_WITH_TAGS = "subrip/typical_with_tags";
|
||||
private static final String TYPICAL_NO_HOURS_AND_MILLIS = "subrip/typical_no_hours_and_millis";
|
||||
private static final String EMPTY_FILE = "media/subrip/empty";
|
||||
private static final String TYPICAL_FILE = "media/subrip/typical";
|
||||
private static final String TYPICAL_WITH_BYTE_ORDER_MARK =
|
||||
"media/subrip/typical_with_byte_order_mark";
|
||||
private static final String TYPICAL_EXTRA_BLANK_LINE = "media/subrip/typical_extra_blank_line";
|
||||
private static final String TYPICAL_MISSING_TIMECODE = "media/subrip/typical_missing_timecode";
|
||||
private static final String TYPICAL_MISSING_SEQUENCE = "media/subrip/typical_missing_sequence";
|
||||
private static final String TYPICAL_NEGATIVE_TIMESTAMPS =
|
||||
"media/subrip/typical_negative_timestamps";
|
||||
private static final String TYPICAL_UNEXPECTED_END = "media/subrip/typical_unexpected_end";
|
||||
private static final String TYPICAL_WITH_TAGS = "media/subrip/typical_with_tags";
|
||||
private static final String TYPICAL_NO_HOURS_AND_MILLIS =
|
||||
"media/subrip/typical_no_hours_and_millis";
|
||||
|
||||
@Test
|
||||
public void decodeEmpty() throws IOException {
|
||||
|
|
|
|||
|
|
@ -40,30 +40,33 @@ import org.junit.runner.RunWith;
|
|||
@RunWith(AndroidJUnit4.class)
|
||||
public final class TtmlDecoderTest {
|
||||
|
||||
private static final String INLINE_ATTRIBUTES_TTML_FILE = "ttml/inline_style_attributes.xml";
|
||||
private static final String INHERIT_STYLE_TTML_FILE = "ttml/inherit_style.xml";
|
||||
private static final String INLINE_ATTRIBUTES_TTML_FILE =
|
||||
"media/ttml/inline_style_attributes.xml";
|
||||
private static final String INHERIT_STYLE_TTML_FILE = "media/ttml/inherit_style.xml";
|
||||
private static final String INHERIT_STYLE_OVERRIDE_TTML_FILE =
|
||||
"ttml/inherit_and_override_style.xml";
|
||||
"media/ttml/inherit_and_override_style.xml";
|
||||
private static final String INHERIT_GLOBAL_AND_PARENT_TTML_FILE =
|
||||
"ttml/inherit_global_and_parent.xml";
|
||||
"media/ttml/inherit_global_and_parent.xml";
|
||||
private static final String INHERIT_MULTIPLE_STYLES_TTML_FILE =
|
||||
"ttml/inherit_multiple_styles.xml";
|
||||
private static final String CHAIN_MULTIPLE_STYLES_TTML_FILE = "ttml/chain_multiple_styles.xml";
|
||||
private static final String MULTIPLE_REGIONS_TTML_FILE = "ttml/multiple_regions.xml";
|
||||
"media/ttml/inherit_multiple_styles.xml";
|
||||
private static final String CHAIN_MULTIPLE_STYLES_TTML_FILE =
|
||||
"media/ttml/chain_multiple_styles.xml";
|
||||
private static final String MULTIPLE_REGIONS_TTML_FILE = "media/ttml/multiple_regions.xml";
|
||||
private static final String NO_UNDERLINE_LINETHROUGH_TTML_FILE =
|
||||
"ttml/no_underline_linethrough.xml";
|
||||
private static final String FONT_SIZE_TTML_FILE = "ttml/font_size.xml";
|
||||
private static final String FONT_SIZE_MISSING_UNIT_TTML_FILE = "ttml/font_size_no_unit.xml";
|
||||
private static final String FONT_SIZE_INVALID_TTML_FILE = "ttml/font_size_invalid.xml";
|
||||
private static final String FONT_SIZE_EMPTY_TTML_FILE = "ttml/font_size_empty.xml";
|
||||
private static final String FRAME_RATE_TTML_FILE = "ttml/frame_rate.xml";
|
||||
private static final String BITMAP_REGION_FILE = "ttml/bitmap_percentage_region.xml";
|
||||
private static final String BITMAP_PIXEL_REGION_FILE = "ttml/bitmap_pixel_region.xml";
|
||||
private static final String BITMAP_UNSUPPORTED_REGION_FILE = "ttml/bitmap_unsupported_region.xml";
|
||||
private static final String TEXT_ALIGN_FILE = "ttml/text_align.xml";
|
||||
private static final String VERTICAL_TEXT_FILE = "ttml/vertical_text.xml";
|
||||
private static final String TEXT_COMBINE_FILE = "ttml/text_combine.xml";
|
||||
private static final String RUBIES_FILE = "ttml/rubies.xml";
|
||||
"media/ttml/no_underline_linethrough.xml";
|
||||
private static final String FONT_SIZE_TTML_FILE = "media/ttml/font_size.xml";
|
||||
private static final String FONT_SIZE_MISSING_UNIT_TTML_FILE = "media/ttml/font_size_no_unit.xml";
|
||||
private static final String FONT_SIZE_INVALID_TTML_FILE = "media/ttml/font_size_invalid.xml";
|
||||
private static final String FONT_SIZE_EMPTY_TTML_FILE = "media/ttml/font_size_empty.xml";
|
||||
private static final String FRAME_RATE_TTML_FILE = "media/ttml/frame_rate.xml";
|
||||
private static final String BITMAP_REGION_FILE = "media/ttml/bitmap_percentage_region.xml";
|
||||
private static final String BITMAP_PIXEL_REGION_FILE = "media/ttml/bitmap_pixel_region.xml";
|
||||
private static final String BITMAP_UNSUPPORTED_REGION_FILE =
|
||||
"media/ttml/bitmap_unsupported_region.xml";
|
||||
private static final String TEXT_ALIGN_FILE = "media/ttml/text_align.xml";
|
||||
private static final String VERTICAL_TEXT_FILE = "media/ttml/vertical_text.xml";
|
||||
private static final String TEXT_COMBINE_FILE = "media/ttml/text_combine.xml";
|
||||
private static final String RUBIES_FILE = "media/ttml/rubies.xml";
|
||||
|
||||
@Test
|
||||
public void inlineAttributes() throws IOException, SubtitleDecoderException {
|
||||
|
|
|
|||
|
|
@ -41,17 +41,20 @@ import org.junit.runner.RunWith;
|
|||
@RunWith(AndroidJUnit4.class)
|
||||
public final class Tx3gDecoderTest {
|
||||
|
||||
private static final String NO_SUBTITLE = "tx3g/no_subtitle";
|
||||
private static final String SAMPLE_JUST_TEXT = "tx3g/sample_just_text";
|
||||
private static final String SAMPLE_WITH_STYL = "tx3g/sample_with_styl";
|
||||
private static final String SAMPLE_WITH_STYL_ALL_DEFAULTS = "tx3g/sample_with_styl_all_defaults";
|
||||
private static final String SAMPLE_UTF16_BE_NO_STYL = "tx3g/sample_utf16_be_no_styl";
|
||||
private static final String SAMPLE_UTF16_LE_NO_STYL = "tx3g/sample_utf16_le_no_styl";
|
||||
private static final String SAMPLE_WITH_MULTIPLE_STYL = "tx3g/sample_with_multiple_styl";
|
||||
private static final String SAMPLE_WITH_OTHER_EXTENSION = "tx3g/sample_with_other_extension";
|
||||
private static final String SAMPLE_WITH_TBOX = "tx3g/sample_with_tbox";
|
||||
private static final String INITIALIZATION = "tx3g/initialization";
|
||||
private static final String INITIALIZATION_ALL_DEFAULTS = "tx3g/initialization_all_defaults";
|
||||
private static final String NO_SUBTITLE = "media/tx3g/no_subtitle";
|
||||
private static final String SAMPLE_JUST_TEXT = "media/tx3g/sample_just_text";
|
||||
private static final String SAMPLE_WITH_STYL = "media/tx3g/sample_with_styl";
|
||||
private static final String SAMPLE_WITH_STYL_ALL_DEFAULTS =
|
||||
"media/tx3g/sample_with_styl_all_defaults";
|
||||
private static final String SAMPLE_UTF16_BE_NO_STYL = "media/tx3g/sample_utf16_be_no_styl";
|
||||
private static final String SAMPLE_UTF16_LE_NO_STYL = "media/tx3g/sample_utf16_le_no_styl";
|
||||
private static final String SAMPLE_WITH_MULTIPLE_STYL = "media/tx3g/sample_with_multiple_styl";
|
||||
private static final String SAMPLE_WITH_OTHER_EXTENSION =
|
||||
"media/tx3g/sample_with_other_extension";
|
||||
private static final String SAMPLE_WITH_TBOX = "media/tx3g/sample_with_tbox";
|
||||
private static final String INITIALIZATION = "media/tx3g/initialization";
|
||||
private static final String INITIALIZATION_ALL_DEFAULTS =
|
||||
"media/tx3g/initialization_all_defaults";
|
||||
|
||||
@Test
|
||||
public void decodeNoSubtitle() throws IOException, SubtitleDecoderException {
|
||||
|
|
|
|||
|
|
@ -41,23 +41,25 @@ import org.junit.runner.RunWith;
|
|||
@RunWith(AndroidJUnit4.class)
|
||||
public class WebvttDecoderTest {
|
||||
|
||||
private static final String TYPICAL_FILE = "webvtt/typical";
|
||||
private static final String TYPICAL_WITH_BAD_TIMESTAMPS = "webvtt/typical_with_bad_timestamps";
|
||||
private static final String TYPICAL_WITH_IDS_FILE = "webvtt/typical_with_identifiers";
|
||||
private static final String TYPICAL_WITH_COMMENTS_FILE = "webvtt/typical_with_comments";
|
||||
private static final String WITH_POSITIONING_FILE = "webvtt/with_positioning";
|
||||
private static final String TYPICAL_FILE = "media/webvtt/typical";
|
||||
private static final String TYPICAL_WITH_BAD_TIMESTAMPS =
|
||||
"media/webvtt/typical_with_bad_timestamps";
|
||||
private static final String TYPICAL_WITH_IDS_FILE = "media/webvtt/typical_with_identifiers";
|
||||
private static final String TYPICAL_WITH_COMMENTS_FILE = "media/webvtt/typical_with_comments";
|
||||
private static final String WITH_POSITIONING_FILE = "media/webvtt/with_positioning";
|
||||
private static final String WITH_OVERLAPPING_TIMESTAMPS_FILE =
|
||||
"webvtt/with_overlapping_timestamps";
|
||||
private static final String WITH_VERTICAL_FILE = "webvtt/with_vertical";
|
||||
private static final String WITH_RUBIES_FILE = "webvtt/with_rubies";
|
||||
private static final String WITH_BAD_CUE_HEADER_FILE = "webvtt/with_bad_cue_header";
|
||||
private static final String WITH_TAGS_FILE = "webvtt/with_tags";
|
||||
private static final String WITH_CSS_STYLES = "webvtt/with_css_styles";
|
||||
private static final String WITH_CSS_COMPLEX_SELECTORS = "webvtt/with_css_complex_selectors";
|
||||
"media/webvtt/with_overlapping_timestamps";
|
||||
private static final String WITH_VERTICAL_FILE = "media/webvtt/with_vertical";
|
||||
private static final String WITH_RUBIES_FILE = "media/webvtt/with_rubies";
|
||||
private static final String WITH_BAD_CUE_HEADER_FILE = "media/webvtt/with_bad_cue_header";
|
||||
private static final String WITH_TAGS_FILE = "media/webvtt/with_tags";
|
||||
private static final String WITH_CSS_STYLES = "media/webvtt/with_css_styles";
|
||||
private static final String WITH_CSS_COMPLEX_SELECTORS =
|
||||
"media/webvtt/with_css_complex_selectors";
|
||||
private static final String WITH_CSS_TEXT_COMBINE_UPRIGHT =
|
||||
"webvtt/with_css_text_combine_upright";
|
||||
private static final String WITH_BOM = "webvtt/with_bom";
|
||||
private static final String EMPTY_FILE = "webvtt/empty";
|
||||
"media/webvtt/with_css_text_combine_upright";
|
||||
private static final String WITH_BOM = "media/webvtt/with_bom";
|
||||
private static final String EMPTY_FILE = "media/webvtt/empty";
|
||||
|
||||
@Rule public final Expect expect = Expect.create();
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import org.junit.runner.RunWith;
|
|||
@RunWith(AndroidJUnit4.class)
|
||||
public final class AssetDataSourceTest {
|
||||
|
||||
private static final String DATA_PATH = "mp3/1024_incrementing_bytes.mp3";
|
||||
private static final String DATA_PATH = "media/mp3/1024_incrementing_bytes.mp3";
|
||||
|
||||
@Test
|
||||
public void readFileUri() throws Exception {
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ public final class DashMediaPeriodTest {
|
|||
// - Embedded track groups.
|
||||
// All cases are deliberately combined in one test to catch potential indexing problems which
|
||||
// only occur in combination.
|
||||
DashManifest manifest = parseManifest("mpd/sample_mpd_stream_keys");
|
||||
DashManifest manifest = parseManifest("media/mpd/sample_mpd_stream_keys");
|
||||
|
||||
// Ignore embedded metadata as we don't want to select primary group just to get embedded track.
|
||||
MediaPeriodAsserts.assertGetStreamKeysAndManifestFilterIntegration(
|
||||
|
|
@ -70,7 +70,7 @@ public final class DashMediaPeriodTest {
|
|||
|
||||
@Test
|
||||
public void adaptationSetSwitchingProperty_mergesTrackGroups() throws IOException {
|
||||
DashManifest manifest = parseManifest("mpd/sample_mpd_switching_property");
|
||||
DashManifest manifest = parseManifest("media/mpd/sample_mpd_switching_property");
|
||||
DashMediaPeriod dashMediaPeriod = createDashMediaPeriod(manifest, 0);
|
||||
List<AdaptationSet> adaptationSets = manifest.getPeriod(0).adaptationSets;
|
||||
|
||||
|
|
@ -91,7 +91,7 @@ public final class DashMediaPeriodTest {
|
|||
|
||||
@Test
|
||||
public void trickPlayProperty_mergesTrackGroups() throws IOException {
|
||||
DashManifest manifest = parseManifest("mpd/sample_mpd_trick_play_property");
|
||||
DashManifest manifest = parseManifest("media/mpd/sample_mpd_trick_play_property");
|
||||
DashMediaPeriod dashMediaPeriod = createDashMediaPeriod(manifest, 0);
|
||||
List<AdaptationSet> adaptationSets = manifest.getPeriod(0).adaptationSets;
|
||||
|
||||
|
|
@ -114,7 +114,7 @@ public final class DashMediaPeriodTest {
|
|||
@Test
|
||||
public void adaptationSetSwitchingProperty_andTrickPlayProperty_mergesTrackGroups()
|
||||
throws IOException {
|
||||
DashManifest manifest = parseManifest("mpd/sample_mpd_switching_and_trick_play_property");
|
||||
DashManifest manifest = parseManifest("media/mpd/sample_mpd_switching_and_trick_play_property");
|
||||
DashMediaPeriod dashMediaPeriod = createDashMediaPeriod(manifest, 0);
|
||||
List<AdaptationSet> adaptationSets = manifest.getPeriod(0).adaptationSets;
|
||||
|
||||
|
|
@ -135,7 +135,7 @@ public final class DashMediaPeriodTest {
|
|||
|
||||
@Test
|
||||
public void cea608AccessibilityDescriptor_createsCea608TrackGroup() throws IOException {
|
||||
DashManifest manifest = parseManifest("mpd/sample_mpd_cea_608_accessibility");
|
||||
DashManifest manifest = parseManifest("media/mpd/sample_mpd_cea_608_accessibility");
|
||||
DashMediaPeriod dashMediaPeriod = createDashMediaPeriod(manifest, 0);
|
||||
List<AdaptationSet> adaptationSets = manifest.getPeriod(0).adaptationSets;
|
||||
|
||||
|
|
@ -165,7 +165,7 @@ public final class DashMediaPeriodTest {
|
|||
|
||||
@Test
|
||||
public void cea708AccessibilityDescriptor_createsCea708TrackGroup() throws IOException {
|
||||
DashManifest manifest = parseManifest("mpd/sample_mpd_cea_708_accessibility");
|
||||
DashManifest manifest = parseManifest("media/mpd/sample_mpd_cea_708_accessibility");
|
||||
DashMediaPeriod dashMediaPeriod = createDashMediaPeriod(manifest, 0);
|
||||
List<AdaptationSet> adaptationSets = manifest.getPeriod(0).adaptationSets;
|
||||
|
||||
|
|
|
|||
|
|
@ -42,14 +42,15 @@ import org.xmlpull.v1.XmlPullParserFactory;
|
|||
@RunWith(AndroidJUnit4.class)
|
||||
public class DashManifestParserTest {
|
||||
|
||||
private static final String SAMPLE_MPD = "mpd/sample_mpd";
|
||||
private static final String SAMPLE_MPD_UNKNOWN_MIME_TYPE = "mpd/sample_mpd_unknown_mime_type";
|
||||
private static final String SAMPLE_MPD_SEGMENT_TEMPLATE = "mpd/sample_mpd_segment_template";
|
||||
private static final String SAMPLE_MPD_EVENT_STREAM = "mpd/sample_mpd_event_stream";
|
||||
private static final String SAMPLE_MPD_LABELS = "mpd/sample_mpd_labels";
|
||||
private static final String SAMPLE_MPD_ASSET_IDENTIFIER = "mpd/sample_mpd_asset_identifier";
|
||||
private static final String SAMPLE_MPD_TEXT = "mpd/sample_mpd_text";
|
||||
private static final String SAMPLE_MPD_TRICK_PLAY = "mpd/sample_mpd_trick_play";
|
||||
private static final String SAMPLE_MPD = "media/mpd/sample_mpd";
|
||||
private static final String SAMPLE_MPD_UNKNOWN_MIME_TYPE =
|
||||
"media/mpd/sample_mpd_unknown_mime_type";
|
||||
private static final String SAMPLE_MPD_SEGMENT_TEMPLATE = "media/mpd/sample_mpd_segment_template";
|
||||
private static final String SAMPLE_MPD_EVENT_STREAM = "media/mpd/sample_mpd_event_stream";
|
||||
private static final String SAMPLE_MPD_LABELS = "media/mpd/sample_mpd_labels";
|
||||
private static final String SAMPLE_MPD_ASSET_IDENTIFIER = "media/mpd/sample_mpd_asset_identifier";
|
||||
private static final String SAMPLE_MPD_TEXT = "media/mpd/sample_mpd_text";
|
||||
private static final String SAMPLE_MPD_TRICK_PLAY = "media/mpd/sample_mpd_trick_play";
|
||||
|
||||
private static final String NEXT_TAG_NAME = "Next";
|
||||
private static final String NEXT_TAG = "<" + NEXT_TAG_NAME + "/>";
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public class FlacFrameReaderTest {
|
|||
new FlacStreamMetadataHolder(/* flacStreamMetadata= */ null);
|
||||
ExtractorInput input =
|
||||
buildExtractorInputReadingFromFirstFrame(
|
||||
"flac/bear_one_metadata_block.flac", streamMetadataHolder);
|
||||
"media/flac/bear_one_metadata_block.flac", streamMetadataHolder);
|
||||
int frameStartMarker = FlacMetadataReader.getFrameStartMarker(input);
|
||||
ParsableByteArray scratch = new ParsableByteArray(FlacConstants.MAX_FRAME_HEADER_SIZE);
|
||||
input.read(scratch.getData(), 0, FlacConstants.MAX_FRAME_HEADER_SIZE);
|
||||
|
|
@ -64,7 +64,7 @@ public class FlacFrameReaderTest {
|
|||
new FlacStreamMetadataHolder(/* flacStreamMetadata= */ null);
|
||||
ExtractorInput input =
|
||||
buildExtractorInputReadingFromFirstFrame(
|
||||
"flac/bear_one_metadata_block.flac", streamMetadataHolder);
|
||||
"media/flac/bear_one_metadata_block.flac", streamMetadataHolder);
|
||||
int frameStartMarker = FlacMetadataReader.getFrameStartMarker(input);
|
||||
ParsableByteArray scratch = new ParsableByteArray(FlacConstants.MAX_FRAME_HEADER_SIZE);
|
||||
input.read(scratch.getData(), 0, FlacConstants.MAX_FRAME_HEADER_SIZE);
|
||||
|
|
@ -85,7 +85,7 @@ public class FlacFrameReaderTest {
|
|||
new FlacStreamMetadataHolder(/* flacStreamMetadata= */ null);
|
||||
ExtractorInput input =
|
||||
buildExtractorInputReadingFromFirstFrame(
|
||||
"flac/bear_one_metadata_block.flac", streamMetadataHolder);
|
||||
"media/flac/bear_one_metadata_block.flac", streamMetadataHolder);
|
||||
int frameStartMarker = FlacMetadataReader.getFrameStartMarker(input);
|
||||
// Skip first frame.
|
||||
input.skip(5030);
|
||||
|
|
@ -105,7 +105,7 @@ public class FlacFrameReaderTest {
|
|||
new FlacStreamMetadataHolder(/* flacStreamMetadata= */ null);
|
||||
ExtractorInput input =
|
||||
buildExtractorInputReadingFromFirstFrame(
|
||||
"flac/bear_one_metadata_block.flac", streamMetadataHolder);
|
||||
"media/flac/bear_one_metadata_block.flac", streamMetadataHolder);
|
||||
ParsableByteArray scratch = new ParsableByteArray(FlacConstants.MAX_FRAME_HEADER_SIZE);
|
||||
input.read(scratch.getData(), 0, FlacConstants.MAX_FRAME_HEADER_SIZE);
|
||||
|
||||
|
|
@ -122,7 +122,7 @@ public class FlacFrameReaderTest {
|
|||
|
||||
@Test
|
||||
public void checkFrameHeaderFromPeek_validData_doesNotUpdatePositions() throws Exception {
|
||||
String file = "flac/bear_one_metadata_block.flac";
|
||||
String file = "media/flac/bear_one_metadata_block.flac";
|
||||
FlacStreamMetadataHolder streamMetadataHolder =
|
||||
new FlacStreamMetadataHolder(/* flacStreamMetadata= */ null);
|
||||
ExtractorInput input = buildExtractorInputReadingFromFirstFrame(file, streamMetadataHolder);
|
||||
|
|
@ -145,7 +145,7 @@ public class FlacFrameReaderTest {
|
|||
new FlacStreamMetadataHolder(/* flacStreamMetadata= */ null);
|
||||
ExtractorInput input =
|
||||
buildExtractorInputReadingFromFirstFrame(
|
||||
"flac/bear_one_metadata_block.flac", streamMetadataHolder);
|
||||
"media/flac/bear_one_metadata_block.flac", streamMetadataHolder);
|
||||
int frameStartMarker = FlacMetadataReader.getFrameStartMarker(input);
|
||||
|
||||
boolean result =
|
||||
|
|
@ -164,7 +164,7 @@ public class FlacFrameReaderTest {
|
|||
new FlacStreamMetadataHolder(/* flacStreamMetadata= */ null);
|
||||
ExtractorInput input =
|
||||
buildExtractorInputReadingFromFirstFrame(
|
||||
"flac/bear_one_metadata_block.flac", streamMetadataHolder);
|
||||
"media/flac/bear_one_metadata_block.flac", streamMetadataHolder);
|
||||
int frameStartMarker = FlacMetadataReader.getFrameStartMarker(input);
|
||||
// Skip first frame.
|
||||
input.skip(5030);
|
||||
|
|
@ -182,7 +182,7 @@ public class FlacFrameReaderTest {
|
|||
new FlacStreamMetadataHolder(/* flacStreamMetadata= */ null);
|
||||
ExtractorInput input =
|
||||
buildExtractorInputReadingFromFirstFrame(
|
||||
"flac/bear_one_metadata_block.flac", streamMetadataHolder);
|
||||
"media/flac/bear_one_metadata_block.flac", streamMetadataHolder);
|
||||
|
||||
// The first bytes of the frame are not equal to the frame start marker.
|
||||
boolean result =
|
||||
|
|
@ -197,7 +197,7 @@ public class FlacFrameReaderTest {
|
|||
|
||||
@Test
|
||||
public void checkFrameHeaderFromPeek_invalidData_doesNotUpdatePositions() throws Exception {
|
||||
String file = "flac/bear_one_metadata_block.flac";
|
||||
String file = "media/flac/bear_one_metadata_block.flac";
|
||||
FlacStreamMetadataHolder streamMetadataHolder =
|
||||
new FlacStreamMetadataHolder(/* flacStreamMetadata= */ null);
|
||||
ExtractorInput input = buildExtractorInputReadingFromFirstFrame(file, streamMetadataHolder);
|
||||
|
|
@ -224,7 +224,7 @@ public class FlacFrameReaderTest {
|
|||
new FlacStreamMetadataHolder(/* flacStreamMetadata= */ null);
|
||||
ExtractorInput input =
|
||||
buildExtractorInputReadingFromFirstFrame(
|
||||
"flac/bear_one_metadata_block.flac", streamMetadataHolder);
|
||||
"media/flac/bear_one_metadata_block.flac", streamMetadataHolder);
|
||||
long initialReadPosition = input.getPosition();
|
||||
// Advance peek position after block size bits.
|
||||
input.advancePeekPosition(FlacConstants.MAX_FRAME_HEADER_SIZE);
|
||||
|
|
@ -241,7 +241,7 @@ public class FlacFrameReaderTest {
|
|||
new FlacStreamMetadataHolder(/* flacStreamMetadata= */ null);
|
||||
ExtractorInput input =
|
||||
buildExtractorInputReadingFromFirstFrame(
|
||||
"flac/bear_one_metadata_block.flac", streamMetadataHolder);
|
||||
"media/flac/bear_one_metadata_block.flac", streamMetadataHolder);
|
||||
// Skip first frame.
|
||||
input.skip(5030);
|
||||
|
||||
|
|
@ -272,7 +272,7 @@ public class FlacFrameReaderTest {
|
|||
@Test
|
||||
public void readFrameBlockSizeSamplesFromKey_keyBetween6And7_returnsCorrectBlockSize()
|
||||
throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("flac/bear_one_metadata_block.flac");
|
||||
ExtractorInput input = buildExtractorInput("media/flac/bear_one_metadata_block.flac");
|
||||
// Skip to block size bits of last frame.
|
||||
input.skipFully(164033);
|
||||
ParsableByteArray scratch = new ParsableByteArray(2);
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public class FlacMetadataReaderTest {
|
|||
|
||||
@Test
|
||||
public void peekId3Metadata_updatesPeekPosition() throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("flac/bear_with_id3.flac");
|
||||
ExtractorInput input = buildExtractorInput("media/flac/bear_with_id3.flac");
|
||||
|
||||
FlacMetadataReader.peekId3Metadata(input, /* parseData= */ false);
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ public class FlacMetadataReaderTest {
|
|||
|
||||
@Test
|
||||
public void peekId3Metadata_parseData_returnsNonEmptyMetadata() throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("flac/bear_with_id3.flac");
|
||||
ExtractorInput input = buildExtractorInput("media/flac/bear_with_id3.flac");
|
||||
|
||||
Metadata metadata = FlacMetadataReader.peekId3Metadata(input, /* parseData= */ true);
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ public class FlacMetadataReaderTest {
|
|||
|
||||
@Test
|
||||
public void peekId3Metadata_doNotParseData_returnsNull() throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("flac/bear_with_id3.flac");
|
||||
ExtractorInput input = buildExtractorInput("media/flac/bear_with_id3.flac");
|
||||
|
||||
Metadata metadata = FlacMetadataReader.peekId3Metadata(input, /* parseData= */ false);
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ public class FlacMetadataReaderTest {
|
|||
|
||||
@Test
|
||||
public void peekId3Metadata_noId3Metadata_returnsNull() throws Exception {
|
||||
String fileWithoutId3Metadata = "flac/bear.flac";
|
||||
String fileWithoutId3Metadata = "media/flac/bear.flac";
|
||||
ExtractorInput input = buildExtractorInput(fileWithoutId3Metadata);
|
||||
|
||||
Metadata metadata = FlacMetadataReader.peekId3Metadata(input, /* parseData= */ true);
|
||||
|
|
@ -84,7 +84,7 @@ public class FlacMetadataReaderTest {
|
|||
|
||||
@Test
|
||||
public void checkAndPeekStreamMarker_updatesPeekPosition() throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("flac/bear.flac");
|
||||
ExtractorInput input = buildExtractorInput("media/flac/bear.flac");
|
||||
|
||||
FlacMetadataReader.checkAndPeekStreamMarker(input);
|
||||
|
||||
|
|
@ -94,7 +94,7 @@ public class FlacMetadataReaderTest {
|
|||
|
||||
@Test
|
||||
public void checkAndPeekStreamMarker_validData_isTrue() throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("flac/bear.flac");
|
||||
ExtractorInput input = buildExtractorInput("media/flac/bear.flac");
|
||||
|
||||
boolean result = FlacMetadataReader.checkAndPeekStreamMarker(input);
|
||||
|
||||
|
|
@ -103,7 +103,7 @@ public class FlacMetadataReaderTest {
|
|||
|
||||
@Test
|
||||
public void checkAndPeekStreamMarker_invalidData_isFalse() throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("mp3/bear-vbr-xing-header.mp3");
|
||||
ExtractorInput input = buildExtractorInput("media/mp3/bear-vbr-xing-header.mp3");
|
||||
|
||||
boolean result = FlacMetadataReader.checkAndPeekStreamMarker(input);
|
||||
|
||||
|
|
@ -112,7 +112,7 @@ public class FlacMetadataReaderTest {
|
|||
|
||||
@Test
|
||||
public void readId3Metadata_updatesReadPositionAndAlignsPeekPosition() throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("flac/bear_with_id3.flac");
|
||||
ExtractorInput input = buildExtractorInput("media/flac/bear_with_id3.flac");
|
||||
// Advance peek position after ID3 metadata.
|
||||
FlacMetadataReader.peekId3Metadata(input, /* parseData= */ false);
|
||||
input.advancePeekPosition(1);
|
||||
|
|
@ -125,7 +125,7 @@ public class FlacMetadataReaderTest {
|
|||
|
||||
@Test
|
||||
public void readId3Metadata_parseData_returnsNonEmptyMetadata() throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("flac/bear_with_id3.flac");
|
||||
ExtractorInput input = buildExtractorInput("media/flac/bear_with_id3.flac");
|
||||
|
||||
Metadata metadata = FlacMetadataReader.readId3Metadata(input, /* parseData= */ true);
|
||||
|
||||
|
|
@ -135,7 +135,7 @@ public class FlacMetadataReaderTest {
|
|||
|
||||
@Test
|
||||
public void readId3Metadata_doNotParseData_returnsNull() throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("flac/bear_with_id3.flac");
|
||||
ExtractorInput input = buildExtractorInput("media/flac/bear_with_id3.flac");
|
||||
|
||||
Metadata metadata = FlacMetadataReader.readId3Metadata(input, /* parseData= */ false);
|
||||
|
||||
|
|
@ -144,7 +144,7 @@ public class FlacMetadataReaderTest {
|
|||
|
||||
@Test
|
||||
public void readId3Metadata_noId3Metadata_returnsNull() throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("flac/bear.flac");
|
||||
ExtractorInput input = buildExtractorInput("media/flac/bear.flac");
|
||||
|
||||
Metadata metadata = FlacMetadataReader.readId3Metadata(input, /* parseData= */ true);
|
||||
|
||||
|
|
@ -153,7 +153,7 @@ public class FlacMetadataReaderTest {
|
|||
|
||||
@Test
|
||||
public void readStreamMarker_updatesReadPosition() throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("flac/bear.flac");
|
||||
ExtractorInput input = buildExtractorInput("media/flac/bear.flac");
|
||||
|
||||
FlacMetadataReader.readStreamMarker(input);
|
||||
|
||||
|
|
@ -163,14 +163,14 @@ public class FlacMetadataReaderTest {
|
|||
|
||||
@Test
|
||||
public void readStreamMarker_invalidData_throwsException() throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("mp3/bear-vbr-xing-header.mp3");
|
||||
ExtractorInput input = buildExtractorInput("media/mp3/bear-vbr-xing-header.mp3");
|
||||
|
||||
assertThrows(ParserException.class, () -> FlacMetadataReader.readStreamMarker(input));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void readMetadataBlock_updatesReadPositionAndAlignsPeekPosition() throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("flac/bear.flac");
|
||||
ExtractorInput input = buildExtractorInput("media/flac/bear.flac");
|
||||
input.skipFully(FlacConstants.STREAM_MARKER_SIZE);
|
||||
// Advance peek position after metadata block.
|
||||
input.advancePeekPosition(FlacConstants.STREAM_INFO_BLOCK_SIZE + 1);
|
||||
|
|
@ -184,7 +184,7 @@ public class FlacMetadataReaderTest {
|
|||
|
||||
@Test
|
||||
public void readMetadataBlock_lastMetadataBlock_isTrue() throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("flac/bear_one_metadata_block.flac");
|
||||
ExtractorInput input = buildExtractorInput("media/flac/bear_one_metadata_block.flac");
|
||||
input.skipFully(FlacConstants.STREAM_MARKER_SIZE);
|
||||
|
||||
boolean result =
|
||||
|
|
@ -196,7 +196,7 @@ public class FlacMetadataReaderTest {
|
|||
|
||||
@Test
|
||||
public void readMetadataBlock_notLastMetadataBlock_isFalse() throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("flac/bear.flac");
|
||||
ExtractorInput input = buildExtractorInput("media/flac/bear.flac");
|
||||
input.skipFully(FlacConstants.STREAM_MARKER_SIZE);
|
||||
|
||||
boolean result =
|
||||
|
|
@ -208,7 +208,7 @@ public class FlacMetadataReaderTest {
|
|||
|
||||
@Test
|
||||
public void readMetadataBlock_streamInfoBlock_setsStreamMetadata() throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("flac/bear.flac");
|
||||
ExtractorInput input = buildExtractorInput("media/flac/bear.flac");
|
||||
input.skipFully(FlacConstants.STREAM_MARKER_SIZE);
|
||||
FlacStreamMetadataHolder metadataHolder =
|
||||
new FlacStreamMetadataHolder(/* flacStreamMetadata= */ null);
|
||||
|
|
@ -221,7 +221,7 @@ public class FlacMetadataReaderTest {
|
|||
|
||||
@Test
|
||||
public void readMetadataBlock_seekTableBlock_updatesStreamMetadata() throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("flac/bear.flac");
|
||||
ExtractorInput input = buildExtractorInput("media/flac/bear.flac");
|
||||
// Skip to seek table block.
|
||||
input.skipFully(FlacConstants.STREAM_MARKER_SIZE + FlacConstants.STREAM_INFO_BLOCK_SIZE);
|
||||
FlacStreamMetadataHolder metadataHolder = new FlacStreamMetadataHolder(buildStreamMetadata());
|
||||
|
|
@ -238,7 +238,7 @@ public class FlacMetadataReaderTest {
|
|||
|
||||
@Test
|
||||
public void readMetadataBlock_vorbisCommentBlock_updatesStreamMetadata() throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("flac/bear_with_vorbis_comments.flac");
|
||||
ExtractorInput input = buildExtractorInput("media/flac/bear_with_vorbis_comments.flac");
|
||||
// Skip to Vorbis comment block.
|
||||
input.skipFully(640);
|
||||
FlacStreamMetadataHolder metadataHolder = new FlacStreamMetadataHolder(buildStreamMetadata());
|
||||
|
|
@ -259,7 +259,7 @@ public class FlacMetadataReaderTest {
|
|||
|
||||
@Test
|
||||
public void readMetadataBlock_pictureBlock_updatesStreamMetadata() throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("flac/bear_with_picture.flac");
|
||||
ExtractorInput input = buildExtractorInput("media/flac/bear_with_picture.flac");
|
||||
// Skip to picture block.
|
||||
input.skipFully(640);
|
||||
FlacStreamMetadataHolder metadataHolder = new FlacStreamMetadataHolder(buildStreamMetadata());
|
||||
|
|
@ -286,7 +286,7 @@ public class FlacMetadataReaderTest {
|
|||
|
||||
@Test
|
||||
public void readMetadataBlock_blockToSkip_updatesReadPosition() throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("flac/bear.flac");
|
||||
ExtractorInput input = buildExtractorInput("media/flac/bear.flac");
|
||||
// Skip to padding block.
|
||||
input.skipFully(640);
|
||||
FlacStreamMetadataHolder metadataHolder = new FlacStreamMetadataHolder(buildStreamMetadata());
|
||||
|
|
@ -300,7 +300,7 @@ public class FlacMetadataReaderTest {
|
|||
@Test
|
||||
public void readMetadataBlock_nonStreamInfoBlockWithNullStreamMetadata_throwsException()
|
||||
throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("flac/bear.flac");
|
||||
ExtractorInput input = buildExtractorInput("media/flac/bear.flac");
|
||||
// Skip to seek table block.
|
||||
input.skipFully(FlacConstants.STREAM_MARKER_SIZE + FlacConstants.STREAM_INFO_BLOCK_SIZE);
|
||||
|
||||
|
|
@ -313,7 +313,7 @@ public class FlacMetadataReaderTest {
|
|||
|
||||
@Test
|
||||
public void readSeekTableMetadataBlock_updatesPosition() throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("flac/bear.flac");
|
||||
ExtractorInput input = buildExtractorInput("media/flac/bear.flac");
|
||||
// Skip to seek table block.
|
||||
input.skipFully(FlacConstants.STREAM_MARKER_SIZE + FlacConstants.STREAM_INFO_BLOCK_SIZE);
|
||||
int seekTableBlockSize = 598;
|
||||
|
|
@ -327,7 +327,7 @@ public class FlacMetadataReaderTest {
|
|||
|
||||
@Test
|
||||
public void readSeekTableMetadataBlock_returnsCorrectSeekPoints() throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("flac/bear.flac");
|
||||
ExtractorInput input = buildExtractorInput("media/flac/bear.flac");
|
||||
// Skip to seek table block.
|
||||
input.skipFully(FlacConstants.STREAM_MARKER_SIZE + FlacConstants.STREAM_INFO_BLOCK_SIZE);
|
||||
int seekTableBlockSize = 598;
|
||||
|
|
@ -345,7 +345,7 @@ public class FlacMetadataReaderTest {
|
|||
@Test
|
||||
public void readSeekTableMetadataBlock_ignoresPlaceholders() throws IOException {
|
||||
byte[] fileData =
|
||||
TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), "flac/bear.flac");
|
||||
TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), "media/flac/bear.flac");
|
||||
ParsableByteArray scratch = new ParsableByteArray(fileData);
|
||||
// Skip to seek table block.
|
||||
scratch.skipBytes(FlacConstants.STREAM_MARKER_SIZE + FlacConstants.STREAM_INFO_BLOCK_SIZE);
|
||||
|
|
@ -359,7 +359,7 @@ public class FlacMetadataReaderTest {
|
|||
@Test
|
||||
public void getFrameStartMarker_doesNotUpdateReadPositionAndAlignsPeekPosition()
|
||||
throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("flac/bear.flac");
|
||||
ExtractorInput input = buildExtractorInput("media/flac/bear.flac");
|
||||
int firstFramePosition = 8880;
|
||||
input.skipFully(firstFramePosition);
|
||||
// Advance the peek position after the frame start marker.
|
||||
|
|
@ -373,7 +373,7 @@ public class FlacMetadataReaderTest {
|
|||
|
||||
@Test
|
||||
public void getFrameStartMarker_returnsCorrectFrameStartMarker() throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("flac/bear.flac");
|
||||
ExtractorInput input = buildExtractorInput("media/flac/bear.flac");
|
||||
// Skip to first frame.
|
||||
input.skipFully(8880);
|
||||
|
||||
|
|
@ -384,7 +384,7 @@ public class FlacMetadataReaderTest {
|
|||
|
||||
@Test
|
||||
public void getFrameStartMarker_invalidData_throwsException() throws Exception {
|
||||
ExtractorInput input = buildExtractorInput("flac/bear.flac");
|
||||
ExtractorInput input = buildExtractorInput("media/flac/bear.flac");
|
||||
|
||||
// Input position is incorrect.
|
||||
assertThrows(ParserException.class, () -> FlacMetadataReader.getFrameStartMarker(input));
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public final class FlacStreamMetadataTest {
|
|||
@Test
|
||||
public void constructFromByteArray_setsFieldsCorrectly() throws IOException {
|
||||
byte[] fileData =
|
||||
TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), "flac/bear.flac");
|
||||
TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), "media/flac/bear.flac");
|
||||
|
||||
FlacStreamMetadata streamMetadata =
|
||||
new FlacStreamMetadata(
|
||||
|
|
|
|||
|
|
@ -51,7 +51,8 @@ public final class Id3PeekerTest {
|
|||
Id3Peeker id3Peeker = new Id3Peeker();
|
||||
FakeExtractorInput input =
|
||||
new FakeExtractorInput.Builder()
|
||||
.setData(getByteArray(ApplicationProvider.getApplicationContext(), "id3/apic.id3"))
|
||||
.setData(
|
||||
getByteArray(ApplicationProvider.getApplicationContext(), "media/id3/apic.id3"))
|
||||
.build();
|
||||
|
||||
@Nullable Metadata metadata = id3Peeker.peekId3Data(input, /* id3FramePredicate= */ null);
|
||||
|
|
@ -72,7 +73,9 @@ public final class Id3PeekerTest {
|
|||
Id3Peeker id3Peeker = new Id3Peeker();
|
||||
FakeExtractorInput input =
|
||||
new FakeExtractorInput.Builder()
|
||||
.setData(getByteArray(ApplicationProvider.getApplicationContext(), "id3/comm_apic.id3"))
|
||||
.setData(
|
||||
getByteArray(
|
||||
ApplicationProvider.getApplicationContext(), "media/id3/comm_apic.id3"))
|
||||
.build();
|
||||
|
||||
@Nullable
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public final class VorbisUtilTest {
|
|||
public void readIdHeader() throws Exception {
|
||||
byte[] data =
|
||||
TestUtil.getByteArray(
|
||||
ApplicationProvider.getApplicationContext(), "binary/vorbis/id_header");
|
||||
ApplicationProvider.getApplicationContext(), "media/binary/vorbis/id_header");
|
||||
ParsableByteArray headerData = new ParsableByteArray(data, data.length);
|
||||
VorbisUtil.VorbisIdHeader vorbisIdHeader =
|
||||
VorbisUtil.readVorbisIdentificationHeader(headerData);
|
||||
|
|
@ -70,7 +70,7 @@ public final class VorbisUtilTest {
|
|||
public void readCommentHeader() throws IOException {
|
||||
byte[] data =
|
||||
TestUtil.getByteArray(
|
||||
ApplicationProvider.getApplicationContext(), "binary/vorbis/comment_header");
|
||||
ApplicationProvider.getApplicationContext(), "media/binary/vorbis/comment_header");
|
||||
ParsableByteArray headerData = new ParsableByteArray(data, data.length);
|
||||
VorbisUtil.CommentHeader commentHeader = VorbisUtil.readVorbisCommentHeader(headerData);
|
||||
|
||||
|
|
@ -85,7 +85,7 @@ public final class VorbisUtilTest {
|
|||
public void readVorbisModes() throws IOException {
|
||||
byte[] data =
|
||||
TestUtil.getByteArray(
|
||||
ApplicationProvider.getApplicationContext(), "binary/vorbis/setup_header");
|
||||
ApplicationProvider.getApplicationContext(), "media/binary/vorbis/setup_header");
|
||||
ParsableByteArray headerData = new ParsableByteArray(data, data.length);
|
||||
VorbisUtil.Mode[] modes = VorbisUtil.readVorbisModes(headerData, 2);
|
||||
|
||||
|
|
|
|||
|
|
@ -42,20 +42,24 @@ public final class AmrExtractorParameterizedTest {
|
|||
@Test
|
||||
public void extractingNarrowBandSamples() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
createAmrExtractorFactory(/* withSeeking= */ false), "amr/sample_nb.amr", simulationConfig);
|
||||
createAmrExtractorFactory(/* withSeeking= */ false),
|
||||
"media/amr/sample_nb.amr",
|
||||
simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void extractingWideBandSamples() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
createAmrExtractorFactory(/* withSeeking= */ false), "amr/sample_wb.amr", simulationConfig);
|
||||
createAmrExtractorFactory(/* withSeeking= */ false),
|
||||
"media/amr/sample_wb.amr",
|
||||
simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void extractingNarrowBandSamples_withSeeking() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
createAmrExtractorFactory(/* withSeeking= */ true),
|
||||
"amr/sample_nb_cbr.amr",
|
||||
"media/amr/sample_nb_cbr.amr",
|
||||
simulationConfig);
|
||||
}
|
||||
|
||||
|
|
@ -63,7 +67,7 @@ public final class AmrExtractorParameterizedTest {
|
|||
public void extractingWideBandSamples_withSeeking() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
createAmrExtractorFactory(/* withSeeking= */ true),
|
||||
"amr/sample_wb_cbr.amr",
|
||||
"media/amr/sample_wb_cbr.amr",
|
||||
simulationConfig);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,10 +39,10 @@ public final class AmrExtractorSeekTest {
|
|||
|
||||
private static final Random random = new Random(1234L);
|
||||
|
||||
private static final String NARROW_BAND_AMR_FILE = "amr/sample_nb.amr";
|
||||
private static final String NARROW_BAND_AMR_FILE = "media/amr/sample_nb.amr";
|
||||
private static final int NARROW_BAND_FILE_DURATION_US = 4_360_000;
|
||||
|
||||
private static final String WIDE_BAND_AMR_FILE = "amr/sample_wb.amr";
|
||||
private static final String WIDE_BAND_AMR_FILE = "media/amr/sample_wb.amr";
|
||||
private static final int WIDE_BAND_FILE_DURATION_US = 3_380_000;
|
||||
|
||||
private FakeTrackOutput expectedTrackOutput;
|
||||
|
|
|
|||
|
|
@ -37,9 +37,10 @@ import org.junit.runner.RunWith;
|
|||
@RunWith(AndroidJUnit4.class)
|
||||
public class FlacExtractorSeekTest {
|
||||
|
||||
private static final String TEST_FILE_SEEK_TABLE = "flac/bear.flac";
|
||||
private static final String TEST_FILE_BINARY_SEARCH = "flac/bear_one_metadata_block.flac";
|
||||
private static final String TEST_FILE_UNSEEKABLE = "flac/bear_no_seek_table_no_num_samples.flac";
|
||||
private static final String TEST_FILE_SEEK_TABLE = "media/flac/bear.flac";
|
||||
private static final String TEST_FILE_BINARY_SEARCH = "media/flac/bear_one_metadata_block.flac";
|
||||
private static final String TEST_FILE_UNSEEKABLE =
|
||||
"media/flac/bear_no_seek_table_no_num_samples.flac";
|
||||
private static final int DURATION_US = 2_741_000;
|
||||
|
||||
private FlacExtractor extractor = new FlacExtractor();
|
||||
|
|
|
|||
|
|
@ -39,8 +39,8 @@ public class FlacExtractorTest {
|
|||
public void sample() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
FlacExtractor::new,
|
||||
"flac/bear.flac",
|
||||
new AssertionConfig.Builder().setDumpFilesPrefix("flac/bear_flac").build(),
|
||||
"media/flac/bear.flac",
|
||||
new AssertionConfig.Builder().setDumpFilesPrefix("extractordumps/flac/bear_flac").build(),
|
||||
simulationConfig);
|
||||
}
|
||||
|
||||
|
|
@ -48,8 +48,10 @@ public class FlacExtractorTest {
|
|||
public void sampleWithId3HeaderAndId3Enabled() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
FlacExtractor::new,
|
||||
"flac/bear_with_id3.flac",
|
||||
new AssertionConfig.Builder().setDumpFilesPrefix("flac/bear_with_id3_enabled_flac").build(),
|
||||
"media/flac/bear_with_id3.flac",
|
||||
new AssertionConfig.Builder()
|
||||
.setDumpFilesPrefix("extractordumps/flac/bear_with_id3_enabled_flac")
|
||||
.build(),
|
||||
simulationConfig);
|
||||
}
|
||||
|
||||
|
|
@ -57,9 +59,9 @@ public class FlacExtractorTest {
|
|||
public void sampleWithId3HeaderAndId3Disabled() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
() -> new FlacExtractor(FlacExtractor.FLAG_DISABLE_ID3_METADATA),
|
||||
"flac/bear_with_id3.flac",
|
||||
"media/flac/bear_with_id3.flac",
|
||||
new AssertionConfig.Builder()
|
||||
.setDumpFilesPrefix("flac/bear_with_id3_disabled_flac")
|
||||
.setDumpFilesPrefix("extractordumps/flac/bear_with_id3_disabled_flac")
|
||||
.build(),
|
||||
simulationConfig);
|
||||
}
|
||||
|
|
@ -68,9 +70,9 @@ public class FlacExtractorTest {
|
|||
public void sampleUnseekable() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
FlacExtractor::new,
|
||||
"flac/bear_no_seek_table_no_num_samples.flac",
|
||||
"media/flac/bear_no_seek_table_no_num_samples.flac",
|
||||
new AssertionConfig.Builder()
|
||||
.setDumpFilesPrefix("flac/bear_no_seek_table_no_num_samples_flac")
|
||||
.setDumpFilesPrefix("extractordumps/flac/bear_no_seek_table_no_num_samples_flac")
|
||||
.build(),
|
||||
simulationConfig);
|
||||
}
|
||||
|
|
@ -79,9 +81,9 @@ public class FlacExtractorTest {
|
|||
public void sampleWithVorbisComments() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
FlacExtractor::new,
|
||||
"flac/bear_with_vorbis_comments.flac",
|
||||
"media/flac/bear_with_vorbis_comments.flac",
|
||||
new AssertionConfig.Builder()
|
||||
.setDumpFilesPrefix("flac/bear_with_vorbis_comments_flac")
|
||||
.setDumpFilesPrefix("extractordumps/flac/bear_with_vorbis_comments_flac")
|
||||
.build(),
|
||||
simulationConfig);
|
||||
}
|
||||
|
|
@ -90,8 +92,10 @@ public class FlacExtractorTest {
|
|||
public void sampleWithPicture() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
FlacExtractor::new,
|
||||
"flac/bear_with_picture.flac",
|
||||
new AssertionConfig.Builder().setDumpFilesPrefix("flac/bear_with_picture_flac").build(),
|
||||
"media/flac/bear_with_picture.flac",
|
||||
new AssertionConfig.Builder()
|
||||
.setDumpFilesPrefix("extractordumps/flac/bear_with_picture_flac")
|
||||
.build(),
|
||||
simulationConfig);
|
||||
}
|
||||
|
||||
|
|
@ -99,9 +103,9 @@ public class FlacExtractorTest {
|
|||
public void oneMetadataBlock() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
FlacExtractor::new,
|
||||
"flac/bear_one_metadata_block.flac",
|
||||
"media/flac/bear_one_metadata_block.flac",
|
||||
new AssertionConfig.Builder()
|
||||
.setDumpFilesPrefix("flac/bear_one_metadata_block_flac")
|
||||
.setDumpFilesPrefix("extractordumps/flac/bear_one_metadata_block_flac")
|
||||
.build(),
|
||||
simulationConfig);
|
||||
}
|
||||
|
|
@ -110,9 +114,9 @@ public class FlacExtractorTest {
|
|||
public void noMinMaxFrameSize() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
FlacExtractor::new,
|
||||
"flac/bear_no_min_max_frame_size.flac",
|
||||
"media/flac/bear_no_min_max_frame_size.flac",
|
||||
new AssertionConfig.Builder()
|
||||
.setDumpFilesPrefix("flac/bear_no_min_max_frame_size_flac")
|
||||
.setDumpFilesPrefix("extractordumps/flac/bear_no_min_max_frame_size_flac")
|
||||
.build(),
|
||||
simulationConfig);
|
||||
}
|
||||
|
|
@ -121,8 +125,10 @@ public class FlacExtractorTest {
|
|||
public void noNumSamples() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
FlacExtractor::new,
|
||||
"flac/bear_no_num_samples.flac",
|
||||
new AssertionConfig.Builder().setDumpFilesPrefix("flac/bear_no_num_samples_flac").build(),
|
||||
"media/flac/bear_no_num_samples.flac",
|
||||
new AssertionConfig.Builder()
|
||||
.setDumpFilesPrefix("extractordumps/flac/bear_no_num_samples_flac")
|
||||
.build(),
|
||||
simulationConfig);
|
||||
}
|
||||
|
||||
|
|
@ -130,9 +136,9 @@ public class FlacExtractorTest {
|
|||
public void uncommonSampleRate() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
FlacExtractor::new,
|
||||
"flac/bear_uncommon_sample_rate.flac",
|
||||
"media/flac/bear_uncommon_sample_rate.flac",
|
||||
new AssertionConfig.Builder()
|
||||
.setDumpFilesPrefix("flac/bear_uncommon_sample_rate_flac")
|
||||
.setDumpFilesPrefix("extractordumps/flac/bear_uncommon_sample_rate_flac")
|
||||
.build(),
|
||||
simulationConfig);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,6 @@ public final class FlvExtractorTest {
|
|||
|
||||
@Test
|
||||
public void sample() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(FlvExtractor::new, "flv/sample.flv", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(FlvExtractor::new, "media/flv/sample.flv", simulationConfig);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,36 +36,39 @@ public final class MatroskaExtractorTest {
|
|||
|
||||
@Test
|
||||
public void mkvSample() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(MatroskaExtractor::new, "mkv/sample.mkv", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(
|
||||
MatroskaExtractor::new, "media/mkv/sample.mkv", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mkvSample_withSubripSubtitles() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
MatroskaExtractor::new, "mkv/sample_with_srt.mkv", simulationConfig);
|
||||
MatroskaExtractor::new, "media/mkv/sample_with_srt.mkv", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mkvSample_withHtcRotationInfoInTrackName() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
MatroskaExtractor::new, "mkv/sample_with_htc_rotation_track_name.mkv", simulationConfig);
|
||||
MatroskaExtractor::new,
|
||||
"media/mkv/sample_with_htc_rotation_track_name.mkv",
|
||||
simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mkvFullBlocksSample() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
MatroskaExtractor::new, "mkv/full_blocks.mkv", simulationConfig);
|
||||
MatroskaExtractor::new, "media/mkv/full_blocks.mkv", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void webmSubsampleEncryption() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
MatroskaExtractor::new, "mkv/subsample_encrypted_noaltref.webm", simulationConfig);
|
||||
MatroskaExtractor::new, "media/mkv/subsample_encrypted_noaltref.webm", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void webmSubsampleEncryptionWithAltrefFrames() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
MatroskaExtractor::new, "mkv/subsample_encrypted_altref.webm", simulationConfig);
|
||||
MatroskaExtractor::new, "media/mkv/subsample_encrypted_altref.webm", simulationConfig);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,9 +39,9 @@ import org.junit.runner.RunWith;
|
|||
@RunWith(AndroidJUnit4.class)
|
||||
public class ConstantBitrateSeekerTest {
|
||||
private static final String CONSTANT_FRAME_SIZE_TEST_FILE =
|
||||
"mp3/bear-cbr-constant-frame-size-no-seek-table.mp3";
|
||||
"media/mp3/bear-cbr-constant-frame-size-no-seek-table.mp3";
|
||||
private static final String VARIABLE_FRAME_SIZE_TEST_FILE =
|
||||
"mp3/bear-cbr-variable-frame-size-no-seek-table.mp3";
|
||||
"media/mp3/bear-cbr-variable-frame-size-no-seek-table.mp3";
|
||||
|
||||
private Mp3Extractor extractor;
|
||||
private FakeExtractorOutput extractorOutput;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ import org.junit.runner.RunWith;
|
|||
@RunWith(AndroidJUnit4.class)
|
||||
public class IndexSeekerTest {
|
||||
|
||||
private static final String TEST_FILE_NO_SEEK_TABLE = "mp3/bear-vbr-no-seek-table.mp3";
|
||||
private static final String TEST_FILE_NO_SEEK_TABLE = "media/mp3/bear-vbr-no-seek-table.mp3";
|
||||
private static final int TEST_FILE_NO_SEEK_TABLE_DURATION = 2_808_000;
|
||||
|
||||
private Mp3Extractor extractor;
|
||||
|
|
|
|||
|
|
@ -38,34 +38,39 @@ public final class Mp3ExtractorTest {
|
|||
@Test
|
||||
public void mp3SampleWithXingHeader() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
Mp3Extractor::new, "mp3/bear-vbr-xing-header.mp3", simulationConfig);
|
||||
Mp3Extractor::new, "media/mp3/bear-vbr-xing-header.mp3", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mp3SampleWithCbrSeeker() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
Mp3Extractor::new, "mp3/bear-cbr-variable-frame-size-no-seek-table.mp3", simulationConfig);
|
||||
Mp3Extractor::new,
|
||||
"media/mp3/bear-cbr-variable-frame-size-no-seek-table.mp3",
|
||||
simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mp3SampleWithIndexSeeker() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
() -> new Mp3Extractor(Mp3Extractor.FLAG_ENABLE_INDEX_SEEKING),
|
||||
"mp3/bear-vbr-no-seek-table.mp3",
|
||||
"media/mp3/bear-vbr-no-seek-table.mp3",
|
||||
simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void trimmedMp3Sample() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(Mp3Extractor::new, "mp3/play-trimmed.mp3", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(
|
||||
Mp3Extractor::new, "media/mp3/play-trimmed.mp3", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mp3SampleWithId3Enabled() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
Mp3Extractor::new,
|
||||
"mp3/bear-id3.mp3",
|
||||
new AssertionConfig.Builder().setDumpFilesPrefix("mp3/bear-id3-enabled").build(),
|
||||
"media/mp3/bear-id3.mp3",
|
||||
new AssertionConfig.Builder()
|
||||
.setDumpFilesPrefix("extractordumps/mp3/bear-id3-enabled")
|
||||
.build(),
|
||||
simulationConfig);
|
||||
}
|
||||
|
||||
|
|
@ -73,8 +78,10 @@ public final class Mp3ExtractorTest {
|
|||
public void mp3SampleWithId3Disabled() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
() -> new Mp3Extractor(Mp3Extractor.FLAG_DISABLE_ID3_METADATA),
|
||||
"mp3/bear-id3.mp3",
|
||||
new AssertionConfig.Builder().setDumpFilesPrefix("mp3/bear-id3-disabled").build(),
|
||||
"media/mp3/bear-id3.mp3",
|
||||
new AssertionConfig.Builder()
|
||||
.setDumpFilesPrefix("extractordumps/mp3/bear-id3-disabled")
|
||||
.build(),
|
||||
simulationConfig);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,14 +42,16 @@ public final class FragmentedMp4ExtractorTest {
|
|||
@Test
|
||||
public void sample() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
getExtractorFactory(ImmutableList.of()), "mp4/sample_fragmented.mp4", simulationConfig);
|
||||
getExtractorFactory(ImmutableList.of()),
|
||||
"media/mp4/sample_fragmented.mp4",
|
||||
simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sampleSeekable() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
getExtractorFactory(ImmutableList.of()),
|
||||
"mp4/sample_fragmented_seekable.mp4",
|
||||
"media/mp4/sample_fragmented_seekable.mp4",
|
||||
simulationConfig);
|
||||
}
|
||||
|
||||
|
|
@ -61,32 +63,38 @@ public final class FragmentedMp4ExtractorTest {
|
|||
Collections.singletonList(
|
||||
new Format.Builder().setSampleMimeType(MimeTypes.APPLICATION_CEA608).build()));
|
||||
ExtractorAsserts.assertBehavior(
|
||||
extractorFactory, "mp4/sample_fragmented_sei.mp4", simulationConfig);
|
||||
extractorFactory, "media/mp4/sample_fragmented_sei.mp4", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sampleWithAc3Track() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
getExtractorFactory(ImmutableList.of()), "mp4/sample_ac3_fragmented.mp4", simulationConfig);
|
||||
getExtractorFactory(ImmutableList.of()),
|
||||
"media/mp4/sample_ac3_fragmented.mp4",
|
||||
simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sampleWithAc4Track() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
getExtractorFactory(ImmutableList.of()), "mp4/sample_ac4_fragmented.mp4", simulationConfig);
|
||||
getExtractorFactory(ImmutableList.of()),
|
||||
"media/mp4/sample_ac4_fragmented.mp4",
|
||||
simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sampleWithProtectedAc4Track() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
getExtractorFactory(ImmutableList.of()), "mp4/sample_ac4_protected.mp4", simulationConfig);
|
||||
getExtractorFactory(ImmutableList.of()),
|
||||
"media/mp4/sample_ac4_protected.mp4",
|
||||
simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sampleWithEac3Track() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
getExtractorFactory(ImmutableList.of()),
|
||||
"mp4/sample_eac3_fragmented.mp4",
|
||||
"media/mp4/sample_eac3_fragmented.mp4",
|
||||
simulationConfig);
|
||||
}
|
||||
|
||||
|
|
@ -94,7 +102,7 @@ public final class FragmentedMp4ExtractorTest {
|
|||
public void sampleWithEac3jocTrack() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
getExtractorFactory(ImmutableList.of()),
|
||||
"mp4/sample_eac3joc_fragmented.mp4",
|
||||
"media/mp4/sample_eac3joc_fragmented.mp4",
|
||||
simulationConfig);
|
||||
}
|
||||
|
||||
|
|
@ -102,7 +110,7 @@ public final class FragmentedMp4ExtractorTest {
|
|||
public void sampleWithOpusTrack() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
getExtractorFactory(ImmutableList.of()),
|
||||
"mp4/sample_opus_fragmented.mp4",
|
||||
"media/mp4/sample_opus_fragmented.mp4",
|
||||
simulationConfig);
|
||||
}
|
||||
|
||||
|
|
@ -110,7 +118,7 @@ public final class FragmentedMp4ExtractorTest {
|
|||
public void samplePartiallyFragmented() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
getExtractorFactory(ImmutableList.of()),
|
||||
"mp4/sample_partially_fragmented.mp4",
|
||||
"media/mp4/sample_partially_fragmented.mp4",
|
||||
simulationConfig);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,13 +36,13 @@ public final class Mp4ExtractorTest {
|
|||
|
||||
@Test
|
||||
public void mp4Sample() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(Mp4Extractor::new, "mp4/sample.mp4", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(Mp4Extractor::new, "media/mp4/sample.mp4", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mp4SampleWithSlowMotionMetadata() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
Mp4Extractor::new, "mp4/sample_android_slow_motion.mp4", simulationConfig);
|
||||
Mp4Extractor::new, "media/mp4/sample_android_slow_motion.mp4", simulationConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -52,31 +52,36 @@ public final class Mp4ExtractorTest {
|
|||
@Test
|
||||
public void mp4SampleWithMdatTooLong() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
Mp4Extractor::new, "mp4/sample_mdat_too_long.mp4", simulationConfig);
|
||||
Mp4Extractor::new, "media/mp4/sample_mdat_too_long.mp4", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mp4SampleWithAc3Track() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(Mp4Extractor::new, "mp4/sample_ac3.mp4", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(
|
||||
Mp4Extractor::new, "media/mp4/sample_ac3.mp4", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mp4SampleWithAc4Track() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(Mp4Extractor::new, "mp4/sample_ac4.mp4", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(
|
||||
Mp4Extractor::new, "media/mp4/sample_ac4.mp4", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mp4SampleWithEac3Track() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(Mp4Extractor::new, "mp4/sample_eac3.mp4", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(
|
||||
Mp4Extractor::new, "media/mp4/sample_eac3.mp4", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mp4SampleWithEac3jocTrack() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(Mp4Extractor::new, "mp4/sample_eac3joc.mp4", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(
|
||||
Mp4Extractor::new, "media/mp4/sample_eac3joc.mp4", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mp4SampleWithOpusTrack() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(Mp4Extractor::new, "mp4/sample_opus.mp4", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(
|
||||
Mp4Extractor::new, "media/mp4/sample_opus.mp4", simulationConfig);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public final class DefaultOggSeekerTest {
|
|||
@Test
|
||||
public void seeking() throws Exception {
|
||||
byte[] data =
|
||||
getByteArray(ApplicationProvider.getApplicationContext(), "ogg/random_1000_pages");
|
||||
getByteArray(ApplicationProvider.getApplicationContext(), "media/ogg/random_1000_pages");
|
||||
int granuleCount = 49269395;
|
||||
int firstPayloadPageSize = 2023;
|
||||
int firstPayloadPageGranuleCount = 57058;
|
||||
|
|
@ -123,7 +123,8 @@ public final class DefaultOggSeekerTest {
|
|||
@Test
|
||||
public void readGranuleOfLastPage() throws IOException {
|
||||
// This test stream has three headers with granule numbers 20000, 40000 and 60000.
|
||||
byte[] data = getByteArray(ApplicationProvider.getApplicationContext(), "ogg/three_headers");
|
||||
byte[] data =
|
||||
getByteArray(ApplicationProvider.getApplicationContext(), "media/ogg/three_headers");
|
||||
FakeExtractorInput input = createInput(data, /* simulateUnknownLength= */ false);
|
||||
assertReadGranuleOfLastPage(input, 60000);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,38 +36,42 @@ public final class OggExtractorNonParameterizedTest {
|
|||
|
||||
@Test
|
||||
public void sniffVorbis() throws Exception {
|
||||
byte[] data = getByteArray(ApplicationProvider.getApplicationContext(), "ogg/vorbis_header");
|
||||
byte[] data =
|
||||
getByteArray(ApplicationProvider.getApplicationContext(), "media/ogg/vorbis_header");
|
||||
assertSniff(data, /* expectedResult= */ true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sniffFlac() throws Exception {
|
||||
byte[] data = getByteArray(ApplicationProvider.getApplicationContext(), "ogg/flac_header");
|
||||
byte[] data =
|
||||
getByteArray(ApplicationProvider.getApplicationContext(), "media/ogg/flac_header");
|
||||
assertSniff(data, /* expectedResult= */ true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sniffFailsOpusFile() throws Exception {
|
||||
byte[] data = getByteArray(ApplicationProvider.getApplicationContext(), "ogg/opus_header");
|
||||
byte[] data =
|
||||
getByteArray(ApplicationProvider.getApplicationContext(), "media/ogg/opus_header");
|
||||
assertSniff(data, /* expectedResult= */ false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sniffFailsInvalidOggHeader() throws Exception {
|
||||
byte[] data =
|
||||
getByteArray(ApplicationProvider.getApplicationContext(), "ogg/invalid_ogg_header");
|
||||
getByteArray(ApplicationProvider.getApplicationContext(), "media/ogg/invalid_ogg_header");
|
||||
assertSniff(data, /* expectedResult= */ false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sniffInvalidHeader() throws Exception {
|
||||
byte[] data = getByteArray(ApplicationProvider.getApplicationContext(), "ogg/invalid_header");
|
||||
byte[] data =
|
||||
getByteArray(ApplicationProvider.getApplicationContext(), "media/ogg/invalid_header");
|
||||
assertSniff(data, /* expectedResult= */ false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sniffFailsEOF() throws Exception {
|
||||
byte[] data = getByteArray(ApplicationProvider.getApplicationContext(), "ogg/eof_header");
|
||||
byte[] data = getByteArray(ApplicationProvider.getApplicationContext(), "media/ogg/eof_header");
|
||||
assertSniff(data, /* expectedResult= */ false);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,29 +40,31 @@ public final class OggExtractorParameterizedTest {
|
|||
|
||||
@Test
|
||||
public void opus() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(OggExtractor::new, "ogg/bear.opus", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(OggExtractor::new, "media/ogg/bear.opus", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void flac() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(OggExtractor::new, "ogg/bear_flac.ogg", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(OggExtractor::new, "media/ogg/bear_flac.ogg", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void flacNoSeektable() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
OggExtractor::new, "ogg/bear_flac_noseektable.ogg", simulationConfig);
|
||||
OggExtractor::new, "media/ogg/bear_flac_noseektable.ogg", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void vorbis() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(OggExtractor::new, "ogg/bear_vorbis.ogg", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(
|
||||
OggExtractor::new, "media/ogg/bear_vorbis.ogg", simulationConfig);
|
||||
}
|
||||
|
||||
// Ensure the extractor can handle non-contiguous pages by using a file with 10 bytes of garbage
|
||||
// data before the start of the second page.
|
||||
@Test
|
||||
public void vorbisWithGapBeforeSecondPage() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(OggExtractor::new, "ogg/bear_vorbis_gap.ogg", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(
|
||||
OggExtractor::new, "media/ogg/bear_vorbis_gap.ogg", simulationConfig);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import org.junit.runner.RunWith;
|
|||
@RunWith(AndroidJUnit4.class)
|
||||
public final class OggPacketTest {
|
||||
|
||||
private static final String TEST_FILE = "ogg/bear.opus";
|
||||
private static final String TEST_FILE = "media/ogg/bear.opus";
|
||||
|
||||
private final Random random = new Random(/* seed= */ 0);
|
||||
private final OggPacket oggPacket = new OggPacket();
|
||||
|
|
@ -47,7 +47,8 @@ public final class OggPacketTest {
|
|||
FakeExtractorInput input =
|
||||
createInput(
|
||||
getByteArray(
|
||||
ApplicationProvider.getApplicationContext(), "ogg/four_packets_with_empty_page"));
|
||||
ApplicationProvider.getApplicationContext(),
|
||||
"media/ogg/four_packets_with_empty_page"));
|
||||
|
||||
assertReadPacket(input, firstPacket);
|
||||
assertThat((oggPacket.getPageHeader().type & 0x02) == 0x02).isTrue();
|
||||
|
|
@ -95,7 +96,7 @@ public final class OggPacketTest {
|
|||
createInput(
|
||||
getByteArray(
|
||||
ApplicationProvider.getApplicationContext(),
|
||||
"ogg/packet_with_zero_size_terminator"));
|
||||
"media/ogg/packet_with_zero_size_terminator"));
|
||||
|
||||
assertReadPacket(input, firstPacket);
|
||||
assertReadPacket(input, secondPacket);
|
||||
|
|
@ -109,7 +110,7 @@ public final class OggPacketTest {
|
|||
createInput(
|
||||
getByteArray(
|
||||
ApplicationProvider.getApplicationContext(),
|
||||
"ogg/continued_packet_over_two_pages"));
|
||||
"media/ogg/continued_packet_over_two_pages"));
|
||||
|
||||
assertReadPacket(input, firstPacket);
|
||||
assertThat((oggPacket.getPageHeader().type & 0x04) == 0x04).isTrue();
|
||||
|
|
@ -126,7 +127,7 @@ public final class OggPacketTest {
|
|||
createInput(
|
||||
getByteArray(
|
||||
ApplicationProvider.getApplicationContext(),
|
||||
"ogg/continued_packet_over_four_pages"));
|
||||
"media/ogg/continued_packet_over_four_pages"));
|
||||
|
||||
assertReadPacket(input, firstPacket);
|
||||
assertThat((oggPacket.getPageHeader().type & 0x04) == 0x04).isTrue();
|
||||
|
|
@ -142,7 +143,8 @@ public final class OggPacketTest {
|
|||
FakeExtractorInput input =
|
||||
createInput(
|
||||
getByteArray(
|
||||
ApplicationProvider.getApplicationContext(), "ogg/continued_packet_at_start"));
|
||||
ApplicationProvider.getApplicationContext(),
|
||||
"media/ogg/continued_packet_at_start"));
|
||||
|
||||
// Expect the first partial packet to be discarded.
|
||||
assertReadPacket(input, Arrays.copyOfRange(pageBody, 256, 256 + 8));
|
||||
|
|
@ -158,7 +160,7 @@ public final class OggPacketTest {
|
|||
createInput(
|
||||
getByteArray(
|
||||
ApplicationProvider.getApplicationContext(),
|
||||
"ogg/zero_sized_packets_at_end_of_stream"));
|
||||
"media/ogg/zero_sized_packets_at_end_of_stream"));
|
||||
|
||||
assertReadPacket(input, firstPacket);
|
||||
assertReadPacket(input, secondPacket);
|
||||
|
|
|
|||
|
|
@ -88,7 +88,8 @@ public final class OggPageHeaderTest {
|
|||
|
||||
@Test
|
||||
public void populatePageHeader_success() throws Exception {
|
||||
byte[] data = getByteArray(ApplicationProvider.getApplicationContext(), "ogg/page_header");
|
||||
byte[] data =
|
||||
getByteArray(ApplicationProvider.getApplicationContext(), "media/ogg/page_header");
|
||||
|
||||
FakeExtractorInput input = createInput(data, /* simulateUnknownLength= */ true);
|
||||
OggPageHeader header = new OggPageHeader();
|
||||
|
|
@ -121,7 +122,8 @@ public final class OggPageHeaderTest {
|
|||
|
||||
@Test
|
||||
public void populatePageHeader_withNotOgg_returnFalseWithoutException() throws Exception {
|
||||
byte[] data = getByteArray(ApplicationProvider.getApplicationContext(), "ogg/page_header");
|
||||
byte[] data =
|
||||
getByteArray(ApplicationProvider.getApplicationContext(), "media/ogg/page_header");
|
||||
// change from 'O' to 'o'
|
||||
data[0] = 'o';
|
||||
FakeExtractorInput input = createInput(data, /* simulateUnknownLength= */ false);
|
||||
|
|
@ -134,7 +136,8 @@ public final class OggPageHeaderTest {
|
|||
|
||||
@Test
|
||||
public void populatePageHeader_withWrongRevision_returnFalseWithoutException() throws Exception {
|
||||
byte[] data = getByteArray(ApplicationProvider.getApplicationContext(), "ogg/page_header");
|
||||
byte[] data =
|
||||
getByteArray(ApplicationProvider.getApplicationContext(), "media/ogg/page_header");
|
||||
// change revision from 0 to 1
|
||||
data[4] = 0x01;
|
||||
FakeExtractorInput input = createInput(data, /* simulateUnknownLength= */ false);
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public final class VorbisReaderTest {
|
|||
// identification, comment and setup header.
|
||||
byte[] data =
|
||||
TestUtil.getByteArray(
|
||||
ApplicationProvider.getApplicationContext(), "binary/ogg/vorbis_header_pages");
|
||||
ApplicationProvider.getApplicationContext(), "media/binary/ogg/vorbis_header_pages");
|
||||
ExtractorInput input = new FakeExtractorInput.Builder().setData(data).setSimulateIOErrors(true)
|
||||
.setSimulateUnknownLength(true).setSimulatePartialReads(true).build();
|
||||
|
||||
|
|
|
|||
|
|
@ -44,6 +44,6 @@ public final class RawCcExtractorTest {
|
|||
.setAccessibilityChannel(1)
|
||||
.build();
|
||||
ExtractorAsserts.assertBehavior(
|
||||
() -> new RawCcExtractor(format), "rawcc/sample.rawcc", simulationConfig);
|
||||
() -> new RawCcExtractor(format), "media/rawcc/sample.rawcc", simulationConfig);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,16 +36,17 @@ public final class Ac3ExtractorTest {
|
|||
|
||||
@Test
|
||||
public void ac3Sample() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(Ac3Extractor::new, "ts/sample.ac3", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(Ac3Extractor::new, "media/ts/sample.ac3", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void eAc3Sample() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(Ac3Extractor::new, "ts/sample.eac3", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(Ac3Extractor::new, "media/ts/sample.eac3", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void eAc3jocSample() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(Ac3Extractor::new, "ts/sample_eac3joc.ec3", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(
|
||||
Ac3Extractor::new, "media/ts/sample_eac3joc.ec3", simulationConfig);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,6 @@ public final class Ac4ExtractorTest {
|
|||
|
||||
@Test
|
||||
public void ac4Sample() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(Ac4Extractor::new, "ts/sample.ac4", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(Ac4Extractor::new, "media/ts/sample.ac4", simulationConfig);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public final class AdtsExtractorSeekTest {
|
|||
|
||||
private static final Random random = new Random(1234L);
|
||||
|
||||
private static final String TEST_FILE = "ts/sample.adts";
|
||||
private static final String TEST_FILE = "media/ts/sample.adts";
|
||||
private static final int FILE_DURATION_US = 3_356_772;
|
||||
private static final long DELTA_TIMESTAMP_THRESHOLD_US = 200_000;
|
||||
|
||||
|
|
|
|||
|
|
@ -36,20 +36,20 @@ public final class AdtsExtractorTest {
|
|||
|
||||
@Test
|
||||
public void sample() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(AdtsExtractor::new, "ts/sample.adts", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(AdtsExtractor::new, "media/ts/sample.adts", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sample_with_id3() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
AdtsExtractor::new, "ts/sample_with_id3.adts", simulationConfig);
|
||||
AdtsExtractor::new, "media/ts/sample_with_id3.adts", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sample_withSeeking() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
() -> new AdtsExtractor(/* flags= */ AdtsExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING),
|
||||
"ts/sample_cbs.adts",
|
||||
"media/ts/sample_cbs.adts",
|
||||
simulationConfig);
|
||||
}
|
||||
|
||||
|
|
@ -58,7 +58,7 @@ public final class AdtsExtractorTest {
|
|||
public void sample_withSeekingAndTruncatedFile() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
() -> new AdtsExtractor(/* flags= */ AdtsExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING),
|
||||
"ts/sample_cbs_truncated.adts",
|
||||
"media/ts/sample_cbs_truncated.adts",
|
||||
simulationConfig);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,8 @@ public final class PsDurationReaderTest {
|
|||
new FakeExtractorInput.Builder()
|
||||
.setData(
|
||||
TestUtil.getByteArray(
|
||||
ApplicationProvider.getApplicationContext(), "ts/sample_h262_mpeg_audio.ps"))
|
||||
ApplicationProvider.getApplicationContext(),
|
||||
"media/ts/sample_h262_mpeg_audio.ps"))
|
||||
.build();
|
||||
|
||||
int result = Extractor.RESULT_CONTINUE;
|
||||
|
|
@ -72,7 +73,8 @@ public final class PsDurationReaderTest {
|
|||
new FakeExtractorInput.Builder()
|
||||
.setData(
|
||||
TestUtil.getByteArray(
|
||||
ApplicationProvider.getApplicationContext(), "ts/sample_h262_mpeg_audio.ps"))
|
||||
ApplicationProvider.getApplicationContext(),
|
||||
"media/ts/sample_h262_mpeg_audio.ps"))
|
||||
.build();
|
||||
|
||||
input.setPosition(1234);
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ import org.junit.runner.RunWith;
|
|||
@RunWith(AndroidJUnit4.class)
|
||||
public final class PsExtractorSeekTest {
|
||||
|
||||
private static final String PS_FILE_PATH = "ts/elephants_dream.mpg";
|
||||
private static final String PS_FILE_PATH = "media/ts/elephants_dream.mpg";
|
||||
private static final int DURATION_US = 30436333;
|
||||
private static final int VIDEO_TRACK_ID = 224;
|
||||
private static final long DELTA_TIMESTAMP_THRESHOLD_US = 500_000L;
|
||||
|
|
|
|||
|
|
@ -37,11 +37,11 @@ public final class PsExtractorTest {
|
|||
@Test
|
||||
public void sampleWithH262AndMpegAudio() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
PsExtractor::new, "ts/sample_h262_mpeg_audio.ps", simulationConfig);
|
||||
PsExtractor::new, "media/ts/sample_h262_mpeg_audio.ps", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sampleWithAc3() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(PsExtractor::new, "ts/sample_ac3.ps", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(PsExtractor::new, "media/ts/sample_ac3.ps", simulationConfig);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public final class TsDurationReaderTest {
|
|||
new FakeExtractorInput.Builder()
|
||||
.setData(
|
||||
TestUtil.getByteArray(
|
||||
ApplicationProvider.getApplicationContext(), "ts/bbb_2500ms.ts"))
|
||||
ApplicationProvider.getApplicationContext(), "media/ts/bbb_2500ms.ts"))
|
||||
.setSimulateIOErrors(false)
|
||||
.setSimulateUnknownLength(false)
|
||||
.setSimulatePartialReads(false)
|
||||
|
|
@ -76,7 +76,7 @@ public final class TsDurationReaderTest {
|
|||
new FakeExtractorInput.Builder()
|
||||
.setData(
|
||||
TestUtil.getByteArray(
|
||||
ApplicationProvider.getApplicationContext(), "ts/bbb_2500ms.ts"))
|
||||
ApplicationProvider.getApplicationContext(), "media/ts/bbb_2500ms.ts"))
|
||||
.setSimulateIOErrors(false)
|
||||
.setSimulateUnknownLength(false)
|
||||
.setSimulatePartialReads(false)
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ import org.junit.runner.RunWith;
|
|||
@RunWith(AndroidJUnit4.class)
|
||||
public final class TsExtractorSeekTest {
|
||||
|
||||
private static final String TEST_FILE = "ts/bbb_2500ms.ts";
|
||||
private static final String TEST_FILE = "media/ts/bbb_2500ms.ts";
|
||||
private static final int DURATION_US = 2_500_000;
|
||||
private static final int AUDIO_TRACK_ID = 257;
|
||||
private static final long MAXIMUM_TIMESTAMP_DELTA_US = 500_000L;
|
||||
|
|
|
|||
|
|
@ -57,25 +57,25 @@ public final class TsExtractorTest {
|
|||
@Test
|
||||
public void sampleWithH262AndMpegAudio() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
TsExtractor::new, "ts/sample_h262_mpeg_audio.ts", simulationConfig);
|
||||
TsExtractor::new, "media/ts/sample_h262_mpeg_audio.ts", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sampleWithH263() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(TsExtractor::new, "ts/sample_h263.ts", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(TsExtractor::new, "media/ts/sample_h263.ts", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sampleWithH264AndMpegAudio() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
TsExtractor::new, "ts/sample_h264_mpeg_audio.ts", simulationConfig);
|
||||
TsExtractor::new, "media/ts/sample_h264_mpeg_audio.ts", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sampleWithH264NoAccessUnitDelimiters() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
() -> new TsExtractor(FLAG_DETECT_ACCESS_UNITS),
|
||||
"ts/sample_h264_no_access_unit_delimiters.ts",
|
||||
"media/ts/sample_h264_no_access_unit_delimiters.ts",
|
||||
simulationConfig);
|
||||
}
|
||||
|
||||
|
|
@ -83,20 +83,20 @@ public final class TsExtractorTest {
|
|||
public void sampleWithH264AndDtsAudio() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
() -> new TsExtractor(DefaultTsPayloadReaderFactory.FLAG_ENABLE_HDMV_DTS_AUDIO_STREAMS),
|
||||
"ts/sample_h264_dts_audio.ts",
|
||||
"media/ts/sample_h264_dts_audio.ts",
|
||||
simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sampleWithH265() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(TsExtractor::new, "ts/sample_h265.ts", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(TsExtractor::new, "media/ts/sample_h265.ts", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sampleWithScte35() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
TsExtractor::new,
|
||||
"ts/sample_scte35.ts",
|
||||
"media/ts/sample_scte35.ts",
|
||||
new ExtractorAsserts.AssertionConfig.Builder()
|
||||
.setDeduplicateConsecutiveFormats(true)
|
||||
.build(),
|
||||
|
|
@ -107,7 +107,7 @@ public final class TsExtractorTest {
|
|||
public void sampleWithAit() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
TsExtractor::new,
|
||||
"ts/sample_ait.ts",
|
||||
"media/ts/sample_ait.ts",
|
||||
new ExtractorAsserts.AssertionConfig.Builder()
|
||||
.setDeduplicateConsecutiveFormats(true)
|
||||
.build(),
|
||||
|
|
@ -116,32 +116,34 @@ public final class TsExtractorTest {
|
|||
|
||||
@Test
|
||||
public void sampleWithAc3() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(TsExtractor::new, "ts/sample_ac3.ts", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(TsExtractor::new, "media/ts/sample_ac3.ts", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sampleWithAc4() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(TsExtractor::new, "ts/sample_ac4.ts", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(TsExtractor::new, "media/ts/sample_ac4.ts", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sampleWithEac3() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(TsExtractor::new, "ts/sample_eac3.ts", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(TsExtractor::new, "media/ts/sample_eac3.ts", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sampleWithEac3joc() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(TsExtractor::new, "ts/sample_eac3joc.ts", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(
|
||||
TsExtractor::new, "media/ts/sample_eac3joc.ts", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sampleWithLatm() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(TsExtractor::new, "ts/sample_latm.ts", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(TsExtractor::new, "media/ts/sample_latm.ts", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void streamWithJunkData() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(TsExtractor::new, "ts/sample_with_junk", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(
|
||||
TsExtractor::new, "media/ts/sample_with_junk", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -153,7 +155,8 @@ public final class TsExtractorTest {
|
|||
new FakeExtractorInput.Builder()
|
||||
.setData(
|
||||
TestUtil.getByteArray(
|
||||
ApplicationProvider.getApplicationContext(), "ts/sample_h262_mpeg_audio.ts"))
|
||||
ApplicationProvider.getApplicationContext(),
|
||||
"media/ts/sample_h262_mpeg_audio.ts"))
|
||||
.setSimulateIOErrors(false)
|
||||
.setSimulateUnknownLength(false)
|
||||
.setSimulatePartialReads(false)
|
||||
|
|
@ -190,7 +193,7 @@ public final class TsExtractorTest {
|
|||
new FakeExtractorInput.Builder()
|
||||
.setData(
|
||||
TestUtil.getByteArray(
|
||||
ApplicationProvider.getApplicationContext(), "ts/sample_with_sdt.ts"))
|
||||
ApplicationProvider.getApplicationContext(), "media/ts/sample_with_sdt.ts"))
|
||||
.setSimulateIOErrors(false)
|
||||
.setSimulateUnknownLength(false)
|
||||
.setSimulatePartialReads(false)
|
||||
|
|
|
|||
|
|
@ -36,21 +36,21 @@ public final class WavExtractorTest {
|
|||
|
||||
@Test
|
||||
public void sample() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(WavExtractor::new, "wav/sample.wav", simulationConfig);
|
||||
ExtractorAsserts.assertBehavior(WavExtractor::new, "media/wav/sample.wav", simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sample_withTrailingBytes_extractsSameData() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
WavExtractor::new,
|
||||
"wav/sample_with_trailing_bytes.wav",
|
||||
new AssertionConfig.Builder().setDumpFilesPrefix("wav/sample.wav").build(),
|
||||
"media/wav/sample_with_trailing_bytes.wav",
|
||||
new AssertionConfig.Builder().setDumpFilesPrefix("extractordumps/wav/sample.wav").build(),
|
||||
simulationConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sample_imaAdpcm() throws Exception {
|
||||
ExtractorAsserts.assertBehavior(
|
||||
WavExtractor::new, "wav/sample_ima_adpcm.wav", simulationConfig);
|
||||
WavExtractor::new, "media/wav/sample_ima_adpcm.wav", simulationConfig);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ public class DefaultHlsExtractorFactoryTest {
|
|||
new FakeExtractorInput.Builder()
|
||||
.setData(
|
||||
TestUtil.getByteArray(
|
||||
ApplicationProvider.getApplicationContext(), "webvtt/typical"))
|
||||
ApplicationProvider.getApplicationContext(), "media/webvtt/typical"))
|
||||
.build();
|
||||
|
||||
BundledHlsMediaChunkExtractor result =
|
||||
|
|
@ -86,7 +86,8 @@ public class DefaultHlsExtractorFactoryTest {
|
|||
ExtractorInput ac3ExtractorInput =
|
||||
new FakeExtractorInput.Builder()
|
||||
.setData(
|
||||
TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), "ts/sample.ac3"))
|
||||
TestUtil.getByteArray(
|
||||
ApplicationProvider.getApplicationContext(), "media/ts/sample.ac3"))
|
||||
.build();
|
||||
|
||||
BundledHlsMediaChunkExtractor result =
|
||||
|
|
@ -108,7 +109,7 @@ public class DefaultHlsExtractorFactoryTest {
|
|||
new FakeExtractorInput.Builder()
|
||||
.setData(
|
||||
TestUtil.getByteArray(
|
||||
ApplicationProvider.getApplicationContext(), "ts/sample_ac3.ts"))
|
||||
ApplicationProvider.getApplicationContext(), "media/ts/sample_ac3.ts"))
|
||||
.build();
|
||||
|
||||
BundledHlsMediaChunkExtractor result =
|
||||
|
|
@ -131,7 +132,7 @@ public class DefaultHlsExtractorFactoryTest {
|
|||
new FakeExtractorInput.Builder()
|
||||
.setData(
|
||||
TestUtil.getByteArray(
|
||||
ApplicationProvider.getApplicationContext(), "mp3/bear-id3.mp3"))
|
||||
ApplicationProvider.getApplicationContext(), "media/mp3/bear-id3.mp3"))
|
||||
.build();
|
||||
|
||||
BundledHlsMediaChunkExtractor result =
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ public class WebvttExtractorTest {
|
|||
TestUtil.extractAllSamplesFromFile(
|
||||
extractor,
|
||||
ApplicationProvider.getApplicationContext(),
|
||||
"webvtt/with_x-timestamp-map_header");
|
||||
"media/webvtt/with_x-timestamp-map_header");
|
||||
|
||||
// The output has a ~5s sampleTime and a large, negative subsampleOffset because the cue
|
||||
// timestamps are ~10 days ahead of the PTS (due to wrapping) so the offset is used to ensure
|
||||
|
|
@ -87,7 +87,7 @@ public class WebvttExtractorTest {
|
|||
DumpFileAsserts.assertOutput(
|
||||
ApplicationProvider.getApplicationContext(),
|
||||
output,
|
||||
"webvtt/with_x-timestamp-map_header.dump");
|
||||
"extractordumps/webvtt/with_x-timestamp-map_header.dump");
|
||||
}
|
||||
|
||||
private static boolean sniffData(byte[] data) throws IOException {
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ import org.junit.runner.RunWith;
|
|||
@RunWith(AndroidJUnit4.class)
|
||||
public final class SsManifestParserTest {
|
||||
|
||||
private static final String SAMPLE_ISMC_1 = "smooth-streaming/sample_ismc_1";
|
||||
private static final String SAMPLE_ISMC_2 = "smooth-streaming/sample_ismc_2";
|
||||
private static final String SAMPLE_ISMC_1 = "media/smooth-streaming/sample_ismc_1";
|
||||
private static final String SAMPLE_ISMC_2 = "media/smooth-streaming/sample_ismc_2";
|
||||
|
||||
/** Simple test to ensure the sample manifests parse without any exceptions being thrown. */
|
||||
@Test
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue