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/player_framework/config.gni") 16 17group("capi_packages") { 18 deps = [] 19 if (player_framework_support_capi) { 20 deps += [ 21 "$MEDIA_PLAYER_ROOT_DIR/interfaces/kits/c:avplayer", 22 "$MEDIA_PLAYER_ROOT_DIR/interfaces/kits/c:native_avscreen_capture", 23 ] 24 } 25} 26 27config("media_capi_config") { 28 include_dirs = [ 29 "$MEDIA_PLAYER_ROOT_DIR/interfaces/inner_api/native", 30 "$MEDIA_PLAYER_ROOT_DIR/interfaces/kits/c", 31 "$MEDIA_PLAYER_ROOT_DIR/frameworks/native/capi/common", 32 "$MEDIA_PLAYER_ROOT_DIR/services/utils/include", 33 ] 34 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 55config("media_capi_public_config") { 56 include_dirs = [ "$MEDIA_PLAYER_ROOT_DIR/interfaces/kits/c" ] 57} 58 59ohos_shared_library("native_avscreen_capture") { 60 stack_protector_ret = true 61 install_enable = true 62 63 sanitize = { 64 integer_overflow = true 65 ubsan = true 66 boundary_sanitize = true 67 cfi = true 68 cfi_cross_dso = true 69 debug = false 70 } 71 72 sources = [ "$MEDIA_PLAYER_ROOT_DIR/frameworks/native/capi/screencapture/native_avscreen_capture.cpp" ] 73 74 configs = [ ":media_capi_config" ] 75 76 public_configs = [ ":media_capi_public_config" ] 77 78 deps = [ "$MEDIA_PLAYER_ROOT_DIR/interfaces/inner_api/native:media_client" ] 79 80 external_deps = [ 81 "av_codec:av_codec_client", 82 "c_utils:utils", 83 "graphic_surface:surface", 84 "hilog:libhilog", 85 "ipc:ipc_core", 86 "media_foundation:media_foundation", 87 "qos_manager:qos", 88 "window_manager:libdm", 89 ] 90 output_extension = "so" 91 subsystem_name = "multimedia" 92 part_name = "player_framework" 93} 94 95ohos_shared_library("avplayer") { 96 stack_protector_ret = true 97 install_enable = true 98 99 sanitize = { 100 integer_overflow = true 101 ubsan = true 102 boundary_sanitize = true 103 cfi = true 104 cfi_cross_dso = true 105 debug = false 106 } 107 108 configs = [ ":media_capi_config" ] 109 110 public_configs = [ ":media_capi_public_config" ] 111 112 sources = [ 113 "$MEDIA_PLAYER_ROOT_DIR/frameworks/native/capi/player/native_avplayer.cpp", 114 ] 115 116 deps = [ "$MEDIA_PLAYER_ROOT_DIR/interfaces/inner_api/native:media_client" ] 117 118 external_deps = [ 119 "audio_framework:audio_capturer", 120 "av_codec:av_codec_client", 121 "c_utils:utils", 122 "graphic_surface:surface", 123 "hilog:libhilog", 124 "ipc:ipc_core", 125 "media_foundation:media_foundation", 126 "window_manager:libdm", 127 ] 128 if (player_framework_support_drm) { 129 public_external_deps = [ 130 "drm_framework:drm_framework", 131 "drm_framework:native_drm", 132 ] 133 } 134 135 defines = [] 136 defines += player_framework_defines 137 138 output_extension = "so" 139 subsystem_name = "multimedia" 140 part_name = "player_framework" 141} 142