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

Commit 62588b69 authored by Kevin Rocard's avatar Kevin Rocard
Browse files

Audio V4: Make effect default wrapper device independent

What was done in this patch:
 # move headers in all-versions/default folder for qualified inclusion
mkdir -p audio/effect/all-versions/include/effect/all-versions/default/
mv audio/effect/all-versions/*[hp] $_
 # Go in the all-versions header folder
cd $_
 # Use a macro for the version
sed -i '/^#/!s/V2_0/AUDIO_HAL_VERSION/g' *
 #Remove 2.0 includes
sed -i "/include.*2.0/d" *
 # Add include guard to make sure AUDIO_HAL_VERSION is set
sed -i '/limitations under the License/!b;N;a\n#include <common/all-versions/IncludeGuard.h>' *
 # Remove guard include macro
sed -i '/^#.*[H_]$/d' *
 # Remove LOG_TAG
sed -i '/LOG_TAG/d' *
 # Remove local include (include "XXX")
sed -i '/include.*"/{N;/\n$/d;D}' *
 # Replace implementation with inclusion
cd audio/effect/2.0/
git checkout HEAD^^
ls *h *cpp| sed -r 's/.*h$/\0 \0/;s/(.*)cpp/\1impl.h \0/' |xargs -L1 printf '1h;2,$H;$!d;g;s$namespace.*}[^\\n]*$#define AUDIO_HAL_VERSION V2_0\\\n#include <effect/all-versions/default/%s>\\\n#undef AUDIO_HAL_VERSION$\000%s\000'|xargs -0 -n2 sed -i
+ manual update of Android.bp and removal of duplicate include

Bug: 38184704
Test: compile
Change-Id: If99871516f3069fcb9e699ab670a665d7d507e7d
parent 1bd2a336
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#define LOG_TAG "AEC_Effect_HAL"

#include "AcousticEchoCancelerEffect.h"

#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/AcousticEchoCancelerEffect.impl.h>
#undef AUDIO_HAL_VERSION
+28 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ACOUSTICECHOCANCELEREFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ACOUSTICECHOCANCELEREFFECT_H

#include <android/hardware/audio/effect/2.0/IAcousticEchoCancelerEffect.h>

#include "Effect.h"

#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/AcousticEchoCancelerEffect.h>
#undef AUDIO_HAL_VERSION

#endif  // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ACOUSTICECHOCANCELEREFFECT_H
+2 −0
Original line number Diff line number Diff line
@@ -39,6 +39,8 @@ cc_library_shared {
    ],

    header_libs: [
        "android.hardware.audio.common.util@all-versions",
        "android.hardware.audio.effect@all-versions-impl",
        "libaudio_system_headers",
        "libaudioclient_headers",
        "libeffects_headers",
+21 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "AudioBufferManager.h"

#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/AudioBufferManager.impl.h>
#undef AUDIO_HAL_VERSION
+26 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUDIO_BUFFER_MANAGER_H_
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUDIO_BUFFER_MANAGER_H_

#include <android/hardware/audio/effect/2.0/types.h>

#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/AudioBufferManager.h>
#undef AUDIO_HAL_VERSION

#endif  // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUDIO_BUFFER_MANAGER_H_
Loading