1# Copyright (C) 2021-2023 HiHope Open Source Organization .
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("//device/soc/rockchip/rk3568/hardware/omx_il/rk_omx.gni")
16import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni")
17
18ohos_static_library("RkOMX_OSAL") {
19  sources = [
20    "Rockchip_OSAL_ColorUtils.cpp",
21    "Rockchip_OSAL_ETC.c",
22    "Rockchip_OSAL_Env.c",
23    "Rockchip_OSAL_Event.c",
24    "Rockchip_OSAL_Library.c",
25    "Rockchip_OSAL_Log.c",
26    "Rockchip_OSAL_Memory.c",
27    "Rockchip_OSAL_Mutex.c",
28    "Rockchip_OSAL_OHOS.cpp",
29    "Rockchip_OSAL_Queue.c",
30    "Rockchip_OSAL_RGA_Process.c",
31    "Rockchip_OSAL_Semaphore.c",
32    "Rockchip_OSAL_SharedMemory.c",
33    "Rockchip_OSAL_Thread.c",
34  ]
35
36  include_dirs = [
37    ".",
38    "//device/soc/rockchip/rk3568/hardware/mpp/mpp/legacy",
39    "//device/soc/rockchip/rk3568/hardware/mpp/include",
40    "//device/soc/rockchip/rk3568/hardware/omx_il/component/common",
41    "//device/soc/rockchip/rk3568/hardware/omx_il/component/video/dec",
42    "//device/soc/rockchip/rk3568/hardware/omx_il/component/video/enc",
43    "//device/soc/rockchip/rk3568/hardware/omx_il/include/khronos",
44    "//device/soc/rockchip/rk3568/hardware/omx_il/include/rockchip",
45    "//device/soc/rockchip/rk3568/hardware/omx_il/include/librkvpu",
46    "//device/soc/rockchip/rk3568/hardware/omx_il/include/librkvpu",
47    "//device/soc/rockchip/rk3568/hardware/rga/include",
48    "//drivers/peripheral/base",
49    "//drivers/peripheral/display/interfaces/include",
50    "//drivers/peripheral/codec/interfaces/include",
51    "//third_party/libdrm/include/drm",
52    "//third_party/openmax/api/1.1.2",
53    "//commonlibrary/c_utils/base/include",
54  ]
55  defines = [
56    "AVS100",
57    "OHOS",
58  ]
59  cflags = [
60    "-Wno-implicit-function-declaration",
61    "-Wno-unused-variable",
62  ]
63
64  cflags_cc = [
65    "-Wno-implicit-function-declaration",
66    "-Wno-unused-variable",
67    "-Wno-format",
68    "-Wno-switch",
69  ]
70
71  if (USE_AFBC) {
72    defines += [ "SUPPORT_AFBC" ]
73  }
74
75  if (USE_GPU) {
76    defines += [ "ROCKCHIP_GPU_LIB_ENABLE" ]
77  }
78
79  if (USE_RGA) {
80    defines += [ "SUPPORT_RGA" ]
81  }
82  if (USE_AVS80) {
83    defines += [ "AVS80" ]
84  }
85  defines += [ "OHOS_BUFFER_HANDLE" ]
86
87  deps =
88      [ "//device/soc/rockchip/rk3568/hardware/mpp/mpp/legacy:librockchip_vpu" ]
89
90  external_deps = [
91    "bounds_checking_function:libsec_static",
92    "hdf_core:libhdf_utils",
93    "hilog:libhilog",
94    "init:libbegetutil",
95  ]
96}
97