1# Copyright (c) 2020-2022 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#     http://www.apache.org/licenses/LICENSE-2.0
6# Unless required by applicable law or agreed to in writing, software
7# distributed under the License is distributed on an "AS IS" BASIS,
8# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9# See the License for the specific language governing permissions and
10# limitations under the License.
11import("//build/lite/config/component/lite_component.gni")
12import("//foundation/multimedia/media_utils_lite/config.gni")
13
14shared_library("camera_lite") {
15  sources = [
16    "camera_ability.cpp",
17    "camera_client.cpp",
18    "camera_config.cpp",
19    "camera_impl.cpp",
20    "camera_info_impl.cpp",
21    "camera_kit.cpp",
22    "camera_manager.cpp",
23    "event_handler.cpp",
24    "frame_config.cpp",
25  ]
26
27  if (enable_media_passthrough_mode == true) {
28    sources += [
29      "../services/impl/src/camera_device.cpp",
30      "../services/impl/src/camera_service.cpp",
31      "passthrough/src/camera_device_client.cpp",
32      "passthrough/src/camera_service_client.cpp",
33    ]
34    include_dirs = [
35      "//drivers/peripheral/display/interfaces/include",
36      "//drivers/peripheral/codec/interfaces/include",
37      "//foundation/multimedia/camera_lite/frameworks/passthrough/include",
38      "//foundation/multimedia/media_utils_lite/hals",
39      "//drivers/peripheral/base",
40    ]
41
42    ldflags = [ "-lhdi_camera" ]
43    defines = [ "ENABLE_PASSTHROUGH_MODE" ]
44  } else {
45    sources += [
46      "binder/src/camera_device_client.cpp",
47      "binder/src/camera_service_client.cpp",
48    ]
49    include_dirs = [
50      "//foundation/multimedia/camera_lite/frameworks/binder/include",
51      "//commonlibrary/utils_lite/include",
52      "//foundation/systemabilitymgr/samgr_lite/interfaces/kits/registry",
53      "//foundation/systemabilitymgr/samgr_lite/interfaces/kits/samgr",
54      "//foundation/systemabilitymgr/samgr_lite/interfaces/kits/communication/broadcast",
55      "//foundation/communication/ipc/interfaces/innerkits/c/ipc/include/",
56    ]
57    ldflags = []
58  }
59
60  include_dirs += [
61    "//foundation/multimedia/camera_lite/frameworks",
62    "//foundation/multimedia/camera_lite/interfaces/kits",
63    "//foundation/multimedia/camera_lite/services/impl/include",
64    "//foundation/multimedia/camera_lite/services/server/include",
65    "//foundation/multimedia/media_utils_lite/interfaces/kits",
66    "//base/security/permission_lite/interfaces/kits",
67  ]
68
69  public_configs = [ ":camera_client_external_library_config" ]
70
71  ldflags += [
72    "-lstdc++",
73    "-lpthread",
74    "-L$ohos_root_path/$root_out_dir",
75  ]
76  if (board_name == "hispark_taurus" || board_name == "hispark_aries") {
77    ldflags += [
78      "-lcodec",
79      "-lhdi_videodisplayer",
80    ]
81  }
82
83  cflags = [ "-fPIC" ]
84  cflags += [ "-Wall" ]
85  cflags_cc = cflags
86  deps = [
87    "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
88    "//base/security/permission_lite/services/pms_client:pms_client",
89    "//foundation/communication/ipc/interfaces/innerkits/c/ipc:ipc_single",
90    "//foundation/systemabilitymgr/samgr_lite/samgr:samgr",
91    "//third_party/bounds_checking_function:libsec_shared",
92  ]
93  if (board_name == "hispark_taurus" || board_name == "hispark_aries") {
94    deps += [
95      "//device/soc/hisilicon/common/hal/media:hardware_media_sdk",
96      "//device/soc/hisilicon/common/hal/middleware:middleware_source_sdk",
97    ]
98  }
99  public_deps = [
100    "//foundation/graphic/surface_lite:surface_lite",
101    "//foundation/multimedia/media_lite/frameworks/recorder_lite:recorder_lite",
102    "//foundation/multimedia/media_utils_lite:media_common",
103  ]
104}
105
106config("camera_client_external_library_config") {
107  include_dirs = [ "//foundation/multimedia/camera_lite/interfaces/kits" ]
108  include_dirs += [ "//foundation/multimedia/media_utils_lite/interfaces/kits" ]
109}
110