• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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("//build/ohos.gni")
15import("//foundation/multimedia/av_codec/config.gni")
16
17config("hcodec_public_cfg") {
18  include_dirs = [
19    "$av_codec_root_dir/services/engine/codec/video/hcodec/include",
20    "$av_codec_root_dir/services/engine/base/include/",
21    "$av_codec_root_dir/interfaces/inner_api/native/",
22    "$av_codec_root_dir/services/utils/include/",
23  ]
24}
25
26config("hcodec_cfg") {
27  cflags_cc = [ "-fexceptions" ]
28}
29
30ohos_shared_library("hcodec") {
31  branch_protector_ret = "pac_ret"
32  install_enable = true
33  subsystem_name = "multimedia"
34  part_name = "av_codec"
35
36  sanitize = av_codec_sanitize
37
38  sources = [
39    "hcodec.cpp",
40    "hcodec_api.cpp",
41    "hcodec_bg.cpp",
42    "hcodec_dfx.cpp",
43    "hcodec_list.cpp",
44    "hcodec_state.cpp",
45    "hcodec_utils.cpp",
46    "hdecoder.cpp",
47    "hencoder.cpp",
48    "msg_handle_loop.cpp",
49    "state_machine.cpp",
50    "type_converter.cpp",
51  ]
52
53  public_configs = [ ":hcodec_public_cfg" ]
54  configs = [ ":hcodec_cfg" ]
55  defines = []
56
57  if (defined(av_codec_support_video_processing_engine) &&
58      av_codec_support_video_processing_engine) {
59    defines += [ "USE_VIDEO_PROCESSING_ENGINE" ]
60  }
61
62  include_dirs = [
63    "$media_foundation_root_dir/src/buffer/avbuffer/include",
64    "$av_codec_root_dir/../../../third_party/openmax/api/1.1.2",
65    "$av_codec_root_dir/../../../drivers/peripheral/codec/interfaces/include/",
66    "$av_codec_root_dir/../../../drivers/hdf_core/interfaces/inner_api",
67    "$av_codec_root_dir/../../../drivers/hdf_core/interfaces/inner_api/osal/uhdf",
68    "$av_codec_root_dir/../../../commonlibrary/memory_utils/libdmabufheap/include",
69    "$av_codec_root_dir/interfaces/inner_api/native",
70  ]
71
72  deps = [
73    "$av_codec_root_dir/services/engine/base:av_codec_codec_base",
74    "$av_codec_root_dir/services/utils:av_codec_service_utils",
75  ]
76
77  external_deps = [
78    "c_utils:utils",
79    "drivers_interface_codec:libcodec_proxy_3.0",
80    "drivers_interface_display:libdisplay_commontype_proxy_1.0",
81    "graphic_surface:surface",
82    "graphic_surface:sync_fence",
83    "hdf_core:libhdi",
84    "hilog:libhilog",
85    "hitrace:hitrace_meter",
86    "init:libbegetutil",
87    "ipc:ipc_single",
88    "media_foundation:media_foundation",
89    "qos_manager:qos",
90  ]
91
92  if (defined(av_codec_support_video_processing_engine) &&
93      av_codec_support_video_processing_engine) {
94    external_deps += [ "video_processing_engine:videoprocessingengine" ]
95  }
96
97  if (build_variant != "user") {
98    defines += [ "BUILD_ENG_VERSION" ]
99  }
100
101  if (av_codec_hcodec_enable_qos_the_whole_time) {
102    defines += [ "AV_CODEC_HCODEC_ENABLE_QOS_THE_WHOLE_TIME" ]
103  }
104}
105
106group("hcodec_group") {
107  deps = [ ":hcodec" ]
108  if (build_variant != "user") {
109    deps += [ "$av_codec_root_dir/test/unittest/hcodec_test/demo:hcodec_demo" ]
110  }
111}
112