1# Copyright (c) 2021-2025 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("./../../multimedia_camera_framework.gni") 16 17_common_sources = [ 18 "${multimedia_camera_framework_path}/frameworks/native/camera/base/src/utils/dps_metadata_info.cpp", 19 "src/base/basic_definitions.cpp", 20 "src/base/buffer_manager/shared_buffer.cpp", 21 "src/base/command_server/command.cpp", 22 "src/base/command_server/command_server.cpp", 23 "src/base/command_server/command_server_impl.cpp", 24 "src/base/dps.cpp", 25 "src/base/image_info.cpp", 26 "src/deferred_processing_service.cpp", 27 "src/dfx/dps_event_report.cpp", 28 "src/dfx/dps_video_report.cpp", 29 "src/event_monitor/command/event_status_change_command.cpp", 30 "src/event_monitor/events_info.cpp", 31 "src/event_monitor/events_monitor.cpp", 32 "src/event_monitor/events_subscriber.cpp", 33 "src/event_monitor/impl/battery_level_strategy.cpp", 34 "src/event_monitor/impl/battery_strategy.cpp", 35 "src/event_monitor/impl/camera_strategy.cpp", 36 "src/event_monitor/impl/charging_strategy.cpp", 37 "src/event_monitor/impl/screen_strategy.cpp", 38 "src/event_monitor/impl/thermal_strategy.cpp", 39 "src/post_processor/command/photo_process_command.cpp", 40 "src/post_processor/command/service_died_command.cpp", 41 "src/post_processor/command/video_process_command.cpp", 42 "src/post_processor/photo_post_processor.cpp", 43 "src/post_processor/photo_process_result.cpp", 44 "src/post_processor/video_post_processor.cpp", 45 "src/post_processor/video_process_result.cpp", 46 "src/schedule/base/state_machine.cpp", 47 "src/schedule/photo_processor/deferred_photo_controller.cpp", 48 "src/schedule/photo_processor/deferred_photo_processor.cpp", 49 "src/schedule/photo_processor/deferred_photo_result.cpp", 50 "src/schedule/photo_processor/command/notify_job_changed_command.cpp", 51 "src/schedule/photo_processor/photo_job_repository/deferred_photo_job.cpp", 52 "src/schedule/photo_processor/photo_job_repository/photo_job_queue.cpp", 53 "src/schedule/photo_processor/photo_job_repository/photo_job_repository.cpp", 54 "src/schedule/photo_processor/strategy/photo_strategy_center.cpp", 55 "src/schedule/scheduler_coordinator.cpp", 56 "src/schedule/scheduler_manager.cpp", 57 "src/schedule/state/photo_camera_state.cpp", 58 "src/schedule/state/photo_hal_state.cpp", 59 "src/schedule/state/photo_media_library_state.cpp", 60 "src/schedule/state/photo_temperature_state.cpp", 61 "src/schedule/state/photo_trailing_state.cpp", 62 "src/schedule/state/state_factory.cpp", 63 "src/schedule/state/video_battery_level_state.cpp", 64 "src/schedule/state/video_battery_state.cpp", 65 "src/schedule/state/video_camera_state.cpp", 66 "src/schedule/state/video_charging_state.cpp", 67 "src/schedule/state/video_hal_state.cpp", 68 "src/schedule/state/video_media_library_state.cpp", 69 "src/schedule/state/video_photo_process_state.cpp", 70 "src/schedule/state/video_screen_state.cpp", 71 "src/schedule/state/video_temperature_state.cpp", 72 "src/schedule/video_processor/deferred_video_controller.cpp", 73 "src/schedule/video_processor/deferred_video_processor.cpp", 74 "src/schedule/video_processor/strategy/video_strategy_center.cpp", 75 "src/schedule/video_processor/video_job_repository/deferred_video_job.cpp", 76 "src/schedule/video_processor/video_job_repository/video_job_queue.cpp", 77 "src/schedule/video_processor/video_job_repository/video_job_repository.cpp", 78 "src/session/command/photo_command.cpp", 79 "src/session/command/session_command.cpp", 80 "src/session/command/sync_command.cpp", 81 "src/session/command/video_command.cpp", 82 "src/session/photo_session/deferred_photo_processing_session.cpp", 83 "src/session/photo_session/photo_session_info.cpp", 84 "src/session/session_coordinator.cpp", 85 "src/session/session_manager.cpp", 86 "src/session/video_session/deferred_video_processing_session.cpp", 87 "src/session/video_session/video_session_info.cpp", 88 "src/utils/dp_power_manager.cpp", 89 "src/utils/dp_timer.cpp", 90 "src/utils/dp_utils.cpp", 91] 92 93_common_cflags = [ 94 "-fPIC", 95 "-Wall", 96 "-Os", 97 "-fstack-protector-strong", 98] 99 100_common_ldflags = [ 101 "-Wl,-z,relro,-z,now", 102 "-fPIE", 103] 104 105_common_sanitize = { 106 boundary_sanitize = true # Enable boundary san detection 107 cfi = true # Enable/disable control flow integrity detection 108 cfi_cross_dso = true # Cross-SO CFI Checks 109 debug = false 110 integer_overflow = true # Enable integer overflow detection 111 ubsan = true # Enable some Ubsan options 112} 113 114_common_include_dirs = [ 115 "${multimedia_camera_framework_path}/services/deferred_processing_service/include", 116 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/base", 117 "${multimedia_camera_framework_path}/services/deferred_processing_service/binder/base/include", 118 "${multimedia_camera_framework_path}/services/deferred_processing_service/binder/client/include", 119 "${multimedia_camera_framework_path}/services/deferred_processing_service/binder/server/include", 120 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/base/buffer_manager", 121 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/base/command_server", 122 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/base/task_manager", 123 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/base/task_manager/task_group", 124 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/base/timer", 125 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/base/timer/core", 126 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/dfx", 127 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/event_monitor", 128 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/event_monitor/base", 129 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/event_monitor/command", 130 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/event_monitor/impl", 131 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/post_processor", 132 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/post_processor/command", 133 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/schedule", 134 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/schedule/base", 135 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/schedule/state", 136 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/schedule/photo_processor", 137 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/schedule/photo_processor/command", 138 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/schedule/photo_processor/photo_job_repository", 139 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/schedule/photo_processor/strategy", 140 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/schedule/video_processor", 141 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/schedule/video_processor/strategy", 142 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/schedule/video_processor/video_job_repository", 143 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/session", 144 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/session/command", 145 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/session/photo_session", 146 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/session/video_session", 147 "${multimedia_camera_framework_path}/services/deferred_processing_service/include/utils", 148 "${multimedia_camera_framework_path}/interfaces/inner_api/native/camera/include/utils", 149] 150 151if (target_cpu == "arm") { 152 _common_cflags += [ "-DBINDER_IPC_32BIT" ] 153} 154if (build_variant == "user") { 155 _common_cflags += [ "-DIS_RELEASE_VERSION" ] 156} 157_common_deps = [ 158 "${multimedia_camera_framework_path}/common:camera_utils", 159 "${multimedia_camera_framework_path}/services/deferred_processing_service/idls:camera_deferred_idl_sa_stub", 160 ] 161 162_common_public_configs = [ "${multimedia_camera_framework_path}/services/deferred_processing_service/idls:deferred_processing_service_idl_config", ] 163 164_common_external_deps = [ 165 "ability_base:want", 166 "access_token:libaccesstoken_sdk", 167 "access_token:libprivacy_sdk", 168 "bundle_framework:appexecfwk_base", 169 "bundle_framework:appexecfwk_core", 170 "c_utils:utils", 171 "common_event_service:cesfwk_innerkits", 172 "drivers_interface_camera:libcamera_proxy_1.0", 173 "drivers_interface_camera:libcamera_proxy_1.1", 174 "drivers_interface_camera:libcamera_proxy_1.2", 175 "drivers_interface_camera:libcamera_proxy_1.3", 176 "drivers_interface_camera:libcamera_proxy_1.4", 177 "drivers_interface_camera:libmap_data_sequenceable_1.0", 178 "drivers_interface_camera:metadata", 179 "graphic_2d:librender_service_client", 180 "graphic_surface:buffer_handle", 181 "graphic_surface:surface", 182 "hdf_core:libhdi", 183 "hicollie:libhicollie", 184 "hilog:libhilog", 185 "hisysevent:libhisysevent", 186 "hitrace:hitrace_meter", 187 "init:libbegetutil", 188 "ipc:ipc_core", 189 "ipc:ipc_single", 190 "safwk:system_ability_fwk", 191 "samgr:samgr_proxy", 192 "window_manager:libdm", 193] 194 195if (use_musl) { 196 if (musl_use_jemalloc && musl_use_jemalloc_dfx_intf) { 197 _common_cflags += [ "-DCONFIG_USE_JEMALLOC_DFX_INTF" ] 198 } 199} 200 201_common_defines = [] 202if (use_thermal_manager) { 203 _common_external_deps += [ "thermal_manager:thermalsrv_client" ] 204 _common_defines += [ "CAMERA_USE_THERMAL" ] 205} 206 207if (use_battery_manager) { 208 _common_external_deps += [ "battery_manager:batterysrv_client" ] 209 _common_defines += [ "CAMERA_USE_BATTERY" ] 210} 211 212if (use_power_manager) { 213 _common_external_deps += [ "power_manager:powermgr_client" ] 214 _common_defines += [ "CAMERA_USE_POWER" ] 215} 216 217ohos_shared_library("deferred_processing_service") { 218 sources = _common_sources 219 include_dirs = _common_include_dirs 220 deps = _common_deps 221 external_deps = _common_external_deps 222 public_configs = _common_public_configs 223 cflags = _common_cflags 224 cflags += [ "-fvisibility=hidden" ] 225 cflags_cc = cflags 226 ldflags = _common_ldflags 227 defines = _common_defines 228 229 install_enable = true 230 231 stack_protector_ret = true 232 sanitize = _common_sanitize 233 part_name = "camera_framework" 234 subsystem_name = "multimedia" 235} 236 237ohos_static_library("deferred_processing_service_test_only") { 238 sources = _common_sources 239 include_dirs = _common_include_dirs 240 deps = _common_deps 241 external_deps = _common_external_deps 242 public_configs = _common_public_configs 243 cflags = _common_cflags 244 cflags_cc = cflags 245 ldflags = _common_ldflags 246 defines = _common_defines 247 248 stack_protector_ret = true 249 sanitize = _common_sanitize 250 251 part_name = "camera_framework" 252 subsystem_name = "multimedia" 253}