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. 13import("//build/test.gni") 14import("//foundation/multimedia/media_foundation/config.gni") 15 16module_output_path = "media_foundation/unittest" 17 18histreamer_unittest_cflags = [ 19 "-std=c++17", 20 "-Wall", 21 "-Werror", 22] 23 24################################################################################################################# 25ohos_unittest("histreamer_unit_test") { 26 module_out_path = module_output_path 27 include_dirs = [ 28 "$histreamer_root_dir/test/unittest/plugins/", 29 "$histreamer_root_dir/test/unittest/", 30 "$histreamer_root_dir/engine/include/plugin/", 31 "$histreamer_root_dir/engine/pipeline/core/", 32 "$histreamer_root_dir/engine/pipeline/filters/common/", 33 "$histreamer_root_dir/engine/plugin/core/", 34 "./plugins/", 35 "//drivers/peripheral/base/", 36 "//drivers/peripheral/codec/hal/include", 37 "//drivers/peripheral/codec/interfaces/include", 38 "//drivers/peripheral/display/interfaces/include", 39 "//third_party/openmax/api/1.1.2", 40 "$histreamer_root_dir/engine/include/", 41 "//graphic/graphic_surface/interfaces/innerkits/surface", 42 "//foundation/window/window_manager/interfaces/innerkits/wm", 43 ] 44 cflags = histreamer_unittest_cflags 45 46 deps = [ 47 "$histreamer_root_dir/engine/pipeline:histreamer_pipeline_base", 48 "$histreamer_root_dir/engine/pipeline/filters/codec:codec_filters", 49 "$histreamer_root_dir/engine/pipeline/filters/demux:demuxer_filter", 50 "$histreamer_root_dir/engine/plugin:ffmpeg_convert", 51 "$histreamer_root_dir/engine/plugin:histreamer_plugin_base", 52 "$histreamer_root_dir/engine/plugin:histreamer_plugin_core", 53 "$histreamer_root_dir/engine/plugin/plugins/codec_adapter:histreamer_plugin_CodecAdapter", 54 "$histreamer_root_dir/engine/plugin/plugins/ffmpeg_adapter:ffmpeg_adapter_common", 55 "$histreamer_root_dir/engine/plugin/plugins/ffmpeg_adapter:ffmpeg_audio_decoders", 56 "$histreamer_root_dir/engine/plugin/plugins/ffmpeg_adapter:ffmpeg_audio_encoders", 57 "$histreamer_root_dir/engine/plugin/plugins/ffmpeg_adapter:ffmpeg_demuxers", 58 "$histreamer_root_dir/engine/plugin/plugins/ffmpeg_adapter:ffmpeg_video_decoders", 59 "$histreamer_root_dir/engine/plugin/plugins/ffmpeg_adapter:ffmpeg_video_encoders", 60 "$histreamer_root_dir/engine/plugin/plugins/sink/audio_server_sink:histreamer_plugin_AudioServerSink", 61 "$histreamer_root_dir/engine/plugin/plugins/sink/video_surface_sink:std_video_surface_sink", 62 "$histreamer_root_dir/engine/plugin/plugins/source/audio_capture:histreamer_plugin_StdAudioCapture", 63 "$histreamer_root_dir/engine/plugin/plugins/source/file_source:filesource", 64 "$histreamer_root_dir/engine/plugin/plugins/source/http_source:httpsource", 65 "//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client", 66 "//foundation/window/window_manager/wm:libwm", 67 "//third_party/googletest:gtest_rtti", 68 ] 69 if (!hst_is_standard_sys) { 70 deps += [ 71 "$histreamer_root_dir/engine/scene:std_engine_factory", 72 "$histreamer_root_dir/engine/scene/player:histreamer_player", 73 ] 74 } 75 76 external_deps = [ 77 "graphic_surface:surface", 78 "hdf_core:libpub_utils", 79 "hilog:libhilog", 80 ] 81 82 public_configs = [ "//foundation/multimedia/audio_framework/frameworks/native/audiocapturer:audio_capturer_config" ] 83 84 sources = [ 85 "$histreamer_root_dir/engine/include/plugin/common/plugin_types.h", 86 "$histreamer_root_dir/engine/include/plugin/core/plugin_manager.h", 87 "./TestAlgoExt.cpp", 88 "./TestAny.cpp", 89 "./TestBitReader.cpp", 90 "./TestBufferPool.cpp", 91 "./TestCommon.cpp", 92 "./TestCompatibleCheck.cpp", 93 "./TestDataPacker.cpp", 94 "./TestFFmpegAudioDecoder.cpp", 95 "./TestFFmpegAudioEncoder.cpp", 96 "./TestFFmpegAvcConfigDataParser.cpp", 97 "./TestFFmpegDemuxer.cpp", 98 "./TestFFmpegUtils.cpp", 99 "./TestFFmpegVidEncConfig.cpp", 100 "./TestFFmpegVideoDecoder.cpp", 101 "./TestFileSourcePlugin.cpp", 102 "./TestFilter.cpp", 103 "./TestHttpSourcePlugin.cpp", 104 "./TestMeta.cpp", 105 "./TestMimeDefs.cpp", 106 "./TestPipline.cpp", 107 "./TestPluginCommon.cpp", 108 "./TestPluginManager.cpp", 109 "./TestSurfaceSinkPlugin.cpp", 110 "./TestSynchronizer.cpp", 111 "./TestVideoFFmpegEncoder.cpp", 112 "./plugins/UtSourceTest1.cpp", 113 "./plugins/UtSourceTest2.cpp", 114 ] 115 116 if (!hst_is_standard_sys) { 117 sources += [ "./TestHiPlayer.cpp" ] 118 } 119} 120