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

Commit 5455eb45 authored by Andy Hung's avatar Andy Hung Committed by Gerrit Code Review
Browse files

Merge "AudioFlinger: timing code build cleanup"

parents d368c88a 4ba1f05d
Loading
Loading
Loading
Loading
+27 −1
Original line number Diff line number Diff line
@@ -7,11 +7,37 @@ package {
    default_applicable_licenses: ["frameworks_av_services_audioflinger_license"],
}

audioflinger_timing_tidy_errors = audioflinger_base_tidy_errors + [
    "modernize-avoid-c-arrays",
    "modernize-deprecated-headers",
    "modernize-pass-by-value",
    "modernize-use-auto",
    "modernize-use-nodiscard",

    // TODO(b/275642749) Reenable these warnings
    "-misc-non-private-member-variables-in-classes",
]

// Eventually use common tidy defaults
cc_defaults {
    name: "audioflinger_timing_flags_defaults",
    // https://clang.llvm.org/docs/UsersManual.html#command-line-options
    // https://clang.llvm.org/docs/DiagnosticsReference.html
    cflags: audioflinger_base_cflags,
    // https://clang.llvm.org/extra/clang-tidy/
    tidy: true,
    tidy_checks: audioflinger_timing_tidy_errors,
    tidy_checks_as_errors: audioflinger_timing_tidy_errors,
    tidy_flags: [
      "-format-style=file",
    ],
}

cc_library {
    name: "libaudioflinger_timing",

    defaults: [
        "audioflinger_flags_defaults",
        "audioflinger_timing_flags_defaults",
    ],

    host_supported: true,
+3 −3
Original line number Diff line number Diff line
@@ -58,19 +58,19 @@ public:
     * This offset is sufficient to ensure monotonicity after flush is called,
     * suitability for any other purpose is *not* guaranteed.
     */
    int64_t getOffsetFrameCount() const { return mOffsetFrameCount; }
    [[nodiscard]] int64_t getOffsetFrameCount() const { return mOffsetFrameCount; }

    /**
     * Returns the last received frameCount.
     */
    int64_t getLastReceivedFrameCount() const {
    [[nodiscard]] int64_t getLastReceivedFrameCount() const {
        return mLastReceivedFrameCount;
    }

    /**
     * Returns the last reported frameCount from updateAndGetMonotonicFrameCount().
     */
    int64_t getLastReportedFrameCount() const {
    [[nodiscard]] int64_t getLastReportedFrameCount() const {
        // This is consistent after onFlush().
        return mOffsetFrameCount + mLastReceivedFrameCount;
    }