1# Copyright (C) 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 17ohos_executable("av_codec_demo") { 18 include_dirs = [ 19 "$av_codec_root_dir/frameworks/native/capi/common", 20 "$av_codec_root_dir/interfaces/inner_api/native", 21 "$av_codec_root_dir/interfaces/kits/c", 22 "$av_codec_root_dir/interfaces/plugin", 23 "$av_codec_root_dir/services/dfx/include", 24 "$av_codec_root_dir/services/engine/base/include", 25 "$av_codec_root_dir/services/engine/codec/include/video", 26 "$av_codec_root_dir/services/engine/common/include", 27 "$av_codec_root_dir/services/utils/include", 28 "./audio_demo", 29 "./video_demo", 30 "./avmuxer", 31 "./avdemuxer", 32 "./codeclist_demo", 33 "./include", 34 "./e2e_demo", 35 ] 36 37 if (target_cpu == "arm64" || is_emulator) { 38 av_codec_plugin_path = "\"/system/lib64/media/av_codec_plugins\"" 39 } else { 40 av_codec_plugin_path = "\"/system/lib/media/av_codec_plugins\"" 41 } 42 43 defines = [ "AV_CODEC_PLUGIN_PATH=${av_codec_plugin_path}" ] 44 defines += av_codec_defines 45 46 cflags = [ 47 "-Wall", 48 "-fno-rtti", 49 "-fno-exceptions", 50 "-fno-common", 51 "-fstack-protector-strong", 52 "-Wshadow", 53 "-FPIC", 54 "-FS", 55 "-O2", 56 "-D_FORTIFY_SOURCE=2", 57 "-fvisibility=hidden", 58 "-Wformat=2", 59 "-Wdate-time", 60 "-Werror", 61 "-Wextra", 62 "-Wimplicit-fallthrough", 63 "-Wsign-compare", 64 "-Wno-unused-parameter", 65 "-Wno-deprecated-declarations", 66 ] 67 68 cflags_cc = cflags 69 cflags_cc += [ "-std=c++17" ] 70 71 sources = [ 72 "./audio_demo/avcodec_audio_aac_encoder_demo.cpp", 73 "./audio_demo/avcodec_audio_avbuffer_aac_encoder_demo.cpp", 74 "./audio_demo/avcodec_audio_avbuffer_amrnb_encoder_demo.cpp", 75 "./audio_demo/avcodec_audio_avbuffer_amrwb_encoder_demo.cpp", 76 "./audio_demo/avcodec_audio_avbuffer_decoder_demo.cpp", 77 "./audio_demo/avcodec_audio_avbuffer_decoder_inner_demo.cpp", 78 "./audio_demo/avcodec_audio_avbuffer_flac_encoder_demo.cpp", 79 "./audio_demo/avcodec_audio_avbuffer_g711mu_encoder_demo.cpp", 80 "./audio_demo/avcodec_audio_avbuffer_lbvc_decoder_inner_demo.cpp", 81 "./audio_demo/avcodec_audio_avbuffer_lbvc_encoder_inner_demo.cpp", 82 "./audio_demo/avcodec_audio_avbuffer_mp3_encoder_demo.cpp", 83 "./audio_demo/avcodec_audio_decoder_demo.cpp", 84 "./audio_demo/avcodec_audio_decoder_inner_demo.cpp", 85 "./audio_demo/avcodec_audio_encoder_inner_demo.cpp", 86 "./audio_demo/avcodec_audio_flac_encoder_demo.cpp", 87 "./audio_demo/avcodec_audio_g711mu_encoder_demo.cpp", 88 "./audio_demo/avcodec_audio_opus_encoder_demo.cpp", 89 "./av_codec_demo.cpp", 90 "./avdemuxer/avdemuxer_demo_runner.cpp", 91 "./avdemuxer/capi_demo/avdemuxer_demo.cpp", 92 "./avdemuxer/capi_demo/avsource_demo.cpp", 93 "./avdemuxer/inner_demo/inner_demuxer_demo.cpp", 94 "./avdemuxer/inner_demo/inner_source_demo.cpp", 95 "./avdemuxer/server_demo/file_server_demo.cpp", 96 "./codeclist_demo/codeclist_demo.cpp", 97 "./e2e_demo/avcodec_e2e_demo.cpp", 98 "./e2e_demo/avcodec_e2e_demo_api10.cpp", 99 "./video_demo/avcodec_video_decoder_demo.cpp", 100 "./video_demo/avcodec_video_decoder_inner_demo.cpp", 101 ] 102 103 deps = [ 104 "$av_codec_root_dir/interfaces/inner_api/native:av_codec_client", 105 "$av_codec_root_dir/interfaces/kits/c:capi_packages", 106 "$av_codec_root_dir/services/services:av_codec_service", 107 "$av_codec_root_dir/test/nativedemo/avmuxer:av_codec_demo_muxer", 108 ] 109 110 external_deps = [ 111 "c_utils:utils", 112 "ffmpeg:libohosffmpeg", 113 "graphic_2d:libgraphic_utils", 114 "graphic_2d:librender_service_client", 115 "graphic_surface:surface", 116 "graphic_surface:sync_fence", 117 "hilog:libhilog", 118 "ipc:ipc_single", 119 "media_foundation:media_foundation", 120 "media_foundation:native_media_core", 121 "window_manager:libwm", 122 ] 123 124 if (av_codec_support_drm) { 125 external_deps += [ 126 "drm_framework:drm_framework", 127 "drm_framework:native_drm", 128 ] 129 } 130 131 install_enable = false 132 133 part_name = "av_codec" 134 subsystem_name = "multimedia" 135} 136