11d3ffd26Sopenharmony_ci# Copyright (c) 2021-2023 Huawei Device Co., Ltd.
21d3ffd26Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
31d3ffd26Sopenharmony_ci# you may not use this file except in compliance with the License.
41d3ffd26Sopenharmony_ci# You may obtain a copy of the License at
51d3ffd26Sopenharmony_ci#
61d3ffd26Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
71d3ffd26Sopenharmony_ci#
81d3ffd26Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
91d3ffd26Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
101d3ffd26Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
111d3ffd26Sopenharmony_ci# See the License for the specific language governing permissions and
121d3ffd26Sopenharmony_ci# limitations under the License.
131d3ffd26Sopenharmony_ci
141d3ffd26Sopenharmony_ciimport("//build/ohos.gni")
151d3ffd26Sopenharmony_ciimport("./../../multimedia_camera_framework.gni")
161d3ffd26Sopenharmony_ci
171d3ffd26Sopenharmony_ciohos_shared_library("camera_service") {
181d3ffd26Sopenharmony_ci  branch_protector_ret = "pac_ret"
191d3ffd26Sopenharmony_ci  install_enable = true
201d3ffd26Sopenharmony_ci  sources = [
211d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/frameworks/native/camera/src/ability/camera_ability_parse_util.cpp",
221d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/frameworks/native/camera/src/output/camera_photo_proxy.cpp",
231d3ffd26Sopenharmony_ci    "binder/client/src/hcamera_device_callback_proxy.cpp",
241d3ffd26Sopenharmony_ci    "binder/client/src/hcamera_listener_proxy.cpp",
251d3ffd26Sopenharmony_ci    "binder/client/src/hcamera_service_callback_proxy.cpp",
261d3ffd26Sopenharmony_ci    "binder/client/src/hcamera_service_proxy.cpp",
271d3ffd26Sopenharmony_ci    "binder/client/src/hcapture_session_callback_proxy.cpp",
281d3ffd26Sopenharmony_ci    "binder/client/src/hstream_capture_callback_proxy.cpp",
291d3ffd26Sopenharmony_ci    "binder/client/src/hstream_depth_data_callback_proxy.cpp",
301d3ffd26Sopenharmony_ci    "binder/client/src/hstream_depth_data_proxy.cpp",
311d3ffd26Sopenharmony_ci    "binder/client/src/hstream_metadata_callback_proxy.cpp",
321d3ffd26Sopenharmony_ci    "binder/client/src/hstream_repeat_callback_proxy.cpp",
331d3ffd26Sopenharmony_ci    "binder/client/src/window_manager_service_proxy_impl/hcamera_mock_session_manager_interface_proxy.cpp",
341d3ffd26Sopenharmony_ci    "binder/client/src/window_manager_service_proxy_impl/hcamera_scene_session_manager_proxy.cpp",
351d3ffd26Sopenharmony_ci    "binder/client/src/window_manager_service_proxy_impl/hcamera_window_session_manager_service_proxy.cpp",
361d3ffd26Sopenharmony_ci    "binder/server/src/hcamera_device_stub.cpp",
371d3ffd26Sopenharmony_ci    "binder/server/src/hcamera_service_stub.cpp",
381d3ffd26Sopenharmony_ci    "binder/server/src/hcapture_session_stub.cpp",
391d3ffd26Sopenharmony_ci    "binder/server/src/hstream_capture_stub.cpp",
401d3ffd26Sopenharmony_ci    "binder/server/src/hstream_depth_data_callback_stub.cpp",
411d3ffd26Sopenharmony_ci    "binder/server/src/hstream_depth_data_stub.cpp",
421d3ffd26Sopenharmony_ci    "binder/server/src/hstream_metadata_stub.cpp",
431d3ffd26Sopenharmony_ci    "binder/server/src/hstream_repeat_stub.cpp",
441d3ffd26Sopenharmony_ci    "binder/server/src/window_manager_service_callback_stub_impl/hcamera_window_manager_callback_stub.cpp",
451d3ffd26Sopenharmony_ci    "src/adapter/bms_adapter.cpp",
461d3ffd26Sopenharmony_ci    "src/app_manager_utils/camera_app_manager_client.cpp",
471d3ffd26Sopenharmony_ci    "src/avcodec/audio_capturer_session.cpp",
481d3ffd26Sopenharmony_ci    "src/avcodec/audio_encoder.cpp",
491d3ffd26Sopenharmony_ci    "src/avcodec/audio_video_muxer.cpp",
501d3ffd26Sopenharmony_ci    "src/avcodec/avcodec_task_manager.cpp",
511d3ffd26Sopenharmony_ci    "src/avcodec/camera_server_photo_proxy.cpp",
521d3ffd26Sopenharmony_ci    "src/avcodec/common/frame_record.cpp",
531d3ffd26Sopenharmony_ci    "src/avcodec/moving_photo_video_cache.cpp",
541d3ffd26Sopenharmony_ci    "src/avcodec/sample_callback.cpp",
551d3ffd26Sopenharmony_ci    "src/avcodec/video_encoder.cpp",
561d3ffd26Sopenharmony_ci    "src/camera_fwk_metadata_utils.cpp",
571d3ffd26Sopenharmony_ci    "src/camera_info_dumper.cpp",
581d3ffd26Sopenharmony_ci    "src/camera_privacy.cpp",
591d3ffd26Sopenharmony_ci    "src/camera_timer.cpp",
601d3ffd26Sopenharmony_ci    "src/camera_util.cpp",
611d3ffd26Sopenharmony_ci    "src/dfx/camera_report_uitls.cpp",
621d3ffd26Sopenharmony_ci    "src/hcamera_device.cpp",
631d3ffd26Sopenharmony_ci    "src/hcamera_device_manager.cpp",
641d3ffd26Sopenharmony_ci    "src/hcamera_host_manager.cpp",
651d3ffd26Sopenharmony_ci    "src/hcamera_preconfig.cpp",
661d3ffd26Sopenharmony_ci    "src/hcamera_restore_param.cpp",
671d3ffd26Sopenharmony_ci    "src/hcamera_service.cpp",
681d3ffd26Sopenharmony_ci    "src/hcapture_session.cpp",
691d3ffd26Sopenharmony_ci    "src/hstream_capture.cpp",
701d3ffd26Sopenharmony_ci    "src/hstream_common.cpp",
711d3ffd26Sopenharmony_ci    "src/hstream_depth_data.cpp",
721d3ffd26Sopenharmony_ci    "src/hstream_metadata.cpp",
731d3ffd26Sopenharmony_ci    "src/hstream_repeat.cpp",
741d3ffd26Sopenharmony_ci    "src/moving_photo/moving_photo_surface_wrapper.cpp",
751d3ffd26Sopenharmony_ci    "src/smooth_zoom/cubic_bezier.cpp",
761d3ffd26Sopenharmony_ci    "src/smooth_zoom/smooth_zoom.cpp",
771d3ffd26Sopenharmony_ci    "src/window_manager_utils/camera_window_manager_agent.cpp",
781d3ffd26Sopenharmony_ci    "src/window_manager_utils/camera_window_manager_client.cpp",
791d3ffd26Sopenharmony_ci  ]
801d3ffd26Sopenharmony_ci  cflags = [
811d3ffd26Sopenharmony_ci    "-fPIC",
821d3ffd26Sopenharmony_ci    "-Wall",
831d3ffd26Sopenharmony_ci    "-fvisibility=hidden",
841d3ffd26Sopenharmony_ci  ]
851d3ffd26Sopenharmony_ci  sanitize = {
861d3ffd26Sopenharmony_ci    cfi = true
871d3ffd26Sopenharmony_ci    cfi_cross_dso = true
881d3ffd26Sopenharmony_ci    debug = false
891d3ffd26Sopenharmony_ci    blocklist = "./camera_cfi_blocklist.txt"
901d3ffd26Sopenharmony_ci  }
911d3ffd26Sopenharmony_ci
921d3ffd26Sopenharmony_ci  include_dirs = [
931d3ffd26Sopenharmony_ci    "//drivers/peripheral/display/interfaces/include",
941d3ffd26Sopenharmony_ci    "${graphic_surface_path}/surface/include",
951d3ffd26Sopenharmony_ci    "//foundation/multimedia/camera_framework/services/camera_service/include",
961d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/common/utils",
971d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/camera_service/binder/base/include/window_manager_service_utils",
981d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/camera_service/binder/client/include/window_manager_service_proxy",
991d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/camera_service/binder/server/include/window_manager_service_callback_stub",
1001d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/camera_service/include/adapter",
1011d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/camera_service/include/app_manager_utils",
1021d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/camera_service/include/dfx",
1031d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/camera_service/include/smooth_zoom",
1041d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/camera_service/include/avcodec",
1051d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/camera_service/include/avcodec/common",
1061d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/camera_service/include/window_manager_utils",
1071d3ffd26Sopenharmony_ci    "//foundation/multimedia/camera_framework/services/camera_service/binder/base/include",
1081d3ffd26Sopenharmony_ci    "//foundation/multimedia/camera_framework/services/camera_service/binder/client/include",
1091d3ffd26Sopenharmony_ci    "//foundation/multimedia/camera_framework/services/camera_service/binder/server/include",
1101d3ffd26Sopenharmony_ci    "//foundation/multimedia/camera_framework/interfaces/inner_api/native/camera/include",
1111d3ffd26Sopenharmony_ci    "//foundation/multimedia/camera_framework/interfaces/inner_api/native/camera/include/utils/",
1121d3ffd26Sopenharmony_ci    "//foundation/window/window_manager/interfaces/innerkits/dm",
1131d3ffd26Sopenharmony_ci    "//base/security/access_token/interfaces/innerkits/accesstoken/include",
1141d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/include",
1151d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/include/base",
1161d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/binder/base/include",
1171d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/binder/client/include",
1181d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/binder/server/include",
1191d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/include/base/buffer_manager",
1201d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/include/base/task_manager",
1211d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/include/base/task_manager/task_group",
1221d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/include/base/timer",
1231d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/include/base/timer/core",
1241d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/include/dfx",
1251d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/include/event_monitor",
1261d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/include/post_processor",
1271d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/include/post_processor/command",
1281d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/include/schedule",
1291d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/include/schedule/base",
1301d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/include/schedule/impl",
1311d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/include/schedule/photo_processor",
1321d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/include/schedule/photo_processor/photo_job_repository",
1331d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/include/schedule/photo_processor/strategy",
1341d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/include/schedule/video_processor",
1351d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/include/schedule/video_processor/strategy",
1361d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/include/schedule/video_processor/video_job_repository",
1371d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/include/session",
1381d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/include/session/photo_session",
1391d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/include/session/video_session",
1401d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service/include/utils",
1411d3ffd26Sopenharmony_ci  ]
1421d3ffd26Sopenharmony_ci
1431d3ffd26Sopenharmony_ci  if (target_cpu == "arm") {
1441d3ffd26Sopenharmony_ci    cflags += [ "-DBINDER_IPC_32BIT" ]
1451d3ffd26Sopenharmony_ci  }
1461d3ffd26Sopenharmony_ci  if (build_variant == "user") {
1471d3ffd26Sopenharmony_ci    cflags += [ "-DIS_RELEASE_VERSION" ]
1481d3ffd26Sopenharmony_ci  }
1491d3ffd26Sopenharmony_ci  deps = [
1501d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/common:camera_utils",
1511d3ffd26Sopenharmony_ci    "${multimedia_camera_framework_path}/services/deferred_processing_service:deferred_processing_service",
1521d3ffd26Sopenharmony_ci  ]
1531d3ffd26Sopenharmony_ci
1541d3ffd26Sopenharmony_ci  external_deps = [
1551d3ffd26Sopenharmony_ci    "ability_base:want",
1561d3ffd26Sopenharmony_ci    "ability_base:zuri",
1571d3ffd26Sopenharmony_ci    "ability_runtime:app_manager",
1581d3ffd26Sopenharmony_ci    "access_token:libaccesstoken_sdk",
1591d3ffd26Sopenharmony_ci    "access_token:libprivacy_sdk",
1601d3ffd26Sopenharmony_ci    "access_token:libtokenid_sdk",
1611d3ffd26Sopenharmony_ci    "access_token:libtokensetproc_shared",
1621d3ffd26Sopenharmony_ci    "audio_framework:audio_capturer",
1631d3ffd26Sopenharmony_ci    "audio_framework:audio_client",
1641d3ffd26Sopenharmony_ci    "av_codec:av_codec_client",
1651d3ffd26Sopenharmony_ci    "av_codec:native_media_acodec",
1661d3ffd26Sopenharmony_ci    "av_codec:native_media_aenc",
1671d3ffd26Sopenharmony_ci    "av_codec:native_media_avcencinfo",
1681d3ffd26Sopenharmony_ci    "av_codec:native_media_avmuxer",
1691d3ffd26Sopenharmony_ci    "av_codec:native_media_codecbase",
1701d3ffd26Sopenharmony_ci    "av_codec:native_media_venc",
1711d3ffd26Sopenharmony_ci    "bundle_framework:appexecfwk_base",
1721d3ffd26Sopenharmony_ci    "bundle_framework:appexecfwk_core",
1731d3ffd26Sopenharmony_ci    "c_utils:utils",
1741d3ffd26Sopenharmony_ci    "common_event_service:cesfwk_innerkits",
1751d3ffd26Sopenharmony_ci    "data_share:datashare_common",
1761d3ffd26Sopenharmony_ci    "data_share:datashare_consumer",
1771d3ffd26Sopenharmony_ci    "drivers_interface_camera:libcamera_proxy_1.0",
1781d3ffd26Sopenharmony_ci    "drivers_interface_camera:libcamera_proxy_1.1",
1791d3ffd26Sopenharmony_ci    "drivers_interface_camera:libcamera_proxy_1.2",
1801d3ffd26Sopenharmony_ci    "drivers_interface_camera:libcamera_proxy_1.3",
1811d3ffd26Sopenharmony_ci    "drivers_interface_camera:metadata",
1821d3ffd26Sopenharmony_ci    "drivers_interface_display:libdisplay_commontype_proxy_1.0",
1831d3ffd26Sopenharmony_ci    "drivers_interface_display:libdisplay_composer_hdi_impl_1.2",
1841d3ffd26Sopenharmony_ci    "graphic_2d:librender_service_client",
1851d3ffd26Sopenharmony_ci    "graphic_surface:buffer_handle",
1861d3ffd26Sopenharmony_ci    "graphic_surface:surface",
1871d3ffd26Sopenharmony_ci    "hdf_core:libhdi",
1881d3ffd26Sopenharmony_ci    "hilog:libhilog",
1891d3ffd26Sopenharmony_ci    "hisysevent:libhisysevent",
1901d3ffd26Sopenharmony_ci    "hitrace:hitrace_meter",
1911d3ffd26Sopenharmony_ci    "init:libbegetutil",
1921d3ffd26Sopenharmony_ci    "ipc:ipc_core",
1931d3ffd26Sopenharmony_ci    "ipc:ipc_single",
1941d3ffd26Sopenharmony_ci    "media_foundation:media_foundation",
1951d3ffd26Sopenharmony_ci    "media_foundation:native_media_core",
1961d3ffd26Sopenharmony_ci    "media_library:media_library",
1971d3ffd26Sopenharmony_ci    "media_library:media_library_manager",
1981d3ffd26Sopenharmony_ci    "memmgr:memmgrclient",
1991d3ffd26Sopenharmony_ci    "os_account:libaccountkits",
2001d3ffd26Sopenharmony_ci    "os_account:os_account_innerkits",
2011d3ffd26Sopenharmony_ci    "safwk:system_ability_fwk",
2021d3ffd26Sopenharmony_ci    "samgr:samgr_proxy",
2031d3ffd26Sopenharmony_ci    "window_manager:libdm",
2041d3ffd26Sopenharmony_ci    "window_manager:libwm",
2051d3ffd26Sopenharmony_ci  ]
2061d3ffd26Sopenharmony_ci
2071d3ffd26Sopenharmony_ci  public_external_deps = [ "e2fsprogs:libext2_uuid" ]
2081d3ffd26Sopenharmony_ci
2091d3ffd26Sopenharmony_ci  defines = []
2101d3ffd26Sopenharmony_ci  if (use_sensor) {
2111d3ffd26Sopenharmony_ci    external_deps += [ "sensor:sensor_interface_native" ]
2121d3ffd26Sopenharmony_ci    defines += [ "CAMERA_USE_SENSOR" ]
2131d3ffd26Sopenharmony_ci  }
2141d3ffd26Sopenharmony_ci
2151d3ffd26Sopenharmony_ci  if (defined(global_parts_info) &&
2161d3ffd26Sopenharmony_ci      defined(global_parts_info.distributedhardware_device_manager)) {
2171d3ffd26Sopenharmony_ci    external_deps += [ "device_manager:devicemanagersdk" ]
2181d3ffd26Sopenharmony_ci    defines += [ "DEVICE_MANAGER" ]
2191d3ffd26Sopenharmony_ci  }
2201d3ffd26Sopenharmony_ci
2211d3ffd26Sopenharmony_ci  if (hicollie_enable) {
2221d3ffd26Sopenharmony_ci    external_deps += [ "hicollie:libhicollie" ]
2231d3ffd26Sopenharmony_ci    defines += [ "HICOLLIE_ENABLE" ]
2241d3ffd26Sopenharmony_ci  }
2251d3ffd26Sopenharmony_ci
2261d3ffd26Sopenharmony_ci  include_dirs += [
2271d3ffd26Sopenharmony_ci    "//drivers/peripheral/camera/interfaces/include",
2281d3ffd26Sopenharmony_ci    "//drivers/peripheral/camera/interfaces/hdi_ipc",
2291d3ffd26Sopenharmony_ci    "//drivers/peripheral/camera/interfaces/hdi_ipc/utils/include",
2301d3ffd26Sopenharmony_ci    "//drivers/peripheral/camera/interfaces/hdi_ipc/callback/device/include",
2311d3ffd26Sopenharmony_ci    "//drivers/peripheral/camera/interfaces/hdi_ipc/callback/operator/include",
2321d3ffd26Sopenharmony_ci    "//drivers/peripheral/camera/interfaces/hdi_ipc/callback/host/include",
2331d3ffd26Sopenharmony_ci  ]
2341d3ffd26Sopenharmony_ci
2351d3ffd26Sopenharmony_ci  if (use_musl) {
2361d3ffd26Sopenharmony_ci    if (musl_use_jemalloc && musl_use_jemalloc_dfx_intf) {
2371d3ffd26Sopenharmony_ci      cflags += [ "-DCONFIG_USE_JEMALLOC_DFX_INTF" ]
2381d3ffd26Sopenharmony_ci    }
2391d3ffd26Sopenharmony_ci  }
2401d3ffd26Sopenharmony_ci
2411d3ffd26Sopenharmony_ci  cflags_cc = cflags
2421d3ffd26Sopenharmony_ci
2431d3ffd26Sopenharmony_ci  part_name = "camera_framework"
2441d3ffd26Sopenharmony_ci  subsystem_name = "multimedia"
2451d3ffd26Sopenharmony_ci}
246