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

Commit 6ba23ce9 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Audio HAL: Simplify types updates for 'common' and 'effect' packages"

parents 2531db4a 595caa3b
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -25,13 +25,13 @@ namespace android {
// static
sp<EffectsFactoryHalInterface> EffectsFactoryHalInterface::create() {
    if (hardware::audio::effect::V5_0::IEffectsFactory::getService() != nullptr) {
        return V5_0::createEffectsFactoryHal();
        return effect::V5_0::createEffectsFactoryHal();
    }
    if (hardware::audio::effect::V4_0::IEffectsFactory::getService() != nullptr) {
        return V4_0::createEffectsFactoryHal();
        return effect::V4_0::createEffectsFactoryHal();
    }
    if (hardware::audio::effect::V2_0::IEffectsFactory::getService() != nullptr) {
        return V2_0::createEffectsFactoryHal();
        return effect::V2_0::createEffectsFactoryHal();
    }
    return nullptr;
}
+2 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ using ::android::hardware::Return;
using ::android::hidl::allocator::V1_0::IAllocator;

namespace android {
namespace effect {
namespace CPP_VERSION {

// static
@@ -142,5 +143,6 @@ void EffectBufferHalHidl::commit(size_t size) {
    memcpy(mExternalData, mAudioBuffer.raw, size);
}

} // namespace effect
} // namespace CPP_VERSION
} // namespace android
+4 −1
Original line number Diff line number Diff line
@@ -23,13 +23,15 @@
#include <media/audiohal/EffectBufferHalInterface.h>
#include <system/audio_effect.h>

using android::hardware::audio::effect::CPP_VERSION::AudioBuffer;
using android::hardware::hidl_memory;
using android::hidl::memory::V1_0::IMemory;

namespace android {
namespace effect {
namespace CPP_VERSION {

using namespace ::android::hardware::audio::effect::CPP_VERSION;

class EffectBufferHalHidl : public EffectBufferHalInterface
{
  public:
@@ -73,6 +75,7 @@ class EffectBufferHalHidl : public EffectBufferHalInterface
};

} // namespace CPP_VERSION
} // namespace effect
} // namespace android

#endif // ANDROID_HARDWARE_EFFECT_BUFFER_HAL_HIDL_H
+3 −5
Original line number Diff line number Diff line
@@ -26,11 +26,6 @@
#include "EffectHalHidl.h"
#include "HidlUtils.h"

using ::android::hardware::audio::effect::CPP_VERSION::AudioBuffer;
using ::android::hardware::audio::effect::CPP_VERSION::EffectBufferAccess;
using ::android::hardware::audio::effect::CPP_VERSION::EffectConfigParameters;
using ::android::hardware::audio::effect::CPP_VERSION::MessageQueueFlagBits;
using ::android::hardware::audio::effect::CPP_VERSION::Result;
using ::android::hardware::audio::common::CPP_VERSION::implementation::HidlUtils;
using ::android::hardware::audio::common::utils::EnumBitfield;
using ::android::hardware::hidl_vec;
@@ -38,9 +33,11 @@ using ::android::hardware::MQDescriptorSync;
using ::android::hardware::Return;

namespace android {
namespace effect {
namespace CPP_VERSION {

using namespace ::android::hardware::audio::common::CPP_VERSION;
using namespace ::android::hardware::audio::effect::CPP_VERSION;

EffectHalHidl::EffectHalHidl(const sp<IEffect>& effect, uint64_t effectId)
        : mEffect(effect), mEffectId(effectId), mBuffersChanged(true), mEfGroup(nullptr) {
@@ -338,4 +335,5 @@ status_t EffectHalHidl::setConfigImpl(
}

} // namespace CPP_VERSION
} // namespace effect
} // namespace android
+6 −7
Original line number Diff line number Diff line
@@ -23,17 +23,15 @@
#include <fmq/MessageQueue.h>
#include <system/audio_effect.h>

using ::android::hardware::audio::effect::CPP_VERSION::EffectBufferConfig;
using ::android::hardware::audio::effect::CPP_VERSION::EffectConfig;
using ::android::hardware::audio::effect::CPP_VERSION::EffectDescriptor;
using ::android::hardware::audio::effect::CPP_VERSION::IEffect;
using EffectResult = ::android::hardware::audio::effect::CPP_VERSION::Result;
using ::android::hardware::EventFlag;
using ::android::hardware::MessageQueue;

namespace android {
namespace effect {
namespace CPP_VERSION {

using namespace ::android::hardware::audio::effect::CPP_VERSION;

class EffectHalHidl : public EffectHalInterface
{
  public:
@@ -70,7 +68,7 @@ class EffectHalHidl : public EffectHalInterface

  private:
    friend class EffectsFactoryHalHidl;
    typedef MessageQueue<EffectResult, hardware::kSynchronizedReadWrite> StatusMQ;
    typedef MessageQueue<Result, hardware::kSynchronizedReadWrite> StatusMQ;

    sp<IEffect> mEffect;
    const uint64_t mEffectId;
@@ -80,7 +78,7 @@ class EffectHalHidl : public EffectHalInterface
    std::unique_ptr<StatusMQ> mStatusMQ;
    EventFlag* mEfGroup;

    static status_t analyzeResult(const EffectResult& result);
    static status_t analyzeResult(const Result& result);
    static void effectBufferConfigFromHal(
            const buffer_config_t& halConfig, EffectBufferConfig* config);
    static void effectBufferConfigToHal(
@@ -105,6 +103,7 @@ class EffectHalHidl : public EffectHalInterface
};

} // namespace CPP_VERSION
} // namespace effect
} // namespace android

#endif // ANDROID_HARDWARE_EFFECT_HAL_HIDL_H
Loading