1# Copyright (C) 2022-2025 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/utils", 35 "$MEDIA_ROOT_DIR/frameworks/js/mediasource", 36 "//foundation/multimedia/player_framework/services/utils/include", 37 ] 38 39 sources = [ 40 "$MEDIA_ROOT_DIR/frameworks/js/common/js_common_utils.cpp", 41 "$MEDIA_ROOT_DIR/frameworks/js/mediasource/media_source_loader_callback.cpp", 42 "$MEDIA_ROOT_DIR/frameworks/js/mediasource/media_source_loading_request_napi.cpp", 43 "$MEDIA_ROOT_DIR/frameworks/js/mediasource/media_source_napi.cpp", 44 "./media_data_source_callback.cpp", 45 "//foundation/multimedia/player_framework/frameworks/js/avplayer/avplayer_callback.cpp", 46 "//foundation/multimedia/player_framework/frameworks/js/avplayer/avplayer_napi.cpp", 47 "//foundation/multimedia/player_framework/frameworks/js/common/common_napi.cpp", 48 ] 49 50 cflags = [ 51 "-std=c++17", 52 "-fno-rtti", 53 "-fno-exceptions", 54 "-Wall", 55 "-fno-common", 56 "-fstack-protector-strong", 57 "-Wshadow", 58 "-FPIC", 59 "-FS", 60 "-O2", 61 "-D_FORTIFY_SOURCE=2", 62 "-fvisibility=hidden", 63 "-Wformat=2", 64 "-Wfloat-equal", 65 "-Wdate-time", 66 "-Werror", 67 "-Wextra", 68 "-Wimplicit-fallthrough", 69 "-Wsign-compare", 70 "-Wunused-parameter", 71 ] 72 73 deps = [ 74 "../../../../../../foundation/multimedia/player_framework/interfaces/inner_api/native:media_client", 75 "../../../../../../foundation/multimedia/player_framework/services/utils:media_service_utils", 76 ] 77 78 external_deps = [ 79 "access_token:libaccesstoken_sdk", 80 "access_token:libtokenid_sdk", 81 "audio_framework:audio_foundation", 82 "av_codec:av_codec_client", 83 "bounds_checking_function:libsec_shared", 84 "c_utils:utils", 85 "ets_runtime:libark_jsruntime", 86 "eventhandler:libeventhandler", 87 "hilog:libhilog", 88 "hisysevent:libhisysevent", 89 "hitrace:hitrace_meter", 90 "ipc:ipc_core", 91 "libuv:uv", 92 "napi:ace_napi", 93 "qos_manager:qos", 94 "samgr:samgr_proxy", 95 ] 96 97 if (player_framework_support_video) { 98 external_deps += [ "graphic_surface:surface" ] 99 } 100 101 if (player_framework_support_jsstack) { 102 external_deps += [ "hiview:libxpower_event_js" ] 103 } 104 105 if (player_framework_support_drm) { 106 external_deps += [ "drm_framework:drm_framework" ] 107 } 108 109 defines = [] 110 defines += player_framework_defines 111 innerapi_tags = [ "platformsdk" ] 112 part_name = "player_framework" 113 subsystem_name = "multimedia" 114} 115