• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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("ffmpeg_adapter_config") {
18  defines = [
19    "HST_ANY_WITH_NO_RTTI",
20    "MEDIA_OHOS",
21  ]
22
23  cflags = [
24    "-fno-exceptions",
25    "-Wall",
26    "-fno-common",
27    "-fstack-protector-all",
28    "-Wshadow",
29    "-FPIC",
30    "-FS",
31    "-O2",
32    "-D_FORTIFY_SOURCE=2",
33    "-Wformat=2",
34    "-Wdate-time",
35  ]
36
37  cflags_cc = [
38    "-std=c++17",
39    "-fno-rtti",
40  ]
41
42  include_dirs = [
43    "$av_codec_root_dir/interfaces",
44    "$av_codec_root_dir/services/media_engine/plugins/ffmpeg_adapter",
45    "$av_codec_root_dir/services/media_engine/plugins/ffmpeg_adapter/muxer",
46    "$av_codec_root_dir/services/media_engine/plugins/ffmpeg_adapter/common",
47  ]
48}
49
50ohos_shared_library("media_plugin_FFmpegMuxer") {
51  branch_protector_ret = "pac_ret"
52  install_enable = true
53
54  sanitize = av_codec_sanitize
55
56  configs = [
57    ":ffmpeg_adapter_config",
58    "$av_codec_root_dir/services/dfx:av_codec_service_log_dfx_public_config",
59  ]
60
61  sources = [
62    "common/ffmpeg_converter.cpp",
63    "common/ffmpeg_utils.cpp",
64    "common/stream_parser_manager.cpp",
65    "muxer/ffmpeg_muxer_plugin.cpp",
66  ]
67
68  external_deps = [
69    "c_utils:utils",
70    "ffmpeg:libohosffmpeg",
71    "hilog:libhilog",
72    "ipc:ipc_single",
73    "media_foundation:media_foundation",
74  ]
75
76  relative_install_dir = "media/media_plugins"
77  subsystem_name = "multimedia"
78  part_name = "av_codec"
79}
80
81ohos_shared_library("media_plugin_FFmpegDemuxer") {
82  branch_protector_ret = "pac_ret"
83  install_enable = true
84
85  sanitize = av_codec_sanitize
86
87  defines = []
88
89  defines += [
90    "OHOS_EXPAND_MP4_INFO",
91    "OHOS_AV3A_DEMUXER",
92  ]
93  defines += av_codec_defines
94
95  public_configs = [ ":ffmpeg_adapter_config" ]
96
97  if (build_variant != "user") {
98    defines += [ "BUILD_ENG_VERSION" ]
99  }
100
101  configs = [
102    ":ffmpeg_adapter_config",
103    "$av_codec_root_dir/services/dfx:av_codec_service_log_dfx_public_config",
104  ]
105
106  sources = [
107    "common/ffmpeg_converter.cpp",
108    "common/ffmpeg_utils.cpp",
109    "common/reference_parser_manager.cpp",
110    "common/stream_parser_manager.cpp",
111    "demuxer/block_queue_pool.cpp",
112    "demuxer/demuxer_log_compressor.cpp",
113    "demuxer/ffmpeg_demuxer_plugin.cpp",
114    "demuxer/ffmpeg_format_helper.cpp",
115    "demuxer/ffmpeg_reference_parser.cpp",
116  ]
117
118  deps = [ "$av_codec_root_dir/services/dfx:av_codec_service_dfx" ]
119
120  external_deps = [
121    "c_utils:utils",
122    "ffmpeg:libohosffmpeg",
123    "hilog:libhilog",
124    "hisysevent:libhisysevent",
125    "init:libbegetutil",
126    "ipc:ipc_single",
127    "media_foundation:media_foundation",
128  ]
129
130  relative_install_dir = "media/media_plugins"
131  subsystem_name = "multimedia"
132  part_name = "av_codec"
133}
134