• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2023 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("//foundation/multimedia/player_framework/config.gni")
16
17group("capi_packages") {
18  deps = []
19  if (multimedia_player_framework_support_capi) {
20    deps += [
21      "$MEDIA_PLAYER_ROOT_DIR/interfaces/kits/c:avplayer",
22      "$MEDIA_PLAYER_ROOT_DIR/interfaces/kits/c:native_avscreen_capture",
23    ]
24  }
25}
26
27config("media_capi_config") {
28  include_dirs = [
29    "$MEDIA_PLAYER_ROOT_DIR/interfaces/inner_api/native",
30    "$MEDIA_PLAYER_ROOT_DIR/interfaces/kits/c",
31    "$MEDIA_PLAYER_ROOT_DIR/frameworks/native/capi/common",
32    "$MEDIA_PLAYER_ROOT_DIR/services/utils/include",
33    "$MEDIA_PLAYER_AVCODEC/interfaces/kits/c",
34    "$MEDIA_PLAYER_GRAPHIC/../graphic_surface/surface/include",
35  ]
36
37  cflags = [
38    "-fno-exceptions",
39    "-Wall",
40    "-fno-common",
41    "-fstack-protector-all",
42    "-Wshadow",
43    "-FPIC",
44    "-FS",
45    "-O2",
46    "-D_FORTIFY_SOURCE=2",
47    "-Wformat=2",
48    "-Wdate-time",
49  ]
50
51  cflags_cc = [
52    "-std=c++17",
53    "-fno-rtti",
54  ]
55}
56
57config("media_capi_public_config") {
58  include_dirs = [ "$MEDIA_PLAYER_ROOT_DIR/interfaces/kits/c" ]
59}
60
61ohos_shared_library("native_avscreen_capture") {
62  install_enable = true
63
64  sanitize = {
65    cfi = true
66    cfi_cross_dso = true
67    debug = false
68    blocklist = "../../../cfi_blocklist.txt"
69  }
70
71  sources = [ "$MEDIA_PLAYER_ROOT_DIR/frameworks/native/capi/screencapture/native_avscreen_capture.cpp" ]
72
73  configs = [ ":media_capi_config" ]
74
75  public_configs = [ ":media_capi_public_config" ]
76
77  deps = [ "$MEDIA_PLAYER_ROOT_DIR/interfaces/inner_api/native:media_client" ]
78
79  external_deps = [
80    "c_utils:utils",
81    "graphic_surface:surface",
82    "hilog:libhilog",
83    "qos_manager:qos",
84    "window_manager:libdm",
85  ]
86  output_extension = "so"
87  subsystem_name = "multimedia"
88  part_name = "player_framework"
89}
90
91ohos_shared_library("avplayer") {
92  install_enable = true
93
94  sanitize = {
95    cfi = true
96    cfi_cross_dso = true
97    debug = false
98  }
99
100  sources = [
101    "$MEDIA_PLAYER_ROOT_DIR/frameworks/native/capi/player/native_avplayer.cpp",
102  ]
103  configs = [ ":media_capi_config" ]
104
105  public_configs = [ ":media_capi_public_config" ]
106
107  deps = [ "$MEDIA_PLAYER_ROOT_DIR/interfaces/inner_api/native:media_client" ]
108
109  external_deps = [
110    "c_utils:utils",
111    "graphic_surface:surface",
112    "hilog:libhilog",
113    "window_manager:libdm",
114  ]
115  output_extension = "so"
116  subsystem_name = "multimedia"
117  part_name = "player_framework"
118}
119