• 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_client_local_config") {
20  include_dirs = [
21    "$MEDIA_ROOT_DIR/services/services/sa_media/client",
22    "$MEDIA_ROOT_DIR/services/services/player/server",
23    "$MEDIA_ROOT_DIR/services/services/recorder/server",
24    "$MEDIA_ROOT_DIR/services/services/avmetadatahelper/server",
25    "$MEDIA_ROOT_DIR/services/services/avcodec/server",
26    "$MEDIA_ROOT_DIR/services/services/factory",
27    "$MEDIA_ROOT_DIR/services/services/engine_intf",
28    "$MEDIA_ROOT_DIR/services/services/avcodeclist/server",
29    "$MEDIA_ROOT_DIR/services/services/recorder_profiles/server",
30    "$MEDIA_ROOT_DIR/services/services/avmuxer/server",
31  ]
32}
33
34config("media_client_ipc_config") {
35  include_dirs = [
36    "$MEDIA_ROOT_DIR/services/services/sa_media/client",
37    "$MEDIA_ROOT_DIR/services/services/sa_media/ipc",
38    "$MEDIA_ROOT_DIR/services/services/player/client",
39    "$MEDIA_ROOT_DIR/services/services/player/ipc",
40    "$MEDIA_ROOT_DIR/services/services/media_data_source/ipc",
41    "$MEDIA_ROOT_DIR/services/services/recorder/client",
42    "$MEDIA_ROOT_DIR/services/services/recorder/ipc",
43    "$MEDIA_ROOT_DIR/services/services/avmetadatahelper/client",
44    "$MEDIA_ROOT_DIR/services/services/avmetadatahelper/ipc",
45    "$MEDIA_ROOT_DIR/services/services/common",
46    "$MEDIA_ROOT_DIR/services/services/avcodec/client",
47    "$MEDIA_ROOT_DIR/services/services/avcodec/ipc",
48    "$MEDIA_ROOT_DIR/services/services/avcodeclist/client",
49    "$MEDIA_ROOT_DIR/services/services/avcodeclist/ipc",
50    "$MEDIA_ROOT_DIR/services/services/recorder_profiles/client",
51    "$MEDIA_ROOT_DIR/services/services/recorder_profiles/ipc",
52    "$MEDIA_ROOT_DIR/services/services/avmuxer/client",
53    "$MEDIA_ROOT_DIR/services/services/avmuxer/ipc",
54  ]
55}
56
57config("media_client_public_config") {
58  include_dirs = [
59    "$MEDIA_ROOT_DIR/interfaces/inner_api/native",
60    "$MEDIA_ROOT_DIR/services/include",
61    "$MEDIA_ROOT_DIR/services/utils/include",
62    "//base/hiviewdfx/hilog/interfaces/native/innerkits/include",
63    "//utils/system/safwk/native/include",
64    "//third_party/bounds_checking_function/include",
65    "//commonlibrary/c_utils/base/include",
66    "//foundation/multimedia/image_framework/interfaces/innerkits/include",
67    "//foundation/multimedia/audio_framework/interfaces/inner_api/native/audiocommon/include",
68    "//foundation/multimedia/audio_framework/interfaces/kits/js/audio_capturer/include",
69    "//foundation/multimedia/audio_framework/interfaces/inner_api/native/audiocapturer/include",
70  ]
71
72  cflags = [
73    "-fno-exceptions",
74    "-Wall",
75    "-fno-common",
76    "-fstack-protector-strong",
77    "-Wshadow",
78    "-FPIC",
79    "-FS",
80    "-O2",
81    "-D_FORTIFY_SOURCE=2",
82    "-Wformat=2",
83    "-Wdate-time",
84  ]
85
86  cflags_cc = [
87    "-std=c++17",
88    "-fno-rtti",
89  ]
90
91  if (target_cpu == "arm") {
92    cflags += [ "-DBINDER_IPC_32BIT" ]
93  }
94
95  defines = []
96  defines += player_framework_defines
97}
98
99ohos_shared_library("media_client") {
100  install_enable = true
101  if (defined(ohos_lite)) {
102    sources = [
103      "$MEDIA_ROOT_DIR/frameworks/native/common/media_errors.cpp",
104      "$MEDIA_ROOT_DIR/services/services/factory/engine_factory_repo.cpp",
105      "$MEDIA_ROOT_DIR/services/services/sa_media/client/media_local.cpp",
106    ]
107    if (multimedia_player_framework_support_player) {
108      sources += [
109        "$MEDIA_ROOT_DIR/frameworks/native/player/player_impl.cpp",
110        "$MEDIA_ROOT_DIR/services/services/player/server/player_server.cpp",
111      ]
112    }
113    if (multimedia_player_framework_support_recorder) {
114      sources += [
115        "$MEDIA_ROOT_DIR/frameworks/native/recorder/recorder_impl.cpp",
116        "$MEDIA_ROOT_DIR/frameworks/native/recorder_profiles/recorder_profiles_impl.cpp",
117        "$MEDIA_ROOT_DIR/services/services/recorder/server/recorder_server.cpp",
118        "$MEDIA_ROOT_DIR/services/services/recorder_profiles/server/recorder_profiles_server.cpp",
119      ]
120    }
121    if (multimedia_player_framework_support_codec) {
122      sources += [
123        "$MEDIA_ROOT_DIR/frameworks/native/avcodec/avcodec_audio_decoder_impl.cpp",
124        "$MEDIA_ROOT_DIR/frameworks/native/avcodec/avcodec_audio_encoder_impl.cpp",
125        "$MEDIA_ROOT_DIR/frameworks/native/avcodec/avcodec_video_decoder_impl.cpp",
126        "$MEDIA_ROOT_DIR/frameworks/native/avcodec/avcodec_video_encoder_impl.cpp",
127        "$MEDIA_ROOT_DIR/frameworks/native/avcodeclist/avcodec_info.cpp",
128        "$MEDIA_ROOT_DIR/frameworks/native/avcodeclist/avcodec_list_impl.cpp",
129        "$MEDIA_ROOT_DIR/services/services/avcodec/server/avcodec_server.cpp",
130        "$MEDIA_ROOT_DIR/services/services/avcodeclist/server/avcodeclist_server.cpp",
131      ]
132    }
133    if (multimedia_player_framework_support_muxer) {
134      sources += [
135        "$MEDIA_ROOT_DIR/frameworks/native/avmuxer/avmuxer_impl.cpp",
136        "$MEDIA_ROOT_DIR/services/services/avmuxer/server/avmuxer_server.cpp",
137      ]
138    }
139    if (multimedia_player_framework_support_metadata) {
140      sources += [
141        "$MEDIA_ROOT_DIR/frameworks/native/avmetadatahelper/avmetadatahelper_impl.cpp",
142        "$MEDIA_ROOT_DIR/services/services/avmetadatahelper/server/avmetadatahelper_server.cpp",
143      ]
144    }
145
146    public_configs = [
147      ":media_client_local_config",
148      ":media_client_public_config",
149    ]
150
151    deps = [
152      "$MEDIA_ROOT_DIR/services/utils:media_format",
153      "//third_party/bounds_checking_function:libsec_static",
154    ]
155
156    if (multimedia_player_framework_support_video) {
157      public_configs += [ "//foundation/graphic/graphic_2d/frameworks/surface:surface_public_config" ]
158      deps += [
159        "//foundation/graphic/graphic_2d/frameworks/surface:surface",
160        "//foundation/multimedia/image_framework/interfaces/innerkits:image_native",
161      ]
162    }
163
164    external_deps = [
165      "c_utils:utils",
166      "hiviewdfx_hilog_native:libhilog",
167      "ipc:ipc_core",
168    ]
169  } else {
170    sources = [
171      "$MEDIA_ROOT_DIR/frameworks/native/common/media_errors.cpp",
172      "$MEDIA_ROOT_DIR/services/services/common/avsharedmemory_ipc.cpp",
173      "$MEDIA_ROOT_DIR/services/services/sa_media/client/media_client.cpp",
174      "$MEDIA_ROOT_DIR/services/services/sa_media/ipc/media_listener_stub.cpp",
175      "$MEDIA_ROOT_DIR/services/services/sa_media/ipc/media_parcel.cpp",
176      "$MEDIA_ROOT_DIR/services/services/sa_media/ipc/media_service_proxy.cpp",
177      "$MEDIA_ROOT_DIR/services/utils/avsharedmemorybase.cpp",
178    ]
179    if (multimedia_player_framework_support_player) {
180      sources += [
181        "$MEDIA_ROOT_DIR/frameworks/native/player/player_impl.cpp",
182        "$MEDIA_ROOT_DIR/services/services/media_data_source/ipc/media_data_source_stub.cpp",
183        "$MEDIA_ROOT_DIR/services/services/player/client/player_client.cpp",
184        "$MEDIA_ROOT_DIR/services/services/player/ipc/player_listener_stub.cpp",
185        "$MEDIA_ROOT_DIR/services/services/player/ipc/player_service_proxy.cpp",
186      ]
187    }
188    if (multimedia_player_framework_support_recorder) {
189      sources += [
190        "$MEDIA_ROOT_DIR/frameworks/native/recorder/recorder_impl.cpp",
191        "$MEDIA_ROOT_DIR/frameworks/native/recorder_profiles/recorder_profiles_impl.cpp",
192        "$MEDIA_ROOT_DIR/services/services/recorder/client/recorder_client.cpp",
193        "$MEDIA_ROOT_DIR/services/services/recorder/ipc/recorder_listener_stub.cpp",
194        "$MEDIA_ROOT_DIR/services/services/recorder/ipc/recorder_service_proxy.cpp",
195        "$MEDIA_ROOT_DIR/services/services/recorder_profiles/client/recorder_profiles_client.cpp",
196        "$MEDIA_ROOT_DIR/services/services/recorder_profiles/ipc/recorder_profiles_service_proxy.cpp",
197        "$MEDIA_ROOT_DIR/services/services/sa_media/ipc/recorder_profiles_parcel.cpp",
198      ]
199    }
200    if (multimedia_player_framework_support_codec) {
201      sources += [
202        "$MEDIA_ROOT_DIR/frameworks/native/avcodec/avcodec_audio_decoder_impl.cpp",
203        "$MEDIA_ROOT_DIR/frameworks/native/avcodec/avcodec_audio_encoder_impl.cpp",
204        "$MEDIA_ROOT_DIR/frameworks/native/avcodec/avcodec_video_decoder_impl.cpp",
205        "$MEDIA_ROOT_DIR/frameworks/native/avcodec/avcodec_video_encoder_impl.cpp",
206        "$MEDIA_ROOT_DIR/frameworks/native/avcodeclist/avcodec_info.cpp",
207        "$MEDIA_ROOT_DIR/frameworks/native/avcodeclist/avcodec_list_impl.cpp",
208        "$MEDIA_ROOT_DIR/services/services/avcodec/client/avcodec_client.cpp",
209        "$MEDIA_ROOT_DIR/services/services/avcodec/ipc/avcodec_listener_stub.cpp",
210        "$MEDIA_ROOT_DIR/services/services/avcodec/ipc/avcodec_service_proxy.cpp",
211        "$MEDIA_ROOT_DIR/services/services/avcodeclist/client/avcodeclist_client.cpp",
212        "$MEDIA_ROOT_DIR/services/services/avcodeclist/ipc/avcodeclist_service_proxy.cpp",
213        "$MEDIA_ROOT_DIR/services/services/sa_media/ipc/avcodeclist_parcel.cpp",
214      ]
215    }
216    if (multimedia_player_framework_support_muxer) {
217      sources += [
218        "$MEDIA_ROOT_DIR/frameworks/native/avmuxer/avmuxer_impl.cpp",
219        "$MEDIA_ROOT_DIR/services/services/avmuxer/client/avmuxer_client.cpp",
220        "$MEDIA_ROOT_DIR/services/services/avmuxer/ipc/avmuxer_service_proxy.cpp",
221      ]
222    }
223    if (multimedia_player_framework_support_metadata) {
224      sources += [
225        "$MEDIA_ROOT_DIR/frameworks/native/avmetadatahelper/avmetadatahelper_impl.cpp",
226        "$MEDIA_ROOT_DIR/services/services/avmetadatahelper/client/avmetadatahelper_client.cpp",
227        "$MEDIA_ROOT_DIR/services/services/avmetadatahelper/ipc/avmetadatahelper_service_proxy.cpp",
228      ]
229    }
230
231    public_configs = [
232      ":media_client_ipc_config",
233      ":media_client_public_config",
234    ]
235
236    deps = [
237      "//foundation/multimedia/player_framework/services/utils:media_format",
238      "//third_party/bounds_checking_function:libsec_static",
239    ]
240
241    if (multimedia_player_framework_support_video) {
242      public_configs += [ "//foundation/graphic/graphic_2d/frameworks/surface:surface_public_config" ]
243      deps += [
244        "//foundation/graphic/graphic_2d/frameworks/surface:surface",
245        "//foundation/multimedia/image_framework/interfaces/innerkits:image_native",
246      ]
247    }
248
249    external_deps = [
250      "c_utils:utils",
251      "hiviewdfx_hilog_native:libhilog",
252      "ipc:ipc_core",
253      "samgr:samgr_proxy",
254    ]
255  }
256
257  subsystem_name = "multimedia"
258  part_name = "multimedia_player_framework"
259}
260