Merge "AIDL Bundle Effects : Add missing initialisation of samples per second." into main
diff --git a/media/libeffects/lvm/wrapper/Aidl/BundleContext.cpp b/media/libeffects/lvm/wrapper/Aidl/BundleContext.cpp
index 0db7a73..a163f4b 100644
--- a/media/libeffects/lvm/wrapper/Aidl/BundleContext.cpp
+++ b/media/libeffects/lvm/wrapper/Aidl/BundleContext.cpp
@@ -32,6 +32,20 @@
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
diff --git a/media/libeffects/lvm/wrapper/Aidl/BundleContext.h b/media/libeffects/lvm/wrapper/Aidl/BundleContext.h
index 3f31b8b..779d53a 100644
--- a/media/libeffects/lvm/wrapper/Aidl/BundleContext.h
+++ b/media/libeffects/lvm/wrapper/Aidl/BundleContext.h
@@ -29,14 +29,8 @@
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();