1# Copyright (c) 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/test.gni") 15import("//foundation/multimedia/av_codec/config.gni") 16 17module_output_path = "av_codec/av_codec/unittest" 18 19av_codec_unittest_include_dirs = [ 20 "$av_codec_root_dir/interfaces/inner_api/native", 21 "$av_codec_root_dir/interfaces/interfaces/inner_api/native", 22] 23 24av_codec_unittest_cflags = [ 25 "-std=c++17", 26 "-fno-rtti", 27 "-fno-exceptions", 28 "-Wall", 29 "-fno-common", 30 "-fstack-protector-all", 31 "-Wshadow", 32 "-FPIC", 33 "-FS", 34 "-O2", 35 "-D_FORTIFY_SOURCE=2", 36 "-Wformat=2", 37 "-Wdate-time", 38 "-Dprivate=public", 39 "-Dprotected=public", 40] 41 42################################################################################################################## 43ohos_unittest("sei_parser_helper_unittest") { 44 sanitize = av_codec_test_sanitize 45 module_out_path = module_output_path 46 include_dirs = av_codec_unittest_include_dirs 47 include_dirs += [ 48 "./", 49 "$av_codec_root_dir/interfaces/kits/c", 50 "$av_codec_root_dir/services/engine/common/include", 51 "$av_codec_root_dir/services/engine/base/include", 52 "$av_codec_root_dir/services/utils/include", 53 "$av_codec_root_dir/services/engine/codec/include/audio", 54 "$av_codec_root_dir/services/engine/factory", 55 "$av_codec_root_dir/services/media_engine/plugins/source", 56 "$av_codec_root_dir/interfaces", 57 "$av_codec_root_dir/interfaces/inner_api/native", 58 "$av_codec_root_dir/services/media_engine/filters", 59 ] 60 defines = [] 61 if (defined(av_codec_support_video_processing_engine) && 62 av_codec_support_video_processing_engine) { 63 defines += [ "USE_VIDEO_PROCESSING_ENGINE" ] 64 } 65 66 cflags = av_codec_unittest_cflags 67 68 cflags_cc = cflags 69 70 public_configs = [] 71 configs = [ 72 "$av_codec_root_dir/services/dfx:av_codec_service_log_dfx_public_config", 73 ] 74 75 if (av_codec_support_test) { 76 sources = [ 77 "$av_codec_root_dir/services/media_engine/filters/sei_parser_helper.cpp", 78 "./sei_parser_helper_unittest.cpp", 79 ] 80 } 81 82 deps = [ 83 "$av_codec_root_dir/interfaces/inner_api/native:av_codec_client", 84 "$av_codec_root_dir/services/dfx:av_codec_service_dfx", 85 "$av_codec_root_dir/services/services:av_codec_service", 86 "$av_codec_root_dir/services/utils:av_codec_service_utils", 87 ] 88 89 public_configs = [] 90 91 external_deps = [ 92 "audio_framework:audio_capturer", 93 "audio_framework:audio_client", 94 "av_codec:av_codec_media_engine_modules", 95 "c_utils:utils", 96 "ffmpeg:libohosffmpeg", 97 "googletest:gmock", 98 "googletest:gtest", 99 "graphic_surface:surface", 100 "graphic_surface:sync_fence", 101 "hilog:libhilog", 102 "hitrace:libhitracechain", 103 "init:libbegetutil", 104 "ipc:ipc_single", 105 "media_foundation:media_foundation", 106 "media_foundation:native_media_core", 107 "safwk:system_ability_fwk", 108 ] 109 110 if (av_codec_support_drm) { 111 defines += [ "SUPPORT_DRM" ] 112 } 113 114 if (av_codec_support_drm) { 115 external_deps += [ "drm_framework:drm_framework" ] 116 } 117 118 if (defined(av_codec_support_video_processing_engine) && 119 av_codec_support_video_processing_engine) { 120 external_deps += [ "video_processing_engine:videoprocessingengine" ] 121 } 122 123 resource_config_file = 124 "$av_codec_root_dir/test/unittest/resources/ohos_test.xml" 125} 126