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