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