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 "bundle_framework:appexecfwk_base", 79 "bundle_framework:appexecfwk_core", 80 "c_utils:utils", 81 "ets_runtime:libark_jsruntime", 82 "eventhandler:libeventhandler", 83 "hilog:libhilog", 84 "hisysevent:libhisysevent", 85 "hitrace:hitrace_meter", 86 "ipc:ipc_core", 87 "libuv:uv", 88 "napi:ace_napi", 89 "os_account:os_account_innerkits", 90 "qos_manager:qos", 91 "samgr:samgr_proxy", 92 ] 93 94 if (player_framework_support_video) { 95 external_deps += [ "graphic_surface:surface" ] 96 } 97 98 if (player_framework_support_jsstack) { 99 external_deps += [ "hiview:libxpower_event_js" ] 100 } 101 102 if (player_framework_support_drm) { 103 external_deps += [ "drm_framework:drm_framework" ] 104 } 105 106 if (is_arkui_x) { 107 defines += [ "CROSS_PLATFORM" ] 108 } 109 110 defines = [] 111 defines += player_framework_defines 112 innerapi_tags = [ "platformsdk" ] 113 part_name = "player_framework" 114 subsystem_name = "multimedia" 115} 116