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/av_codec/config.gni")
16
17config("audio_server_sink_plugin_config") {
18  defines = [
19    "HST_ANY_WITH_NO_RTTI",
20    "MEDIA_OHOS",
21  ]
22
23  cflags = [
24    "-O2",
25    "-fPIC",
26    "-Wall",
27    "-fexceptions",
28    "-fno-rtti",
29    "-Wno-unused-but-set-variable",
30    "-Wno-format",
31  ]
32  cflags_cc = cflags
33
34  include_dirs = [
35    "$av_codec_root_dir/interfaces",
36    "$av_codec_root_dir/interfaces/inner_api/native",
37    "$av_codec_root_dir/services/media_engine/plugins/ffmpeg_adapter/common",
38    "$av_codec_root_dir/services/media_engine/plugins/sink",
39    "$audio_framework_root_dir/interfaces/inner_api/native/audiocommon/include",
40  ]
41}
42
43ohos_shared_library("media_plugin_AudioServerSink") {
44  branch_protector_ret = "pac_ret"
45  install_enable = true
46
47  sanitize = av_codec_sanitize
48
49  configs = [
50    ":audio_server_sink_plugin_config",
51    "$av_codec_root_dir/services/dfx:av_codec_service_log_dfx_public_config",
52  ]
53
54  deps = [ "$av_codec_root_dir/services/dfx:av_codec_service_dfx" ]
55
56  public_external_deps = [ "ffmpeg:libohosffmpeg" ]
57
58  sources = [
59    "../ffmpeg_adapter/common/ffmpeg_convert.cpp",
60    "../ffmpeg_adapter/common/ffmpeg_utils.cpp",
61    "audio_server_sink_plugin.cpp",
62  ]
63
64  external_deps = [
65    "audio_framework:audio_renderer",
66    "c_utils:utils",
67    "graphic_surface:surface",
68    "graphic_surface:sync_fence",
69    "hilog:libhilog",
70    "init:libbegetutil",
71    "ipc:ipc_single",
72    "media_foundation:media_foundation",
73    "safwk:system_ability_fwk",
74  ]
75
76  relative_install_dir = "media/media_plugins"
77  subsystem_name = "multimedia"
78  part_name = "av_codec"
79}
80