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("../../../../castplus_cast_engine_part.gni") 17import("../../../../config.gni") 18 19ohos_shared_library("avsession_napi") { 20 sanitize = { 21 cfi = true 22 cfi_cross_dso = true 23 debug = false 24 } 25 include_dirs = [ 26 "include", 27 "../../../../interfaces/inner_api/native/session/include", 28 "../../../native/session/include", 29 ] 30 31 sources = [ 32 "src/napi_async_callback.cpp", 33 "src/napi_async_work.cpp", 34 "src/napi_avcall_meta_data.cpp", 35 "src/napi_avcall_state.cpp", 36 "src/napi_avcast_picker_helper.cpp", 37 "src/napi_avcontroller_callback.cpp", 38 "src/napi_avsession.cpp", 39 "src/napi_avsession_callback.cpp", 40 "src/napi_avsession_controller.cpp", 41 "src/napi_avsession_enum.cpp", 42 "src/napi_avsession_manager.cpp", 43 "src/napi_cast_control_command.cpp", 44 "src/napi_control_command.cpp", 45 "src/napi_media_description.cpp", 46 "src/napi_media_info_holder.cpp", 47 "src/napi_meta_data.cpp", 48 "src/napi_module.cpp", 49 "src/napi_playback_state.cpp", 50 "src/napi_queue_item.cpp", 51 "src/napi_session_listener.cpp", 52 "src/napi_utils.cpp", 53 ] 54 55 deps = [ 56 "../../../../utils:avsession_utils", 57 "../../../common:avsession_common", 58 "../../../native/session:avsession_client", 59 ] 60 61 external_deps = [ 62 "ability_base:base", 63 "ability_base:want", 64 "ability_base:zuri", 65 "ability_runtime:ability_context_native", 66 "ability_runtime:ability_manager", 67 "ability_runtime:abilitykit_native", 68 "ability_runtime:app_manager", 69 "ability_runtime:napi_base_context", 70 "ability_runtime:napi_common", 71 "ability_runtime:ui_extension", 72 "ability_runtime:wantagent_innerkits", 73 "access_token:libtokenid_sdk", 74 "ace_engine:ace_uicontent", 75 "audio_framework:audio_foundation", 76 "bundle_framework:appexecfwk_base", 77 "bundle_framework:appexecfwk_core", 78 "c_utils:utils", 79 "curl:curl_shared", 80 "hilog:libhilog", 81 "image_framework:image", 82 "image_framework:image_native", 83 "input:libmmi-client", 84 "ipc:ipc_single", 85 "napi:ace_napi", 86 "safwk:system_ability_fwk", 87 "samgr:samgr_proxy", 88 ] 89 90 cflags = [] 91 92 if (castplus_cast_engine_enable) { 93 cflags += [ "-DCASTPLUS_CAST_ENGINE_ENABLE" ] 94 sources += [ 95 "src/napi_avcast_controller.cpp", 96 "src/napi_avcast_controller_callback.cpp", 97 ] 98 deps += [ "../../../native/session:avsession_cast_client" ] 99 } 100 101 if (multimedia_av_session_enable_trace_control) { 102 cflags += [ "-DENBABLE_AVSESSION_TRACE_CONTROL" ] 103 external_deps += [ "hitrace:hitrace_meter" ] 104 } 105 if (multimedia_av_session_enable_sysevent_control) { 106 cflags += [ "-DENABLE_AVSESSION_SYSEVENT_CONTROL" ] 107 external_deps += [ "hisysevent:libhisysevent" ] 108 } 109 relative_install_dir = "module/multimedia" 110 111 subsystem_name = "multimedia" 112 part_name = "av_session" 113} 114