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

Commit b58afa74 authored by Harish Mahendrakar's avatar Harish Mahendrakar
Browse files

C2 VTS: Format using clang-format

Added .clang-format and formatted all the sources and headers

Bug: 184389394
Test: atest VtsHalMediaC2V1_0TargetAudioDecTest \
      VtsHalMediaC2V1_0TargetAudioEncTest \
      VtsHalMediaC2V1_0TargetVideoDecTest \
      VtsHalMediaC2V1_0TargetVideoEncTest \
      VtsHalMediaC2V1_0TargetComponentTest \
      VtsHalMediaC2V1_0TargetMasterTest
Change-Id: Ia132a8c051b5ab442afb1114d220f822168a3632
parent 66547278
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
../../../../../../../build/soong/scripts/system-clang-format
 No newline at end of file
+20 −30
Original line number Original line Diff line number Diff line
@@ -46,36 +46,26 @@ struct CompToURL {
};
};


std::vector<CompToURL> kCompToURL = {
std::vector<CompToURL> kCompToURL = {
    {"mp4a-latm",
        {"mp4a-latm", "bbb_aac_stereo_128kbps_48000hz.aac", "bbb_aac_stereo_128kbps_48000hz.info"},
     "bbb_aac_stereo_128kbps_48000hz.aac", "bbb_aac_stereo_128kbps_48000hz.info"},
        {"mp4a-latm", "bbb_aac_stereo_128kbps_48000hz.aac",
    {"mp4a-latm",
         "bbb_aac_stereo_128kbps_48000hz_multi_frame.info"},
     "bbb_aac_stereo_128kbps_48000hz.aac", "bbb_aac_stereo_128kbps_48000hz_multi_frame.info"},
        {"audio/mpeg", "bbb_mp3_stereo_192kbps_48000hz.mp3", "bbb_mp3_stereo_192kbps_48000hz.info"},
    {"audio/mpeg",
        {"audio/mpeg", "bbb_mp3_stereo_192kbps_48000hz.mp3",
     "bbb_mp3_stereo_192kbps_48000hz.mp3", "bbb_mp3_stereo_192kbps_48000hz.info"},
         "bbb_mp3_stereo_192kbps_48000hz_multi_frame.info"},
    {"audio/mpeg",
        {"3gpp", "sine_amrnb_1ch_12kbps_8000hz.amrnb", "sine_amrnb_1ch_12kbps_8000hz.info"},
     "bbb_mp3_stereo_192kbps_48000hz.mp3", "bbb_mp3_stereo_192kbps_48000hz_multi_frame.info"},
        {"3gpp", "sine_amrnb_1ch_12kbps_8000hz.amrnb",
    {"3gpp",
         "sine_amrnb_1ch_12kbps_8000hz_multi_frame.info"},
     "sine_amrnb_1ch_12kbps_8000hz.amrnb", "sine_amrnb_1ch_12kbps_8000hz.info"},
        {"amr-wb", "bbb_amrwb_1ch_14kbps_16000hz.amrwb", "bbb_amrwb_1ch_14kbps_16000hz.info"},
    {"3gpp",
        {"amr-wb", "bbb_amrwb_1ch_14kbps_16000hz.amrwb",
     "sine_amrnb_1ch_12kbps_8000hz.amrnb", "sine_amrnb_1ch_12kbps_8000hz_multi_frame.info"},
         "bbb_amrwb_1ch_14kbps_16000hz_multi_frame.info"},
    {"amr-wb",
        {"vorbis", "bbb_vorbis_stereo_128kbps_48000hz.vorbis",
     "bbb_amrwb_1ch_14kbps_16000hz.amrwb", "bbb_amrwb_1ch_14kbps_16000hz.info"},
         "bbb_vorbis_stereo_128kbps_48000hz.info"},
    {"amr-wb",
        {"opus", "bbb_opus_stereo_128kbps_48000hz.opus", "bbb_opus_stereo_128kbps_48000hz.info"},
     "bbb_amrwb_1ch_14kbps_16000hz.amrwb", "bbb_amrwb_1ch_14kbps_16000hz_multi_frame.info"},
        {"g711-alaw", "bbb_g711alaw_1ch_8khz.raw", "bbb_g711alaw_1ch_8khz.info"},
    {"vorbis",
        {"g711-mlaw", "bbb_g711mulaw_1ch_8khz.raw", "bbb_g711mulaw_1ch_8khz.info"},
     "bbb_vorbis_stereo_128kbps_48000hz.vorbis", "bbb_vorbis_stereo_128kbps_48000hz.info"},
        {"gsm", "bbb_gsm_1ch_8khz_13kbps.raw", "bbb_gsm_1ch_8khz_13kbps.info"},
    {"opus",
        {"raw", "bbb_raw_1ch_8khz_s32le.raw", "bbb_raw_1ch_8khz_s32le.info"},
     "bbb_opus_stereo_128kbps_48000hz.opus", "bbb_opus_stereo_128kbps_48000hz.info"},
        {"flac", "bbb_flac_stereo_680kbps_48000hz.flac", "bbb_flac_stereo_680kbps_48000hz.info"},
    {"g711-alaw",
     "bbb_g711alaw_1ch_8khz.raw", "bbb_g711alaw_1ch_8khz.info"},
    {"g711-mlaw",
     "bbb_g711mulaw_1ch_8khz.raw", "bbb_g711mulaw_1ch_8khz.info"},
    {"gsm",
     "bbb_gsm_1ch_8khz_13kbps.raw", "bbb_gsm_1ch_8khz_13kbps.info"},
    {"raw",
     "bbb_raw_1ch_8khz_s32le.raw", "bbb_raw_1ch_8khz_s32le.info"},
    {"flac",
     "bbb_flac_stereo_680kbps_48000hz.flac", "bbb_flac_stereo_680kbps_48000hz.info"},
};
};


class LinearBuffer : public C2Buffer {
class LinearBuffer : public C2Buffer {
+5 −7
Original line number Original line Diff line number Diff line
@@ -246,7 +246,8 @@ bool getConfigParams(std::string mime, int32_t* nChannels, int32_t* nSampleRate,
        *nChannels = 1;
        *nChannels = 1;
        *nSampleRate = 16000;
        *nSampleRate = 16000;
        *samplesPerFrame = 160;
        *samplesPerFrame = 160;
    } else return false;
    } else
        return false;


    return true;
    return true;
}
}
@@ -258,10 +259,8 @@ void Codec2AudioEncHidlTestBase::GetURLForComponent(char* mURL) {
        const char* mURL;
        const char* mURL;
    };
    };
    static const CompToURL kCompToURL[] = {
    static const CompToURL kCompToURL[] = {
            {"mp4a-latm", "bbb_raw_2ch_48khz_s16le.raw"},
            {"mp4a-latm", "bbb_raw_2ch_48khz_s16le.raw"}, {"3gpp", "bbb_raw_1ch_8khz_s16le.raw"},
            {"3gpp", "bbb_raw_1ch_8khz_s16le.raw"},
            {"amr-wb", "bbb_raw_1ch_16khz_s16le.raw"},    {"flac", "bbb_raw_2ch_48khz_s16le.raw"},
            {"amr-wb", "bbb_raw_1ch_16khz_s16le.raw"},
            {"flac", "bbb_raw_2ch_48khz_s16le.raw"},
            {"opus", "bbb_raw_2ch_48khz_s16le.raw"},
            {"opus", "bbb_raw_2ch_48khz_s16le.raw"},
    };
    };


@@ -428,8 +427,7 @@ TEST_P(Codec2AudioEncEncodeTest, EncodeTest) {
        ALOGE("framesReceived : %d inputFrames : %u", mFramesReceived, numFrames);
        ALOGE("framesReceived : %d inputFrames : %u", mFramesReceived, numFrames);
        ASSERT_TRUE(false);
        ASSERT_TRUE(false);
    }
    }
    if ((mMime.find("flac") != std::string::npos) ||
    if ((mMime.find("flac") != std::string::npos) || (mMime.find("opus") != std::string::npos) ||
        (mMime.find("opus") != std::string::npos) ||
        (mMime.find("mp4a-latm") != std::string::npos)) {
        (mMime.find("mp4a-latm") != std::string::npos)) {
        ASSERT_TRUE(mCsd) << "CSD buffer missing";
        ASSERT_TRUE(mCsd) << "CSD buffer missing";
    }
    }
+18 −20
Original line number Original line Diff line number Diff line
@@ -134,8 +134,7 @@ void workDone(const std::shared_ptr<android::Codec2Client::Component>& component
        for (size_t i = 0; i < updates.size(); ++i) {
        for (size_t i = 0; i < updates.size(); ++i) {
            C2Param* param = updates[i].get();
            C2Param* param = updates[i].get();
            if (param->index() == C2StreamInitDataInfo::output::PARAM_TYPE) {
            if (param->index() == C2StreamInitDataInfo::output::PARAM_TYPE) {
                C2StreamInitDataInfo::output* csdBuffer =
                C2StreamInitDataInfo::output* csdBuffer = (C2StreamInitDataInfo::output*)(param);
                        (C2StreamInitDataInfo::output*)(param);
                size_t csdSize = csdBuffer->flexCount();
                size_t csdSize = csdBuffer->flexCount();
                if (csdSize > 0) csd = true;
                if (csdSize > 0) csd = true;
            } else if ((param->index() == C2StreamSampleRateInfo::output::PARAM_TYPE) ||
            } else if ((param->index() == C2StreamSampleRateInfo::output::PARAM_TYPE) ||
@@ -160,8 +159,7 @@ void workDone(const std::shared_ptr<android::Codec2Client::Component>& component
            typedef std::unique_lock<std::mutex> ULock;
            typedef std::unique_lock<std::mutex> ULock;
            ULock l(queueLock);
            ULock l(queueLock);
            workQueue.push_back(std::move(work));
            workQueue.push_back(std::move(work));
            if (!flushedIndices.empty() &&
            if (!flushedIndices.empty() && (frameIndexIt != flushedIndices.end())) {
                (frameIndexIt != flushedIndices.end())) {
                flushedIndices.erase(frameIndexIt);
                flushedIndices.erase(frameIndexIt);
            }
            }
            queueCondition.notify_all();
            queueCondition.notify_all();
+27 −41
Original line number Original line Diff line number Diff line
@@ -52,43 +52,30 @@ struct CompToURL {
    std::string chksum;
    std::string chksum;
};
};
std::vector<CompToURL> kCompToURL = {
std::vector<CompToURL> kCompToURL = {
    {"avc",
        {"avc", "bbb_avc_176x144_300kbps_60fps.h264", "bbb_avc_176x144_300kbps_60fps.info",
     "bbb_avc_176x144_300kbps_60fps.h264", "bbb_avc_176x144_300kbps_60fps.info",
         "bbb_avc_176x144_300kbps_60fps_chksum.md5"},
         "bbb_avc_176x144_300kbps_60fps_chksum.md5"},
    {"avc",
        {"avc", "bbb_avc_640x360_768kbps_30fps.h264", "bbb_avc_640x360_768kbps_30fps.info",
     "bbb_avc_640x360_768kbps_30fps.h264", "bbb_avc_640x360_768kbps_30fps.info",
         "bbb_avc_640x360_768kbps_30fps_chksum.md5"},
         "bbb_avc_640x360_768kbps_30fps_chksum.md5"},
    {"hevc",
        {"hevc", "bbb_hevc_176x144_176kbps_60fps.hevc", "bbb_hevc_176x144_176kbps_60fps.info",
     "bbb_hevc_176x144_176kbps_60fps.hevc", "bbb_hevc_176x144_176kbps_60fps.info",
         "bbb_hevc_176x144_176kbps_60fps_chksum.md5"},
         "bbb_hevc_176x144_176kbps_60fps_chksum.md5"},
    {"hevc",
        {"hevc", "bbb_hevc_640x360_1600kbps_30fps.hevc", "bbb_hevc_640x360_1600kbps_30fps.info",
     "bbb_hevc_640x360_1600kbps_30fps.hevc", "bbb_hevc_640x360_1600kbps_30fps.info",
         "bbb_hevc_640x360_1600kbps_30fps_chksum.md5"},
         "bbb_hevc_640x360_1600kbps_30fps_chksum.md5"},
    {"mpeg2",
        {"mpeg2", "bbb_mpeg2_176x144_105kbps_25fps.m2v", "bbb_mpeg2_176x144_105kbps_25fps.info",
     "bbb_mpeg2_176x144_105kbps_25fps.m2v", "bbb_mpeg2_176x144_105kbps_25fps.info", ""},
         ""},
    {"mpeg2",
        {"mpeg2", "bbb_mpeg2_352x288_1mbps_60fps.m2v", "bbb_mpeg2_352x288_1mbps_60fps.info", ""},
     "bbb_mpeg2_352x288_1mbps_60fps.m2v","bbb_mpeg2_352x288_1mbps_60fps.info", ""},
        {"3gpp", "bbb_h263_352x288_300kbps_12fps.h263", "bbb_h263_352x288_300kbps_12fps.info", ""},
    {"3gpp",
        {"mp4v-es", "bbb_mpeg4_352x288_512kbps_30fps.m4v", "bbb_mpeg4_352x288_512kbps_30fps.info",
     "bbb_h263_352x288_300kbps_12fps.h263", "bbb_h263_352x288_300kbps_12fps.info", ""},
         ""},
    {"mp4v-es",
        {"vp8", "bbb_vp8_176x144_240kbps_60fps.vp8", "bbb_vp8_176x144_240kbps_60fps.info", ""},
     "bbb_mpeg4_352x288_512kbps_30fps.m4v", "bbb_mpeg4_352x288_512kbps_30fps.info", ""},
        {"vp8", "bbb_vp8_640x360_2mbps_30fps.vp8", "bbb_vp8_640x360_2mbps_30fps.info",
    {"vp8",
     "bbb_vp8_176x144_240kbps_60fps.vp8", "bbb_vp8_176x144_240kbps_60fps.info", ""},
    {"vp8",
     "bbb_vp8_640x360_2mbps_30fps.vp8", "bbb_vp8_640x360_2mbps_30fps.info",
         "bbb_vp8_640x360_2mbps_30fps_chksm.md5"},
         "bbb_vp8_640x360_2mbps_30fps_chksm.md5"},
    {"vp9",
        {"vp9", "bbb_vp9_176x144_285kbps_60fps.vp9", "bbb_vp9_176x144_285kbps_60fps.info", ""},
     "bbb_vp9_176x144_285kbps_60fps.vp9", "bbb_vp9_176x144_285kbps_60fps.info", ""},
        {"vp9", "bbb_vp9_640x360_1600kbps_30fps.vp9", "bbb_vp9_640x360_1600kbps_30fps.info",
    {"vp9",
     "bbb_vp9_640x360_1600kbps_30fps.vp9", "bbb_vp9_640x360_1600kbps_30fps.info",
         "bbb_vp9_640x360_1600kbps_30fps_chksm.md5"},
         "bbb_vp9_640x360_1600kbps_30fps_chksm.md5"},
    {"vp9",
        {"vp9", "bbb_vp9_704x480_280kbps_24fps_altref_2.vp9",
     "bbb_vp9_704x480_280kbps_24fps_altref_2.vp9",
         "bbb_vp9_704x480_280kbps_24fps_altref_2.info", ""},
         "bbb_vp9_704x480_280kbps_24fps_altref_2.info", ""},
    {"av01",
        {"av01", "bbb_av1_640_360.av1", "bbb_av1_640_360.info", "bbb_av1_640_360_chksum.md5"},
     "bbb_av1_640_360.av1", "bbb_av1_640_360.info", "bbb_av1_640_360_chksum.md5"},
        {"av01", "bbb_av1_176_144.av1", "bbb_av1_176_144.info", "bbb_av1_176_144_chksm.md5"},
    {"av01",
     "bbb_av1_176_144.av1", "bbb_av1_176_144.info", "bbb_av1_176_144_chksm.md5"},
};
};


class LinearBuffer : public C2Buffer {
class LinearBuffer : public C2Buffer {
@@ -251,8 +238,7 @@ class Codec2VideoDecHidlTestBase : public ::testing::Test {
                if (!codecConfig && !work->worklets.front()->output.buffers.empty()) {
                if (!codecConfig && !work->worklets.front()->output.buffers.empty()) {
                    if (mReorderDepth < 0) {
                    if (mReorderDepth < 0) {
                        C2PortReorderBufferDepthTuning::output reorderBufferDepth;
                        C2PortReorderBufferDepthTuning::output reorderBufferDepth;
                        mComponent->query({&reorderBufferDepth}, {}, C2_MAY_BLOCK,
                        mComponent->query({&reorderBufferDepth}, {}, C2_MAY_BLOCK, nullptr);
                                          nullptr);
                        mReorderDepth = reorderBufferDepth.value;
                        mReorderDepth = reorderBufferDepth.value;
                        if (mReorderDepth > 0) {
                        if (mReorderDepth > 0) {
                            // TODO: Add validation for reordered output
                            // TODO: Add validation for reordered output
Loading