1# Copyright (c) 2024 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/AVCodec_Video/unittest" 18pts_and_index_conversion_test_sources = [ 19 "$av_codec_root_dir/services/media_engine/modules/demuxer/pts_and_index_conversion.cpp", 20 "$av_codec_root_dir/services/media_engine/modules/demuxer/type_finder.cpp", 21 "$av_codec_root_dir/services/media_engine/modules/source/source.cpp", 22] 23config("pts_and_index_conversio_unittest_cfg") { 24 defines = [ 25 "HST_ANY_WITH_NO_RTTI", 26 "MEDIA_OHOS", 27 "TESTING", 28 ] 29 30 cflags = [ 31 "-Wno-sign-compare", 32 "-fno-exceptions", 33 "-fno-common", 34 "-fstack-protector-all", 35 "-Wshadow", 36 "-FPIC", 37 "-FS", 38 "-O2", 39 "-D_FORTIFY_SOURCE=2", 40 "-Wformat=2", 41 "-Wdate-time", 42 "-Dprivate=public", 43 "-Dprotected=public", 44 "-Wno-unused-parameter", 45 ] 46 47 cflags_cc = [ 48 "-std=c++17", 49 "-fno-rtti", 50 ] 51 52 include_dirs = [ 53 "$av_codec_root_dir/interfaces", 54 "$av_codec_root_dir/interfaces/inner_api", 55 "$av_codec_root_dir/interfaces/inner_api/native", 56 "$av_codec_root_dir/services/media_engine/modules", 57 "$av_codec_root_dir/services/media_engine/modules/demuxer", 58 "$av_codec_root_dir/test/unittest/common", 59 ] 60} 61 62################################################################################################################# 63ohos_unittest("pts_and_index_conversion_unit_test") { 64 sanitize = av_codec_test_sanitize 65 module_out_path = module_output_path 66 testonly = true 67 configs = [ 68 ":pts_and_index_conversio_unittest_cfg", 69 "$av_codec_root_dir/services/dfx:av_codec_service_log_dfx_public_config", 70 ] 71 sources = pts_and_index_conversion_test_sources + 72 [ "pts_and_index_conversion_unit_test.cpp" ] 73 deps = [ 74 "$av_codec_root_dir/services/dfx:av_codec_service_dfx", 75 "$av_codec_root_dir/services/engine/base:av_codec_codec_base", 76 ] 77 78 external_deps = [ 79 "c_utils:utils", 80 "hilog:libhilog", 81 "hisysevent:libhisysevent", 82 "media_foundation:media_foundation", 83 ] 84 resource_config_file = 85 "$av_codec_root_dir/test/unittest/resources/ohos_test.xml" 86} 87