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

Commit 96d47c88 authored by Kevin Rocard's avatar Kevin Rocard Committed by Android (Google) Code Review
Browse files

Merge changes from topic "audio-pre-v5"

* changes:
  Audio VTS: Simplify sequential #if
  Audio VTS: Fix missing whitespace in error message
  Audio HAL: Factorize Android.bp
  Audio HAL: Update file tree documentation
  Audio HAL: Factorize V2 and V4 like libaudiohal
  Audio VTS: Move version specific code to its own file
  Audio HAL: Align V2 and V4 VTS
  Audio HAL: Cleanup implementation
  Audio: Run clang-format on all files
parents 4fb17ff8 55a5b8b4
Loading
Loading
Loading
Loading
+16 −31
Original line number Diff line number Diff line
Directory structure of the audio HIDL related code.

audio
|-- 2.0              <== HIDL (.hal) can not be moved to fit the directory structure
|                        because that would create a separate HAL
|-- 2.0              <== core 2.0 HIDL API. .hal can not be moved into the core directory
|                        because that would change its namespace and include path
|-- 4.0              <== Version 4.0 of the core API
|
|-- ...
|
|-- common           <== code common to audio core and effect API
|   |-- 2.0
|   |   |-- default  <== code that wraps the legacy API
|   |   `-- vts      <== vts of 2.0 core and effect API common code
|   |-- 2.0          <== HIDL API of V2
|   |-- 4.0
|   |   |-- default
|   |   `-- vts
|   |-- ...          <== The future versions should continue this structure
|   |   |-- default
|   |   `-- vts
|   |-- ...
|   `-- all_versions <== code common to all version of both core and effect API
|       |-- default
|       `-- vts      <== vts of core and effect API common version independent code
|       |-- default  <== implementation shared code between core and effect impl
|       |-- test     <== utilities used by tests
|       `-- util     <== utilities used by both implementation and tests
|
|-- core           <== code relative to the core API
|   |-- 2.0          <== 2.0 core API code (except .hal, see audio/2.0)
|   |   |-- default
|   |   `-- vts
|-- core             <== VTS and default implementation of the core API (not HIDL, see /audio/2.0))
|   `-- all_versions <== Code is version independent through #if and separate files
|       |-- default  <== code that wraps the legacy API
|       `-- vts      <== vts of core API
|           |-- 2.0  <== 2.0 specific tests and helpers
|           |-- 4.0
|   |   |-- default  <== default implementation of the core 4.0 api
|   |   `-- vts      <== vts code of the 4.0 API
|           |-- ...
|   |   |-- default
|   |   `-- vts
|   `-- all_versions
|       |-- default
|       `-- vts      <== vts of core API common version independent code
|
`-- effect           <== idem for the effect API
    |-- 2.0
    |   |-- default
    |   `-- vts
    |-- 4.0
    |   |-- default
    |   `-- vts
    |-- ...
    |   |-- default
    |   `-- vts
    `-- all_versions
        |-- default
        `-- vts
+0 −47
Original line number Diff line number Diff line
//
// Copyright (C) 2016 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.

cc_library_shared {
    name: "android.hardware.audio.common@2.0-util",
    defaults: ["hidl_defaults"],
    vendor_available: true,
    vndk: {
        enabled: true,
    },
    srcs: [
        "HidlUtils.cpp",
    ],

    export_include_dirs: ["."],

    static_libs: [
    ],

    shared_libs: [
        "liblog",
        "libutils",
        "libhidlbase",
        "android.hardware.audio.common-util",
        "android.hardware.audio.common@2.0",
    ],
    export_shared_lib_headers: [
        "android.hardware.audio.common-util"
    ],

    header_libs: [
        "libaudio_system_headers",
        "libhardware_headers",
    ],
}
+0 −21
Original line number Diff line number Diff line
/*
 * Copyright (C) 2016 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 "HidlUtils.h"

#define AUDIO_HAL_VERSION V2_0
#include <common/all-versions/default/HidlUtils.impl.h>
#undef AUDIO_HAL_VERSION
+0 −26
Original line number Diff line number Diff line
/*
 * Copyright (C) 2016 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_V2_0_Hidl_Utils_H_
#define android_hardware_audio_V2_0_Hidl_Utils_H_

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

#define AUDIO_HAL_VERSION V2_0
#include <common/all-versions/default/HidlUtils.h>
#undef AUDIO_HAL_VERSION

#endif  // android_hardware_audio_V2_0_Hidl_Utils_H_
+0 −41
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 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_VERSION_UTILS_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_VERSION_UTILS_H

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

namespace android {
namespace hardware {
namespace audio {
namespace common {
namespace V2_0 {
namespace implementation {

typedef common::V2_0::AudioDevice AudioDeviceBitfield;
typedef common::V2_0::AudioChannelMask AudioChannelBitfield;
typedef common::V2_0::AudioOutputFlag AudioOutputFlagBitfield;
typedef common::V2_0::AudioInputFlag AudioInputFlagBitfield;

}  // namespace implementation
}  // namespace V2_0
}  // namespace common
}  // namespace audio
}  // namespace hardware
}  // namespace android

#endif  // ANDROID_HARDWARE_AUDIO_EFFECT_VERSION_UTILS_H
Loading