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