• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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    "cJSON:cjson",
79    "c_utils:utils",
80    "curl:curl_shared",
81    "hilog:libhilog",
82    "image_framework:image",
83    "image_framework:image_native",
84    "input:libmmi-client",
85    "ipc:ipc_single",
86    "napi:ace_napi",
87    "safwk:system_ability_fwk",
88    "samgr:samgr_proxy",
89  ]
90
91  cflags = []
92
93  if (castplus_cast_engine_enable) {
94    cflags += [ "-DCASTPLUS_CAST_ENGINE_ENABLE" ]
95    sources += [
96      "src/napi_avcast_controller.cpp",
97      "src/napi_avcast_controller_callback.cpp",
98    ]
99    deps += [ "../../../native/session:avsession_cast_client" ]
100  }
101
102  if (multimedia_av_session_enable_trace_control) {
103    cflags += [ "-DENBABLE_AVSESSION_TRACE_CONTROL" ]
104    external_deps += [ "hitrace:hitrace_meter" ]
105  }
106  if (multimedia_av_session_enable_sysevent_control) {
107    cflags += [ "-DENABLE_AVSESSION_SYSEVENT_CONTROL" ]
108    external_deps += [ "hisysevent:libhisysevent" ]
109  }
110  relative_install_dir = "module/multimedia"
111
112  subsystem_name = "multimedia"
113  part_name = "av_session"
114}
115