• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023 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("../../camera.gni")
15
16if (defined(ohos_lite)) {
17  import("//build/ohos.gni")
18  import("../../../../hdf_core/adapter/uhdf/uhdf.gni")
19
20  config("camhdi_impl_config") {
21    visibility = [ ":*" ]
22    cflags = [
23      "-DGST_DISABLE_DEPRECATED",
24      "-DHAVE_CONFIG_H",
25    ]
26
27    cflags_cc = [ "-std=c++17" ]
28    ldflags = [ "-Wl" ]
29
30    ldflags += [ "--coverage" ]
31  }
32
33  ohos_shared_library("camera_host_service_1.0") {
34    output_extension = "z.so"
35    sources = [
36      "./src/camera_device_service.cpp",
37      "./src/camera_host_service.cpp",
38      "./src/offline_stream_operator_service.cpp",
39      "./src/stream_operator_service.cpp",
40    ]
41
42    include_dirs = [
43      "$camera_path/../../interfaces/include",
44      "$camera_path/../../interfaces/hdi_passthrough",
45      "$camera_path/include",
46      "$camera_path/utils/hicollie",
47      "$camera_path/utils/watchdog",
48      "$camera_path/../interfaces",
49      "./include",
50    ]
51
52    deps = [ "$camera_path/utils:peripheral_camera_utils" ]
53    external_deps = [
54      "drivers_interface_camera:metadata",
55      "graphic_surface:surface",
56      "hdf_core:libhdf_utils",
57      "hilog_lite:hilog_shared",
58    ]
59    public_configs = [ ":camhdi_impl_config" ]
60    subsystem_name = "hdf"
61    part_name = "drivers_peripheral_camera"
62  }
63} else {
64  import("//build/ohos.gni")
65
66  config("camhdi_impl_config") {
67    visibility = [ ":*" ]
68    cflags = [
69      "-DGST_DISABLE_DEPRECATED",
70      "-DHAVE_CONFIG_H",
71    ]
72
73    ldflags = [ "-Wl" ]
74
75    if (enable_camera_device_utest) {
76      cflags += [
77        "-fprofile-arcs",
78        "-ftest-coverage",
79      ]
80
81      ldflags += [ "--coverage" ]
82    }
83  }
84
85  host_sources = [
86    "$camera_path/../../interfaces/hdi_ipc/camera_host_driver.cpp",
87    "./src/camera_device_service.cpp",
88    "./src/camera_device_service_callback.cpp",
89    "./src/camera_host_service.cpp",
90    "./src/camera_host_service_callback.cpp",
91    "./src/camera_service_type_converter.cpp",
92    "./src/offline_stream_operator_service.cpp",
93    "./src/stream_operator_service.cpp",
94    "./src/stream_operator_service_callback.cpp",
95  ]
96
97  host_includes = [
98    "$camera_path/../../interfaces/include",
99    "$camera_path/../../interfaces/hdi_ipc",
100    "$camera_path/../../interfaces/hdi_ipc/utils/include",
101    "$camera_path/../../interfaces/hdi_ipc/callback/host/include",
102    "$camera_path/../../interfaces/hdi_ipc/callback/device/include",
103    "$camera_path/../../interfaces/hdi_ipc/callback/operator/include",
104    "$camera_path/include",
105    "$camera_path/utils/hicollie",
106    "$camera_path/utils/watchdog",
107    "$camera_path/../interfaces",
108    "./include",
109  ]
110
111  ohos_shared_library("camera_host_service_1.0") {
112    sources = host_sources
113    include_dirs = host_includes
114
115    deps = [ "$camera_path/utils:peripheral_camera_utils" ]
116
117    defines = []
118    if (enable_camera_device_utest) {
119      defines += [ "CAMERA_DEVICE_UTEST" ]
120    }
121    if (use_hitrace) {
122      defines += [ "HITRACE_LOG_ENABLED" ]
123    }
124    if (drivers_peripheral_camera_feature_usb) {
125      defines += [ "CHIP_PROD_CAMERA_HOST_CONFIG" ]
126    }
127
128    if (is_standard_system) {
129      external_deps = [
130        "c_utils:utils",
131        "graphic_surface:surface",
132        "hdf_core:libhdf_host",
133        "hdf_core:libhdf_ipc_adapter",
134        "hdf_core:libhdf_utils",
135        "hdf_core:libhdi",
136        "hicollie:libhicollie",
137        "hilog:libhilog",
138      ]
139    } else {
140      external_deps = [ "hilog:libhilog" ]
141    }
142
143    if (use_hitrace) {
144      external_deps += [ "hitrace:hitrace_meter" ]
145    }
146
147    external_deps += [
148      "drivers_interface_camera:libcamera_stub_1.0",
149      "drivers_interface_camera:metadata",
150      "ipc:ipc_single",
151    ]
152    shlib_type = "hdi"
153    public_configs = [ ":camhdi_impl_config" ]
154    install_images = [ chipset_base_dir ]
155    subsystem_name = "hdf"
156    part_name = "drivers_peripheral_camera"
157  }
158
159  ohos_static_library("camera_host_service_1.0_static") {
160    sources = host_sources
161    include_dirs = host_includes
162
163    deps = [ "$camera_path/utils:peripheral_camera_utils" ]
164
165    defines = []
166    if (enable_camera_device_utest) {
167      defines += [ "CAMERA_DEVICE_UTEST" ]
168    }
169    if (use_hitrace) {
170      defines += [ "HITRACE_LOG_ENABLED" ]
171    }
172
173    if (is_standard_system) {
174      external_deps = [
175        "c_utils:utils",
176        "graphic_surface:surface",
177        "hdf_core:libhdf_host",
178        "hdf_core:libhdf_ipc_adapter",
179        "hdf_core:libhdf_utils",
180        "hdf_core:libhdi",
181        "hicollie:libhicollie",
182        "hilog:libhilog",
183      ]
184    } else {
185      external_deps = [ "hilog:libhilog" ]
186    }
187
188    if (use_hitrace) {
189      external_deps += [ "hitrace:hitrace_meter" ]
190    }
191
192    external_deps += [
193      "drivers_interface_camera:libcamera_stub_1.0",
194      "drivers_interface_camera:metadata",
195      "ipc:ipc_single",
196    ]
197
198    public_configs = [ ":camhdi_impl_config" ]
199    subsystem_name = "hdf"
200    part_name = "drivers_peripheral_camera"
201  }
202}
203