1# Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS.  All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
9import("../../webrtc.gni")
10
11rtc_library("column_printer") {
12  testonly = true
13  sources = [
14    "column_printer.cc",
15    "column_printer.h",
16  ]
17  deps = [
18    "../../rtc_base:macromagic",
19    "../../rtc_base:stringutils",
20    "../logging:log_writer",
21  ]
22}
23
24if (is_ios || rtc_include_tests) {
25  scenario_resources = [
26    "../../resources/difficult_photo_1850_1110.yuv",
27    "../../resources/photo_1850_1110.yuv",
28    "../../resources/presentation_1850_1110.yuv",
29    "../../resources/web_screenshot_1850_1110.yuv",
30  ]
31  scenario_unittest_resources = [ "../../resources/foreman_cif.yuv" ]
32}
33
34if (is_ios) {
35  bundle_data("scenario_resources_bundle_data") {
36    testonly = true
37    sources = scenario_resources
38    outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
39  }
40  bundle_data("scenario_unittest_resources_bundle_data") {
41    testonly = true
42    sources = scenario_unittest_resources
43    outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
44  }
45}
46if (rtc_include_tests) {
47  rtc_library("scenario") {
48    testonly = true
49    sources = [
50      "audio_stream.cc",
51      "audio_stream.h",
52      "call_client.cc",
53      "call_client.h",
54      "hardware_codecs.cc",
55      "hardware_codecs.h",
56      "network_node.cc",
57      "network_node.h",
58      "performance_stats.cc",
59      "performance_stats.h",
60      "scenario.cc",
61      "scenario.h",
62      "scenario_config.cc",
63      "scenario_config.h",
64      "stats_collection.cc",
65      "stats_collection.h",
66      "video_frame_matcher.cc",
67      "video_frame_matcher.h",
68      "video_stream.cc",
69      "video_stream.h",
70    ]
71    deps = [
72      ":column_printer",
73      "../:fake_video_codecs",
74      "../:fileutils",
75      "../:rtp_test_utils",
76      "../:test_common",
77      "../:test_support",
78      "../:video_test_common",
79      "../../api:create_frame_generator",
80      "../../api:fec_controller_api",
81      "../../api:frame_generator_api",
82      "../../api:libjingle_peerconnection_api",
83      "../../api:rtc_event_log_output_file",
84      "../../api:rtp_parameters",
85      "../../api:time_controller",
86      "../../api:time_controller",
87      "../../api:transport_api",
88      "../../api/audio_codecs:builtin_audio_decoder_factory",
89      "../../api/audio_codecs:builtin_audio_encoder_factory",
90      "../../api/rtc_event_log",
91      "../../api/rtc_event_log:rtc_event_log_factory",
92      "../../api/test/video:function_video_factory",
93      "../../api/transport:network_control",
94      "../../api/units:data_rate",
95      "../../api/units:data_size",
96      "../../api/units:time_delta",
97      "../../api/units:timestamp",
98      "../../api/video:builtin_video_bitrate_allocator_factory",
99      "../../api/video:video_frame",
100      "../../api/video:video_frame_i420",
101      "../../api/video:video_rtp_headers",
102      "../../api/video_codecs:video_codecs_api",
103      "../../audio",
104      "../../call",
105      "../../call:call_interfaces",
106      "../../call:rtp_sender",
107      "../../call:simulated_network",
108      "../../call:video_stream_api",
109      "../../common_video",
110      "../../media:rtc_audio_video",
111      "../../media:rtc_internal_video_codecs",
112      "../../media:rtc_media_base",
113      "../../modules/audio_device",
114      "../../modules/audio_device:audio_device_impl",
115      "../../modules/audio_device:mock_audio_device",
116      "../../modules/audio_mixer:audio_mixer_impl",
117      "../../modules/audio_processing",
118      "../../modules/congestion_controller/goog_cc:test_goog_cc_printer",
119      "../../modules/rtp_rtcp",
120      "../../modules/rtp_rtcp:mock_rtp_rtcp",
121      "../../modules/rtp_rtcp:rtp_rtcp_format",
122      "../../modules/video_coding:video_codec_interface",
123      "../../modules/video_coding:video_coding_utility",
124      "../../modules/video_coding:webrtc_h264",
125      "../../modules/video_coding:webrtc_multiplex",
126      "../../modules/video_coding:webrtc_vp8",
127      "../../modules/video_coding:webrtc_vp9",
128      "../../rtc_base",
129      "../../rtc_base:checks",
130      "../../rtc_base:rtc_base_approved",
131      "../../rtc_base:rtc_base_tests_utils",
132      "../../rtc_base:rtc_numerics",
133      "../../rtc_base:rtc_task_queue",
134      "../../rtc_base:safe_minmax",
135      "../../rtc_base:task_queue_for_test",
136      "../../rtc_base/synchronization:mutex",
137      "../../rtc_base/synchronization:sequence_checker",
138      "../../rtc_base/task_utils:repeating_task",
139      "../../system_wrappers",
140      "../../system_wrappers:field_trial",
141      "../../video",
142      "../logging:log_writer",
143      "../network:emulated_network",
144      "../time_controller",
145    ]
146    absl_deps = [
147      "//third_party/abseil-cpp/absl/flags:flag",
148      "//third_party/abseil-cpp/absl/flags:parse",
149      "//third_party/abseil-cpp/absl/memory",
150      "//third_party/abseil-cpp/absl/strings",
151      "//third_party/abseil-cpp/absl/types:optional",
152    ]
153    if (is_android) {
154      deps += [ "../../modules/video_coding:android_codec_factory_helper" ]
155    } else if (is_ios || is_mac) {
156      deps += [ "../../modules/video_coding:objc_codec_factory_helper" ]
157    }
158    if (rtc_enable_protobuf) {
159      deps += [ "../../modules/audio_coding:ana_config_proto" ]
160    }
161    data = scenario_resources
162    if (is_ios) {
163      deps += [ ":scenario_resources_bundle_data" ]
164    }
165  }
166  rtc_library("scenario_unittests") {
167    testonly = true
168    sources = [
169      "performance_stats_unittest.cc",
170      "scenario_unittest.cc",
171      "stats_collection_unittest.cc",
172      "video_stream_unittest.cc",
173    ]
174    deps = [
175      ":scenario",
176      "../../logging:mocks",
177      "../../rtc_base:checks",
178      "../../rtc_base:rtc_base_approved",
179      "../../system_wrappers",
180      "../../system_wrappers:field_trial",
181      "../../test:field_trial",
182      "../../test:test_support",
183      "../logging:log_writer",
184      "//testing/gmock",
185    ]
186    data = scenario_unittest_resources
187    if (is_ios) {
188      deps += [ ":scenario_unittest_resources_bundle_data" ]
189    }
190  }
191}
192