• 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/watchdog",
47      "$camera_path/../interfaces",
48      "./include",
49    ]
50
51    deps = [ "$camera_path/utils:peripheral_camera_utils" ]
52    external_deps = [
53      "drivers_interface_camera:metadata",
54      "graphic_surface:surface",
55      "hdf_core:libhdf_utils",
56      "hilog_lite:hilog_shared",
57    ]
58    public_configs = [ ":camhdi_impl_config" ]
59    subsystem_name = "hdf"
60    part_name = "drivers_peripheral_camera"
61  }
62} else {
63  import("//build/ohos.gni")
64  import("../../../../hdf_core/adapter/uhdf2/uhdf.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/watchdog",
106    "$camera_path/../interfaces",
107    "./include",
108  ]
109
110  ohos_shared_library("camera_host_service_1.0") {
111    sources = host_sources
112    include_dirs = host_includes
113
114    deps = [ "$camera_path/utils:peripheral_camera_utils" ]
115
116    defines = []
117    if (enable_camera_device_utest) {
118      defines += [ "CAMERA_DEVICE_UTEST" ]
119    }
120    if (use_hitrace) {
121      defines += [ "HITRACE_LOG_ENABLED" ]
122    }
123
124    if (is_standard_system) {
125      external_deps = [
126        "c_utils:utils",
127        "graphic_surface:surface",
128        "hdf_core:libhdf_host",
129        "hdf_core:libhdf_ipc_adapter",
130        "hdf_core:libhdf_utils",
131        "hdf_core:libhdi",
132        "hilog:libhilog",
133        "ipc:ipc_single",
134      ]
135    } else {
136      external_deps = [ "hilog:libhilog" ]
137    }
138
139    if (use_hitrace) {
140      external_deps += [ "hitrace:hitrace_meter" ]
141    }
142
143    external_deps += [
144      "drivers_interface_camera:libcamera_stub_1.0",
145      "drivers_interface_camera:metadata",
146      "ipc:ipc_single",
147    ]
148    shlib_type = "hdi"
149    public_configs = [ ":camhdi_impl_config" ]
150    install_images = [ chipset_base_dir ]
151    subsystem_name = "hdf"
152    part_name = "drivers_peripheral_camera"
153  }
154
155  ohos_static_library("camera_host_service_1.0_static") {
156    sources = host_sources
157    include_dirs = host_includes
158
159    deps = [ "$camera_path/utils:peripheral_camera_utils" ]
160
161    defines = []
162    if (enable_camera_device_utest) {
163      defines += [ "CAMERA_DEVICE_UTEST" ]
164    }
165    if (use_hitrace) {
166      defines += [ "HITRACE_LOG_ENABLED" ]
167    }
168
169    if (is_standard_system) {
170      external_deps = [
171        "c_utils:utils",
172        "graphic_surface:surface",
173        "hdf_core:libhdf_host",
174        "hdf_core:libhdf_ipc_adapter",
175        "hdf_core:libhdf_utils",
176        "hdf_core:libhdi",
177        "hilog:libhilog",
178        "ipc:ipc_single",
179      ]
180    } else {
181      external_deps = [ "hilog:libhilog" ]
182    }
183
184    if (use_hitrace) {
185      external_deps += [ "hitrace:hitrace_meter" ]
186    }
187
188    external_deps += [
189      "drivers_interface_camera:libcamera_stub_1.0",
190      "drivers_interface_camera:metadata",
191      "ipc:ipc_single",
192    ]
193
194    public_configs = [ ":camhdi_impl_config" ]
195    subsystem_name = "hdf"
196    part_name = "drivers_peripheral_camera"
197  }
198}
199