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

Commit 514c8636 authored by Shraddha Basantwani's avatar Shraddha Basantwani
Browse files

AIDL Bundle Effects : Add missing initialisation of samples per second.

Test: atest audioeffect_analysis
Bug: 302036943
Change-Id: Id4d28e1de4ce6d5d70d7ebacc6d1f7662b43ac8a
parent d49d1480
Loading
Loading
Loading
Loading
+14 −0
Original line number Original line Diff line number Diff line
@@ -32,6 +32,20 @@ using ::aidl::android::media::audio::common::AudioChannelLayout;
using ::aidl::android::media::audio::common::AudioDeviceDescription;
using ::aidl::android::media::audio::common::AudioDeviceDescription;
using ::aidl::android::media::audio::common::AudioDeviceType;
using ::aidl::android::media::audio::common::AudioDeviceType;


BundleContext::BundleContext(int statusDepth, const Parameter::Common& common,
              const lvm::BundleEffectType& type)
        : EffectContext(statusDepth, common), mType(type) {
    LOG(DEBUG) << __func__ << type;
    int channelCount = ::aidl::android::hardware::audio::common::getChannelCount(
            common.input.base.channelMask);
    mSamplesPerSecond = common.input.base.sampleRate * channelCount;
}

BundleContext::~BundleContext() {
    LOG(DEBUG) << __func__;
    deInit();
}

RetCode BundleContext::init() {
RetCode BundleContext::init() {
    std::lock_guard lg(mMutex);
    std::lock_guard lg(mMutex);
    // init with pre-defined preset NORMAL
    // init with pre-defined preset NORMAL
+2 −8
Original line number Original line Diff line number Diff line
@@ -29,14 +29,8 @@ namespace aidl::android::hardware::audio::effect {
class BundleContext final : public EffectContext {
class BundleContext final : public EffectContext {
  public:
  public:
    BundleContext(int statusDepth, const Parameter::Common& common,
    BundleContext(int statusDepth, const Parameter::Common& common,
                  const lvm::BundleEffectType& type)
                  const lvm::BundleEffectType& type);
        : EffectContext(statusDepth, common), mType(type) {
    ~BundleContext();
        LOG(DEBUG) << __func__ << type;
    }
    ~BundleContext() override {
        LOG(DEBUG) << __func__;
        deInit();
    }


    RetCode init();
    RetCode init();
    void deInit();
    void deInit();