diff --git a/audio/BUILD.gn b/audio/BUILD.gn index d960654e53e3097b16e017408f1134079b058425..351ab9a2237c8be3614fefb05771997291a9459d 100755 --- a/audio/BUILD.gn +++ b/audio/BUILD.gn @@ -41,8 +41,8 @@ group("hdi_audio") { } else { deps += [ "config/linux:hdf_audio_json", - "hal/hdi_binder/proxy:audio_hdi_proxy_server", - "hal/hdi_binder/server:audio_hdi_adapter_server", + "hal/hdi_binder/proxy:hdi_audio_client", + "hal/hdi_binder/server:hdi_audio_server", ] } diff --git a/audio/hal/hdi_binder/proxy/BUILD.gn b/audio/hal/hdi_binder/proxy/BUILD.gn index ef932c02df8128edfb22adabd680e7a53bcf28f3..282a9024ace41609b37ecc910722a6517fe6aef4 100755 --- a/audio/hal/hdi_binder/proxy/BUILD.gn +++ b/audio/hal/hdi_binder/proxy/BUILD.gn @@ -47,124 +47,129 @@ config("hdi_service_proxy_config") { ldflags = [ "-Wl" ] } -if (defined(ohos_lite)) { - shared_library("audio_hdi_proxy_server") { - include_dirs = [ - "//drivers/peripheral/audio/interfaces/include", - "//drivers/peripheral/audio/hal/hdi_passthrough/include", - "//drivers/peripheral/audio/hal/hdi_binder/proxy/include", - "//drivers/peripheral/audio/hal/hdi_binder/server/include", - "$hdf_framework_path/include/core", - "$hdf_framework_path/include/utils", - "$hdf_framework_path/include/osal", - "$hdf_framework_path/ability/sbuf/include", - "$hdf_framework_path/utils/include", - "$hdf_framework_path/include", - "$hdf_framework_path/core/sec/include", - "$hdf_framework_path/core/shared/include", - "$hdf_framework_path/core/host/include", - "$hdf_framework_path/core/manager/include", - "$hdf_framework_path/core/common/include/host/", - "//third_party/cJSON", - "//third_party/bounds_checking_function/include", - "//drivers/adapter/khdf/liteos/osal/include", - "$hdf_uhdf_path/shared/include", - "$hdf_uhdf_path/include/hdi/", - "$hdf_uhdf_path/host/include", - ] - - sources = [ - "$hdf_framework_path/ability/sbuf/src/hdf_sbuf.c", - "//drivers/peripheral/audio/hal/hdi_passthrough/src/audio_adapter_info_common.c", - "//drivers/peripheral/audio/hal/hdi_passthrough/src/audio_common.c", - "//third_party/cJSON/cJSON.c", - "src/audio_proxy_adapter.c", - "src/audio_proxy_capture.c", - "src/audio_proxy_common.c", - "src/audio_proxy_manager.c", - "src/audio_proxy_render.c", - ] - - deps = [ - "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio", - "//third_party/bounds_checking_function:libsec_shared", - ] - - if (enable_audio_hal_hdf_log) { - defines = [ "AUDIO_HAL_HDF_LOG" ] - } +if ("$product_name" != "ohos-arm64") { + import("//vendor/$product_company/$product_name/hals/audio/product.gni") +} +if (!defined(enable_hdf_proxy_stub) || enable_hdf_proxy_stub == true) { + if (defined(ohos_lite)) { + shared_library("hdi_audio_client") { + include_dirs = [ + "//drivers/peripheral/audio/interfaces/include", + "//drivers/peripheral/audio/hal/hdi_passthrough/include", + "//drivers/peripheral/audio/hal/hdi_binder/proxy/include", + "//drivers/peripheral/audio/hal/hdi_binder/server/include", + "$hdf_framework_path/include/core", + "$hdf_framework_path/include/utils", + "$hdf_framework_path/include/osal", + "$hdf_framework_path/ability/sbuf/include", + "$hdf_framework_path/utils/include", + "$hdf_framework_path/include", + "$hdf_framework_path/core/sec/include", + "$hdf_framework_path/core/shared/include", + "$hdf_framework_path/core/host/include", + "$hdf_framework_path/core/manager/include", + "$hdf_framework_path/core/common/include/host/", + "//third_party/cJSON", + "//third_party/bounds_checking_function/include", + "//drivers/adapter/khdf/liteos/osal/include", + "$hdf_uhdf_path/shared/include", + "$hdf_uhdf_path/include/hdi/", + "$hdf_uhdf_path/host/include", + ] - public_configs = [ ":hdi_service_proxy_config" ] - } + sources = [ + "$hdf_framework_path/ability/sbuf/src/hdf_sbuf.c", + "//drivers/peripheral/audio/hal/hdi_passthrough/src/audio_adapter_info_common.c", + "//drivers/peripheral/audio/hal/hdi_passthrough/src/audio_common.c", + "//third_party/cJSON/cJSON.c", + "src/audio_proxy_adapter.c", + "src/audio_proxy_capture.c", + "src/audio_proxy_common.c", + "src/audio_proxy_manager.c", + "src/audio_proxy_render.c", + ] - lite_component("hdi_audio") { - features = [ ":audio_hdi_proxy_server" ] - } -} else { - ohos_shared_library("audio_hdi_proxy_server") { - include_dirs = [ - "//drivers/peripheral/audio/interfaces/include", - "//drivers/peripheral/audio/hal/hdi_passthrough/include", - "//drivers/peripheral/audio/hal/hdi_binder/proxy/include", - "//drivers/peripheral/audio/hal/hdi_binder/server/include", - "//third_party/cJSON", - "$hdf_framework_path/include/core", - "$hdf_framework_path/include/utils", - "$hdf_framework_path/include/osal", - "$hdf_framework_path/include", - "//third_party/bounds_checking_function/include", - "$hdf_framework_path/ability/sbuf/include", - "$hdf_framework_path/utils/include", - "$hdf_framework_path/ability/sbuf/include", - "$hdf_uhdf_path/osal/include", - "$hdf_framework_path/include", - "$hdf_framework_path/core/sec/include", - "$hdf_framework_path/core/shared/include", - "$hdf_framework_path/core/host/include", - "$hdf_framework_path/core/manager/include", - "$hdf_uhdf_path/include/devhost", - "$hdf_uhdf_path/devhost/include", - "$hdf_uhdf_path/devmgr/include", - "$hdf_uhdf_path/host/include", - "$hdf_uhdf_path/manager/include", - "$hdf_uhdf_path/include/host", - ] - - sources = [ - "//drivers/peripheral/audio/hal/hdi_passthrough/src/audio_adapter_info_common.c", - "//drivers/peripheral/audio/hal/hdi_passthrough/src/audio_common.c", - "//third_party/cJSON/cJSON.c", - "src/audio_proxy_adapter.c", - "src/audio_proxy_capture.c", - "src/audio_proxy_common.c", - "src/audio_proxy_manager.c", - "src/audio_proxy_render.c", - ] - - deps = [ - "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio", - "//utils/native/base:utils", - ] - - if (is_standard_system) { - external_deps = [ - "device_driver_framework:libhdf_host", - "device_driver_framework:libhdf_ipc_adapter", - "device_driver_framework:libhdf_utils", - "device_driver_framework:libhdi", - "hiviewdfx_hilog_native:libhilog", + deps = [ + "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio", + "//third_party/bounds_checking_function:libsec_shared", ] - } else { - external_deps = [ "hilog:libhilog" ] + + if (enable_audio_hal_hdf_log) { + defines = [ "AUDIO_HAL_HDF_LOG" ] + } + + public_configs = [ ":hdi_service_proxy_config" ] } - if (enable_audio_hal_hdf_log) { - defines = [ "AUDIO_HAL_HDF_LOG" ] + lite_component("hdi_audio") { + features = [ ":hdi_audio_client" ] } + } else { + ohos_shared_library("hdi_audio_client") { + include_dirs = [ + "//drivers/peripheral/audio/interfaces/include", + "//drivers/peripheral/audio/hal/hdi_passthrough/include", + "//drivers/peripheral/audio/hal/hdi_binder/proxy/include", + "//drivers/peripheral/audio/hal/hdi_binder/server/include", + "//third_party/cJSON", + "$hdf_framework_path/include/core", + "$hdf_framework_path/include/utils", + "$hdf_framework_path/include/osal", + "$hdf_framework_path/include", + "//third_party/bounds_checking_function/include", + "$hdf_framework_path/ability/sbuf/include", + "$hdf_framework_path/utils/include", + "$hdf_framework_path/ability/sbuf/include", + "$hdf_uhdf_path/osal/include", + "$hdf_framework_path/include", + "$hdf_framework_path/core/sec/include", + "$hdf_framework_path/core/shared/include", + "$hdf_framework_path/core/host/include", + "$hdf_framework_path/core/manager/include", + "$hdf_uhdf_path/include/devhost", + "$hdf_uhdf_path/devhost/include", + "$hdf_uhdf_path/devmgr/include", + "$hdf_uhdf_path/host/include", + "$hdf_uhdf_path/manager/include", + "$hdf_uhdf_path/include/host", + ] - public_configs = [ ":hdi_service_proxy_config" ] + sources = [ + "//drivers/peripheral/audio/hal/hdi_passthrough/src/audio_adapter_info_common.c", + "//drivers/peripheral/audio/hal/hdi_passthrough/src/audio_common.c", + "//third_party/cJSON/cJSON.c", + "src/audio_proxy_adapter.c", + "src/audio_proxy_capture.c", + "src/audio_proxy_common.c", + "src/audio_proxy_manager.c", + "src/audio_proxy_render.c", + ] - subsystem_name = "hdf" - part_name = "audio_device_driver" + deps = [ + "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio", + "//utils/native/base:utils", + ] + + if (is_standard_system) { + external_deps = [ + "device_driver_framework:libhdf_host", + "device_driver_framework:libhdf_ipc_adapter", + "device_driver_framework:libhdf_utils", + "device_driver_framework:libhdi", + "hiviewdfx_hilog_native:libhilog", + ] + } else { + external_deps = [ "hilog:libhilog" ] + } + + if (enable_audio_hal_hdf_log) { + defines = [ "AUDIO_HAL_HDF_LOG" ] + } + + public_configs = [ ":hdi_service_proxy_config" ] + + subsystem_name = "hdf" + part_name = "audio_device_driver" + } } } diff --git a/audio/hal/hdi_binder/server/BUILD.gn b/audio/hal/hdi_binder/server/BUILD.gn index ff131820a6cf0f767241db288079b9b3fc26b540..f901121fc030e985adc5dac60f74cdb93ecee865 100755 --- a/audio/hal/hdi_binder/server/BUILD.gn +++ b/audio/hal/hdi_binder/server/BUILD.gn @@ -47,92 +47,97 @@ config("hdi_service_config") { ldflags = [ "-Wl" ] } -if (defined(ohos_lite)) { - shared_library("audio_hdi_adapter_server") { - include_dirs = [ - "//drivers/peripheral/audio/interfaces/include", - "//drivers/peripheral/audio/hal/hdi_passthrough/include", - "//drivers/peripheral/audio/hal/hdi_binder/proxy/include", - "//drivers/peripheral/audio/hal/hdi_binder/server/include", - "$hdf_framework_path/core/sec/include", - "$hdf_framework_path/core/shared/include", - "$hdf_framework_path/core/host/include", - "$hdf_framework_path/core/manager/include", - "$hdf_framework_path/core/common/include/host/", - "//third_party/bounds_checking_function/include", - "//drivers/adapter/khdf/liteos/osal/include", - "//drivers/adapter/uhdf2/shared/include", - "//drivers/adapter/uhdf2/include/hdi/", - ] - - sources = [ - "$hdf_framework_path/support/posix/src/osal_mem.c", - "$hdf_framework_path/utils/src/hdf_sbuf.c", - "src/hdf_audio_server.c", - "src/hdf_audio_server_capture.c", - "src/hdf_audio_server_common.c", - "src/hdf_audio_server_render.c", - ] - - deps = [ - "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio", - "//third_party/bounds_checking_function:libsec_shared", - ] - - if (enable_audio_hal_hdf_log) { - defines = [ "AUDIO_HAL_HDF_LOG" ] - } +if ("$product_name" != "ohos-arm64") { + import("//vendor/$product_company/$product_name/hals/audio/product.gni") +} +if (!defined(enable_hdf_proxy_stub) || enable_hdf_proxy_stub == true) { + if (defined(ohos_lite)) { + shared_library("hdi_audio_server") { + include_dirs = [ + "//drivers/peripheral/audio/interfaces/include", + "//drivers/peripheral/audio/hal/hdi_passthrough/include", + "//drivers/peripheral/audio/hal/hdi_binder/proxy/include", + "//drivers/peripheral/audio/hal/hdi_binder/server/include", + "$hdf_framework_path/core/sec/include", + "$hdf_framework_path/core/shared/include", + "$hdf_framework_path/core/host/include", + "$hdf_framework_path/core/manager/include", + "$hdf_framework_path/core/common/include/host/", + "//third_party/bounds_checking_function/include", + "//drivers/adapter/khdf/liteos/osal/include", + "//drivers/adapter/uhdf2/shared/include", + "//drivers/adapter/uhdf2/include/hdi/", + ] - public_configs = [ ":hdi_service_config" ] - } + sources = [ + "$hdf_framework_path/support/posix/src/osal_mem.c", + "$hdf_framework_path/utils/src/hdf_sbuf.c", + "src/hdf_audio_server.c", + "src/hdf_audio_server_capture.c", + "src/hdf_audio_server_common.c", + "src/hdf_audio_server_render.c", + ] - lite_component("hdi") { - features = [ ":audio_hdi_adapter_server" ] - } -} else { - ohos_shared_library("audio_hdi_adapter_server") { - include_dirs = [ - "//drivers/peripheral/audio/interfaces/include", - "//drivers/peripheral/audio/hal/hdi_passthrough/include", - "//drivers/peripheral/audio/hal/hdi_binder/server/include", - "//third_party/bounds_checking_function/include", - ] - - sources = [ - "src/hdf_audio_server.c", - "src/hdf_audio_server_capture.c", - "src/hdf_audio_server_common.c", - "src/hdf_audio_server_render.c", - ] - - deps = [ - "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio", - "//utils/native/base:utils", - ] - - defines = [] - if (enable_audio_device_mpi) { - defines += [ "AUDIO_HAL_USER" ] - } - if (is_standard_system) { - external_deps = [ - "device_driver_framework:libhdf_host", - "device_driver_framework:libhdf_ipc_adapter", - "device_driver_framework:libhdf_utils", - "device_driver_framework:libhdi", - "hiviewdfx_hilog_native:libhilog", + deps = [ + "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio", + "//third_party/bounds_checking_function:libsec_shared", ] - } else { - external_deps = [ "hilog:libhilog" ] + + if (enable_audio_hal_hdf_log) { + defines = [ "AUDIO_HAL_HDF_LOG" ] + } + + public_configs = [ ":hdi_service_config" ] } - if (enable_audio_hal_hdf_log) { - defines += [ "AUDIO_HAL_HDF_LOG" ] + lite_component("hdi") { + features = [ ":hdi_audio_server" ] } + } else { + ohos_shared_library("hdi_audio_server") { + include_dirs = [ + "//drivers/peripheral/audio/interfaces/include", + "//drivers/peripheral/audio/hal/hdi_passthrough/include", + "//drivers/peripheral/audio/hal/hdi_binder/server/include", + "//third_party/bounds_checking_function/include", + ] - public_configs = [ ":hdi_service_config" ] + sources = [ + "src/hdf_audio_server.c", + "src/hdf_audio_server_capture.c", + "src/hdf_audio_server_common.c", + "src/hdf_audio_server_render.c", + ] + + deps = [ + "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio", + "//utils/native/base:utils", + ] - subsystem_name = "hdf" - part_name = "audio_device_driver" + defines = [] + if (enable_audio_device_mpi) { + defines += [ "AUDIO_HAL_USER" ] + } + if (is_standard_system) { + external_deps = [ + "device_driver_framework:libhdf_host", + "device_driver_framework:libhdf_ipc_adapter", + "device_driver_framework:libhdf_utils", + "device_driver_framework:libhdi", + "hiviewdfx_hilog_native:libhilog", + ] + } else { + external_deps = [ "hilog:libhilog" ] + } + + if (enable_audio_hal_hdf_log) { + defines += [ "AUDIO_HAL_HDF_LOG" ] + } + + public_configs = [ ":hdi_service_config" ] + + subsystem_name = "hdf" + part_name = "audio_device_driver" + } } } diff --git a/audio/hal/hdi_binder/server/src/hdf_audio_server.c b/audio/hal/hdi_binder/server/src/hdf_audio_server.c index 537720b8ac75c35507bc60b00af8522699d69250..0a7c13d14608c65b960c64cc315ef83ae488ab2b 100755 --- a/audio/hal/hdi_binder/server/src/hdf_audio_server.c +++ b/audio/hal/hdi_binder/server/src/hdf_audio_server.c @@ -547,7 +547,7 @@ int AudioHdiServerInit(struct HdfDeviceObject *deviceObject) struct HdfDriverEntry g_hdiServerEntry = { .moduleVersion = 1, - .moduleName = "audio_hdi_adapter_server", + .moduleName = "hdi_audio_server", .Bind = AudioHdiServerBind, .Init = AudioHdiServerInit, .Release = AudioHdiServerRelease, diff --git a/audio/sample/framework_capture.c b/audio/sample/framework_capture.c index 48d6de61cc1d404b1f5235d9057978cf4de0cd1e..ef90955327ec989ca764e47cc9c8d6532cba2b06 100755 --- a/audio/sample/framework_capture.c +++ b/audio/sample/framework_capture.c @@ -469,10 +469,10 @@ int32_t SelectLoadingMode(char *resolvedPath, int32_t pathLen, char *func, int32 int32_t ret; #ifdef __LITEOS__ soPathHdi = "/usr/lib/libhdi_audio.so"; - soPathProxy = "/usr/lib/libaudio_hdi_proxy_server.so"; + soPathProxy = "/usr/lib/libhdi_audio_client.so"; #else soPathHdi = "/system/lib/libhdi_audio.z.so"; - soPathProxy = "/system/lib/libaudio_hdi_proxy_server.z.so"; + soPathProxy = "/system/lib/libhdi_audio_client.z.so"; #endif PrintMenu1(); printf("Please enter your choice:"); diff --git a/audio/sample/framework_render.c b/audio/sample/framework_render.c index 1858dc614cb60a712c5b96fea427b18cf322e769..c0307ca577ada33d0f3cab4f539f0a85a085b0d0 100755 --- a/audio/sample/framework_render.c +++ b/audio/sample/framework_render.c @@ -626,10 +626,10 @@ int32_t SelectLoadingMode(char *resolvedPath, int32_t pathLen, char *func, int32 char *soPathProxy = NULL; #ifdef __LITEOS__ soPathHdi = "/usr/lib/libhdi_audio.so"; - soPathProxy = "/usr/lib/libaudio_hdi_proxy_server.so"; + soPathProxy = "/usr/lib/libhdi_audio_client.so"; #else soPathHdi = "/system/lib/libhdi_audio.z.so"; - soPathProxy = "/system/lib/libaudio_hdi_proxy_server.z.so"; + soPathProxy = "/system/lib/libhdi_audio_client.z.so"; #endif PrintMenu1(); printf("Please enter your choice:"); diff --git a/audio/test/fuzztest/common/include/audio_hdi_fuzzer_common.h b/audio/test/fuzztest/common/include/audio_hdi_fuzzer_common.h index 0c6c3a3b5506cd5389674fdca2c6dbae7661ff04..7345507a0ac566465b629821bba2c0472ab74d8d 100755 --- a/audio/test/fuzztest/common/include/audio_hdi_fuzzer_common.h +++ b/audio/test/fuzztest/common/include/audio_hdi_fuzzer_common.h @@ -53,7 +53,7 @@ using namespace std; #endif #ifdef AUDIO_ADM_SERVICE const std::string FUNCTION_NAME = "GetAudioProxyManagerFuncs"; - const std::string RESOLVED_PATH = "//system/lib/libaudio_hdi_proxy_server.z.so"; + const std::string RESOLVED_PATH = "//system/lib/libhdi_audio_client.z.so"; using TestAudioManager = struct AudioProxyManager; #endif const uint32_t INT_32_MAX = 0x7fffffff; diff --git a/audio/test/systemtest/common/hdi_common/include/audio_hdi_common.h b/audio/test/systemtest/common/hdi_common/include/audio_hdi_common.h index 633834ce5a1f4d08e5ab69a87f387b6c05f26a05..4dde9c8315ec2eef70d36790d5789ad7e60aef57 100755 --- a/audio/test/systemtest/common/hdi_common/include/audio_hdi_common.h +++ b/audio/test/systemtest/common/hdi_common/include/audio_hdi_common.h @@ -60,13 +60,13 @@ namespace Audio { #endif #ifdef AUDIO_ADM_SERVICE const std::string FUNCTION_NAME = "GetAudioProxyManagerFuncs"; - const std::string RESOLVED_PATH = "//system/lib/libaudio_hdi_proxy_server.z.so"; + const std::string RESOLVED_PATH = "//system/lib/libhdi_audio_client.z.so"; using TestAudioManager = struct AudioProxyManager; const int IS_ADM = true; #endif #ifdef AUDIO_MPI_SERVICE const std::string FUNCTION_NAME = "GetAudioProxyManagerFuncs"; - const std::string RESOLVED_PATH = "//system/lib/libaudio_hdi_proxy_server.z.so"; + const std::string RESOLVED_PATH = "//system/lib/libhdi_audio_client.z.so"; using TestAudioManager = struct AudioProxyManager; const int IS_ADM = false; #endif