1# Copyright (c) 2024 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. 13 14import("//foundation/multimedia/media_foundation/config.gni") 15import("$histreamer_root_dir/video_processing_engine/config.gni") 16 17if (hst_is_standard_sys) { 18 config("vpe_capi_config") { 19 cflags = [ 20 "-fno-exceptions", 21 "-Wall", 22 "-fno-common", 23 "-fstack-protector-all", 24 "-Wshadow", 25 "-FPIC", 26 "-FS", 27 "-O2", 28 "-D_FORTIFY_SOURCE=2", 29 "-Wformat=2", 30 "-Wdate-time", 31 ] 32 33 cflags_cc = [ 34 "-std=c++17", 35 "-fno-rtti", 36 ] 37 } 38 39 config("vpe_capi_public_config") { 40 include_dirs = [ 41 "$vpe_interface_capi_dir", 42 "$vpe_interface_inner_dir", 43 ] 44 } 45 46 ohos_shared_library("image_processing") { 47 stack_protector_ret = true 48 install_enable = true 49 50 sanitize = { 51 boundary_sanitize = true 52 cfi = true 53 cfi_cross_dso = true 54 integer_overflow = true 55 ubsan = true 56 debug = false 57 } 58 59 configs = [ ":vpe_capi_config" ] 60 public_configs = [ ":vpe_capi_public_config" ] 61 62 include_dirs = [ 63 "$vpe_interface_capi_dir", 64 "$vpe_interface_inner_dir", 65 "$vpe_dfx_dir/include", 66 "$vpe_capi_image_dir/include", 67 "$vpe_capi_image_dir/detail_enhancer/include", 68 "$vpe_algorithm_dir/include", 69 "$vpe_algorithm_dir/detail_enhancer/include", 70 ] 71 72 sources = [ 73 "$vpe_algorithm_dir/detail_enhancer/detail_enhancer.cpp", 74 "$vpe_capi_image_dir/detail_enhancer/detail_enhancer_image_native.cpp", 75 "$vpe_capi_image_dir/image_processing.cpp", 76 "$vpe_capi_image_dir/image_processing_capability.cpp", 77 "$vpe_capi_image_dir/image_processing_impl.cpp", 78 "$vpe_capi_image_dir/image_processing_loader.cpp", 79 "$vpe_capi_image_dir/image_processing_native.cpp", 80 ] 81 82 defines = [] 83 84 deps = [ "$vpe_base_root_dir/src:media_foundation" ] 85 86 external_deps = [ 87 "c_utils:utils", 88 "graphic_2d:2d_graphics", 89 "hilog:libhilog", 90 "hitrace:hitrace_meter", 91 "image_framework:image_native", 92 "image_framework:pixelmap", 93 "ipc:ipc_single", 94 ] 95 96 if (has_skia) { 97 defines += [ "SKIA_ENABLE" ] 98 external_deps += [ "skia:skia_canvaskit" ] 99 include_dirs += [ "$vpe_algorithm_dir/detail_enhancer/skia/include" ] 100 sources += [ "$vpe_algorithm_dir/detail_enhancer/skia/skia_impl.cpp" ] 101 } 102 103 innerapi_tags = [ "ndk" ] 104 output_extension = "so" 105 subsystem_name = "multimedia" 106 part_name = "media_foundation" 107 } 108 109 ohos_shared_library("video_processing") { 110 stack_protector_ret = true 111 install_enable = true 112 113 sanitize = { 114 boundary_sanitize = true 115 cfi = true 116 cfi_cross_dso = true 117 integer_overflow = true 118 ubsan = true 119 debug = false 120 } 121 122 configs = [ ":vpe_capi_config" ] 123 public_configs = [ ":vpe_capi_public_config" ] 124 125 include_dirs = [ 126 "$vpe_interface_capi_dir", 127 "$vpe_interface_inner_dir", 128 "$vpe_dfx_dir/include", 129 "$vpe_capi_video_dir/include", 130 "$vpe_capi_video_dir/detail_enhancer/include", 131 "$vpe_algorithm_dir/include", 132 "$vpe_algorithm_dir/detail_enhancer/include", 133 ] 134 135 sources = [ 136 "$vpe_algorithm_dir/detail_enhancer/detail_enhancer.cpp", 137 "$vpe_capi_video_dir/detail_enhancer/detail_enhancer_video_native.cpp", 138 "$vpe_capi_video_dir/video_processing.cpp", 139 "$vpe_capi_video_dir/video_processing_callback_impl.cpp", 140 "$vpe_capi_video_dir/video_processing_callback_native.cpp", 141 "$vpe_capi_video_dir/video_processing_capability.cpp", 142 "$vpe_capi_video_dir/video_processing_impl.cpp", 143 "$vpe_capi_video_dir/video_processing_loader.cpp", 144 "$vpe_capi_video_dir/video_processing_native.cpp", 145 ] 146 147 defines = [] 148 149 deps = [ "$vpe_base_root_dir/src:media_foundation" ] 150 151 external_deps = [ 152 "c_utils:utils", 153 "graphic_surface:surface", 154 "hilog:libhilog", 155 "hitrace:hitrace_meter", 156 "ipc:ipc_single", 157 ] 158 159 if (has_skia) { 160 defines += [ "SKIA_ENABLE" ] 161 external_deps += [ "skia:skia_canvaskit" ] 162 include_dirs += [ "$vpe_algorithm_dir/detail_enhancer/skia/include" ] 163 sources += [ "$vpe_algorithm_dir/detail_enhancer/skia/skia_impl.cpp" ] 164 } 165 166 innerapi_tags = [ "ndk" ] 167 output_extension = "so" 168 subsystem_name = "multimedia" 169 part_name = "media_foundation" 170 } 171} else { 172 group("image_processing") { 173 } 174 group("video_processing") { 175 } 176} 177