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.
13
14import("//build/ohos.gni")
15import("../codec.gni")
16
17config("headers_config") {
18  include_dirs = [
19    "../interfaces/include",
20    "../hal/include",
21  ]
22}
23
24ohos_shared_library("libcodec_hdi_omx_server") {
25  include_dirs = [
26    "../hal/v2.0/hdi_impl/include",
27    "../hal/include",
28    "../utils/include",
29  ]
30  configs = [ ":headers_config" ]
31
32  sources = [
33    "../utils/src/codec_util.c",
34    "src/codec_adapter.cpp",
35    "src/codec_callback_type_proxy.c",
36    "src/codec_component_capability_config.c",
37    "src/codec_component_manager_service.c",
38    "src/codec_component_manager_stub.c",
39    "src/codec_component_type_driver.c",
40    "src/codec_component_type_service.c",
41    "src/codec_component_type_stub.c",
42    "src/codec_config_parser.c",
43    "src/codec_death_recipient.cpp",
44    "src/codec_dfx_service.c",
45    "src/codec_types.c",
46    "v2.0/hdi_impl/src/codec_dyna_buffer.cpp",
47    "v2.0/hdi_impl/src/codec_handle_buffer.cpp",
48    "v2.0/hdi_impl/src/codec_omx_core.cpp",
49    "v2.0/hdi_impl/src/codec_share_buffer.cpp",
50    "v2.0/hdi_impl/src/component_mgr.cpp",
51    "v2.0/hdi_impl/src/component_node.cpp",
52    "v2.0/hdi_impl/src/icodec_buffer.cpp",
53  ]
54  if (is_standard_system) {
55    external_deps = [
56      "c_utils:utils",
57      "graphic_surface:buffer_handle",
58      "hdf_core:libhdf_host",
59      "hdf_core:libhdf_ipc_adapter",
60      "hdf_core:libhdf_utils",
61      "hilog:libhilog",
62    ]
63  } else {
64    external_deps = [ "hilog:libhilog" ]
65  }
66  external_deps += [
67    "hitrace:hitrace_meter",
68    "openmax:libopenmax_static",
69  ]
70  defines = [ "LOG_TAG_HDI_SERVER" ]
71  if (drivers_peripheral_codec_feature_set_omx_role) {
72    defines += [ "SUPPORT_ROLE" ]
73  }
74  if (use_musl) {
75    if (musl_use_jemalloc && musl_use_jemalloc_dfx_intf) {
76      defines += [ "CONFIG_USE_JEMALLOC_DFX_INTF" ]
77    }
78  }
79  shlib_type = "hdi"
80  install_images = [ chipset_base_dir ]
81  subsystem_name = "hdf"
82  part_name = "drivers_peripheral_codec"
83}
84
85ohos_static_library("libcodec_hdi_omx_server_static") {
86  include_dirs = [
87    "../interfaces/include",
88    "../hal/v2.0/hdi_impl/include",
89    "../hal/include",
90    "../utils/include",
91  ]
92  sources = [
93    "../utils/src/codec_util.c",
94    "src/codec_adapter.cpp",
95    "src/codec_callback_type_proxy.c",
96    "src/codec_component_capability_config.c",
97    "src/codec_component_manager_service.c",
98    "src/codec_component_manager_stub.c",
99    "src/codec_component_type_driver.c",
100    "src/codec_component_type_service.c",
101    "src/codec_component_type_stub.c",
102    "src/codec_config_parser.c",
103    "src/codec_death_recipient.cpp",
104    "src/codec_dfx_service.c",
105    "src/codec_types.c",
106    "v2.0/hdi_impl/src/codec_dyna_buffer.cpp",
107    "v2.0/hdi_impl/src/codec_handle_buffer.cpp",
108    "v2.0/hdi_impl/src/codec_omx_core.cpp",
109    "v2.0/hdi_impl/src/codec_share_buffer.cpp",
110    "v2.0/hdi_impl/src/component_mgr.cpp",
111    "v2.0/hdi_impl/src/component_node.cpp",
112    "v2.0/hdi_impl/src/icodec_buffer.cpp",
113  ]
114  if (is_standard_system) {
115    external_deps = [
116      "c_utils:utils",
117      "graphic_surface:buffer_handle",
118      "hdf_core:libhdf_host",
119      "hdf_core:libhdf_ipc_adapter",
120      "hdf_core:libhdf_utils",
121      "hilog:libhilog",
122    ]
123  } else {
124    external_deps = [ "hilog:libhilog" ]
125  }
126  external_deps += [
127    "hitrace:hitrace_meter",
128    "openmax:libopenmax_static",
129  ]
130  defines = [ "LOG_TAG_HDI_SERVER" ]
131  if (drivers_peripheral_codec_feature_set_omx_role) {
132    defines += [ "SUPPORT_ROLE" ]
133  }
134  if (use_musl) {
135    if (musl_use_jemalloc && musl_use_jemalloc_dfx_intf) {
136      defines += [ "CONFIG_USE_JEMALLOC_DFX_INTF" ]
137    }
138  }
139  subsystem_name = "hdf"
140  part_name = "drivers_peripheral_codec"
141}
142
143ohos_shared_library("libcodec_hdi_omx_client") {
144  include_dirs = [
145    "../hal/include",
146    "../utils/include",
147  ]
148  public_configs = [ ":headers_config" ]
149  sources = [
150    "../utils/src/codec_util.c",
151    "src/codec_callback_type_stub.c",
152    "src/codec_component_manager_proxy.c",
153    "src/codec_component_type_proxy.c",
154    "src/codec_types.c",
155  ]
156
157  if (is_standard_system) {
158    external_deps = [
159      "c_utils:utils",
160      "graphic_surface:buffer_handle",
161      "hdf_core:libhdf_ipc_adapter",
162      "hdf_core:libhdi",
163      "hdf_core:libpub_utils",
164      "hilog:libhilog",
165    ]
166  } else {
167    external_deps = [ "hilog:libhilog" ]
168  }
169  external_deps += [ "openmax:libopenmax_static" ]
170  defines = [ "LOG_TAG_HDI_CLIENT" ]
171  if (use_musl) {
172    if (musl_use_jemalloc && musl_use_jemalloc_dfx_intf) {
173      defines += [ "CONFIG_USE_JEMALLOC_DFX_INTF" ]
174    }
175  }
176  install_images = [ system_base_dir ]
177  subsystem_name = "hdf"
178  part_name = "drivers_peripheral_codec"
179}
180
181ohos_shared_library("libcodec_hdi_omx_callback_type_service_impl") {
182  include_dirs = [
183    "../hal/include",
184    "../utils/include",
185  ]
186  configs = [ ":headers_config" ]
187
188  sources = [ "src/codec_callback_type_service.c" ]
189
190  if (is_standard_system) {
191    external_deps = [
192      "c_utils:utils",
193      "hdf_core:libhdf_ipc_adapter",
194      "hdf_core:libhdf_utils",
195      "hdf_core:libhdi",
196      "hilog:libhilog",
197    ]
198  } else {
199    external_deps = [ "hilog:libhilog" ]
200  }
201  external_deps += [ "openmax:libopenmax_static" ]
202  defines = [ "LOG_TAG_HDI_CLIENT" ]
203  install_images = [ chipset_base_dir ]
204  innerapi_tags = [ "passthrough" ]
205  subsystem_name = "hdf"
206  part_name = "drivers_peripheral_codec"
207}
208
209group("codec_hdi_omx") {
210  deps = [
211    ":libcodec_hdi_omx_callback_type_service_impl",
212    ":libcodec_hdi_omx_client",
213    ":libcodec_hdi_omx_server",
214  ]
215}
216