# Copyright (C) 2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("//foundation/multimedia/player_framework/config.gni") group("capi_packages") { deps = [] if (player_framework_support_capi) { deps += [ "$MEDIA_PLAYER_ROOT_DIR/interfaces/kits/c:avplayer", "$MEDIA_PLAYER_ROOT_DIR/interfaces/kits/c:native_avscreen_capture", ] } } config("media_capi_config") { include_dirs = [ "$MEDIA_PLAYER_ROOT_DIR/interfaces/inner_api/native", "$MEDIA_PLAYER_ROOT_DIR/interfaces/kits/c", "$MEDIA_PLAYER_ROOT_DIR/frameworks/native/capi/common", "$MEDIA_PLAYER_ROOT_DIR/services/utils/include", ] cflags = [ "-fno-exceptions", "-Wall", "-fno-common", "-fstack-protector-all", "-Wshadow", "-FPIC", "-FS", "-O2", "-D_FORTIFY_SOURCE=2", "-Wformat=2", "-Wdate-time", ] cflags_cc = [ "-std=c++17", "-fno-rtti", ] } config("media_capi_public_config") { include_dirs = [ "$MEDIA_PLAYER_ROOT_DIR/interfaces/kits/c" ] } ohos_shared_library("native_avscreen_capture") { stack_protector_ret = true install_enable = true sanitize = { integer_overflow = true ubsan = true boundary_sanitize = true cfi = true cfi_cross_dso = true debug = false } sources = [ "$MEDIA_PLAYER_ROOT_DIR/frameworks/native/capi/screencapture/native_avscreen_capture.cpp" ] configs = [ ":media_capi_config" ] public_configs = [ ":media_capi_public_config" ] deps = [ "$MEDIA_PLAYER_ROOT_DIR/interfaces/inner_api/native:media_client" ] external_deps = [ "av_codec:av_codec_client", "c_utils:utils", "graphic_surface:surface", "hilog:libhilog", "ipc:ipc_core", "media_foundation:media_foundation", "qos_manager:qos", "window_manager:libdm", ] output_extension = "so" subsystem_name = "multimedia" part_name = "player_framework" } ohos_shared_library("avplayer") { stack_protector_ret = true install_enable = true sanitize = { integer_overflow = true ubsan = true boundary_sanitize = true cfi = true cfi_cross_dso = true debug = false } configs = [ ":media_capi_config" ] public_configs = [ ":media_capi_public_config" ] sources = [ "$MEDIA_PLAYER_ROOT_DIR/frameworks/native/capi/player/native_avplayer.cpp", ] deps = [ "$MEDIA_PLAYER_ROOT_DIR/interfaces/inner_api/native:media_client" ] external_deps = [ "audio_framework:audio_capturer", "av_codec:av_codec_client", "c_utils:utils", "graphic_surface:surface", "hilog:libhilog", "ipc:ipc_core", "media_foundation:media_foundation", "window_manager:libdm", ] if (player_framework_support_drm) { public_external_deps = [ "drm_framework:drm_framework", "drm_framework:native_drm", ] } defines = [] defines += player_framework_defines output_extension = "so" subsystem_name = "multimedia" part_name = "player_framework" }