• 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 = []
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/monitor/client",
37    "$MEDIA_ROOT_DIR/services/services/monitor/ipc",
38    "$MEDIA_ROOT_DIR/services/services/recorder/client",
39    "$MEDIA_ROOT_DIR/services/services/recorder/ipc",
40    "$MEDIA_ROOT_DIR/services/services/avmetadatahelper/client",
41    "$MEDIA_ROOT_DIR/services/services/avmetadatahelper/ipc",
42    "$MEDIA_ROOT_DIR/services/services/common",
43    "$MEDIA_ROOT_DIR/services/services/avcodec/client",
44    "$MEDIA_ROOT_DIR/services/services/avcodec/ipc",
45    "$MEDIA_ROOT_DIR/services/services/avcodeclist/client",
46    "$MEDIA_ROOT_DIR/services/services/avcodeclist/ipc",
47    "$MEDIA_ROOT_DIR/services/services/recorder_profiles/client",
48    "$MEDIA_ROOT_DIR/services/services/recorder_profiles/ipc",
49    "$MEDIA_ROOT_DIR/services/services/screen_capture/ipc",
50    "$MEDIA_ROOT_DIR/services/services/screen_capture/client",
51  ]
52}
53
54config("media_client_base_config") {
55  include_dirs = [
56    "$MEDIA_ROOT_DIR/interfaces/inner_api/native",
57    "$MEDIA_ROOT_DIR/services/include",
58    "$MEDIA_ROOT_DIR/services/utils/include",
59    "//utils/system/safwk/native/include",
60    "//commonlibrary/c_utils/base/include",
61    "$MEDIA_PLAYER_GRAPHIC/../graphic_surface/surface/include",
62  ]
63
64  cflags = [
65    "-std=c++17",
66    "-fno-rtti",
67    "-fno-exceptions",
68    "-Wall",
69    "-fno-common",
70    "-fstack-protector-strong",
71    "-Wshadow",
72    "-FPIC",
73    "-FS",
74    "-O2",
75    "-D_FORTIFY_SOURCE=2",
76    "-fvisibility=hidden",
77    "-Wformat=2",
78    "-Wfloat-equal",
79    "-Wdate-time",
80    "-Werror",
81    "-Wextra",
82    "-Wimplicit-fallthrough",
83    "-Wsign-compare",
84    "-Wunused-parameter",
85  ]
86
87  if (target_cpu == "arm") {
88    cflags += [ "-DBINDER_IPC_32BIT" ]
89  }
90
91  defines = []
92  defines += player_framework_defines
93}
94
95ohos_shared_library("media_client") {
96  install_enable = true
97
98  sanitize = {
99    cfi = true
100    cfi_cross_dso = true
101    debug = false
102  }
103
104  sources = [
105    "$MEDIA_ROOT_DIR/frameworks/native/common/media_errors.cpp",
106    "$MEDIA_ROOT_DIR/services/services/common/avsharedmemory_ipc.cpp",
107    "$MEDIA_ROOT_DIR/services/services/monitor/client/monitor_client.cpp",
108    "$MEDIA_ROOT_DIR/services/services/monitor/client/monitor_client_object.cpp",
109    "$MEDIA_ROOT_DIR/services/services/monitor/ipc/monitor_service_proxy.cpp",
110    "$MEDIA_ROOT_DIR/services/services/sa_media/client/media_client.cpp",
111    "$MEDIA_ROOT_DIR/services/services/sa_media/ipc/media_listener_stub.cpp",
112    "$MEDIA_ROOT_DIR/services/services/sa_media/ipc/media_parcel.cpp",
113    "$MEDIA_ROOT_DIR/services/services/sa_media/ipc/media_service_proxy.cpp",
114  ]
115  if (multimedia_player_framework_support_player) {
116    sources += [
117      "$MEDIA_ROOT_DIR/frameworks/native/player/player_impl.cpp",
118      "$MEDIA_ROOT_DIR/services/services/media_data_source/ipc/media_data_source_stub.cpp",
119      "$MEDIA_ROOT_DIR/services/services/player/client/player_client.cpp",
120      "$MEDIA_ROOT_DIR/services/services/player/ipc/player_listener_stub.cpp",
121      "$MEDIA_ROOT_DIR/services/services/player/ipc/player_service_proxy.cpp",
122    ]
123  }
124  if (multimedia_player_framework_support_recorder) {
125    sources += [
126      "$MEDIA_ROOT_DIR/frameworks/native/recorder/recorder_impl.cpp",
127      "$MEDIA_ROOT_DIR/frameworks/native/recorder_profiles/recorder_profiles_impl.cpp",
128      "$MEDIA_ROOT_DIR/services/services/recorder/client/recorder_client.cpp",
129      "$MEDIA_ROOT_DIR/services/services/recorder/ipc/recorder_listener_stub.cpp",
130      "$MEDIA_ROOT_DIR/services/services/recorder/ipc/recorder_service_proxy.cpp",
131      "$MEDIA_ROOT_DIR/services/services/recorder_profiles/client/recorder_profiles_client.cpp",
132      "$MEDIA_ROOT_DIR/services/services/recorder_profiles/ipc/recorder_profiles_service_proxy.cpp",
133      "$MEDIA_ROOT_DIR/services/services/sa_media/ipc/recorder_profiles_parcel.cpp",
134    ]
135  }
136  if (multimedia_player_framework_support_codec) {
137    sources += [
138      "$MEDIA_ROOT_DIR/frameworks/native/avcodec/avcodec_audio_decoder_impl.cpp",
139      "$MEDIA_ROOT_DIR/frameworks/native/avcodec/avcodec_audio_encoder_impl.cpp",
140      "$MEDIA_ROOT_DIR/frameworks/native/avcodec/avcodec_video_decoder_impl.cpp",
141      "$MEDIA_ROOT_DIR/frameworks/native/avcodec/avcodec_video_encoder_impl.cpp",
142      "$MEDIA_ROOT_DIR/frameworks/native/avcodeclist/avcodec_info.cpp",
143      "$MEDIA_ROOT_DIR/frameworks/native/avcodeclist/avcodec_list_impl.cpp",
144      "$MEDIA_ROOT_DIR/services/services/avcodec/client/avcodec_client.cpp",
145      "$MEDIA_ROOT_DIR/services/services/avcodec/ipc/avcodec_listener_stub.cpp",
146      "$MEDIA_ROOT_DIR/services/services/avcodec/ipc/avcodec_service_proxy.cpp",
147      "$MEDIA_ROOT_DIR/services/services/avcodeclist/client/avcodeclist_client.cpp",
148      "$MEDIA_ROOT_DIR/services/services/avcodeclist/ipc/avcodeclist_service_proxy.cpp",
149      "$MEDIA_ROOT_DIR/services/services/sa_media/ipc/avcodeclist_parcel.cpp",
150    ]
151  }
152  if (multimedia_player_framework_support_metadata) {
153    sources += [
154      "$MEDIA_ROOT_DIR/frameworks/native/avmetadatahelper/avmetadatahelper_impl.cpp",
155      "$MEDIA_ROOT_DIR/services/services/avmetadatahelper/client/avmetadatahelper_client.cpp",
156      "$MEDIA_ROOT_DIR/services/services/avmetadatahelper/ipc/avmetadatahelper_service_proxy.cpp",
157      "$MEDIA_ROOT_DIR/services/services/avmetadatahelper/ipc/helper_listener_stub.cpp",
158    ]
159  }
160  if (multimedia_player_framework_support_screen_capture) {
161    sources += [
162      "$MEDIA_ROOT_DIR/frameworks/native/screen_capture/screen_capture_impl.cpp",
163      "$MEDIA_ROOT_DIR/services/services/screen_capture/client/screen_capture_client.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    ]
167  }
168
169  configs = [
170    ":media_client_base_config",
171    ":media_client_ipc_config",
172  ]
173
174  public_configs = [ ":media_public_config" ]
175  deps = [ "$MEDIA_ROOT_DIR/services/utils:media_service_utils" ]
176
177  external_deps = [
178    "audio_framework:audio_client",
179    "c_utils:utils",
180    "hilog:libhilog",
181    "hitrace:hitrace_meter",
182    "image_framework:image_native",
183    "ipc:ipc_single",
184    "media_foundation:media_foundation",
185    "qos_manager:qos",
186    "samgr:samgr_proxy",
187  ]
188  public_deps = [ "$MEDIA_PLAYER_HISTREAMER/src:media_foundation" ]
189
190  if (multimedia_player_framework_support_video) {
191    external_deps += [ "graphic_surface:surface" ]
192  }
193
194  if (multimedia_player_framework_support_drm) {
195    external_deps += [ "drm_framework:drm_framework" ]
196  }
197
198  innerapi_tags = [ "platformsdk" ]
199  subsystem_name = "multimedia"
200  part_name = "player_framework"
201  version_script = "player_framework.versionscript"
202}
203