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