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
17ohos_static_library("av_codec_audio_ffmpeg_codec") {
18  branch_protector_ret = "pac_ret"
19  cflags = [
20    "-std=c++17",
21    "-fno-rtti",
22    "-fno-exceptions",
23    "-Wall",
24    "-fno-common",
25    "-fstack-protector-strong",
26    "-Wshadow",
27    "-FPIC",
28    "-FS",
29    "-O2",
30    "-D_FORTIFY_SOURCE=2",
31    "-fvisibility=hidden",
32    "-Wformat=2",
33    "-Wfloat-equal",
34    "-Wdate-time",
35    "-Werror",
36    "-Wno-deprecated-declarations",
37    "-Wextra",
38    "-Wimplicit-fallthrough",
39    "-Wsign-compare",
40    "-Wunused-parameter",
41  ]
42
43  sanitize = av_codec_sanitize
44
45  include_dirs = [
46    "$av_codec_root_dir/interfaces/inner_api/native",
47    "$av_codec_root_dir/interfaces/kits/c",
48    "$av_codec_root_dir/services/dfx/include",
49    "$av_codec_root_dir/services/engine/base/include",
50    "$av_codec_root_dir/services/engine/codec/include/audio",
51    "$av_codec_root_dir/services/engine/codec/include/audio/decoder",
52    "$av_codec_root_dir/services/engine/codec/include/audio/encoder",
53    "$av_codec_root_dir/services/engine/factory",
54    "$av_codec_root_dir/services/utils/include",
55    "$av_codec_root_dir/services/engine/common/include",
56  ]
57
58  sources = [
59    "$av_codec_root_dir/services/engine/codec/audio/audio_buffer_info.cpp",
60    "$av_codec_root_dir/services/engine/codec/audio/audio_buffers_manager.cpp",
61    "$av_codec_root_dir/services/engine/codec/audio/audio_codec_adapter.cpp",
62    "$av_codec_root_dir/services/engine/codec/audio/audio_codec_worker.cpp",
63    "$av_codec_root_dir/services/engine/codec/audio/audio_resample.cpp",
64    "$av_codec_root_dir/services/engine/codec/audio/decoder/audio_ffmpeg_aac_decoder_plugin.cpp",
65    "$av_codec_root_dir/services/engine/codec/audio/decoder/audio_ffmpeg_amrnb_decoder_plugin.cpp",
66    "$av_codec_root_dir/services/engine/codec/audio/decoder/audio_ffmpeg_amrwb_decoder_plugin.cpp",
67    "$av_codec_root_dir/services/engine/codec/audio/decoder/audio_ffmpeg_decoder_plugin.cpp",
68    "$av_codec_root_dir/services/engine/codec/audio/decoder/audio_ffmpeg_flac_decoder_plugin.cpp",
69    "$av_codec_root_dir/services/engine/codec/audio/decoder/audio_ffmpeg_mp3_decoder_plugin.cpp",
70    "$av_codec_root_dir/services/engine/codec/audio/decoder/audio_ffmpeg_vorbis_decoder_plugin.cpp",
71    "$av_codec_root_dir/services/engine/codec/audio/decoder/audio_g711mu_decoder_plugin.cpp",
72    "$av_codec_root_dir/services/engine/codec/audio/decoder/audio_opus_decoder_plugin.cpp",
73    "$av_codec_root_dir/services/engine/codec/audio/encoder/audio_ffmpeg_aac_encoder_plugin.cpp",
74    "$av_codec_root_dir/services/engine/codec/audio/encoder/audio_ffmpeg_encoder_plugin.cpp",
75    "$av_codec_root_dir/services/engine/codec/audio/encoder/audio_ffmpeg_flac_encoder_plugin.cpp",
76    "$av_codec_root_dir/services/engine/codec/audio/encoder/audio_g711mu_encoder_plugin.cpp",
77    "$av_codec_root_dir/services/engine/codec/audio/encoder/audio_opus_encoder_plugin.cpp",
78  ]
79
80  deps = [
81    "$av_codec_root_dir/services/engine/base:av_codec_codec_base",
82    "$av_codec_root_dir/services/engine/common:av_codec_engine_common",
83  ]
84
85  public_deps = [
86    "$av_codec_root_dir/services/dfx:av_codec_service_dfx",
87    "$av_codec_root_dir/services/utils:av_codec_service_utils",
88  ]
89
90  external_deps = [
91    "bounds_checking_function:libsec_static",
92    "c_utils:utils",
93    "ffmpeg:libohosffmpeg",
94    "graphic_surface:surface",
95    "hilog:libhilog",
96    "hisysevent:libhisysevent",
97    "hitrace:hitrace_meter",
98    "media_foundation:media_foundation",
99  ]
100
101  subsystem_name = "multimedia"
102  part_name = "av_codec"
103}
104