Audio V4: Update namespace and version of 4.0 shim
Put the shim in a V4_0 namespace to comply with the ODR.
Make the include guard unique.
Split from the error prone interface adaptation change for safer review.
Patch generated with:
sed -i 's/V2_0/V4_0/g' *
sed -i "/include.*2.0/s/2\.0/4.0/" *
sed -i '/namespace android *{/anamespace V4_0 {' *
sed -Ei 's/(ifndef|define|endif)(.*)_H/\1\2_4_0_H/' *
sed -Ei 's#}(.*)namespace android$#}\1namespace V4_0\n\0#' *
Bug: 38184704
Test: Compile
Change-Id: I7d3aa46b3dfec664cbeea8a6b946456b8e8f06e3
Merged-In: I7d3aa46b3dfec664cbeea8a6b946456b8e8f06e3
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
diff --git a/media/libaudiohal/4.0/EffectHalHidl.h b/media/libaudiohal/4.0/EffectHalHidl.h
index 6ffdaf1..5a4dab1 100644
--- a/media/libaudiohal/4.0/EffectHalHidl.h
+++ b/media/libaudiohal/4.0/EffectHalHidl.h
@@ -14,23 +14,24 @@
* limitations under the License.
*/
-#ifndef ANDROID_HARDWARE_EFFECT_HAL_HIDL_H
-#define ANDROID_HARDWARE_EFFECT_HAL_HIDL_H
+#ifndef ANDROID_HARDWARE_EFFECT_HAL_HIDL_4_0_H
+#define ANDROID_HARDWARE_EFFECT_HAL_HIDL_4_0_H
-#include <android/hardware/audio/effect/2.0/IEffect.h>
+#include <android/hardware/audio/effect/4.0/IEffect.h>
#include <media/audiohal/EffectHalInterface.h>
#include <fmq/EventFlag.h>
#include <fmq/MessageQueue.h>
#include <system/audio_effect.h>
-using ::android::hardware::audio::effect::V2_0::EffectBufferConfig;
-using ::android::hardware::audio::effect::V2_0::EffectConfig;
-using ::android::hardware::audio::effect::V2_0::EffectDescriptor;
-using ::android::hardware::audio::effect::V2_0::IEffect;
+using ::android::hardware::audio::effect::V4_0::EffectBufferConfig;
+using ::android::hardware::audio::effect::V4_0::EffectConfig;
+using ::android::hardware::audio::effect::V4_0::EffectDescriptor;
+using ::android::hardware::audio::effect::V4_0::IEffect;
using ::android::hardware::EventFlag;
using ::android::hardware::MessageQueue;
namespace android {
+namespace V4_0 {
class EffectHalHidl : public EffectHalInterface
{
@@ -69,7 +70,7 @@
private:
friend class EffectsFactoryHalHidl;
typedef MessageQueue<
- hardware::audio::effect::V2_0::Result, hardware::kSynchronizedReadWrite> StatusMQ;
+ hardware::audio::effect::V4_0::Result, hardware::kSynchronizedReadWrite> StatusMQ;
sp<IEffect> mEffect;
const uint64_t mEffectId;
@@ -79,7 +80,7 @@
std::unique_ptr<StatusMQ> mStatusMQ;
EventFlag* mEfGroup;
- static status_t analyzeResult(const hardware::audio::effect::V2_0::Result& result);
+ static status_t analyzeResult(const hardware::audio::effect::V4_0::Result& result);
static void effectBufferConfigFromHal(
const buffer_config_t& halConfig, EffectBufferConfig* config);
static void effectBufferConfigToHal(
@@ -103,6 +104,7 @@
status_t setProcessBuffers();
};
+} // namespace V4_0
} // namespace android
-#endif // ANDROID_HARDWARE_EFFECT_HAL_HIDL_H
+#endif // ANDROID_HARDWARE_EFFECT_HAL_HIDL_4_0_H