1# Copyright (c) 2023-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("http_source_plugin_config") { 18 defines = [ 19 "HST_ANY_WITH_NO_RTTI", 20 "MEDIA_OHOS", 21 ] 22 23 cflags = [ 24 "-Wno-sign-compare", 25 "-fno-exceptions", 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/interfaces/inner_api/native", 45 "$av_codec_root_dir/services/media_engine/plugins/source/http_source", 46 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/base64", 47 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/xml", 48 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash", 49 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/include", 50 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/include/mpd_parser", 51 ] 52} 53 54ohos_shared_library("media_plugin_HttpSource") { 55 branch_protector_ret = "pac_ret" 56 install_enable = true 57 sanitize = av_codec_sanitize 58 59 configs = [ 60 ":http_source_plugin_config", 61 "$av_codec_root_dir/services/dfx:av_codec_service_log_dfx_public_config", 62 ] 63 64 deps = [ 65 ":media_plugin_HttpSource_static", 66 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/download/network_client:http_curl_client", 67 ] 68 69 relative_install_dir = "media/media_plugins" 70 subsystem_name = "multimedia" 71 part_name = "av_codec" 72} 73 74ohos_static_library("media_plugin_HttpSource_static") { 75 branch_protector_ret = "pac_ret" 76 sanitize = av_codec_sanitize 77 78 configs = [ 79 ":http_source_plugin_config", 80 "$av_codec_root_dir/services/dfx:av_codec_service_log_dfx_public_config", 81 ] 82 83 sources = [ 84 "base64/base64_utils.cpp", 85 "dash/dash_media_downloader.cpp", 86 "dash/dash_mpd_downloader.cpp", 87 "dash/dash_segment_downloader.cpp", 88 "dash/mpd_parser/dash_adpt_set_manager.cpp", 89 "dash/mpd_parser/dash_adpt_set_node.cpp", 90 "dash/mpd_parser/dash_com_attrs_elements.cpp", 91 "dash/mpd_parser/dash_content_comp_node.cpp", 92 "dash/mpd_parser/dash_descriptor_node.cpp", 93 "dash/mpd_parser/dash_manager_util.cpp", 94 "dash/mpd_parser/dash_mpd_manager.cpp", 95 "dash/mpd_parser/dash_mpd_node.cpp", 96 "dash/mpd_parser/dash_mpd_parser.cpp", 97 "dash/mpd_parser/dash_mpd_util.cpp", 98 "dash/mpd_parser/dash_mult_seg_base_node.cpp", 99 "dash/mpd_parser/dash_period_manager.cpp", 100 "dash/mpd_parser/dash_period_node.cpp", 101 "dash/mpd_parser/dash_representation_manager.cpp", 102 "dash/mpd_parser/dash_representation_node.cpp", 103 "dash/mpd_parser/dash_seg_base_node.cpp", 104 "dash/mpd_parser/dash_seg_list_node.cpp", 105 "dash/mpd_parser/dash_seg_template_node.cpp", 106 "dash/mpd_parser/dash_seg_tmline_node.cpp", 107 "dash/mpd_parser/dash_seg_url_node.cpp", 108 "dash/mpd_parser/dash_url_type_node.cpp", 109 "dash/mpd_parser/i_dash_mpd_node.cpp", 110 "dash/mpd_parser/sidx_box_parser.cpp", 111 "download/downloader.cpp", 112 "hls/hls_media_downloader.cpp", 113 "hls/hls_playlist_downloader.cpp", 114 "hls/hls_tags.cpp", 115 "hls/m3u8.cpp", 116 "hls/playlist_downloader.cpp", 117 "http/http_media_downloader.cpp", 118 "http_source_plugin.cpp", 119 "monitor/download_monitor.cpp", 120 "utils/media_cached_buffer.cpp", 121 "xml/xml_element.cpp", 122 "xml/xml_parser.cpp", 123 ] 124 125 deps = [ "$av_codec_root_dir/services/dfx:av_codec_service_dfx" ] 126 127 public_external_deps = [ 128 "c_utils:utils", 129 "ffmpeg:libohosffmpeg", 130 "graphic_surface:surface", 131 "hilog:libhilog", 132 "init:libbegetutil", 133 "ipc:ipc_single", 134 "libxml2:libxml2", 135 "media_foundation:media_foundation", 136 "netmanager_base:net_conn_manager_if", 137 "openssl:libcrypto_shared", 138 "safwk:system_ability_fwk", 139 ] 140 141 subsystem_name = "multimedia" 142 part_name = "av_codec" 143} 144