1# Copyright (c) 2022-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("//build/ohos.gni") 15import("//build/ohos_var.gni") 16import( 17 "//foundation/distributedhardware/distributed_camera/distributedcamera.gni") 18 19ohos_shared_library("distributed_camera_data_process") { 20 sanitize = { 21 cfi = true 22 cfi_cross_dso = true 23 debug = false 24 blocklist = "./cfi_blocklist.txt" 25 boundary_sanitize = true 26 integer_overflow = true 27 ubsan = true 28 } 29 stack_protector_ret = true 30 include_dirs = [ 31 "${fwk_common_path}/utils/include", 32 "${fwk_utils_path}/include/eventbus", 33 "${graphicsurface_path}/surface/include", 34 "${services_path}/cameraservice/base/include", 35 ] 36 37 include_dirs += [ 38 "include/interfaces", 39 "include/eventbus", 40 "include/pipeline", 41 "include/utils", 42 "include/pipeline_node/multimedia_codec/decoder", 43 "include/pipeline_node/multimedia_codec/encoder", 44 "include/pipeline_node/fpscontroller", 45 "include/pipeline_node/scale_conversion", 46 "//third_party/json/include", 47 "${common_path}/include/constants", 48 "${common_path}/include/utils", 49 "${feeding_smoother_path}/base", 50 "${feeding_smoother_path}/derived", 51 "${feeding_smoother_path}/utils", 52 "${innerkits_path}/native_cpp/camera_source/include", 53 ] 54 55 sources = [ 56 "${services_path}/cameraservice/base/src/dcamera_sink_frame_info.cpp", 57 "src/pipeline/abstract_data_process.cpp", 58 "src/pipeline/dcamera_pipeline_sink.cpp", 59 "src/pipeline/dcamera_pipeline_source.cpp", 60 "src/pipeline_node/fpscontroller/fps_controller_process.cpp", 61 "src/pipeline_node/multimedia_codec/decoder/decode_surface_listener.cpp", 62 "src/pipeline_node/multimedia_codec/decoder/decode_video_callback.cpp", 63 "src/pipeline_node/multimedia_codec/encoder/encode_data_process.cpp", 64 "src/pipeline_node/multimedia_codec/encoder/encode_video_callback.cpp", 65 "src/utils/image_common_type.cpp", 66 "src/utils/property_carrier.cpp", 67 ] 68 69 deps = [ "${common_path}:distributed_camera_utils" ] 70 71 if (!distributed_camera_common) { 72 sources += [ 73 "src/pipeline_node/multimedia_codec/decoder/decode_data_process.cpp", 74 "src/pipeline_node/scale_conversion/scale_convert_process.cpp", 75 ] 76 } else { 77 include_dirs += [ "//third_party/ffmpeg/" ] 78 sources += [ 79 "src/pipeline_node/multimedia_codec/decoder/decode_data_process_common.cpp", 80 "src/pipeline_node/scale_conversion/scale_convert_process_common.cpp", 81 ] 82 deps += [ "//third_party/ffmpeg:libohosffmpeg" ] 83 } 84 85 cflags = [ 86 "-fPIC", 87 "-Wall", 88 ] 89 90 if (distributed_camera_common) { 91 cflags += [ "-DDCAMERA_SUPPORT_FFMPEG" ] 92 } 93 94 defines = [ 95 "HI_LOG_ENABLE", 96 "DH_LOG_TAG=\"dcameradataproc\"", 97 "LOG_DOMAIN=0xD004150", 98 ] 99 100 if (build_variant == "root") { 101 defines += [ "DUMP_DCAMERA_FILE" ] 102 } 103 104 external_deps = [ 105 "av_codec:av_codec_client", 106 "c_utils:utils", 107 "drivers_interface_display:libdisplay_composer_proxy_1.0", 108 "eventhandler:libeventhandler", 109 "graphic_surface:surface", 110 "hitrace:hitrace_meter", 111 "media_foundation:media_foundation", 112 "safwk:system_ability_fwk", 113 "samgr:samgr_proxy", 114 ] 115 116 if (!distributed_camera_common) { 117 external_deps += [ "libyuv:yuv" ] 118 } 119 subsystem_name = "distributedhardware" 120 121 part_name = "distributed_camera" 122} 123