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/services/dfx/include", 23 "$av_codec_root_dir/services/engine/base/include", 24 "$av_codec_root_dir/services/engine/codec/include/video", 25 "$av_codec_root_dir/services/engine/common/include", 26 "$av_codec_root_dir/services/engine/plugin/core", 27 "$av_codec_root_dir/services/engine/plugin/interface", 28 "$av_codec_root_dir/services/engine/source/hst_releated", 29 "$av_codec_root_dir/services/services/factory", 30 "$av_codec_root_dir/services/utils/include", 31 "$av_codec_root_dir/../../graphic/graphic_2d/interfaces/inner_api", 32 "$av_codec_root_dir/../../window/window_manager/interfaces/innerkits", 33 "./audio_demo", 34 "./video_demo", 35 "./avmuxer", 36 "./avdemuxer", 37 "./codeclist_demo", 38 "./include", 39 "//third_party/ffmpeg", 40 ] 41 42 if (target_cpu == "arm64") { 43 av_codec_plugin_path = "\"/system/lib64/media/av_codec_plugins\"" 44 } else { 45 av_codec_plugin_path = "\"/system/lib/media/av_codec_plugins\"" 46 } 47 48 defines = [ "AV_CODEC_PLUGIN_PATH=${av_codec_plugin_path}" ] 49 50 cflags = [ 51 "-Wall", 52 "-fno-rtti", 53 "-fno-exceptions", 54 "-fno-common", 55 "-fstack-protector-strong", 56 "-Wshadow", 57 "-FPIC", 58 "-FS", 59 "-O2", 60 "-D_FORTIFY_SOURCE=2", 61 "-fvisibility=hidden", 62 "-Wformat=2", 63 "-Wdate-time", 64 "-Werror", 65 "-Wextra", 66 "-Wimplicit-fallthrough", 67 "-Wsign-compare", 68 "-Wno-unused-parameter", 69 "-Wno-deprecated-declarations", 70 ] 71 72 cflags_cc = cflags 73 cflags_cc += [ "-std=c++17" ] 74 75 sources = [ 76 "./audio_demo/avcodec_audio_aac_encoder_demo.cpp", 77 "./audio_demo/avcodec_audio_decoder_demo.cpp", 78 "./audio_demo/avcodec_audio_decoder_inner_demo.cpp", 79 "./audio_demo/avcodec_audio_encoder_inner_demo.cpp", 80 "./audio_demo/avcodec_audio_flac_encoder_demo.cpp", 81 "./av_codec_demo.cpp", 82 "./avdemuxer/avdemuxer_demo_runner.cpp", 83 "./avdemuxer/capi_demo/avdemuxer_demo.cpp", 84 "./avdemuxer/capi_demo/avsource_demo.cpp", 85 "./avdemuxer/inner_demo/inner_demuxer_demo.cpp", 86 "./avdemuxer/inner_demo/inner_source_demo.cpp", 87 "./avdemuxer/server_demo/file_server_demo.cpp", 88 "./avmuxer/avmuxer_demo.cpp", 89 "./avmuxer/avmuxer_demo_base.cpp", 90 "./avmuxer/avmuxer_demo_common.c", 91 "./avmuxer/avmuxer_demo_runner.cpp", 92 "./avmuxer/avmuxer_engine_demo.cpp", 93 "./avmuxer/avmuxer_ffmpeg_demo.cpp", 94 "./avmuxer/native_avmuxer_demo.c", 95 "./codeclist_demo/codeclist_demo.cpp", 96 "./video_demo/avcodec_video_decoder_demo.cpp", 97 "./video_demo/avcodec_video_decoder_inner_demo.cpp", 98 ] 99 100 deps = [ 101 "$av_codec_root_dir/interfaces/inner_api/native:av_codec_client", 102 "$av_codec_root_dir/interfaces/kits/c:capi_packages", 103 "$av_codec_root_dir/interfaces/kits/c:native_media_avmuxer", 104 "$av_codec_root_dir/services/services:av_codec_service", 105 "$av_codec_root_dir/services/utils:av_codec_format", 106 "//third_party/ffmpeg:libohosffmpeg", 107 ] 108 109 external_deps = [ 110 "c_utils:utils", 111 "graphic_2d:libgraphic_utils", 112 "graphic_2d:librender_service_client", 113 "graphic_2d:surface", 114 "graphic_2d:sync_fence", 115 "hilog:libhilog", 116 "ipc:ipc_core", 117 "window_manager:libwm", 118 ] 119 install_enable = false 120 121 part_name = "av_codec" 122 subsystem_name = "multimedia" 123} 124