# Copyright (c) 2022 Huawei Device Co., Ltd. # 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. import("//build/ohos.gni") import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") CODEC_OEM_PATH = rebase_path("//device/soc/${device_company}/${product_name}/hardware/codec") cmd = "if [ -f ${CODEC_OEM_PATH}/BUILD.gn ]; then echo true; else echo false; fi" HAVE_CODEC_OEM_PATH = exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value") ohos_executable("codec_hdi_adapter_decode") { if (HAVE_CODEC_OEM_PATH) { include_dirs = [ "./include", "${CODEC_OEM_PATH}/include", "${CODEC_OEM_PATH}/../mpp/include", "//drivers/peripheral/codec/hal/include", "//drivers/peripheral/codec/interfaces/include", "//third_party/openmax/api/1.1.2", "//drivers/peripheral/display/hdi_service/gralloc/include", ] sources = [ "src/codec_hdi_adapter_decode.cpp", "src/command_adapter_parse.cpp", ] deps = [ "//drivers/hdf_core/adapter/uhdf2/hdi:libhdi", "//drivers/hdf_core/adapter/uhdf2/utils:libhdf_utils", "//drivers/peripheral/codec/hal/passthrough:libcodec_hdi_passthrough_impl", "//third_party/bounds_checking_function:libsec_shared", ] } if (is_standard_system) { external_deps = [ "c_utils:utils", "drivers_peripheral_display:hdi_gralloc_client", "graphic_chipsetsdk:buffer_handle", "hiviewdfx_hilog_native:libhilog", ] } else { external_deps = [ "hilog:libhilog" ] } install_enable = false install_images = [ chipset_base_dir ] subsystem_name = "hdf" part_name = "drivers_peripheral_codec" } ohos_executable("codec_hdi_adapter_encode") { if (HAVE_CODEC_OEM_PATH) { include_dirs = [ "./include", "${CODEC_OEM_PATH}/include", "${CODEC_OEM_PATH}/../mpp/include", "//drivers/peripheral/codec/hal/include", "//drivers/hdf_core/adapter/uhdf2/include/hdi", "//drivers/peripheral/codec/interfaces/include", "//third_party/openmax/api/1.1.2", "//drivers/peripheral/display/hdi_service/gralloc/include", ] sources = [ "src/codec_hdi_adapter_encode.cpp", "src/command_adapter_parse.cpp", ] deps = [ "//drivers/hdf_core/adapter/uhdf2/hdi:libhdi", "//drivers/hdf_core/adapter/uhdf2/utils:libhdf_utils", "//drivers/peripheral/codec/hal/passthrough:libcodec_hdi_passthrough_impl", "//third_party/bounds_checking_function:libsec_shared", ] } if (is_standard_system) { external_deps = [ "c_utils:utils", "drivers_peripheral_display:hdi_gralloc_client", "graphic_chipsetsdk:buffer_handle", "hiviewdfx_hilog_native:libhilog", ] } else { external_deps = [ "hilog:libhilog" ] } install_enable = false install_images = [ chipset_base_dir ] subsystem_name = "hdf" part_name = "drivers_peripheral_codec" } group("codec_hdi_adapter_demo") { deps = [ ":codec_hdi_adapter_decode", ":codec_hdi_adapter_encode", ] }