1# Copyright (c) 2021 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13import("//build/ohos.gni") 14import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") 15 16ohos_shared_library("libcodec_client") { 17 include_dirs = [ 18 "//drivers/hdf_core/adapter/uhdf2/include/hdi", 19 "//drivers/peripheral/codec/hdi_service/common", 20 "//drivers/peripheral/codec/interfaces/include", 21 ] 22 sources = [ 23 "codec_proxy/codec_callback_proxy.c", 24 "codec_proxy/codec_proxy.c", 25 "codec_proxy/proxy_msgproc.c", 26 "common/common_msgproc.c", 27 ] 28 29 if (is_standard_system) { 30 external_deps = [ 31 "c_utils:utils", 32 "drivers_peripheral_display:hdi_gralloc_client", 33 "graphic_chipsetsdk:buffer_handle", 34 "hdf_core:libhdf_ipc_adapter", 35 "hdf_core:libhdf_utils", 36 "hdf_core:libhdi", 37 "hiviewdfx_hilog_native:libhilog", 38 ] 39 } else { 40 external_deps = [ "hilog:libhilog" ] 41 } 42 43 install_images = [ chipset_base_dir ] 44 subsystem_name = "hdf" 45 part_name = "drivers_peripheral_codec" 46} 47 48group("codec_client") { 49 deps = [ ":libcodec_client" ] 50} 51 52ohos_shared_library("libcodec_server") { 53 include_dirs = [ 54 "//drivers/peripheral/codec/interfaces/include", 55 "//drivers/peripheral/codec/hdi_service/codec_proxy", 56 "//drivers/peripheral/codec/hdi_service/common/", 57 "//drivers/peripheral/codec/hal/v1.0/codec_instance/include", 58 "//drivers/peripheral/codec/hal/v1.0/share_mem/include", 59 "//drivers/peripheral/codec/hal/v1.0/oem_interface/include", 60 "//drivers/peripheral/codec/hal/v1.0/buffer_manager/include", 61 ] 62 sources = [ 63 "//drivers/peripheral/codec/hal/v1.0/codec_instance/src/codec_instance.c", 64 "//drivers/peripheral/codec/hal/v1.0/share_mem/src/ashmem_wrapper.cpp", 65 "//drivers/peripheral/codec/hal/v1.0/share_mem/src/share_mem.c", 66 "codec_service_stub/codec_callback_service.c", 67 "codec_service_stub/codec_callback_stub.c", 68 "codec_service_stub/codec_config_parser.c", 69 "codec_service_stub/codec_host.c", 70 "codec_service_stub/codec_service.c", 71 "codec_service_stub/codec_stub.c", 72 "codec_service_stub/stub_msgproc.c", 73 "common/common_msgproc.c", 74 ] 75 76 deps = [ "//drivers/peripheral/codec/hdi_service:codec_client" ] 77 78 if (is_standard_system) { 79 external_deps = [ 80 "c_utils:utils", 81 "drivers_peripheral_display:hdi_gralloc_client", 82 "graphic_chipsetsdk:buffer_handle", 83 "hdf_core:libhdf_host", 84 "hdf_core:libhdf_ipc_adapter", 85 "hdf_core:libhdf_utils", 86 "hiviewdfx_hilog_native:libhilog", 87 ] 88 } else { 89 external_deps = [ "hilog:libhilog" ] 90 } 91 92 install_images = [ chipset_base_dir ] 93 subsystem_name = "hdf" 94 part_name = "drivers_peripheral_codec" 95} 96 97group("codec_service") { 98 CODEC_OEM_PATH = rebase_path( 99 "//device/soc/${device_company}/${product_name}/hardware/codec") 100 cmd = "if [ -f ${CODEC_OEM_PATH}/BUILD.gn ]; then echo true; else echo false; fi" 101 HAVE_CODEC_OEM_PATH = 102 exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value") 103 104 if (HAVE_CODEC_OEM_PATH) { 105 deps = [ ":libcodec_server" ] 106 } 107} 108