1# Copyright (c) 2022 HiSilicon (Shanghai) Technologies CO., LIMITED. 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. 13 14import("//build/lite/config/component/lite_component.gni") 15lite_component("hi3516dv300_ai_sample") { 16 features = [ ":ohos_camera_ai_demo" ] 17} 18 19need_link_mpp_lib = true 20if (need_link_mpp_lib) { 21 mpp_lib_path = "//device/soc/hisilicon/hi3516dv300/sdk_linux/out" 22} 23 24need_link_opencv_lib = true 25if (need_link_opencv_lib) { 26 opencv_lib_path = "//device/soc/hisilicon/hi3516dv300/sdk_linux/sample/taurus/ai_sample/third_party" 27} 28 29executable("ohos_camera_ai_demo") { 30 output_name = "ohos_camera_ai_demo" 31 sources = [ 32 "//device/soc/hisilicon/hi3516dv300/sdk_linux/sample/platform/audio/adp/audio_aac_adp.c", 33 "//device/soc/hisilicon/hi3516dv300/sdk_linux/sample/platform/audio/adp/audio_dl_adp.c", 34 "//device/soc/hisilicon/hi3516dv300/sdk_linux/sample/platform/common/sample_comm_audio.c", 35 "//device/soc/hisilicon/hi3516dv300/sdk_linux/sample/platform/common/sample_comm_isp.c", 36 "//device/soc/hisilicon/hi3516dv300/sdk_linux/sample/platform/common/sample_comm_sys.c", 37 "//device/soc/hisilicon/hi3516dv300/sdk_linux/sample/platform/common/sample_comm_vi.c", 38 "//device/soc/hisilicon/hi3516dv300/sdk_linux/sample/platform/common/sample_comm_vo.c", 39 "//device/soc/hisilicon/hi3516dv300/sdk_linux/sample/platform/common/sample_comm_vpss.c", 40 "//device/soc/hisilicon/hi3516dv300/sdk_linux/sample/platform/svp/common/sample_comm_nnie.c", 41 "//device/soc/hisilicon/hi3516dv300/sdk_linux/sample/platform/svp/common/sample_comm_svp.c", 42 "//device/soc/hisilicon/hi3516dv300/sdk_linux/sample/platform/svp/nnie/sample_nnie_software/sample_svp_nnie_software.c", 43 "ai_infer_process/ai_infer_process.c", 44 "dependency/audio_test.c", 45 "ext_util/base_interface.c", 46 "ext_util/misc_util.c", 47 "ext_util/posix_help.c", 48 "interconnection_server/hisignalling.c", 49 "mpp_help/src/ive_img.c", 50 "mpp_help/src/osd_img.c", 51 "mpp_help/src/vgs_img.c", 52 "scenario/cnn_trash_classify/cnn_trash_classify.c", 53 "scenario/hand_classify/hand_classify.c", 54 "scenario/hand_classify/yolov2_hand_detect.c", 55 "scenario/tennis_detect/tennis_detect.cpp", 56 "smp/sample_ai_main.cpp", 57 "smp/sample_media_ai.c", 58 "smp/sample_media_opencv.cpp", 59 "third_party/src/iniparser/src/dictionary.c", 60 "third_party/src/iniparser/src/iniparser.c", 61 ] 62 63 include_dirs = [ 64 "//device/soc/hisilicon/hi3516dv300/sdk_linux/include", 65 "//device/soc/hisilicon/hi3516dv300/sdk_linux/drv/mpp/cbb/include", 66 "//device/soc/hisilicon/hi3516dv300/sdk_linux/drv/mpp/cbb/init", 67 "//device/soc/hisilicon/hi3516dv300/sdk_linux/mpp/include", 68 "ai_infer_process", 69 "smp", 70 "//device/soc/hisilicon/hi3516dv300/sdk_linux/sample/platform/common", 71 "//device/soc/hisilicon/hi3516dv300/sdk_linux/sample/platform/svp/common", 72 "//device/soc/hisilicon/hi3516dv300/sdk_linux/sample/platform/svp/nnie/sample_nnie_software", 73 "//device/soc/hisilicon/hi3516dv300/sdk_linux/sample/platform/audio/adp/", 74 "scenario/cnn_trash_classify", 75 "scenario/hand_classify", 76 "scenario/tennis_detect", 77 "mpp_help/include", 78 "ext_util", 79 "dependency", 80 "third_party/src/iniparser/src", 81 "third_party/output/opencv/include/opencv4", 82 "//third_party/bounds_checking_function/include", 83 "interconnection_server", 84 ] 85 86 defines = [ 87 "SENSOR0_TYPE=SONY_IMX335_MIPI_4M_30FPS_12BIT", 88 "SENSOR1_TYPE=SONY_IMX335_MIPI_4M_30FPS_12BIT", 89 ] 90 91 if (need_link_mpp_lib) { 92 outdir = rebase_path("$mpp_lib_path/lib") 93 ldflags = [ "-L$outdir" ] 94 ldflags += [ "-laaccomm" ] 95 ldflags += [ "-laacdec" ] 96 ldflags += [ "-laacenc" ] 97 ldflags += [ "-laacsbrdec" ] 98 ldflags += [ "-laacsbrenc" ] 99 ldflags += [ "-ldnvqe" ] 100 ldflags += [ "-lhdmi" ] 101 ldflags += [ "-lhi3516cv500_acodec" ] 102 ldflags += [ "-lhi3516cv500_adec" ] 103 ldflags += [ "-lhi3516cv500_aenc" ] 104 ldflags += [ "-lhi3516cv500_aio" ] 105 ldflags += [ "-lhi3516cv500_ai" ] 106 ldflags += [ "-lhi3516cv500_ao" ] 107 ldflags += [ "-lhi3516cv500_base" ] 108 ldflags += [ "-lhi3516cv500_chnl" ] 109 ldflags += [ "-lhi3516cv500_dis" ] 110 ldflags += [ "-lhi3516cv500_gdc" ] 111 ldflags += [ "-lhi3516cv500_h264e" ] 112 ldflags += [ "-lhi3516cv500_h265e" ] 113 ldflags += [ "-lhi3516cv500_isp" ] 114 ldflags += [ "-lhi3516cv500_ive" ] 115 ldflags += [ "-lhi3516cv500_jpegd" ] 116 ldflags += [ "-lhi3516cv500_jpege" ] 117 ldflags += [ "-lhi3516cv500_nnie" ] 118 ldflags += [ "-lhi3516cv500_rc" ] 119 ldflags += [ "-lhi3516cv500_rgn" ] 120 ldflags += [ "-lhi3516cv500_sys" ] 121 ldflags += [ "-lhi3516cv500_vdec" ] 122 ldflags += [ "-lhi3516cv500_vedu" ] 123 ldflags += [ "-lhi3516cv500_venc" ] 124 ldflags += [ "-lhi3516cv500_vfmw" ] 125 ldflags += [ "-lhi3516cv500_vgs" ] 126 ldflags += [ "-lhi3516cv500_vi" ] 127 ldflags += [ "-lhi3516cv500_vo" ] 128 ldflags += [ "-lhi3516cv500_vpss" ] 129 ldflags += [ "-l_hiacs" ] 130 ldflags += [ "-l_hiae" ] 131 ldflags += [ "-l_hiawb_natura" ] 132 ldflags += [ "-l_hiawb" ] 133 ldflags += [ "-l_hicalcflicker" ] 134 ldflags += [ "-l_hidehaze" ] 135 ldflags += [ "-l_hidrc" ] 136 ldflags += [ "-lhifisheyecalibrate" ] 137 ldflags += [ "-l_hiir_auto" ] 138 ldflags += [ "-lhi_irq" ] 139 ldflags += [ "-l_hildci" ] 140 ldflags += [ "-lhi_osal" ] 141 ldflags += [ "-lhi_sensor_i2c" ] 142 ldflags += [ "-lhive_AEC" ] 143 ldflags += [ "-lhive_AGC" ] 144 ldflags += [ "-lhive_ANR" ] 145 ldflags += [ "-lhive_common" ] 146 ldflags += [ "-lhive_EQ" ] 147 ldflags += [ "-lhive_HPF" ] 148 ldflags += [ "-lhive_record" ] 149 ldflags += [ "-lhive_RES_ext" ] 150 ldflags += [ "-lhive_RES" ] 151 ldflags += [ "-lhive_talkv2" ] 152 ldflags += [ "-lhive_wnr" ] 153 ldflags += [ "-lisp" ] 154 ldflags += [ "-live" ] 155 ldflags += [ "-lmd" ] 156 ldflags += [ "-lmpi" ] 157 ldflags += [ "-lmpp_vbs" ] 158 ldflags += [ "-lnnie" ] 159 ldflags += [ "-lsdk" ] 160 ldflags += [ "-lsecurec" ] 161 ldflags += [ "-lsns_imx335" ] 162 ldflags += [ "-ltde" ] 163 ldflags += [ "-lupvqe" ] 164 ldflags += [ "-lvb_server" ] 165 ldflags += [ "-lVoiceEngine" ] 166 167 opencv_lib_dir = rebase_path("$opencv_lib_path/output/opencv/lib") 168 ldflags += [ "-L$opencv_lib_dir" ] 169 ldflags += [ "-lopencv_world" ] 170 ldflags += [ "-Wl,-rpath=//userdata/lib" ] 171 172 deps = [] 173 } 174} 175