• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 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("//build/ohos.gni")
15import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni")
16CODEC_OEM_PATH =
17    rebase_path("//device/soc/${device_company}/${product_name}/hardware/codec")
18cmd =
19    "if [ -f ${CODEC_OEM_PATH}/BUILD.gn ]; then echo true; else echo false; fi"
20HAVE_CODEC_OEM_PATH =
21    exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value")
22ohos_executable("codec_hdi_adapter_decode") {
23  if (HAVE_CODEC_OEM_PATH) {
24    include_dirs = [
25      "./include",
26      "${CODEC_OEM_PATH}/include",
27      "${CODEC_OEM_PATH}/../mpp/include",
28      "//drivers/peripheral/codec/hal/include",
29      "//drivers/peripheral/codec/interfaces/include",
30      "//third_party/openmax/api/1.1.2",
31      "//drivers/peripheral/display/hdi_service/gralloc/include",
32    ]
33
34    sources = [
35      "src/codec_hdi_adapter_decode.cpp",
36      "src/command_adapter_parse.cpp",
37    ]
38
39    deps = [
40      "//drivers/hdf_core/adapter/uhdf2/hdi:libhdi",
41      "//drivers/hdf_core/adapter/uhdf2/utils:libhdf_utils",
42      "//drivers/peripheral/codec/hal/passthrough:libcodec_hdi_passthrough_impl",
43      "//third_party/bounds_checking_function:libsec_shared",
44    ]
45  }
46
47  if (is_standard_system) {
48    external_deps = [
49      "c_utils:utils",
50      "drivers_peripheral_display:hdi_gralloc_client",
51      "graphic_chipsetsdk:buffer_handle",
52      "hiviewdfx_hilog_native:libhilog",
53    ]
54  } else {
55    external_deps = [ "hilog:libhilog" ]
56  }
57  install_enable = false
58  install_images = [ chipset_base_dir ]
59  subsystem_name = "hdf"
60  part_name = "drivers_peripheral_codec"
61}
62
63ohos_executable("codec_hdi_adapter_encode") {
64  if (HAVE_CODEC_OEM_PATH) {
65    include_dirs = [
66      "./include",
67      "${CODEC_OEM_PATH}/include",
68      "${CODEC_OEM_PATH}/../mpp/include",
69      "//drivers/peripheral/codec/hal/include",
70      "//drivers/hdf_core/adapter/uhdf2/include/hdi",
71      "//drivers/peripheral/codec/interfaces/include",
72      "//third_party/openmax/api/1.1.2",
73      "//drivers/peripheral/display/hdi_service/gralloc/include",
74    ]
75
76    sources = [
77      "src/codec_hdi_adapter_encode.cpp",
78      "src/command_adapter_parse.cpp",
79    ]
80
81    deps = [
82      "//drivers/hdf_core/adapter/uhdf2/hdi:libhdi",
83      "//drivers/hdf_core/adapter/uhdf2/utils:libhdf_utils",
84      "//drivers/peripheral/codec/hal/passthrough:libcodec_hdi_passthrough_impl",
85      "//third_party/bounds_checking_function:libsec_shared",
86    ]
87  }
88
89  if (is_standard_system) {
90    external_deps = [
91      "c_utils:utils",
92      "drivers_peripheral_display:hdi_gralloc_client",
93      "graphic_chipsetsdk:buffer_handle",
94      "hiviewdfx_hilog_native:libhilog",
95    ]
96  } else {
97    external_deps = [ "hilog:libhilog" ]
98  }
99  install_enable = false
100  install_images = [ chipset_base_dir ]
101  subsystem_name = "hdf"
102  part_name = "drivers_peripheral_codec"
103}
104group("codec_hdi_adapter_demo") {
105  deps = [
106    ":codec_hdi_adapter_decode",
107    ":codec_hdi_adapter_encode",
108  ]
109}
110