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