1# Copyright (C) 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("//build/ohos.gni") 15import("//foundation/multimedia/player_framework/config.gni") 16 17MEDIA_ROOT_DIR = "//foundation/multimedia/player_framework" 18 19group("capi_packages") { 20 deps = [] 21 if (multimedia_player_framework_support_capi) { 22 deps += [ 23 "//foundation/multimedia/player_framework/interfaces/kits/c:native_media_adec", 24 "//foundation/multimedia/player_framework/interfaces/kits/c:native_media_aenc", 25 "//foundation/multimedia/player_framework/interfaces/kits/c:native_media_codecbase", 26 "//foundation/multimedia/player_framework/interfaces/kits/c:native_media_core", 27 "//foundation/multimedia/player_framework/interfaces/kits/c:native_media_vdec", 28 "//foundation/multimedia/player_framework/interfaces/kits/c:native_media_venc", 29 ] 30 } 31} 32 33config("media_capi_config") { 34 include_dirs = [ 35 "$MEDIA_ROOT_DIR/interfaces/inner_api/native", 36 "$MEDIA_ROOT_DIR/interfaces/kits/c", 37 "$MEDIA_ROOT_DIR/frameworks/native/capi/avcodec", 38 "$MEDIA_ROOT_DIR/frameworks/native/capi/common", 39 "$MEDIA_ROOT_DIR/services/utils/include", 40 "//foundation/graphic/graphic_2d/frameworks/surface/include", 41 ] 42 43 cflags = [ 44 "-fno-exceptions", 45 "-Wall", 46 "-fno-common", 47 "-fstack-protector-all", 48 "-Wshadow", 49 "-FPIC", 50 "-FS", 51 "-O2", 52 "-D_FORTIFY_SOURCE=2", 53 "-Wformat=2", 54 "-Wdate-time", 55 ] 56 57 cflags_cc = [ 58 "-std=c++17", 59 "-fno-rtti", 60 ] 61} 62 63ohos_shared_library("native_media_core") { 64 install_enable = true 65 sources = [ 66 "$MEDIA_ROOT_DIR/frameworks/native/capi/common/native_avformat.cpp", 67 "$MEDIA_ROOT_DIR/frameworks/native/capi/common/native_avmemory.cpp", 68 ] 69 70 public_configs = [ ":media_capi_config" ] 71 72 deps = [ 73 "//foundation/multimedia/player_framework/interfaces/inner_api/native:media_client", 74 "//foundation/multimedia/player_framework/services/utils:media_format", 75 ] 76 77 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 78 output_extension = "so" 79 subsystem_name = "multimedia" 80 part_name = "multimedia_player_framework" 81} 82 83ohos_shared_library("native_media_codecbase") { 84 install_enable = true 85 sources = [ 86 "$MEDIA_ROOT_DIR/frameworks/native/capi/avcodec/native_avcodec_base.cpp", 87 ] 88 89 public_configs = [ ":media_capi_config" ] 90 91 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 92 output_extension = "so" 93 subsystem_name = "multimedia" 94 part_name = "multimedia_player_framework" 95} 96 97ohos_shared_library("native_media_adec") { 98 install_enable = true 99 sources = [ 100 "$MEDIA_ROOT_DIR/frameworks/native/capi/avcodec/native_audio_decoder.cpp", 101 ] 102 103 public_configs = [ ":media_capi_config" ] 104 105 deps = [ 106 "//foundation/multimedia/player_framework/interfaces/inner_api/native:media_client", 107 "//foundation/multimedia/player_framework/interfaces/kits/c:native_media_codecbase", 108 "//foundation/multimedia/player_framework/interfaces/kits/c:native_media_core", 109 ] 110 111 external_deps = [ 112 "c_utils:utils", 113 "hiviewdfx_hilog_native:libhilog", 114 ] 115 output_extension = "so" 116 subsystem_name = "multimedia" 117 part_name = "multimedia_player_framework" 118} 119 120ohos_shared_library("native_media_aenc") { 121 install_enable = true 122 sources = [ 123 "$MEDIA_ROOT_DIR/frameworks/native/capi/avcodec/native_audio_encoder.cpp", 124 ] 125 126 public_configs = [ ":media_capi_config" ] 127 128 deps = [ 129 "//foundation/multimedia/player_framework/interfaces/inner_api/native:media_client", 130 "//foundation/multimedia/player_framework/interfaces/kits/c:native_media_codecbase", 131 "//foundation/multimedia/player_framework/interfaces/kits/c:native_media_core", 132 ] 133 134 external_deps = [ 135 "c_utils:utils", 136 "hiviewdfx_hilog_native:libhilog", 137 ] 138 output_extension = "so" 139 subsystem_name = "multimedia" 140 part_name = "multimedia_player_framework" 141} 142 143ohos_shared_library("native_media_vdec") { 144 install_enable = true 145 sources = [ 146 "$MEDIA_ROOT_DIR/frameworks/native/capi/avcodec/native_video_decoder.cpp", 147 ] 148 149 public_configs = [ 150 ":media_capi_config", 151 "//foundation/graphic/graphic_2d/frameworks/surface:surface_public_config", 152 ] 153 154 deps = [ 155 "//foundation/graphic/graphic_2d/frameworks/surface:surface", 156 "//foundation/multimedia/player_framework/interfaces/inner_api/native:media_client", 157 "//foundation/multimedia/player_framework/interfaces/kits/c:native_media_codecbase", 158 "//foundation/multimedia/player_framework/interfaces/kits/c:native_media_core", 159 ] 160 161 external_deps = [ 162 "c_utils:utils", 163 "hiviewdfx_hilog_native:libhilog", 164 ] 165 output_extension = "so" 166 subsystem_name = "multimedia" 167 part_name = "multimedia_player_framework" 168} 169 170ohos_shared_library("native_media_venc") { 171 install_enable = true 172 sources = [ 173 "$MEDIA_ROOT_DIR/frameworks/native/capi/avcodec/native_video_encoder.cpp", 174 ] 175 176 public_configs = [ 177 ":media_capi_config", 178 "//foundation/graphic/graphic_2d/frameworks/surface:surface_public_config", 179 ] 180 181 deps = [ 182 "//foundation/graphic/graphic_2d/frameworks/surface:surface", 183 "//foundation/multimedia/player_framework/interfaces/inner_api/native:media_client", 184 "//foundation/multimedia/player_framework/interfaces/kits/c:native_media_codecbase", 185 "//foundation/multimedia/player_framework/interfaces/kits/c:native_media_core", 186 ] 187 188 external_deps = [ 189 "c_utils:utils", 190 "hiviewdfx_hilog_native:libhilog", 191 ] 192 output_extension = "so" 193 subsystem_name = "multimedia" 194 part_name = "multimedia_player_framework" 195} 196