1 /* 2 * Copyright (C) 2023 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #pragma once 18 19 /** 20 * Conversions between the NDK and CPP backends for common types. 21 */ 22 #include <aidl/android/media/audio/common/AudioFormatDescription.h> 23 #include <aidl/android/media/audio/common/AudioHalEngineConfig.h> 24 #include <aidl/android/media/audio/common/AudioMMapPolicyInfo.h> 25 #include <aidl/android/media/audio/common/AudioMMapPolicyType.h> 26 #include <aidl/android/media/audio/common/AudioMode.h> 27 #include <aidl/android/media/audio/common/AudioPort.h> 28 #include <android/media/audio/common/AudioFormatDescription.h> 29 #include <android/media/audio/common/AudioHalEngineConfig.h> 30 #include <android/media/audio/common/AudioMMapPolicyInfo.h> 31 #include <android/media/audio/common/AudioMMapPolicyType.h> 32 #include <android/media/audio/common/AudioMode.h> 33 #include <android/media/audio/common/AudioPort.h> 34 #include <media/AidlConversionUtil.h> 35 36 namespace android { 37 38 #define DECLARE_CONVERTERS(packageName, className) \ 39 ConversionResult<::aidl::packageName::className> \ 40 cpp2ndk_##className(const ::packageName::className& cpp); \ 41 ConversionResult<::packageName::className> \ 42 ndk2cpp_##className(const ::aidl::packageName::className& ndk); 43 44 DECLARE_CONVERTERS(android::media::audio::common, AudioFormatDescription); 45 DECLARE_CONVERTERS(android::media::audio::common, AudioHalEngineConfig); 46 DECLARE_CONVERTERS(android::media::audio::common, AudioMMapPolicyInfo); 47 DECLARE_CONVERTERS(android::media::audio::common, AudioMMapPolicyType); 48 DECLARE_CONVERTERS(android::media::audio::common, AudioMode); 49 DECLARE_CONVERTERS(android::media::audio::common, AudioPort); 50 51 #undef DECLARE_CONVERTERS 52 53 } // namespace android 54