1# Copyright (C) 2022 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("//build/ohos/ace/ace.gni") 16import("//foundation/multimedia/player_framework/config.gni") 17MEDIA_ROOT_DIR = "//foundation/multimedia/player_framework/" 18 19ohos_shared_library("media_avplayer") { 20 stack_protector_ret = true 21 sanitize = { 22 integer_overflow = true 23 ubsan = true 24 boundary_sanitize = true 25 cfi = true 26 cfi_cross_dso = true 27 debug = false 28 } 29 30 include_dirs = [ 31 "//foundation/multimedia/player_framework/interfaces/inner_api", 32 "//foundation/multimedia/player_framework/frameworks/js/avplayer", 33 "//foundation/multimedia/player_framework/frameworks/js/common", 34 "$MEDIA_ROOT_DIR/frameworks/js/mediasource", 35 "//foundation/multimedia/player_framework/services/utils/include", 36 ] 37 38 sources = [ 39 "$MEDIA_ROOT_DIR/frameworks/js/mediasource/media_source_napi.cpp", 40 "./media_data_source_callback.cpp", 41 "//foundation/multimedia/player_framework/frameworks/js/avplayer/avplayer_callback.cpp", 42 "//foundation/multimedia/player_framework/frameworks/js/avplayer/avplayer_napi.cpp", 43 "//foundation/multimedia/player_framework/frameworks/js/common/common_napi.cpp", 44 ] 45 46 cflags = [ 47 "-std=c++17", 48 "-fno-rtti", 49 "-fno-exceptions", 50 "-Wall", 51 "-fno-common", 52 "-fstack-protector-strong", 53 "-Wshadow", 54 "-FPIC", 55 "-FS", 56 "-O2", 57 "-D_FORTIFY_SOURCE=2", 58 "-fvisibility=hidden", 59 "-Wformat=2", 60 "-Wfloat-equal", 61 "-Wdate-time", 62 "-Werror", 63 "-Wextra", 64 "-Wimplicit-fallthrough", 65 "-Wsign-compare", 66 "-Wunused-parameter", 67 ] 68 69 deps = [ 70 "../../../../../../foundation/multimedia/player_framework/interfaces/inner_api/native:media_client", 71 "../../../../../../foundation/multimedia/player_framework/services/utils:media_service_utils", 72 ] 73 74 external_deps = [ 75 "audio_framework:audio_client", 76 "av_codec:av_codec_client", 77 "bounds_checking_function:libsec_shared", 78 "c_utils:utils", 79 "ets_runtime:libark_jsruntime", 80 "eventhandler:libeventhandler", 81 "hilog:libhilog", 82 "hisysevent:libhisysevent", 83 "hitrace:hitrace_meter", 84 "ipc:ipc_core", 85 "libuv:uv", 86 "napi:ace_napi", 87 "qos_manager:qos", 88 "samgr:samgr_proxy", 89 ] 90 91 if (player_framework_support_video) { 92 external_deps += [ "graphic_surface:surface" ] 93 } 94 95 if (player_framework_support_jsstack) { 96 external_deps += [ "hiview:libxpower_event_js" ] 97 } 98 99 if (player_framework_support_drm) { 100 external_deps += [ "drm_framework:drm_framework" ] 101 } 102 103 defines = [] 104 defines += player_framework_defines 105 innerapi_tags = [ "platformsdk" ] 106 part_name = "player_framework" 107 subsystem_name = "multimedia" 108} 109