Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3bb6da1 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge changes I90bb3d16,I38824d04,Ie6f6709d am: 2d87e445 am: 4ec440d3

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/1352142

Change-Id: Iea3c078c77f7500901e3f503139d8705f5325e7d
parents 0ab30223 4ec440d3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
        <option name="cleanup" value="true" />
        <option name="push" value="ExtractorUnitTest->/data/local/tmp/ExtractorUnitTest" />
        <option name="push-file"
            key="https://storage.googleapis.com/android_media/frameworks/av/media/extractors/tests/extractor.zip?unzip=true"
            key="https://storage.googleapis.com/android_media/frameworks/av/media/extractors/tests/extractor-1.3.zip?unzip=true"
            value="/data/local/tmp/ExtractorUnitTestRes/" />
    </target_preparer>

+56 −10
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@ enum inputID {
    VORBIS_1,
    // video streams
    HEVC_1,
    HEVC_2,
    MPEG2_PS_1,
    MPEG2_TS_1,
    MPEG4_1,
@@ -101,6 +102,7 @@ static const struct InputData {
        // Test (b/151677264) for MP4 extractor
        {HEVC_1, MEDIA_MIMETYPE_VIDEO_HEVC, "crowd_508x240_25fps_hevc.mp4", 508, 240,
         HEVCProfileMain, 25},
        {HEVC_2, MEDIA_MIMETYPE_IMAGE_ANDROID_HEIC, "test3.heic", 820, 460, kUndefined, kUndefined},
        {MPEG2_PS_1, MEDIA_MIMETYPE_VIDEO_MPEG2, "swirl_144x136_mpeg2.mpg", 144, 136,
         MPEG2ProfileMain, 12},
        {MPEG2_TS_1, MEDIA_MIMETYPE_VIDEO_MPEG2, "bbb_cif_768kbps_30fps_mpeg2.ts", 352, 288,
@@ -608,6 +610,19 @@ TEST_P(ExtractorFunctionalityTest, SeekTest) {
            AMediaFormat_delete(trackMeta);
            continue;
        }

        AMediaFormat *trackFormat = AMediaFormat_new();
        ASSERT_NE(trackFormat, nullptr) << "AMediaFormat_new returned null format";
        status = track->getFormat(trackFormat);
        ASSERT_EQ(OK, (media_status_t)status) << "Failed to get track meta data";

        const char *mime;
        ASSERT_TRUE(AMediaFormat_getString(trackFormat, AMEDIAFORMAT_KEY_MIME, &mime))
                << "Failed to get mime";

        // Image formats are not expected to be seekable
        if (!strncmp(mime, "image/", 6)) continue;

        // Request seekable points for remaining extractors which will be used to validate the seek
        // accuracy for the extractors. Depending on SEEK Mode, we expect the extractors to return
        // the expected sync frame. We don't prefer random seek test for these extractors because
@@ -617,15 +632,8 @@ TEST_P(ExtractorFunctionalityTest, SeekTest) {
        ASSERT_GT(seekablePoints.size(), 0)
                << "Failed to get seekable points for " << mContainer << " extractor";

        AMediaFormat *trackFormat = AMediaFormat_new();
        ASSERT_NE(trackFormat, nullptr) << "AMediaFormat_new returned null format";
        status = track->getFormat(trackFormat);
        ASSERT_EQ(OK, (media_status_t)status) << "Failed to get track meta data";

        bool isOpus = false;
        int64_t opusSeekPreRollUs = 0;
        const char *mime;
        AMediaFormat_getString(trackFormat, AMEDIAFORMAT_KEY_MIME, &mime);
        if (!strcmp(mime, "audio/opus")) {
            isOpus = true;
            void *seekPreRollBuf = nullptr;
@@ -762,9 +770,14 @@ TEST_P(ExtractorFunctionalityTest, MonkeySeekTest) {
                trackMeta, idx, MediaExtractorPluginHelper::kIncludeExtensiveMetaData);
        ASSERT_EQ(OK, (media_status_t)status) << "Failed to get trackMetaData";

        const char *mime;
        ASSERT_TRUE(AMediaFormat_getString(trackMeta, AMEDIAFORMAT_KEY_MIME, &mime))
                << "Failed to get mime";

        int64_t clipDuration = 0;
        AMediaFormat_getInt64(trackMeta, AMEDIAFORMAT_KEY_DURATION, &clipDuration);
        ASSERT_GT(clipDuration, 0) << "Invalid clip duration ";
        // Image formats are not expected to have duration information
        ASSERT_TRUE(clipDuration > 0 || !strncmp(mime, "image/", 6)) << "Invalid clip duration ";
        AMediaFormat_delete(trackMeta);

        int64_t seekToTimeStampUs[] = {-clipDuration, clipDuration / 2, clipDuration,
@@ -1095,12 +1108,13 @@ INSTANTIATE_TEST_SUITE_P(ConfigParamTestAll, ConfigParamTest,
                                           make_pair("ogg", VORBIS_1),

                                           make_pair("mpeg4", HEVC_1),
                                           make_pair("mpeg4", HEVC_2),
                                           make_pair("mpeg2ps", MPEG2_PS_1),
                                           make_pair("mpeg2ts", MPEG2_TS_1),
                                           make_pair("mkv", MPEG4_1),
                                           make_pair("mkv", VP9_1)));

// Validate extractors for container format, input file and supports seek flag
// Validate extractors for container format, input file, no. of tracks and supports seek flag
INSTANTIATE_TEST_SUITE_P(
        ExtractorUnitTestAll, ExtractorFunctionalityTest,
        ::testing::Values(
@@ -1118,13 +1132,25 @@ INSTANTIATE_TEST_SUITE_P(
                make_tuple("mpeg2ts", "testac3ts.ts", 1, false),
                make_tuple("mpeg2ts", "testac4ts.ts", 1, false),
                make_tuple("mpeg2ts", "testeac3ts.ts", 1, false),
                make_tuple("mpeg4", "audio_aac_mono_70kbs_44100hz.mp4", 2, true),
                make_tuple("mpeg4", "multi0_ac4.mp4", 1, true),
                make_tuple("mpeg4", "noise_6ch_44khz_aot5_dr_sbr_sig2_mp4.m4a", 1, true),
                make_tuple("mpeg4", "sinesweepalac.mov", 1, true),
                make_tuple("mpeg4", "sinesweepflacmp4.mp4", 1, true),
                make_tuple("mpeg4", "sinesweepm4a.m4a", 1, true),
                make_tuple("mpeg4", "sinesweepoggmp4.mp4", 1, true),
                make_tuple("mpeg4", "sinesweepopusmp4.mp4", 1, true),
                make_tuple("mpeg4", "testac3mp4.mp4", 1, true),
                make_tuple("mpeg4", "testeac3mp4.mp4", 1, true),
                make_tuple("ogg", "john_cage.ogg", 1, true),
                make_tuple("ogg", "testopus.opus", 1, true),
                make_tuple("ogg", "sinesweepoggalbumart.ogg", 1, true),
                make_tuple("wav", "loudsoftwav.wav", 1, true),
                make_tuple("wav", "monotestgsm.wav", 1, true),
                make_tuple("wav", "noise_5ch_44khz_aot2_wave.wav", 1, true),
                make_tuple("wav", "sine1khzm40db_alaw.wav", 1, true),
                make_tuple("wav", "sine1khzm40db_f32le.wav", 1, true),
                make_tuple("wav", "sine1khzm40db_mulaw.wav", 1, true),

                make_tuple("mkv", "swirl_144x136_avc.mkv", 1, true),
                make_tuple("mkv", "withoutcues.mkv", 2, true),
@@ -1132,7 +1158,27 @@ INSTANTIATE_TEST_SUITE_P(
                make_tuple("mkv", "swirl_144x136_vp8.webm", 1, true),
                make_tuple("mpeg2ps", "swirl_144x136_mpeg2.mpg", 1, false),
                make_tuple("mpeg2ps", "programstream.mpeg", 2, false),
                make_tuple("mpeg4", "swirl_132x130_mpeg4.mp4", 1, true)));
                make_tuple("mpeg4", "color_176x144_bt601_525_lr_sdr_h264.mp4", 1, true),
                make_tuple("mpeg4", "heifwriter_input.heic", 4, false),
                make_tuple("mpeg4", "psshtest.mp4", 1, true),
                make_tuple("mpeg4", "swirl_132x130_mpeg4.mp4", 1, true),
                make_tuple("mpeg4", "testvideo.3gp", 4, true),
                make_tuple("mpeg4", "testvideo_with_2_timedtext_tracks.3gp", 4, true),
                make_tuple("mpeg4",
                           "video_176x144_3gp_h263_300kbps_25fps_aac_stereo_128kbps_11025hz_"
                           "metadata_gyro_compliant.3gp",
                           3, true),
                make_tuple(
                        "mpeg4",
                        "video_1920x1080_mp4_mpeg2_12000kbps_30fps_aac_stereo_128kbps_48000hz.mp4",
                        2, true),
                make_tuple("mpeg4",
                           "video_480x360_mp4_hevc_650kbps_30fps_aac_stereo_128kbps_48000hz.mp4", 2,
                           true),
                make_tuple(
                        "mpeg4",
                        "video_480x360_mp4_h264_1350kbps_30fps_aac_stereo_128kbps_44100hz_dash.mp4",
                        2, true)));

int main(int argc, char **argv) {
    gEnv = new ExtractorUnitTestEnvironment();