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

Commit 7297ae7d authored by Mikhail Naganov's avatar Mikhail Naganov Committed by Automerger Merge Worker
Browse files

Merge "AIDL Bundle Effects : Add missing initialisation of samples per...

Merge "AIDL Bundle Effects : Add missing initialisation of samples per second." into main am: 37fefc82

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



Change-Id: I0a141e06c822c852885a580d02f45c3a4c4ba4fb
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents b474ce14 37fefc82
Loading
Loading
Loading
Loading
+14 −0
Original line number 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::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() {
    std::lock_guard lg(mMutex);
    // init with pre-defined preset NORMAL
+2 −8
Original line number Diff line number Diff line
@@ -29,14 +29,8 @@ namespace aidl::android::hardware::audio::effect {
class BundleContext final : public EffectContext {
  public:
    BundleContext(int statusDepth, const Parameter::Common& common,
                  const lvm::BundleEffectType& type)
        : EffectContext(statusDepth, common), mType(type) {
        LOG(DEBUG) << __func__ << type;
    }
    ~BundleContext() override {
        LOG(DEBUG) << __func__;
        deInit();
    }
                  const lvm::BundleEffectType& type);
    ~BundleContext();

    RetCode init();
    void deInit();