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("av_codec_media_engine_modules_pts_and_index_convert_config") {
18  include_dirs = [ "$av_codec_root_dir/services/media_engine/modules/demuxer" ]
19}
20
21config("av_codec_media_engine_modules_config") {
22  defines = [
23    "HST_ANY_WITH_NO_RTTI",
24    "MEDIA_OHOS",
25  ]
26
27  cflags = [
28    "-fno-exceptions",
29    "-Wall",
30    "-fno-common",
31    "-fstack-protector-all",
32    "-Wshadow",
33    "-FPIC",
34    "-FS",
35    "-O2",
36    "-D_FORTIFY_SOURCE=2",
37    "-Wformat=2",
38    "-Wdate-time",
39  ]
40
41  cflags_cc = [
42    "-std=c++17",
43    "-fno-rtti",
44  ]
45
46  include_dirs = [
47    "$av_codec_root_dir/interfaces",
48    "$av_codec_root_dir/interfaces/inner_api/native",
49    "$av_codec_root_dir/services/drm_decryptor",
50    "$av_codec_root_dir/services/media_engine/modules",
51  ]
52}
53
54ohos_shared_library("av_codec_media_engine_modules") {
55  branch_protector_ret = "pac_ret"
56  install_enable = true
57
58  sanitize = av_codec_sanitize
59
60  configs = [
61    ":av_codec_media_engine_modules_config",
62    "$av_codec_root_dir/services/dfx:av_codec_service_log_dfx_public_config",
63  ]
64
65  sources = [
66    "$av_codec_root_dir/services/drm_decryptor/codec_drm_decrypt.cpp",
67    "demuxer/base_stream_demuxer.cpp",
68    "demuxer/demuxer_plugin_manager.cpp",
69    "demuxer/media_demuxer.cpp",
70    "demuxer/pts_and_index_conversion.cpp",
71    "demuxer/stream_demuxer.cpp",
72    "demuxer/type_finder.cpp",
73    "media_codec/media_codec.cpp",
74    "muxer/data_sink_fd.cpp",
75    "muxer/data_sink_file.cpp",
76    "muxer/media_muxer.cpp",
77    "sink/audio_sampleformat.cpp",
78    "sink/audio_sink.cpp",
79    "sink/calc_max_amplitude.cpp",
80    "sink/media_sync_manager.cpp",
81    "sink/media_synchronous_sink.cpp",
82    "sink/subtitle_sink.cpp",
83    "sink/video_sink.cpp",
84    "source/audio_capture/audio_capture_module.cpp",
85    "source/audio_capture/audio_type_translate.cpp",
86    "source/source.cpp",
87  ]
88
89  deps = [ "$av_codec_root_dir/services/engine/base:av_codec_codec_base" ]
90
91  public_configs = [
92    "$audio_framework_root_dir/frameworks/native/audiocapturer:audio_capturer_config",
93    ":av_codec_media_engine_modules_pts_and_index_convert_config",
94  ]
95
96  external_deps = [
97    "audio_framework:audio_capturer",
98    "c_utils:utils",
99    "ffmpeg:libohosffmpeg",
100    "graphic_surface:surface",
101    "graphic_surface:sync_fence",
102    "hilog:libhilog",
103    "hitrace:libhitracechain",
104    "init:libbegetutil",
105    "ipc:ipc_single",
106    "media_foundation:media_foundation",
107    "safwk:system_ability_fwk",
108  ]
109
110  if (av_codec_support_drm) {
111    defines = [ "SUPPORT_DRM" ]
112  }
113  if (av_codec_support_drm) {
114    external_deps += [ "drm_framework:drm_framework" ]
115  }
116
117  subsystem_name = "multimedia"
118  part_name = "av_codec"
119}
120