• 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
17group("capi_packages") {
18  deps = []
19  if (av_codec_support_capi) {
20    deps += [
21      "$av_codec_root_dir/interfaces/kits/c:native_media_adec",
22      "$av_codec_root_dir/interfaces/kits/c:native_media_aenc",
23      "$av_codec_root_dir/interfaces/kits/c:native_media_avdemuxer",
24      "$av_codec_root_dir/interfaces/kits/c:native_media_avmuxer",
25      "$av_codec_root_dir/interfaces/kits/c:native_media_avsource",
26      "$av_codec_root_dir/interfaces/kits/c:native_media_codecbase",
27      "$av_codec_root_dir/interfaces/kits/c:native_media_core",
28      "$av_codec_root_dir/interfaces/kits/c:native_media_vdec",
29      "$av_codec_root_dir/interfaces/kits/c:native_media_venc",
30    ]
31  }
32}
33
34config("av_codec_capi_config") {
35  include_dirs = [
36    "$av_codec_root_dir/frameworks/native/capi/common",
37    "$av_codec_root_dir/interfaces/inner_api/native",
38    "$av_codec_root_dir/interfaces/kits/c",
39    "$av_codec_root_dir/services/dfx/include",
40    "$av_codec_root_dir/services/utils/include",
41    "//foundation/graphic/graphic_2d/frameworks/surface/include",
42  ]
43
44  cflags = [
45    "-fno-exceptions",
46    "-Wall",
47    "-fno-common",
48    "-fstack-protector-all",
49    "-Wshadow",
50    "-FPIC",
51    "-FS",
52    "-O2",
53    "-D_FORTIFY_SOURCE=2",
54    "-Wformat=2",
55    "-Wdate-time",
56  ]
57
58  cflags_cc = [
59    "-std=c++17",
60    "-fno-rtti",
61  ]
62}
63
64ohos_shared_library("native_media_core") {
65  install_enable = true
66
67  sanitize = {
68    cfi = true
69    cfi_cross_dso = true
70    debug = false
71    blocklist = "../../../cfi_blocklist.txt"
72  }
73
74  configs = [ ":av_codec_capi_config" ]
75
76  sources = [
77    "$av_codec_root_dir/frameworks/native/capi/common/native_avformat.cpp",
78    "$av_codec_root_dir/frameworks/native/capi/common/native_avmemory.cpp",
79  ]
80
81  if (av_codec_support_codeclist) {
82    sources += [ "$av_codec_root_dir/frameworks/native/capi/common/native_avcapability.cpp" ]
83  }
84
85  deps = [
86    "$av_codec_root_dir/interfaces/inner_api/native:av_codec_client",
87    "$av_codec_root_dir/services/utils:av_codec_format",
88  ]
89
90  external_deps = [
91    "graphic_2d:surface",
92    "hilog:libhilog",
93  ]
94  output_extension = "so"
95  subsystem_name = "multimedia"
96  part_name = "av_codec"
97}
98
99ohos_shared_library("native_media_avmuxer") {
100  install_enable = true
101  sources = [
102    "$av_codec_root_dir/frameworks/native/capi/avcodec/native_avcodec_base.cpp",
103    "$av_codec_root_dir/frameworks/native/capi/avmuxer/native_avmuxer.cpp",
104    "$av_codec_root_dir/frameworks/native/capi/common/native_avformat.cpp",
105    "$av_codec_root_dir/frameworks/native/capi/common/native_avmemory.cpp",
106  ]
107
108  public_configs = [ ":av_codec_capi_config" ]
109
110  deps = [
111    "$av_codec_root_dir/interfaces/inner_api/native:av_codec_client",
112    "$av_codec_root_dir/services/utils:av_codec_format",
113  ]
114
115  external_deps = [
116    "c_utils:utils",
117    "hilog:libhilog",
118  ]
119  output_extension = "so"
120  subsystem_name = "multimedia"
121  part_name = "av_codec"
122}
123
124ohos_shared_library("native_media_avdemuxer") {
125  install_enable = true
126  sources = [
127    "$av_codec_root_dir/frameworks/native/capi/avdemuxer/native_avdemuxer.cpp",
128  ]
129
130  public_configs = [ ":av_codec_capi_config" ]
131
132  deps = [
133    "$av_codec_root_dir/interfaces/inner_api/native:av_codec_client",
134    "$av_codec_root_dir/interfaces/kits/c:native_media_core",
135    "$av_codec_root_dir/services/utils:av_codec_format",
136  ]
137
138  external_deps = [
139    "c_utils:utils",
140    "graphic_2d:surface",
141    "hilog:libhilog",
142  ]
143  output_extension = "so"
144  subsystem_name = "multimedia"
145  part_name = "av_codec"
146}
147
148ohos_shared_library("native_media_avsource") {
149  install_enable = true
150  sources = [
151    "$av_codec_root_dir/frameworks/native/capi/avsource/native_avsource.cpp",
152  ]
153
154  public_configs = [ ":av_codec_capi_config" ]
155
156  deps = [
157    "$av_codec_root_dir/interfaces/inner_api/native:av_codec_client",
158    "$av_codec_root_dir/interfaces/kits/c:native_media_core",
159    "$av_codec_root_dir/services/utils:av_codec_format",
160  ]
161
162  external_deps = [
163    "c_utils:utils",
164    "graphic_2d:surface",
165    "hilog:libhilog",
166  ]
167  output_extension = "so"
168  subsystem_name = "multimedia"
169  part_name = "av_codec"
170}
171
172ohos_shared_library("native_media_codecbase") {
173  install_enable = true
174  sources = [
175    "$av_codec_root_dir/frameworks/native/capi/avcodec/native_avcodec_base.cpp",
176  ]
177
178  public_configs = [ ":av_codec_capi_config" ]
179
180  external_deps = [ "hilog:libhilog" ]
181  output_extension = "so"
182  subsystem_name = "multimedia"
183  part_name = "av_codec"
184}
185
186ohos_shared_library("native_media_adec") {
187  install_enable = true
188  sources = [ "$av_codec_root_dir/frameworks/native/capi/avcodec/native_audio_decoder.cpp" ]
189
190  public_configs = [ ":av_codec_capi_config" ]
191
192  deps = [
193    "$av_codec_root_dir/interfaces/inner_api/native:av_codec_client",
194    "$av_codec_root_dir/interfaces/kits/c:native_media_codecbase",
195    "$av_codec_root_dir/interfaces/kits/c:native_media_core",
196    "$av_codec_root_dir/services/dfx:av_codec_service_dfx",
197  ]
198
199  external_deps = [
200    "c_utils:utils",
201    "hilog:libhilog",
202  ]
203  output_extension = "so"
204  subsystem_name = "multimedia"
205  part_name = "av_codec"
206}
207
208ohos_shared_library("native_media_aenc") {
209  install_enable = true
210  sources = [ "$av_codec_root_dir/frameworks/native/capi/avcodec/native_audio_encoder.cpp" ]
211
212  public_configs = [ ":av_codec_capi_config" ]
213
214  deps = [
215    "$av_codec_root_dir/interfaces/inner_api/native:av_codec_client",
216    "$av_codec_root_dir/interfaces/kits/c:native_media_codecbase",
217    "$av_codec_root_dir/interfaces/kits/c:native_media_core",
218    "$av_codec_root_dir/services/dfx:av_codec_service_dfx",
219  ]
220
221  external_deps = [
222    "c_utils:utils",
223    "hilog:libhilog",
224  ]
225  output_extension = "so"
226  subsystem_name = "multimedia"
227  part_name = "av_codec"
228}
229
230ohos_shared_library("native_media_vdec") {
231  install_enable = true
232  sources = [ "$av_codec_root_dir/frameworks/native/capi/avcodec/native_video_decoder.cpp" ]
233
234  public_configs = [ ":av_codec_capi_config" ]
235
236  deps = [
237    "$av_codec_root_dir/interfaces/inner_api/native:av_codec_client",
238    "$av_codec_root_dir/interfaces/kits/c:native_media_codecbase",
239    "$av_codec_root_dir/interfaces/kits/c:native_media_core",
240    "$av_codec_root_dir/services/dfx:av_codec_service_dfx",
241  ]
242
243  external_deps = [
244    "c_utils:utils",
245    "graphic_2d:surface",
246    "hilog:libhilog",
247  ]
248  output_extension = "so"
249  subsystem_name = "multimedia"
250  part_name = "av_codec"
251}
252
253ohos_shared_library("native_media_venc") {
254  install_enable = true
255  sources = [ "$av_codec_root_dir/frameworks/native/capi/avcodec/native_video_encoder.cpp" ]
256
257  public_configs = [ ":av_codec_capi_config" ]
258
259  deps = [
260    "$av_codec_root_dir/interfaces/inner_api/native:av_codec_client",
261    "$av_codec_root_dir/interfaces/kits/c:native_media_codecbase",
262    "$av_codec_root_dir/interfaces/kits/c:native_media_core",
263    "$av_codec_root_dir/services/dfx:av_codec_service_dfx",
264  ]
265
266  external_deps = [
267    "c_utils:utils",
268    "graphic_2d:surface",
269    "hilog:libhilog",
270  ]
271  output_extension = "so"
272  subsystem_name = "multimedia"
273  part_name = "av_codec"
274}
275