• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/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    "$histreamer_root_dir/engine/include/",
36  ]
37  cflags = histreamer_unittest_cflags
38
39  deps = [
40    "$histreamer_root_dir/engine/pipeline:histreamer_pipeline_base",
41    "$histreamer_root_dir/engine/pipeline/filters/codec:codec_filters",
42    "$histreamer_root_dir/engine/pipeline/filters/demux:demuxer_filter",
43    "$histreamer_root_dir/engine/plugin:ffmpeg_convert",
44    "$histreamer_root_dir/engine/plugin:histreamer_plugin_base",
45    "$histreamer_root_dir/engine/plugin:histreamer_plugin_core",
46    "$histreamer_root_dir/engine/plugin/plugins/codec_adapter:histreamer_plugin_CodecAdapter",
47    "$histreamer_root_dir/engine/plugin/plugins/ffmpeg_adapter:ffmpeg_adapter_common",
48    "$histreamer_root_dir/engine/plugin/plugins/ffmpeg_adapter:ffmpeg_audio_decoders",
49    "$histreamer_root_dir/engine/plugin/plugins/ffmpeg_adapter:ffmpeg_audio_encoders",
50    "$histreamer_root_dir/engine/plugin/plugins/ffmpeg_adapter:ffmpeg_demuxers",
51    "$histreamer_root_dir/engine/plugin/plugins/ffmpeg_adapter:ffmpeg_video_decoders",
52    "$histreamer_root_dir/engine/plugin/plugins/ffmpeg_adapter:ffmpeg_video_encoders",
53    "$histreamer_root_dir/engine/plugin/plugins/sink/audio_server_sink:histreamer_plugin_AudioServerSink",
54    "$histreamer_root_dir/engine/plugin/plugins/sink/video_surface_sink:std_video_surface_sink",
55    "$histreamer_root_dir/engine/plugin/plugins/source/audio_capture:histreamer_plugin_StdAudioCapture",
56    "$histreamer_root_dir/engine/plugin/plugins/source/file_source:filesource",
57    "$histreamer_root_dir/engine/plugin/plugins/source/http_source:httpsource",
58  ]
59  if (!hst_is_standard_sys) {
60    deps += [
61      "$histreamer_root_dir/engine/scene:std_engine_factory",
62      "$histreamer_root_dir/engine/scene/player:histreamer_player",
63    ]
64  }
65
66  external_deps = [
67    "drivers_interface_display:libdisplay_composer_hdi_impl_1.2",
68    "graphic_2d:librender_service_client",
69    "graphic_surface:surface",
70    "hdf_core:libpub_utils",
71    "hilog:libhilog",
72    "openmax:libopenmax_static",
73    "window_manager:libwm",
74    "googletest:gtest_rtti",
75    "audio_framework:audio_capturer",
76  ]
77
78  sources = [
79    "$histreamer_root_dir/engine/include/plugin/common/plugin_types.h",
80    "$histreamer_root_dir/engine/include/plugin/core/plugin_manager.h",
81    "./TestAlgoExt.cpp",
82    "./TestAny.cpp",
83    "./TestBitReader.cpp",
84    "./TestBufferPool.cpp",
85    "./TestCommon.cpp",
86    "./TestCompatibleCheck.cpp",
87    "./TestDataPacker.cpp",
88    "./TestFFmpegAudioDecoder.cpp",
89    "./TestFFmpegAudioEncoder.cpp",
90    "./TestFFmpegAvcConfigDataParser.cpp",
91    "./TestFFmpegDemuxer.cpp",
92    "./TestFFmpegUtils.cpp",
93    "./TestFFmpegVidEncConfig.cpp",
94    "./TestFFmpegVideoDecoder.cpp",
95    "./TestFileSourcePlugin.cpp",
96    "./TestFilter.cpp",
97    "./TestHttpSourcePlugin.cpp",
98    "./TestMeta.cpp",
99    "./TestMimeDefs.cpp",
100    "./TestPipline.cpp",
101    "./TestPluginCommon.cpp",
102    "./TestPluginManager.cpp",
103    "./TestSurfaceSinkPlugin.cpp",
104    "./TestSynchronizer.cpp",
105    "./TestVideoFFmpegEncoder.cpp",
106    "./plugins/UtSourceTest1.cpp",
107    "./plugins/UtSourceTest2.cpp",
108  ]
109
110  if (!hst_is_standard_sys) {
111    sources += [ "./TestHiPlayer.cpp" ]
112  }
113}
114