• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 - 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  config("buffer_manager_config") {
19    visibility = [ ":*" ]
20    cflags = [
21      "-DGST_DISABLE_DEPRECATED",
22      "-DHAVE_CONFIG_H",
23    ]
24
25    cflags_cc = [ "-std=c++17" ]
26    ldflags = [ "-Wl" ]
27    ldflags += [ "--coverage" ]
28  }
29
30  ohos_shared_library("camera_buffer_manager") {
31    sources = [
32      "./src/buffer_adapter/lite/buffer_adapter.cpp",
33      "./src/buffer_allocator.cpp",
34      "./src/buffer_allocator_factory.cpp",
35      "./src/buffer_allocator_utils.cpp",
36      "./src/buffer_loop_tracking.cpp",
37      "./src/buffer_manager.cpp",
38      "./src/buffer_pool.cpp",
39      "./src/buffer_tracking.cpp",
40      "./src/heap_buffer_allocator/heap_buffer_allocator.cpp",
41      "./src/image_buffer.cpp",
42    ]
43
44    include_dirs = [
45      "./include",
46      "$camera_path/include",
47      "./src/buffer_adapter/lite",
48      "$camera_path/../../display/interfaces/include",
49      "$camera_path/../../base",
50    ]
51
52    libs = []
53    defines = []
54    deps = []
55    external_deps = [
56      "drivers_peripheral_display:hdi_display",
57      "graphic_chipsetsdk:surface",
58      "hdf_core:libhdf_utils",
59      "hilog_featured_lite:hilog_shared",
60    ]
61
62    public_configs = [ ":buffer_manager_config" ]
63    subsystem_name = "hdf"
64    part_name = "drivers_peripheral_camera"
65  }
66} else {
67  import("//build/ohos.gni")
68  config("buffer_manager_config") {
69    visibility = [ ":*" ]
70
71    cflags = [
72      "-DGST_DISABLE_DEPRECATED",
73      "-DHAVE_CONFIG_H",
74    ]
75
76    ldflags = [ "-Wl" ]
77
78    if (enable_camera_device_utest) {
79      cflags += [
80        "-fprofile-arcs",
81        "-ftest-coverage",
82      ]
83
84      ldflags += [ "--coverage" ]
85    }
86  }
87
88  ohos_shared_library("camera_buffer_manager") {
89    sources = [
90      "./src/buffer_adapter/standard/buffer_adapter.cpp",
91      "./src/buffer_allocator.cpp",
92      "./src/buffer_allocator_factory.cpp",
93      "./src/buffer_allocator_utils.cpp",
94      "./src/buffer_loop_tracking.cpp",
95      "./src/buffer_manager.cpp",
96      "./src/buffer_pool.cpp",
97      "./src/buffer_tracking.cpp",
98      "./src/heap_buffer_allocator/heap_buffer_allocator.cpp",
99      "./src/image_buffer.cpp",
100    ]
101
102    include_dirs = [
103      "./include",
104      "./src/buffer_adapter/standard",
105      "$camera_path/include",
106    ]
107
108    libs = []
109
110    defines = []
111
112    if (enable_camera_device_utest) {
113      defines += [ "CAMERA_DEVICE_UTEST" ]
114    }
115
116    if (is_standard_system) {
117      external_deps = [
118        "c_utils:utils",
119        "graphic_chipsetsdk:surface",
120        "hdf_core:libhdf_utils",
121        "hilog:libhilog",
122      ]
123    } else {
124      external_deps = [ "hilog:libhilog" ]
125    }
126    external_deps += [ "drivers_interface_camera:metadata" ]
127    public_configs = [ ":buffer_manager_config" ]
128    install_images = [ chipset_base_dir ]
129    subsystem_name = "hdf"
130    part_name = "drivers_peripheral_camera"
131  }
132}
133