1# Copyright (C) 2021 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 17MEDIA_ROOT_DIR = "//foundation/multimedia/player_framework" 18 19config("media_public_config") { 20 include_dirs = [ 21 "$MEDIA_ROOT_DIR/interfaces/inner_api/native", 22 "$MEDIA_ROOT_DIR/services/utils/include", 23 ] 24 25 defines = [ "IMAGE_COLORSPACE_FLAG" ] 26 defines += player_framework_defines 27} 28 29config("media_client_ipc_config") { 30 include_dirs = [ 31 "$MEDIA_ROOT_DIR/services/services/sa_media/client", 32 "$MEDIA_ROOT_DIR/services/services/sa_media/ipc", 33 "$MEDIA_ROOT_DIR/services/services/player/client", 34 "$MEDIA_ROOT_DIR/services/services/player/ipc", 35 "$MEDIA_ROOT_DIR/services/services/media_data_source/ipc", 36 "$MEDIA_ROOT_DIR/services/services/monitor/client", 37 "$MEDIA_ROOT_DIR/services/services/monitor/ipc", 38 "$MEDIA_ROOT_DIR/services/services/recorder/client", 39 "$MEDIA_ROOT_DIR/services/services/recorder/ipc", 40 "$MEDIA_ROOT_DIR/services/services/avmetadatahelper/client", 41 "$MEDIA_ROOT_DIR/services/services/avmetadatahelper/ipc", 42 "$MEDIA_ROOT_DIR/services/services/common", 43 "$MEDIA_ROOT_DIR/services/services/recorder_profiles/client", 44 "$MEDIA_ROOT_DIR/services/services/recorder_profiles/ipc", 45 "$MEDIA_ROOT_DIR/services/services/screen_capture/ipc", 46 "$MEDIA_ROOT_DIR/services/services/screen_capture/client", 47 "$MEDIA_ROOT_DIR/services/services/screen_capture_monitor/ipc", 48 "$MEDIA_ROOT_DIR/services/services/screen_capture_monitor/client", 49 "$MEDIA_ROOT_DIR/services/services/transcoder/ipc", 50 "$MEDIA_ROOT_DIR/services/services/transcoder/client", 51 ] 52} 53 54config("media_client_base_config") { 55 include_dirs = [ 56 "$MEDIA_ROOT_DIR/interfaces/inner_api/native", 57 "$MEDIA_ROOT_DIR/services/include", 58 "$MEDIA_ROOT_DIR/services/utils/include", 59 ] 60 61 cflags = [ 62 "-std=c++17", 63 "-fno-rtti", 64 "-fno-exceptions", 65 "-Wall", 66 "-fno-common", 67 "-fstack-protector-strong", 68 "-Wshadow", 69 "-FPIC", 70 "-FS", 71 "-O2", 72 "-D_FORTIFY_SOURCE=2", 73 "-Wformat=2", 74 "-Wfloat-equal", 75 "-Wdate-time", 76 "-Werror", 77 "-Wextra", 78 "-Wimplicit-fallthrough", 79 "-Wsign-compare", 80 "-Wunused-parameter", 81 ] 82 83 if (target_cpu == "arm") { 84 cflags += [ "-DBINDER_IPC_32BIT" ] 85 } 86 87 defines = [] 88 defines += player_framework_defines 89} 90 91ohos_shared_library("media_client") { 92 branch_protector_ret = "pac_ret" 93 install_enable = true 94 95 sanitize = { 96 integer_overflow = true 97 ubsan = true 98 boundary_sanitize = true 99 cfi = true 100 cfi_cross_dso = true 101 debug = false 102 } 103 104 sources = [ 105 "$MEDIA_ROOT_DIR/frameworks/native/common/media_errors.cpp", 106 "$MEDIA_ROOT_DIR/services/services/common/avsharedmemory_ipc.cpp", 107 "$MEDIA_ROOT_DIR/services/services/monitor/client/monitor_client.cpp", 108 "$MEDIA_ROOT_DIR/services/services/monitor/client/monitor_client_object.cpp", 109 "$MEDIA_ROOT_DIR/services/services/monitor/ipc/monitor_service_proxy.cpp", 110 "$MEDIA_ROOT_DIR/services/services/sa_media/client/media_client.cpp", 111 "$MEDIA_ROOT_DIR/services/services/sa_media/ipc/media_listener_stub.cpp", 112 "$MEDIA_ROOT_DIR/services/services/sa_media/ipc/media_parcel.cpp", 113 "$MEDIA_ROOT_DIR/services/services/sa_media/ipc/media_service_proxy.cpp", 114 ] 115 if (player_framework_support_player) { 116 sources += [ 117 "$MEDIA_ROOT_DIR/frameworks/native/player/player_impl.cpp", 118 "$MEDIA_ROOT_DIR/services/services/media_data_source/ipc/media_data_source_stub.cpp", 119 "$MEDIA_ROOT_DIR/services/services/player/client/player_client.cpp", 120 "$MEDIA_ROOT_DIR/services/services/player/ipc/player_listener_stub.cpp", 121 "$MEDIA_ROOT_DIR/services/services/player/ipc/player_service_proxy.cpp", 122 ] 123 } 124 if (player_framework_support_recorder) { 125 sources += [ 126 "$MEDIA_ROOT_DIR/frameworks/native/recorder/recorder_impl.cpp", 127 "$MEDIA_ROOT_DIR/frameworks/native/recorder_profiles/recorder_profiles_impl.cpp", 128 "$MEDIA_ROOT_DIR/services/services/recorder/client/recorder_client.cpp", 129 "$MEDIA_ROOT_DIR/services/services/recorder/ipc/recorder_listener_stub.cpp", 130 "$MEDIA_ROOT_DIR/services/services/recorder/ipc/recorder_service_proxy.cpp", 131 "$MEDIA_ROOT_DIR/services/services/recorder_profiles/client/recorder_profiles_client.cpp", 132 "$MEDIA_ROOT_DIR/services/services/recorder_profiles/ipc/recorder_profiles_service_proxy.cpp", 133 "$MEDIA_ROOT_DIR/services/services/sa_media/ipc/recorder_profiles_parcel.cpp", 134 ] 135 } 136 if (player_framework_support_metadata) { 137 sources += [ 138 "$MEDIA_ROOT_DIR/frameworks/native/avmetadatahelper/avmetadatahelper_impl.cpp", 139 "$MEDIA_ROOT_DIR/services/services/avmetadatahelper/client/avmetadatahelper_client.cpp", 140 "$MEDIA_ROOT_DIR/services/services/avmetadatahelper/ipc/avmetadatahelper_service_proxy.cpp", 141 "$MEDIA_ROOT_DIR/services/services/avmetadatahelper/ipc/helper_listener_stub.cpp", 142 ] 143 } 144 if (player_framework_support_screen_capture) { 145 sources += [ 146 "$MEDIA_ROOT_DIR/frameworks/native/screen_capture/screen_capture_controller_impl.cpp", 147 "$MEDIA_ROOT_DIR/frameworks/native/screen_capture/screen_capture_impl.cpp", 148 "$MEDIA_ROOT_DIR/frameworks/native/screen_capture/screen_capture_monitor_impl.cpp", 149 "$MEDIA_ROOT_DIR/services/services/screen_capture/client/screen_capture_client.cpp", 150 "$MEDIA_ROOT_DIR/services/services/screen_capture/client/screen_capture_controller_client.cpp", 151 "$MEDIA_ROOT_DIR/services/services/screen_capture/ipc/screen_capture_controller_proxy.cpp", 152 "$MEDIA_ROOT_DIR/services/services/screen_capture/ipc/screen_capture_listener_stub.cpp", 153 "$MEDIA_ROOT_DIR/services/services/screen_capture/ipc/screen_capture_service_proxy.cpp", 154 "$MEDIA_ROOT_DIR/services/services/screen_capture_monitor/client/screen_capture_monitor_client.cpp", 155 "$MEDIA_ROOT_DIR/services/services/screen_capture_monitor/ipc/screen_capture_monitor_listener_stub.cpp", 156 "$MEDIA_ROOT_DIR/services/services/screen_capture_monitor/ipc/screen_capture_monitor_service_proxy.cpp", 157 ] 158 } 159 if (player_framework_support_transcoder) { 160 sources += [ 161 "$MEDIA_ROOT_DIR/frameworks/native/transcoder/transcoder_impl.cpp", 162 "$MEDIA_ROOT_DIR/services/services/transcoder/client/transcoder_client.cpp", 163 "$MEDIA_ROOT_DIR/services/services/transcoder/ipc/transcoder_listener_stub.cpp", 164 "$MEDIA_ROOT_DIR/services/services/transcoder/ipc/transcoder_service_proxy.cpp", 165 ] 166 } 167 168 configs = [ 169 ":media_client_base_config", 170 ":media_client_ipc_config", 171 ] 172 173 public_configs = [ ":media_public_config" ] 174 deps = [ "$MEDIA_ROOT_DIR/services/utils:media_service_utils" ] 175 176 external_deps = [ 177 "audio_framework:audio_client", 178 "av_codec:av_codec_client", 179 "c_utils:utils", 180 "drivers_interface_display:display_commontype_idl_headers", 181 "graphic_surface:surface", 182 "hilog:libhilog", 183 "hisysevent:libhisysevent", 184 "hitrace:hitrace_meter", 185 "hitrace:libhitracechain", 186 "image_framework:image_native", 187 "ipc:ipc_single", 188 "qos_manager:qos", 189 "samgr:samgr_proxy", 190 ] 191 192 public_external_deps = [ 193 "graphic_2d:color_manager", 194 "media_foundation:media_foundation", 195 ] 196 197 if (player_framework_support_video) { 198 external_deps += [ "graphic_surface:surface" ] 199 } 200 201 if (player_framework_support_drm) { 202 external_deps += [ "drm_framework:drm_framework" ] 203 } 204 205 innerapi_tags = [ "platformsdk" ] 206 subsystem_name = "multimedia" 207 part_name = "player_framework" 208 version_script = "player_framework.versionscript" 209} 210