1# Copyright (C) 2023-2025 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("av_codec_media_engine_modules_pts_and_index_convert_config") { 18 include_dirs = [ "$av_codec_root_dir/services/media_engine/modules/demuxer" ] 19} 20 21config("av_codec_media_engine_modules_config") { 22 defines = [ 23 "HST_ANY_WITH_NO_RTTI", 24 "MEDIA_OHOS", 25 ] 26 27 if (defined(av_codec_support_video_processing_engine) && 28 av_codec_support_video_processing_engine) { 29 defines += [ "USE_VIDEO_PROCESSING_ENGINE" ] 30 } 31 32 if (av_codec_enable_start_stop_on_demand) { 33 defines += [ "SUPPORT_START_STOP_ON_DEMAND" ] 34 } 35 36 cflags = [ 37 "-fno-exceptions", 38 "-Wall", 39 "-fno-common", 40 "-fstack-protector-all", 41 "-Wshadow", 42 "-FPIC", 43 "-FS", 44 "-O2", 45 "-D_FORTIFY_SOURCE=2", 46 "-Wformat=2", 47 "-Wdate-time", 48 ] 49 50 cflags_cc = [ 51 "-std=c++17", 52 "-fno-rtti", 53 ] 54 55 include_dirs = [ 56 "$av_codec_root_dir/interfaces", 57 "$av_codec_root_dir/interfaces/inner_api/native", 58 "$av_codec_root_dir/services/drm_decryptor", 59 "$av_codec_root_dir/services/media_engine/modules", 60 "$av_codec_root_dir/services/utils/include", 61 ] 62} 63 64ohos_shared_library("av_codec_media_engine_modules") { 65 branch_protector_ret = "pac_ret" 66 install_enable = true 67 68 sanitize = av_codec_sanitize 69 70 configs = [ 71 ":av_codec_media_engine_modules_config", 72 "$av_codec_root_dir/services/dfx:av_codec_service_log_dfx_public_config", 73 ] 74 75 sources = [ 76 "$av_codec_root_dir/services/drm_decryptor/codec_drm_decrypt.cpp", 77 "demuxer/base_stream_demuxer.cpp", 78 "demuxer/demuxer_plugin_manager.cpp", 79 "demuxer/media_demuxer.cpp", 80 "demuxer/pts_and_index_conversion.cpp", 81 "demuxer/sample_queue.cpp", 82 "demuxer/stream_demuxer.cpp", 83 "demuxer/type_finder.cpp", 84 "media_codec/media_codec.cpp", 85 "muxer/data_sink_fd.cpp", 86 "muxer/data_sink_file.cpp", 87 "muxer/media_muxer.cpp", 88 "post_processor/video_post_processor_factory.cpp", 89 "sink/audio_sampleformat.cpp", 90 "sink/audio_sink.cpp", 91 "sink/calc_max_amplitude.cpp", 92 "sink/media_sync_manager.cpp", 93 "sink/media_synchronous_sink.cpp", 94 "sink/subtitle_sink.cpp", 95 "sink/video_sink.cpp", 96 "source/audio_capture/audio_capture_module.cpp", 97 "source/audio_capture/audio_type_translate.cpp", 98 "source/source.cpp", 99 ] 100 101 if (defined(av_codec_support_video_processing_engine) && 102 av_codec_support_video_processing_engine) { 103 sources += [ "post_processor/super_resolution_post_processor.cpp" ] 104 } 105 106 deps = [ "$av_codec_root_dir/services/engine/base:av_codec_codec_base" ] 107 108 public_configs = 109 [ ":av_codec_media_engine_modules_pts_and_index_convert_config" ] 110 111 external_deps = [ 112 "audio_framework:audio_capturer", 113 "bundle_framework:appexecfwk_base", 114 "bundle_framework:appexecfwk_core", 115 "c_utils:utils", 116 "ffmpeg:libohosffmpeg", 117 "graphic_surface:surface", 118 "graphic_surface:sync_fence", 119 "hilog:libhilog", 120 "hisysevent:libhisysevent", 121 "hitrace:libhitracechain", 122 "init:libbegetutil", 123 "ipc:ipc_single", 124 "media_foundation:media_foundation", 125 "openssl:libcrypto_shared", 126 "safwk:system_ability_fwk", 127 "samgr:samgr_proxy", 128 ] 129 130 if (defined(av_codec_support_video_processing_engine) && 131 av_codec_support_video_processing_engine) { 132 external_deps += [ "video_processing_engine:videoprocessingengine" ] 133 } 134 135 if (av_codec_support_drm) { 136 defines = [ "SUPPORT_DRM" ] 137 } 138 if (av_codec_support_drm) { 139 external_deps += [ "drm_framework:drm_framework" ] 140 } 141 142 subsystem_name = "multimedia" 143 part_name = "av_codec" 144} 145