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_usb.gni")
15
16import("//build/ohos.gni")
17config("buffer_manager_config") {
18  visibility = [ ":*" ]
19
20  cflags = [
21    "-DGST_DISABLE_DEPRECATED",
22    "-DHAVE_CONFIG_H",
23  ]
24
25  ldflags = [ "-Wl" ]
26
27  if (enable_camera_device_utest) {
28    cflags += [
29      "-fprofile-arcs",
30      "-ftest-coverage",
31    ]
32
33    ldflags += [ "--coverage" ]
34  }
35}
36
37ohos_shared_library("usb_camera_buffer_manager") {
38  sources = [
39    "$camera_path_vdi/buffer_manager/src/buffer_allocator.cpp",
40    "$camera_path_vdi/buffer_manager/src/buffer_allocator_factory.cpp",
41    "$camera_path_vdi/buffer_manager/src/buffer_allocator_utils.cpp",
42    "$camera_path_vdi/buffer_manager/src/buffer_loop_tracking.cpp",
43    "$camera_path_vdi/buffer_manager/src/buffer_manager.cpp",
44    "$camera_path_vdi/buffer_manager/src/buffer_pool.cpp",
45    "$camera_path_vdi/buffer_manager/src/buffer_tracking.cpp",
46    "$camera_path_vdi/buffer_manager/src/heap_buffer_allocator/heap_buffer_allocator.cpp",
47    "$camera_path_vdi/buffer_manager/src/image_buffer.cpp",
48    "./src/buffer_adapter/standard/buffer_adapter.cpp",
49  ]
50
51  include_dirs = [
52    "$camera_path_vdi/buffer_manager/include",
53    "$camera_path_vdi/buffer_manager/src/buffer_adapter/standard",
54    "$camera_path_vdi/include",
55    "$camera_path_vdi/../../interfaces/include",
56    "$camera_path_vdi/utils/event",
57  ]
58
59  libs = []
60
61  defines = []
62  deps = [ "$camera_path_vdi/utils:peripheral_camera_utils" ]
63  if (enable_camera_device_utest) {
64    defines += [ "CAMERA_DEVICE_UTEST" ]
65  }
66
67  external_deps = [
68    "c_utils:utils",
69    "drivers_interface_camera:metadata",
70    "graphic_surface:surface",
71    "hdf_core:libhdf_utils",
72    "hilog:libhilog",
73  ]
74  public_configs = [ ":buffer_manager_config" ]
75  install_images = [ chipset_base_dir ]
76  subsystem_name = "hdf"
77  part_name = "drivers_peripheral_camera"
78}
79