1# Copyright (c) 2021-2022 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("//foundation/multimedia/histreamer/config.gni") 15if (!hst_is_lite_sys) { 16 ohos_kernel_type = "" 17} 18 19declare_args() { 20 if (ohos_kernel_type == "liteos_m") { 21 plugin_dynamic_register = false 22 } else { 23 plugin_dynamic_register = true 24 } 25} 26 27group("histreamer_plugin") { 28 deps = [ 29 ":histreamer_plugin_core", 30 ":histreamer_plugin_intf", 31 "plugins:histreamer_plugin_store", 32 ] 33} 34 35# build plugin interface 36config("hst_plugin_intf_config") { 37 include_dirs = [ "//foundation/multimedia/histreamer/engine/plugin" ] 38 if (hst_is_lite_sys) { 39 include_dirs += [ "//foundation/multimedia/utils/lite/interfaces/kits" ] 40 } else { 41 include_dirs += [ 42 "//foundation/multimedia/histreamer/engine/scene/standard", 43 "//foundation/multimedia/player_framework/interfaces/inner_api/native", 44 ] 45 if (multimedia_histreamer_enable_video) { 46 include_dirs += [ 47 "//commonlibrary/c_utils/base/include", 48 "//drivers/peripheral/display/interfaces/include", 49 "//foundation/graphic/graphic_2d/frameworks/surface/include", 50 "//foundation/graphic/graphic_2d/interfaces/inner_api/", 51 "//foundation/graphic/graphic_2d/utils/sync_fence/export", 52 ] 53 } 54 } 55} 56 57source_set("histreamer_plugin_intf") { 58 sources = [ 59 "common/media_sink.cpp", 60 "common/media_source.cpp", 61 "common/plugin_buffer.cpp", 62 ] 63 if (!hst_is_lite_sys && multimedia_histreamer_enable_video) { 64 sources += [ 65 "common/share_allocator.cpp", 66 "common/share_memory.cpp", 67 "common/surface_allocator.cpp", 68 "common/surface_memory.cpp", 69 ] 70 } 71 public_configs = [ 72 ":hst_plugin_intf_config", 73 "//foundation/multimedia/histreamer:histreamer_presets", 74 ] 75 if (hst_is_lite_sys) { 76 if (ohos_kernel_type == "liteos_m") { 77 public_deps = [ "//third_party/bounds_checking_function:libsec_static" ] 78 } else { 79 public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ] 80 } 81 } else { 82 public_deps = [ "//third_party/bounds_checking_function:libsec_static" ] 83 if (multimedia_histreamer_enable_video) { 84 public_deps += [ 85 "//foundation/graphic/graphic_2d/frameworks/surface:surface", 86 "//foundation/graphic/graphic_2d/utils:sync_fence", 87 ] 88 } 89 } 90} 91 92config("hst_plugin_core_config") { 93 include_dirs = [ 94 "//foundation/multimedia/histreamer/engine/", 95 "//foundation/multimedia/histreamer/engine/plugin", 96 ] 97 if (hst_is_lite_sys) { 98 include_dirs += [ "//foundation/multimedia/utils/lite/interfaces/kits" ] 99 } else { 100 include_dirs += [ 101 "//commonlibrary/c_utils/base/include", 102 "//foundation/graphic/graphic_2d/frameworks/surface/include", 103 "//foundation/graphic/graphic_2d/interfaces/inner_api/", 104 "//foundation/multimedia/player_framework/interfaces/inner_api/native", 105 "//drivers/peripheral/display/interfaces/include", 106 ] 107 } 108} 109 110source_set("histreamer_plugin_core") { 111 sources = [ 112 "core/audio_sink.cpp", 113 "core/base.cpp", 114 "core/codec.cpp", 115 "core/demuxer.cpp", 116 "core/muxer.cpp", 117 "core/output_sink.cpp", 118 "core/plugin_core_utils.cpp", 119 "core/plugin_manager.cpp", 120 "core/plugin_meta.cpp", 121 "core/plugin_register.cpp", 122 "core/plugin_wrapper.cpp", 123 "core/source.cpp", 124 "core/video_sink.cpp", 125 ] 126 defines = [] 127 if (plugin_dynamic_register) { 128 sources += [ "core/plugin_loader.cpp" ] 129 defines += [ "DYNAMIC_PLUGINS" ] 130 } 131 if (hst_is_lite_sys) { 132 defines += [ 133 "HST_PLUGIN_PATH=\"/usr/lib\"", 134 "HST_PLUGIN_FILE_TAIL=\".so\"", 135 ] 136 } else { 137 if (target_cpu == "arm64") { 138 hst_plugin_path = "\"/system/lib64/media/histreamer_plugins\"" 139 } else { 140 hst_plugin_path = "\"/system/lib/media/histreamer_plugins\"" 141 } 142 defines += [ 143 "HST_PLUGIN_PATH=${hst_plugin_path}", 144 "HST_PLUGIN_FILE_TAIL=\".z.so\"", 145 ] 146 } 147 public_configs = [ 148 ":hst_plugin_core_config", 149 "//foundation/multimedia/histreamer:histreamer_presets", 150 ] 151 public_deps = [ 152 ":histreamer_plugin_intf", 153 "//foundation/multimedia/histreamer/engine/foundation:histreamer_foundation", 154 ] 155 156 if (hst_is_lite_sys) { 157 if (ohos_kernel_type == "liteos_m") { 158 public_deps += [ "//third_party/bounds_checking_function:libsec_static" ] 159 } else { 160 public_deps += [ "//third_party/bounds_checking_function:libsec_shared" ] 161 } 162 } else { 163 public_deps += [ 164 "//foundation/multimedia/histreamer/engine/plugin/core/hdi_codec:hdi_codec_adapter", 165 "//third_party/bounds_checking_function:libsec_static", 166 ] 167 } 168 public_deps += [ "plugins:gen_plugin_static_header" ] 169} 170