1# Copyright (c) 2022-2023 Shenzhen Kaihong DID 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.
13import("//build/ohos.gni")
14import("../..//codec.gni")
15
16ohos_shared_library("libcodec_component_manager_service_3.0") {
17  include_dirs = [
18    "../../interfaces/include/",
19    "../../utils/include/",
20    "include",
21  ]
22  sources = [
23    "../../utils/src/codec_hcb_util.c",
24    "src/codec_component_config.cpp",
25    "src/codec_component_manager_service.cpp",
26    "src/codec_component_service.cpp",
27    "src/codec_death_recipient.cpp",
28    "src/codec_dfx_service.cpp",
29    "src/codec_dma_buffer.cpp",
30    "src/codec_dyna_buffer.cpp",
31    "src/codec_handle_buffer.cpp",
32    "src/codec_omx_core.cpp",
33    "src/codec_share_buffer.cpp",
34    "src/component_mgr.cpp",
35    "src/component_node.cpp",
36    "src/icodec_buffer.cpp",
37  ]
38
39  if (is_standard_system) {
40    external_deps = [
41      "c_utils:utils",
42      "drivers_interface_codec:libcodec_proxy_3.0",
43      "drivers_interface_display:libdisplay_buffer_proxy_1.0",
44      "graphic_surface:buffer_handle",
45      "hdf_core:libhdf_host",
46      "hdf_core:libhdf_ipc_adapter",
47      "hdf_core:libhdf_utils",
48      "hdf_core:libhdi",
49      "hilog:libhilog",
50      "hitrace:hitrace_meter",
51      "ipc:ipc_single",
52    ]
53  } else {
54    external_deps = [
55      "hilog:libhilog",
56      "ipc:ipc_single",
57    ]
58  }
59  external_deps += [ "openmax:libopenmax_static" ]
60  defines = []
61  if (drivers_peripheral_codec_feature_set_omx_role) {
62    defines += [ "SUPPORT_ROLE" ]
63  }
64  if (use_musl && musl_use_jemalloc && musl_use_jemalloc_dfx_intf) {
65    defines += [ "CONFIG_USE_JEMALLOC_DFX_INTF" ]
66  }
67  innerapi_tags = [ "passthrough_indirect" ]
68  install_images = [ chipset_base_dir ]
69  subsystem_name = "hdf"
70  part_name = "drivers_peripheral_codec"
71}
72
73ohos_shared_library("libcodec_driver") {
74  include_dirs = [
75    "../../interfaces/include/",
76    "../../utils/include/",
77    "include",
78  ]
79
80  sources = [ "src/codec_component_manager_driver.cpp" ]
81
82  deps = [ ":libcodec_component_manager_service_3.0" ]
83
84  if (is_standard_system) {
85    external_deps = [
86      "c_utils:utils",
87      "drivers_interface_codec:libcodec_stub_3.0",
88      "drivers_interface_display:libdisplay_buffer_proxy_1.0",
89      "graphic_surface:buffer_handle",
90      "hdf_core:libhdf_host",
91      "hdf_core:libhdf_ipc_adapter",
92      "hdf_core:libhdf_utils",
93      "hdf_core:libhdi",
94      "hilog:libhilog",
95      "ipc:ipc_single",
96    ]
97  } else {
98    external_deps = [
99      "hilog:libhilog",
100      "ipc:ipc_single",
101    ]
102  }
103  external_deps += [ "openmax:libopenmax_static" ]
104  install_images = [ chipset_base_dir ]
105  subsystem_name = "hdf"
106  part_name = "drivers_peripheral_codec"
107  shlib_type = "hdi"
108}
109
110group("codec_idl_omx_service") {
111  deps = [
112    ":libcodec_component_manager_service_3.0",
113    ":libcodec_driver",
114  ]
115}
116