1# Copyright (C) 2023-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
14declare_args() {
15  av_codec_support_capi = true
16  av_codec_support_codec = true
17  av_codec_client_support_codec = true
18  av_codec_support_codeclist = true
19  av_codec_support_hcodec = true
20  av_codec_support_demuxer = true
21  av_codec_support_source = true
22  av_codec_support_muxer = true
23  av_codec_support_test = true
24  av_codec_support_xcollie = true
25  av_codec_support_bitstream_dump = true
26  av_codec_support_drm = false
27  av_codec_enable_special_codec = false
28  av_codec_support_video_processing_engine = false
29  if (defined(global_parts_info) &&
30      defined(global_parts_info.multimedia_video_processing_engine)) {
31    av_codec_support_video_processing_engine = true
32  }
33  av_codec_support_libcurl = true
34}
35av_codec_sanitize = {
36  boundary_sanitize = true
37  cfi = true
38  cfi_cross_dso = true
39  integer_overflow = true
40  ubsan = true
41  debug = false
42}
43av_codec_test_sanitize = {
44  debug = false
45}
46av_codec_root_dir = "//foundation/multimedia/av_codec"
47media_foundation_root_dir = "//foundation/multimedia/media_foundation"
48audio_framework_root_dir = "//foundation/multimedia/audio_framework"
49graphic_2d_root_dir = "//foundation/graphic/graphic_2d"
50graphic_suface_root_dir = "//foundation/graphic/graphic_surface"
51c_utils_root_dir = "//commonlibrary/c_utils"
52drm_framework_root_dir = "//foundation/multimedia/drm_framework"
53video_processing_engine_root_dir =
54    "//foundation/multimedia/video_processing_engine"
55
56av_codec_defines = [
57  "HST_ANY_WITH_NO_RTTI",
58  "MEDIA_OHOS",
59]
60
61if (av_codec_support_capi) {
62  av_codec_defines += [ "SUPPORT_CAPI" ]
63} else {
64  av_codec_defines += [ "UNSUPPORT_CAPI" ]
65}
66
67if (av_codec_support_codec) {
68  av_codec_defines += [ "SUPPORT_CODEC" ]
69} else {
70  av_codec_defines += [ "UNSUPPORT_CODEC" ]
71}
72
73if (av_codec_support_codeclist) {
74  av_codec_defines += [ "SUPPORT_CODECLIST" ]
75} else {
76  av_codec_defines += [ "UNSUPPORT_CODECLIST" ]
77}
78
79if (av_codec_support_hcodec) {
80  av_codec_defines += [ "SUPPORT_HCODEC" ]
81} else {
82  av_codec_defines += [ "UNSUPPORT_HCODEC" ]
83}
84
85if (av_codec_support_demuxer) {
86  av_codec_defines += [ "SUPPORT_DEMUXER" ]
87} else {
88  av_codec_defines += [ "UNSUPPORT_DEMUXER" ]
89}
90
91if (av_codec_support_muxer) {
92  av_codec_defines += [ "SUPPORT_MUXER" ]
93} else {
94  av_codec_defines += [ "UNSUPPORT_MUXER" ]
95}
96
97if (av_codec_support_source) {
98  av_codec_defines += [ "SUPPORT_SOURCE" ]
99} else {
100  av_codec_defines += [ "UNSUPPORT_SOURCE" ]
101}
102
103if (av_codec_support_xcollie) {
104  av_codec_defines += [ "HICOLLIE_ENABLE" ]
105}
106
107if (av_codec_support_bitstream_dump) {
108  av_codec_defines += [ "BITSTREAM_DUMP_ENABLE" ]
109}
110
111if (defined(global_parts_info) &&
112    defined(global_parts_info.multimedia_drm_framework)) {
113  av_codec_support_drm = true
114}
115
116if (av_codec_support_drm) {
117  av_codec_defines += [ "SUPPORT_DRM" ]
118} else {
119  av_codec_defines += [ "UNSUPPORT_DRM" ]
120}
121