• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2021 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
17MEDIA_ROOT_DIR = "//foundation/multimedia/player_framework"
18
19config("media_public_config") {
20  include_dirs = [
21    "$MEDIA_ROOT_DIR/interfaces/inner_api/native",
22    "$MEDIA_ROOT_DIR/services/utils/include",
23  ]
24
25  defines = [ "IMAGE_COLORSPACE_FLAG" ]
26  defines += player_framework_defines
27}
28
29config("media_client_ipc_config") {
30  include_dirs = [
31    "$MEDIA_ROOT_DIR/services/services/sa_media/client",
32    "$MEDIA_ROOT_DIR/services/services/sa_media/ipc",
33    "$MEDIA_ROOT_DIR/services/services/player/client",
34    "$MEDIA_ROOT_DIR/services/services/player/ipc",
35    "$MEDIA_ROOT_DIR/services/services/media_data_source/ipc",
36    "$MEDIA_ROOT_DIR/services/services/media_source/ipc",
37    "$MEDIA_ROOT_DIR/services/services/monitor/client",
38    "$MEDIA_ROOT_DIR/services/services/monitor/ipc",
39    "$MEDIA_ROOT_DIR/services/services/recorder/client",
40    "$MEDIA_ROOT_DIR/services/services/recorder/ipc",
41    "$MEDIA_ROOT_DIR/services/services/avmetadatahelper/client",
42    "$MEDIA_ROOT_DIR/services/services/avmetadatahelper/ipc",
43    "$MEDIA_ROOT_DIR/services/services/common",
44    "$MEDIA_ROOT_DIR/services/services/recorder_profiles/client",
45    "$MEDIA_ROOT_DIR/services/services/recorder_profiles/ipc",
46    "$MEDIA_ROOT_DIR/services/services/screen_capture/ipc",
47    "$MEDIA_ROOT_DIR/services/services/screen_capture/client",
48    "$MEDIA_ROOT_DIR/services/services/screen_capture_monitor/ipc",
49    "$MEDIA_ROOT_DIR/services/services/screen_capture_monitor/client",
50    "$MEDIA_ROOT_DIR/services/services/transcoder/ipc",
51    "$MEDIA_ROOT_DIR/services/services/transcoder/client",
52    "$MEDIA_ROOT_DIR/frameworks/native/media_source_loading_request",
53  ]
54}
55
56config("media_client_base_config") {
57  include_dirs = [
58    "$MEDIA_ROOT_DIR/interfaces/inner_api/native",
59    "$MEDIA_ROOT_DIR/services/include",
60    "$MEDIA_ROOT_DIR/services/utils/include",
61  ]
62
63  cflags = [
64    "-std=c++17",
65    "-fno-rtti",
66    "-fno-exceptions",
67    "-Wall",
68    "-fno-common",
69    "-fstack-protector-strong",
70    "-Wshadow",
71    "-FPIC",
72    "-FS",
73    "-O2",
74    "-D_FORTIFY_SOURCE=2",
75    "-Wformat=2",
76    "-Wfloat-equal",
77    "-Wdate-time",
78    "-Werror",
79    "-Wextra",
80    "-Wimplicit-fallthrough",
81    "-Wsign-compare",
82    "-Wunused-parameter",
83  ]
84
85  if (target_cpu == "arm") {
86    cflags += [ "-DBINDER_IPC_32BIT" ]
87  }
88
89  defines = []
90  defines += player_framework_defines
91}
92
93ohos_shared_library("media_client") {
94  branch_protector_ret = "pac_ret"
95  install_enable = true
96
97  sanitize = {
98    integer_overflow = true
99    ubsan = true
100    boundary_sanitize = true
101    cfi = true
102    cfi_cross_dso = true
103    debug = false
104  }
105
106  sources = [
107    "$MEDIA_ROOT_DIR/frameworks/native/common/media_errors.cpp",
108    "$MEDIA_ROOT_DIR/services/services/common/avsharedmemory_ipc.cpp",
109    "$MEDIA_ROOT_DIR/services/services/monitor/client/monitor_client.cpp",
110    "$MEDIA_ROOT_DIR/services/services/monitor/client/monitor_client_object.cpp",
111    "$MEDIA_ROOT_DIR/services/services/monitor/ipc/monitor_service_proxy.cpp",
112    "$MEDIA_ROOT_DIR/services/services/sa_media/client/media_client.cpp",
113    "$MEDIA_ROOT_DIR/services/services/sa_media/ipc/media_listener_stub.cpp",
114    "$MEDIA_ROOT_DIR/services/services/sa_media/ipc/media_parcel.cpp",
115    "$MEDIA_ROOT_DIR/services/services/sa_media/ipc/media_reply_stub.cpp",
116    "$MEDIA_ROOT_DIR/services/services/sa_media/ipc/media_service_proxy.cpp",
117  ]
118  if (player_framework_support_player) {
119    sources += [
120      "$MEDIA_ROOT_DIR/frameworks/native/media_source_loading_request/loading_request_impl.cpp",
121      "$MEDIA_ROOT_DIR/frameworks/native/player/player_impl.cpp",
122      "$MEDIA_ROOT_DIR/services/services/media_data_source/ipc/media_data_source_stub.cpp",
123      "$MEDIA_ROOT_DIR/services/services/media_source/ipc/media_source_loader_stub.cpp",
124      "$MEDIA_ROOT_DIR/services/services/media_source/ipc/media_source_loading_request_proxy.cpp",
125      "$MEDIA_ROOT_DIR/services/services/player/client/player_client.cpp",
126      "$MEDIA_ROOT_DIR/services/services/player/ipc/player_listener_stub.cpp",
127      "$MEDIA_ROOT_DIR/services/services/player/ipc/player_service_proxy.cpp",
128    ]
129  }
130  if (player_framework_support_recorder) {
131    sources += [
132      "$MEDIA_ROOT_DIR/frameworks/native/recorder/recorder_impl.cpp",
133      "$MEDIA_ROOT_DIR/frameworks/native/recorder_profiles/recorder_profiles_impl.cpp",
134      "$MEDIA_ROOT_DIR/services/services/recorder/client/recorder_client.cpp",
135      "$MEDIA_ROOT_DIR/services/services/recorder/ipc/recorder_listener_stub.cpp",
136      "$MEDIA_ROOT_DIR/services/services/recorder/ipc/recorder_service_proxy.cpp",
137      "$MEDIA_ROOT_DIR/services/services/recorder_profiles/client/recorder_profiles_client.cpp",
138      "$MEDIA_ROOT_DIR/services/services/recorder_profiles/ipc/recorder_profiles_service_proxy.cpp",
139      "$MEDIA_ROOT_DIR/services/services/sa_media/ipc/recorder_profiles_parcel.cpp",
140    ]
141  }
142  if (player_framework_support_metadata) {
143    sources += [
144      "$MEDIA_ROOT_DIR/frameworks/native/avmetadatahelper/avmetadatahelper_impl.cpp",
145      "$MEDIA_ROOT_DIR/services/services/avmetadatahelper/client/avmetadatahelper_client.cpp",
146      "$MEDIA_ROOT_DIR/services/services/avmetadatahelper/ipc/avmetadatahelper_service_proxy.cpp",
147      "$MEDIA_ROOT_DIR/services/services/avmetadatahelper/ipc/helper_listener_stub.cpp",
148    ]
149  }
150  if (player_framework_support_screen_capture) {
151    sources += [
152      "$MEDIA_ROOT_DIR/frameworks/native/screen_capture/screen_capture_controller_impl.cpp",
153      "$MEDIA_ROOT_DIR/frameworks/native/screen_capture/screen_capture_impl.cpp",
154      "$MEDIA_ROOT_DIR/frameworks/native/screen_capture/screen_capture_monitor_impl.cpp",
155      "$MEDIA_ROOT_DIR/services/services/screen_capture/client/screen_capture_client.cpp",
156      "$MEDIA_ROOT_DIR/services/services/screen_capture/client/screen_capture_controller_client.cpp",
157      "$MEDIA_ROOT_DIR/services/services/screen_capture/ipc/screen_capture_controller_proxy.cpp",
158      "$MEDIA_ROOT_DIR/services/services/screen_capture/ipc/screen_capture_listener_stub.cpp",
159      "$MEDIA_ROOT_DIR/services/services/screen_capture/ipc/screen_capture_service_proxy.cpp",
160      "$MEDIA_ROOT_DIR/services/services/screen_capture_monitor/client/screen_capture_monitor_client.cpp",
161      "$MEDIA_ROOT_DIR/services/services/screen_capture_monitor/ipc/screen_capture_monitor_listener_stub.cpp",
162      "$MEDIA_ROOT_DIR/services/services/screen_capture_monitor/ipc/screen_capture_monitor_service_proxy.cpp",
163    ]
164  }
165  if (player_framework_support_transcoder) {
166    sources += [
167      "$MEDIA_ROOT_DIR/frameworks/native/transcoder/transcoder_impl.cpp",
168      "$MEDIA_ROOT_DIR/services/services/transcoder/client/transcoder_client.cpp",
169      "$MEDIA_ROOT_DIR/services/services/transcoder/ipc/transcoder_listener_stub.cpp",
170      "$MEDIA_ROOT_DIR/services/services/transcoder/ipc/transcoder_service_proxy.cpp",
171    ]
172  }
173
174  configs = [
175    ":media_client_base_config",
176    ":media_client_ipc_config",
177  ]
178
179  public_configs = [ ":media_public_config" ]
180  deps = [ "$MEDIA_ROOT_DIR/services/utils:media_service_utils" ]
181
182  external_deps = [
183    "audio_framework:audio_client",
184    "av_codec:av_codec_client",
185    "c_utils:utils",
186    "drivers_interface_display:display_commontype_idl_headers",
187    "graphic_surface:surface",
188    "hilog:libhilog",
189    "hisysevent:libhisysevent",
190    "hitrace:hitrace_meter",
191    "hitrace:libhitracechain",
192    "image_framework:image_native",
193    "init:libbegetutil",
194    "ipc:ipc_single",
195    "qos_manager:qos",
196    "samgr:samgr_proxy",
197  ]
198
199  public_external_deps = [
200    "graphic_2d:color_manager",
201    "media_foundation:media_foundation",
202  ]
203
204  if (player_framework_support_video) {
205    external_deps += [ "graphic_surface:surface" ]
206  }
207
208  if (player_framework_support_drm) {
209    external_deps += [ "drm_framework:drm_framework" ]
210  }
211
212  innerapi_tags = [ "platformsdk" ]
213  subsystem_name = "multimedia"
214  part_name = "player_framework"
215  version_script = "player_framework.versionscript"
216}
217