• 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/services/services/lpp_audio_streamer/ipc",
53    "$MEDIA_ROOT_DIR/services/services/lpp_audio_streamer/client",
54    "$MEDIA_ROOT_DIR/services/services/lpp_video_streamer/ipc",
55    "$MEDIA_ROOT_DIR/services/services/lpp_video_streamer/client",
56    "$MEDIA_ROOT_DIR/frameworks/native/media_source_loading_request",
57  ]
58}
59
60config("media_client_base_config") {
61  include_dirs = [
62    "$MEDIA_ROOT_DIR/interfaces/inner_api/native",
63    "$MEDIA_ROOT_DIR/services/include",
64    "$MEDIA_ROOT_DIR/services/utils/include",
65  ]
66
67  cflags = [
68    "-std=c++17",
69    "-fno-rtti",
70    "-fno-exceptions",
71    "-Wall",
72    "-fno-common",
73    "-fstack-protector-strong",
74    "-Wshadow",
75    "-FPIC",
76    "-FS",
77    "-O2",
78    "-D_FORTIFY_SOURCE=2",
79    "-Wformat=2",
80    "-Wfloat-equal",
81    "-Wdate-time",
82    "-Werror",
83    "-Wextra",
84    "-Wimplicit-fallthrough",
85    "-Wsign-compare",
86    "-Wunused-parameter",
87  ]
88
89  if (target_cpu == "arm") {
90    cflags += [ "-DBINDER_IPC_32BIT" ]
91  }
92
93  defines = []
94  defines += player_framework_defines
95}
96
97ohos_shared_library("media_client") {
98  branch_protector_ret = "pac_ret"
99  install_enable = true
100
101  sanitize = {
102    integer_overflow = true
103    ubsan = true
104    boundary_sanitize = true
105    cfi = true
106    cfi_cross_dso = true
107    debug = false
108  }
109
110  sources = [
111    "$MEDIA_ROOT_DIR/frameworks/native/common/media_errors.cpp",
112    "$MEDIA_ROOT_DIR/frameworks/native/common/lpp_common.cpp",
113    "$MEDIA_ROOT_DIR/services/services/common/avsharedmemory_ipc.cpp",
114    "$MEDIA_ROOT_DIR/services/services/monitor/client/monitor_client.cpp",
115    "$MEDIA_ROOT_DIR/services/services/monitor/client/monitor_client_object.cpp",
116    "$MEDIA_ROOT_DIR/services/services/monitor/ipc/monitor_service_proxy.cpp",
117    "$MEDIA_ROOT_DIR/services/services/sa_media/client/media_client.cpp",
118    "$MEDIA_ROOT_DIR/services/services/sa_media/ipc/media_listener_stub.cpp",
119    "$MEDIA_ROOT_DIR/services/services/sa_media/ipc/media_parcel.cpp",
120    "$MEDIA_ROOT_DIR/services/services/sa_media/ipc/media_reply_stub.cpp",
121    "$MEDIA_ROOT_DIR/services/services/sa_media/ipc/media_service_proxy.cpp",
122  ]
123  if (player_framework_support_player) {
124    sources += [
125      "$MEDIA_ROOT_DIR/frameworks/native/media_source_loading_request/loading_request_impl.cpp",
126      "$MEDIA_ROOT_DIR/frameworks/native/player/player_impl.cpp",
127      "$MEDIA_ROOT_DIR/frameworks/native/player/hiappevent_agent.cpp",
128      "$MEDIA_ROOT_DIR/services/services/media_data_source/ipc/media_data_source_stub.cpp",
129      "$MEDIA_ROOT_DIR/services/services/media_source/ipc/media_source_loader_stub.cpp",
130      "$MEDIA_ROOT_DIR/services/services/media_source/ipc/media_source_loading_request_proxy.cpp",
131      "$MEDIA_ROOT_DIR/services/services/player/client/player_client.cpp",
132      "$MEDIA_ROOT_DIR/services/services/player/ipc/player_listener_stub.cpp",
133      "$MEDIA_ROOT_DIR/services/services/player/ipc/player_service_proxy.cpp",
134    ]
135  }
136  if (player_framework_support_recorder) {
137    sources += [
138      "$MEDIA_ROOT_DIR/frameworks/native/recorder/recorder_impl.cpp",
139      "$MEDIA_ROOT_DIR/frameworks/native/recorder_profiles/recorder_profiles_impl.cpp",
140      "$MEDIA_ROOT_DIR/services/services/recorder/client/recorder_client.cpp",
141      "$MEDIA_ROOT_DIR/services/services/recorder/ipc/recorder_listener_stub.cpp",
142      "$MEDIA_ROOT_DIR/services/services/recorder/ipc/recorder_service_proxy.cpp",
143      "$MEDIA_ROOT_DIR/services/services/recorder_profiles/client/recorder_profiles_client.cpp",
144      "$MEDIA_ROOT_DIR/services/services/recorder_profiles/ipc/recorder_profiles_service_proxy.cpp",
145      "$MEDIA_ROOT_DIR/services/services/sa_media/ipc/recorder_profiles_parcel.cpp",
146    ]
147  }
148  if (player_framework_support_metadata) {
149    sources += [
150      "$MEDIA_ROOT_DIR/frameworks/native/avmetadatahelper/avmetadatahelper_impl.cpp",
151      "$MEDIA_ROOT_DIR/services/services/avmetadatahelper/client/avmetadatahelper_client.cpp",
152      "$MEDIA_ROOT_DIR/services/services/avmetadatahelper/ipc/avmetadatahelper_service_proxy.cpp",
153      "$MEDIA_ROOT_DIR/services/services/avmetadatahelper/ipc/helper_listener_stub.cpp",
154    ]
155  }
156  if (player_framework_support_screen_capture) {
157    sources += [
158      "$MEDIA_ROOT_DIR/frameworks/native/screen_capture/screen_capture_controller_impl.cpp",
159      "$MEDIA_ROOT_DIR/frameworks/native/screen_capture/screen_capture_impl.cpp",
160      "$MEDIA_ROOT_DIR/frameworks/native/screen_capture/screen_capture_monitor_impl.cpp",
161      "$MEDIA_ROOT_DIR/services/services/screen_capture/client/screen_capture_client.cpp",
162      "$MEDIA_ROOT_DIR/services/services/screen_capture/client/screen_capture_controller_client.cpp",
163      "$MEDIA_ROOT_DIR/services/services/screen_capture/ipc/screen_capture_controller_proxy.cpp",
164      "$MEDIA_ROOT_DIR/services/services/screen_capture/ipc/screen_capture_listener_stub.cpp",
165      "$MEDIA_ROOT_DIR/services/services/screen_capture/ipc/screen_capture_service_proxy.cpp",
166      "$MEDIA_ROOT_DIR/services/services/screen_capture_monitor/client/screen_capture_monitor_client.cpp",
167      "$MEDIA_ROOT_DIR/services/services/screen_capture_monitor/ipc/screen_capture_monitor_listener_stub.cpp",
168      "$MEDIA_ROOT_DIR/services/services/screen_capture_monitor/ipc/screen_capture_monitor_service_proxy.cpp",
169    ]
170  }
171  if (player_framework_support_transcoder) {
172    sources += [
173      "$MEDIA_ROOT_DIR/frameworks/native/transcoder/transcoder_impl.cpp",
174      "$MEDIA_ROOT_DIR/services/services/transcoder/client/transcoder_client.cpp",
175      "$MEDIA_ROOT_DIR/services/services/transcoder/ipc/transcoder_listener_stub.cpp",
176      "$MEDIA_ROOT_DIR/services/services/transcoder/ipc/transcoder_service_proxy.cpp",
177    ]
178  }
179
180  if (player_framework_support_lowpower_av_sink) {
181    sources += [
182      "$MEDIA_ROOT_DIR/frameworks/native/lpp_audio_streamer/audio_streamer_impl.cpp",
183      "$MEDIA_ROOT_DIR/services/services/lpp_audio_streamer/client/lpp_audio_streamer_client.cpp",
184      "$MEDIA_ROOT_DIR/services/services/lpp_audio_streamer/ipc/lpp_audio_streamer_listener_stub.cpp",
185      "$MEDIA_ROOT_DIR/services/services/lpp_audio_streamer/ipc/lpp_audio_streamer_service_proxy.cpp",
186    ]
187  }
188
189  if (player_framework_support_lowpower_av_sink) {
190    sources += [
191      "$MEDIA_ROOT_DIR/frameworks/native/lpp_video_streamer/video_streamer_impl.cpp",
192      "$MEDIA_ROOT_DIR/services/services/lpp_video_streamer/client/lpp_video_streamer_client.cpp",
193      "$MEDIA_ROOT_DIR/services/services/lpp_video_streamer/ipc/lpp_video_streamer_listener_stub.cpp",
194      "$MEDIA_ROOT_DIR/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_proxy.cpp",
195    ]
196  }
197
198  configs = [
199    ":media_client_base_config",
200    ":media_client_ipc_config",
201  ]
202
203  public_configs = [ ":media_public_config" ]
204  deps = [ "$MEDIA_ROOT_DIR/services/utils:media_service_utils" ]
205
206  external_deps = [
207    "audio_framework:audio_client",
208    "av_codec:av_codec_client",
209    "c_utils:utils",
210    "drivers_interface_display:display_commontype_idl_headers",
211    "graphic_surface:surface",
212    "hilog:libhilog",
213    "hisysevent:libhisysevent",
214    "hitrace:hitrace_meter",
215    "hitrace:libhitracechain",
216    "image_framework:image_native",
217    "init:libbegetutil",
218    "ipc:ipc_single",
219    "qos_manager:qos",
220    "samgr:samgr_proxy",
221  ]
222
223  public_external_deps = [
224    "graphic_2d:color_manager",
225    "media_foundation:media_foundation",
226  ]
227
228  if (player_framework_support_video) {
229    external_deps += [ "graphic_surface:surface" ]
230  }
231
232  if (player_framework_support_drm) {
233    external_deps += [ "drm_framework:drm_framework" ]
234  }
235
236  if (player_framework_support_hiappevent) {
237    external_deps += [ "hiappevent:hiappevent_innerapi" ]
238  }
239
240  innerapi_tags = [ "platformsdk" ]
241  subsystem_name = "multimedia"
242  part_name = "player_framework"
243  version_script = "player_framework.versionscript"
244}
245