1# Copyright (c) 2021-2021 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} 18config("histreamer_presets") { 19 include_dirs = [ 20 "//foundation/multimedia/histreamer/engine", 21 "//base/hiviewdfx/hitrace/interfaces/native/innerkits/include/hitrace_meter", 22 ] 23 defines = [ "MEDIA_OHOS" ] 24 cflags = [ 25 "-O2", 26 "-fPIC", 27 "-Wall", 28 "-frtti", 29 "-fexceptions", 30 "-Wno-unused-but-set-variable", 31 "-Wno-format", 32 ] 33 cflags_cc = cflags 34 if (histreamer_enable_recorder) { 35 defines += [ "RECORDER_SUPPORT" ] 36 } 37 if (histreamer_enable_video) { 38 defines += [ "VIDEO_SUPPORT" ] 39 } 40 if (histreamer_enable_avs3da) { 41 defines += [ "AVS3DA_SUPPORT" ] 42 } 43 if (hst_is_lite_sys) { 44 defines += [ "OHOS_LITE" ] 45 } 46} 47if (hst_is_lite_sys) { 48 config("hiplayer_external_library_config") { 49 include_dirs = [ "//foundation/multimedia/histreamer/interface" ] 50 } 51} 52if (ohos_kernel_type != "liteos_m") { 53 # L1 & std shared and seprated 54 group("histreamer") { 55 deps = [ 56 ":media_engine_histreamer", 57 "engine/plugin/plugins:histreamer_plugin_store", 58 ] 59 } 60 61 # media_engine_histreamer lib for L1 & std 62 if (hst_is_lite_sys) { 63 import("//build/lite/config/component/lite_component.gni") 64 lite_library("media_engine_histreamer") { 65 target_type = "shared_library" 66 sources = [] 67 deps = [ "engine/scene/player:histreamer_player" ] 68 if (histreamer_enable_recorder) { 69 deps += [ "engine/scene/recorder:histreamer_recorder" ] 70 } 71 public_deps = [ "//foundation/multimedia/media_utils_lite:media_common" ] 72 public_configs = [ ":hiplayer_external_library_config" ] 73 output_name = "histreamer" 74 } 75 } else { 76 import("//build/ohos.gni") 77 ohos_shared_library("media_engine_histreamer") { 78 sanitize = { 79 cfi = true 80 cfi_cross_dso = true 81 debug = false 82 integer_overflow = true 83 } 84 sources = [] 85 deps = [ "engine/scene:std_engine_factory" ] 86 external_deps = [ "hitrace:hitrace_meter" ] 87 relative_install_dir = "media" 88 subsystem_name = "multimedia" 89 part_name = "histreamer" 90 } 91 } 92} else { 93 # L0 compile as a whole static lib 94 import("//build/lite/config/component/lite_component.gni") 95 lite_library("histreamer") { 96 target_type = "static_library" 97 complete_static_lib = true 98 sources = [] 99 deps = [ 100 "engine/plugin/plugins:histreamer_plugin_store", 101 "engine/scene/player:histreamer_player", 102 ] 103 if (histreamer_enable_recorder) { 104 deps += [ "engine/scene/recorder:histreamer_recorder" ] 105 } 106 public_deps = [ "//foundation/multimedia/media_utils_lite:media_common" ] 107 public_configs = [ ":hiplayer_external_library_config" ] 108 } 109} 110