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 boundary_sanitize = true 25 integer_overflow = true 26 ubsan = true 27 } 28 stack_protector_ret = true 29 30 include_dirs = [ 31 "include/interfaces", 32 "include/eventbus", 33 "include/pipeline", 34 "include/utils", 35 "include/pipeline_node/multimedia_codec/decoder", 36 "include/pipeline_node/multimedia_codec/encoder", 37 "include/pipeline_node/fpscontroller", 38 "include/pipeline_node/scale_conversion", 39 "${common_path}/include/constants", 40 "${common_path}/include/utils", 41 "${feeding_smoother_path}/base", 42 "${feeding_smoother_path}/derived", 43 "${feeding_smoother_path}/utils", 44 "${innerkits_path}/native_cpp/camera_source/include", 45 "${services_path}/cameraservice/base/include", 46 ] 47 48 sources = [ 49 "${services_path}/cameraservice/base/src/dcamera_sink_frame_info.cpp", 50 "src/pipeline/abstract_data_process.cpp", 51 "src/pipeline/dcamera_pipeline_sink.cpp", 52 "src/pipeline/dcamera_pipeline_source.cpp", 53 "src/pipeline_node/fpscontroller/fps_controller_process.cpp", 54 "src/pipeline_node/multimedia_codec/decoder/decode_surface_listener.cpp", 55 "src/pipeline_node/multimedia_codec/decoder/decode_video_callback.cpp", 56 "src/pipeline_node/multimedia_codec/encoder/encode_data_process.cpp", 57 "src/pipeline_node/multimedia_codec/encoder/encode_video_callback.cpp", 58 "src/utils/image_common_type.cpp", 59 "src/utils/property_carrier.cpp", 60 ] 61 62 deps = [ "${common_path}:distributed_camera_utils" ] 63 64 external_deps = [ 65 "av_codec:av_codec_client", 66 "cJSON:cjson", 67 "c_utils:utils", 68 "drivers_interface_display:libdisplay_composer_hdi_impl_1.2", 69 "drivers_interface_display:libdisplay_composer_proxy_1.0", 70 "eventhandler:libeventhandler", 71 "graphic_surface:surface", 72 "hilog:libhilog", 73 "hitrace:hitrace_meter", 74 "media_foundation:media_foundation", 75 "safwk:system_ability_fwk", 76 "samgr:samgr_proxy", 77 ] 78 79 if (!distributed_camera_common) { 80 sources += [ 81 "src/pipeline_node/multimedia_codec/decoder/decode_data_process.cpp", 82 "src/pipeline_node/scale_conversion/scale_convert_process.cpp", 83 ] 84 } else { 85 sources += [ 86 "src/pipeline_node/multimedia_codec/decoder/decode_data_process_common.cpp", 87 "src/pipeline_node/scale_conversion/scale_convert_process_common.cpp", 88 ] 89 external_deps += [ "ffmpeg:libohosffmpeg" ] 90 } 91 92 cflags = [ 93 "-fPIC", 94 "-Wall", 95 ] 96 97 if (distributed_camera_common) { 98 cflags += [ "-DDCAMERA_SUPPORT_FFMPEG" ] 99 } else { 100 cflags += [ "-DDCAMERA_MMAP_RESERVE" ] 101 } 102 103 defines = [ 104 "HI_LOG_ENABLE", 105 "DH_LOG_TAG=\"dcameradataproc\"", 106 "LOG_DOMAIN=0xD004150", 107 ] 108 109 if (build_variant == "root") { 110 defines += [ "DUMP_DCAMERA_FILE" ] 111 } 112 113 subsystem_name = "distributedhardware" 114 115 part_name = "distributed_camera" 116} 117