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/media_foundation/config.gni") 16 17if (hst_is_standard_sys) { 18 group("capi_packages") { 19 deps = [ ":native_media_core" ] 20 } 21 22 config("media_foundation_capi_public_config") { 23 include_dirs = [ 24 "./", 25 "./common", 26 "$histreamer_root_dir/interface/inner_api", 27 "$histreamer_root_dir/interface/kits/c", 28 ] 29 defines = [ 30 "HST_ANY_WITH_NO_RTTI", 31 "MEDIA_OHOS", 32 ] 33 } 34 35 config("media_foundation_capi_config") { 36 cflags = [ 37 "-fno-exceptions", 38 "-Wall", 39 "-fno-common", 40 "-fstack-protector-all", 41 "-Wshadow", 42 "-FPIC", 43 "-FS", 44 "-O2", 45 "-D_FORTIFY_SOURCE=2", 46 "-Wformat=2", 47 "-Wdate-time", 48 ] 49 50 cflags_cc = [ 51 "-std=c++17", 52 "-fno-rtti", 53 ] 54 } 55 56 ohos_shared_library("native_media_core") { 57 stack_protector_ret = true 58 install_enable = true 59 60 sanitize = { 61 ubsan = true 62 boundary_sanitize = true 63 cfi = true 64 cfi_cross_dso = true 65 debug = false 66 integer_overflow = true 67 } 68 69 configs = [ ":media_foundation_capi_config" ] 70 public_configs = [ ":media_foundation_capi_public_config" ] 71 72 deps = [ "$histreamer_root_dir/src:media_foundation" ] 73 74 sources = [ 75 "./native_avbuffer.cpp", 76 "./native_avformat.cpp", 77 "./native_avmemory.cpp", 78 ] 79 80 external_deps = [ 81 "c_utils:utils", 82 "graphic_surface:surface", 83 "graphic_surface:sync_fence", 84 "hilog:libhilog", 85 "ipc:ipc_core", 86 ] 87 88 output_extension = "so" 89 innerapi_tags = [ "ndk" ] 90 subsystem_name = "multimedia" 91 part_name = "media_foundation" 92 } 93} else { 94 group("capi_packages") { 95 } 96 group("native_media_core") { 97 } 98} 99