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

Commit 9b6599e1 authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

libaudioprocessing: Trivial dependency cleanups

- Remove unused dependencies on libnbaio and libnblog;

- Move dependencies on libaudiohal and libsonic to libaudioprocessing
  as AudioMixer implementation does not use them.

Test: make
Merged-In: I258a450725bdacb4fcf437b6f86582d51d40e622
Change-Id: I258a450725bdacb4fcf437b6f86582d51d40e622
parent 52a42dde
Loading
Loading
Loading
Loading
+0 −10
Original line number Original line Diff line number Diff line
@@ -43,10 +43,6 @@


namespace android {
namespace android {


namespace NBLog {
class Writer;
}   // namespace NBLog

// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------


class AudioMixer
class AudioMixer
@@ -188,10 +184,6 @@ public:
        return ss.str();
        return ss.str();
    }
    }


    void        setNBLogWriter(NBLog::Writer *logWriter) {
        mNBLogWriter = logWriter;
    }

    static inline bool isValidFormat(audio_format_t format) {
    static inline bool isValidFormat(audio_format_t format) {
        switch (format) {
        switch (format) {
        case AUDIO_FORMAT_PCM_8_BIT:
        case AUDIO_FORMAT_PCM_8_BIT:
@@ -491,8 +483,6 @@ private:
    const uint32_t mSampleRate;
    const uint32_t mSampleRate;
    const size_t mFrameCount;
    const size_t mFrameCount;


    NBLog::Writer *mNBLogWriter = nullptr;   // associated NBLog::Writer

    process_hook_t mHook = &AudioMixer::process__nop;   // one of process__*, never nullptr
    process_hook_t mHook = &AudioMixer::process__nop;   // one of process__*, never nullptr


    // the size of the type (int32_t) should be the largest of all types supported
    // the size of the type (int32_t) should be the largest of all types supported
+6 −4
Original line number Original line Diff line number Diff line
@@ -4,13 +4,9 @@ cc_defaults {
    export_include_dirs: ["include"],
    export_include_dirs: ["include"],


    shared_libs: [
    shared_libs: [
        "libaudiohal",
        "libaudioutils",
        "libaudioutils",
        "libcutils",
        "libcutils",
        "liblog",
        "liblog",
        "libnbaio",
        "libnblog",
        "libsonic",
        "libutils",
        "libutils",
        "libvibrator",
        "libvibrator",
    ],
    ],
@@ -36,6 +32,12 @@ cc_library_shared {
        "BufferProviders.cpp",
        "BufferProviders.cpp",
        "RecordBufferConverter.cpp",
        "RecordBufferConverter.cpp",
    ],
    ],

    shared_libs: [
        "libaudiohal",
        "libsonic",
    ],

    whole_static_libs: ["libaudioprocessing_arm"],
    whole_static_libs: ["libaudioprocessing_arm"],
}
}


+1 −6
Original line number Original line Diff line number Diff line
@@ -105,13 +105,8 @@ const FastThreadState *FastMixer::poll()
    return mSQ.poll();
    return mSQ.poll();
}
}


void FastMixer::setNBLogWriter(NBLog::Writer *logWriter)
void FastMixer::setNBLogWriter(NBLog::Writer *logWriter __unused)
{
{
    // FIXME If mMixer is set or changed prior to this, we don't inform correctly.
    //       Should cache logWriter and re-apply it at the assignment to mMixer.
    if (mMixer != NULL) {
        mMixer->setNBLogWriter(logWriter);
    }
}
}


void FastMixer::onIdle()
void FastMixer::onIdle()
+1 −1
Original line number Original line Diff line number Diff line
@@ -124,7 +124,7 @@ bool FastThread::threadLoop()
            mDumpState = next->mDumpState != NULL ? next->mDumpState : mDummyDumpState;
            mDumpState = next->mDumpState != NULL ? next->mDumpState : mDummyDumpState;
            tlNBLogWriter = next->mNBLogWriter != NULL ?
            tlNBLogWriter = next->mNBLogWriter != NULL ?
                    next->mNBLogWriter : mDummyNBLogWriter.get();
                    next->mNBLogWriter : mDummyNBLogWriter.get();
            setNBLogWriter(tlNBLogWriter); // FastMixer informs its AudioMixer, FastCapture ignores
            setNBLogWriter(tlNBLogWriter); // This is used for debugging only


            // We want to always have a valid reference to the previous (non-idle) state.
            // We want to always have a valid reference to the previous (non-idle) state.
            // However, the state queue only guarantees access to current and previous states.
            // However, the state queue only guarantees access to current and previous states.