166f3657fSopenharmony_ci# Copyright (c) 2022-2024 Huawei Device Co., Ltd.
266f3657fSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
366f3657fSopenharmony_ci# you may not use this file except in compliance with the License.
466f3657fSopenharmony_ci# You may obtain a copy of the License at
566f3657fSopenharmony_ci#
666f3657fSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
766f3657fSopenharmony_ci#
866f3657fSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
966f3657fSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
1066f3657fSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1166f3657fSopenharmony_ci# See the License for the specific language governing permissions and
1266f3657fSopenharmony_ci# limitations under the License.
1366f3657fSopenharmony_ci
1466f3657fSopenharmony_ciimport("//build/ohos.gni")
1566f3657fSopenharmony_ciimport("//build/ohos_var.gni")
1666f3657fSopenharmony_ciimport(
1766f3657fSopenharmony_ci    "//foundation/distributedhardware/distributed_screen/distributedscreen.gni")
1866f3657fSopenharmony_ci
1966f3657fSopenharmony_ciohos_shared_library("distributed_screen_sink") {
2066f3657fSopenharmony_ci  sanitize = {
2166f3657fSopenharmony_ci    cfi = true
2266f3657fSopenharmony_ci    cfi_cross_dso = true
2366f3657fSopenharmony_ci    debug = false
2466f3657fSopenharmony_ci    boundary_sanitize = true
2566f3657fSopenharmony_ci    integer_overflow = true
2666f3657fSopenharmony_ci    ubsan = true
2766f3657fSopenharmony_ci  }
2866f3657fSopenharmony_ci  branch_protector_ret = "pac_ret"
2966f3657fSopenharmony_ci  include_dirs = [
3066f3657fSopenharmony_ci    "./dscreenservice/include",
3166f3657fSopenharmony_ci    "${services_path}/screenservice/sinkservice/screenregionmgr",
3266f3657fSopenharmony_ci    "${interfaces_path}/innerkits/native_cpp/screen_sink/include",
3366f3657fSopenharmony_ci    "${interfaces_path}/innerkits/native_cpp/screen_sink/include/callback",
3466f3657fSopenharmony_ci    "${interfaces_path}/innerkits/native_cpp/screen_source/include",
3566f3657fSopenharmony_ci    "${interfaces_path}/innerkits/native_cpp/screen_source/include/callback",
3666f3657fSopenharmony_ci    "${common_path}/include",
3766f3657fSopenharmony_ci    "${services_path}/common/utils/include",
3866f3657fSopenharmony_ci    "${services_path}/common/databuffer/include",
3966f3657fSopenharmony_ci    "${services_path}/common/screen_channel/include",
4066f3657fSopenharmony_ci    "${services_path}/screentransport/screensinktrans/include",
4166f3657fSopenharmony_ci    "${services_path}/screentransport/screensinkprocessor/include",
4266f3657fSopenharmony_ci    "${services_path}/screentransport/screensinkprocessor/decoder/include",
4366f3657fSopenharmony_ci    "${services_path}/screenclient/include/",
4466f3657fSopenharmony_ci  ]
4566f3657fSopenharmony_ci
4666f3657fSopenharmony_ci  sources = [
4766f3657fSopenharmony_ci    "${interfaces_path}/innerkits/native_cpp/screen_sink/src/dscreen_sink_proxy.cpp",
4866f3657fSopenharmony_ci    "${interfaces_path}/innerkits/native_cpp/screen_source/src/dscreen_source_proxy.cpp",
4966f3657fSopenharmony_ci    "${services_path}/common/utils/src/dscreen_fwkkit.cpp",
5066f3657fSopenharmony_ci    "${services_path}/common/utils/src/dscreen_hidumper.cpp",
5166f3657fSopenharmony_ci    "${services_path}/common/utils/src/dscreen_maprelation.cpp",
5266f3657fSopenharmony_ci    "${services_path}/common/utils/src/video_param.cpp",
5366f3657fSopenharmony_ci    "./dscreenservice/src/dscreen_sink_service.cpp",
5466f3657fSopenharmony_ci    "./dscreenservice/src/dscreen_sink_stub.cpp",
5566f3657fSopenharmony_ci    "./screenregionmgr/1.0/src/screenregion.cpp",
5666f3657fSopenharmony_ci    "./screenregionmgr/1.0/src/screenregionmgr.cpp",
5766f3657fSopenharmony_ci    "./screenregionmgr/2.0/src/av_receiver_engine_adapter.cpp",
5866f3657fSopenharmony_ci    "./screenregionmgr/2.0/src/screenregion.cpp",
5966f3657fSopenharmony_ci    "./screenregionmgr/2.0/src/screenregionmgr.cpp",
6066f3657fSopenharmony_ci  ]
6166f3657fSopenharmony_ci
6266f3657fSopenharmony_ci  deps = [
6366f3657fSopenharmony_ci    "${common_path}:distributed_screen_utils",
6466f3657fSopenharmony_ci    "${services_path}/screenclient:distributed_screen_client",
6566f3657fSopenharmony_ci    "${services_path}/screentransport/screensinktrans:distributed_screen_sinktrans",
6666f3657fSopenharmony_ci  ]
6766f3657fSopenharmony_ci
6866f3657fSopenharmony_ci  defines = [
6966f3657fSopenharmony_ci    "HI_LOG_ENABLE",
7066f3657fSopenharmony_ci    "DH_LOG_TAG=\"dscreensink\"",
7166f3657fSopenharmony_ci    "LOG_DOMAIN=0xD004140",
7266f3657fSopenharmony_ci  ]
7366f3657fSopenharmony_ci
7466f3657fSopenharmony_ci  if (build_variant == "root") {
7566f3657fSopenharmony_ci    defines += [ "DUMP_DSCREENREGION_FILE" ]
7666f3657fSopenharmony_ci  }
7766f3657fSopenharmony_ci
7866f3657fSopenharmony_ci  external_deps = [
7966f3657fSopenharmony_ci    "access_token:libaccesstoken_sdk",
8066f3657fSopenharmony_ci    "access_token:libtokenid_sdk",
8166f3657fSopenharmony_ci    "av_codec:av_codec_client",
8266f3657fSopenharmony_ci    "cJSON:cjson",
8366f3657fSopenharmony_ci    "c_utils:utils",
8466f3657fSopenharmony_ci    "distributed_hardware_fwk:distributed_av_receiver",
8566f3657fSopenharmony_ci    "distributed_hardware_fwk:distributedhardwareutils",
8666f3657fSopenharmony_ci    "distributed_hardware_fwk:libdhfwk_sdk",
8766f3657fSopenharmony_ci    "graphic_2d:libgraphic_utils",
8866f3657fSopenharmony_ci    "graphic_2d:librender_service_client",
8966f3657fSopenharmony_ci    "graphic_surface:surface",
9066f3657fSopenharmony_ci    "hilog:libhilog",
9166f3657fSopenharmony_ci    "hisysevent:libhisysevent",
9266f3657fSopenharmony_ci    "hitrace:hitrace_meter",
9366f3657fSopenharmony_ci    "ipc:ipc_core",
9466f3657fSopenharmony_ci    "json:nlohmann_json_static",
9566f3657fSopenharmony_ci    "media_foundation:media_foundation",
9666f3657fSopenharmony_ci    "safwk:system_ability_fwk",
9766f3657fSopenharmony_ci    "samgr:samgr_proxy",
9866f3657fSopenharmony_ci    "window_manager:libdm",
9966f3657fSopenharmony_ci  ]
10066f3657fSopenharmony_ci
10166f3657fSopenharmony_ci  subsystem_name = "distributedhardware"
10266f3657fSopenharmony_ci
10366f3657fSopenharmony_ci  part_name = "distributed_screen"
10466f3657fSopenharmony_ci}
105