Move frame_generator_capture.{cc, h} and video_capturer.h to video_test_common.
Remove video_capture as a dependency of test_common and add it as a dependency of modules_unittests, as it was before the refactor in https://codereview.webrtc.org/2629923002
BUG=webrtc:7037
NOTRY=True
Review-Url: https://codereview.webrtc.org/2666113003
Cr-Commit-Position: refs/heads/master@{#16439}
diff --git a/webrtc/BUILD.gn b/webrtc/BUILD.gn
index 8969f13..5f91fa8 100644
--- a/webrtc/BUILD.gn
+++ b/webrtc/BUILD.gn
@@ -416,6 +416,7 @@
"modules/video_capture",
"test:test_common",
"test:test_main",
+ "test:video_test_common",
"video:video_tests",
]
data = video_engine_tests_resources
diff --git a/webrtc/common_video/BUILD.gn b/webrtc/common_video/BUILD.gn
index 1c13fa4..b3e6c42 100644
--- a/webrtc/common_video/BUILD.gn
+++ b/webrtc/common_video/BUILD.gn
@@ -119,6 +119,7 @@
deps = [
":common_video",
+ "../modules/video_capture:video_capture",
"../system_wrappers:system_wrappers",
"../test:test_main",
"../test:video_test_common",
diff --git a/webrtc/modules/BUILD.gn b/webrtc/modules/BUILD.gn
index 1d247db..e750a81 100644
--- a/webrtc/modules/BUILD.gn
+++ b/webrtc/modules/BUILD.gn
@@ -52,6 +52,7 @@
deps = [
"../test:test_main",
+ "../test:video_test_common",
"audio_coding:audio_coding_modules_tests",
"desktop_capture:desktop_capture_modules_tests",
"rtp_rtcp:rtp_rtcp_modules_tests",
@@ -225,6 +226,7 @@
"remote_bitrate_estimator:remote_bitrate_estimator_unittests",
"rtp_rtcp:rtp_rtcp_unittests",
"utility:utility_unittests",
+ "video_capture",
"video_coding:video_coding_unittests",
"video_processing:video_processing_unittests",
]
diff --git a/webrtc/modules/desktop_capture/BUILD.gn b/webrtc/modules/desktop_capture/BUILD.gn
index e4f5b30..bbf9ac5 100644
--- a/webrtc/modules/desktop_capture/BUILD.gn
+++ b/webrtc/modules/desktop_capture/BUILD.gn
@@ -46,6 +46,7 @@
"../../base:rtc_base_approved",
"../../system_wrappers:system_wrappers",
"../../test:test_support",
+ "../../test:video_test_support",
]
sources += [
"screen_capturer_integration_test.cc",
diff --git a/webrtc/modules/remote_bitrate_estimator/BUILD.gn b/webrtc/modules/remote_bitrate_estimator/BUILD.gn
index f89137e..3a6997b 100644
--- a/webrtc/modules/remote_bitrate_estimator/BUILD.gn
+++ b/webrtc/modules/remote_bitrate_estimator/BUILD.gn
@@ -199,6 +199,7 @@
"../../base:rtc_base_approved",
"../../test:test_common",
"../../test:test_main",
+ "../../test:video_test_common",
"../video_capture",
"//testing/gmock",
"//testing/gtest",
diff --git a/webrtc/modules/video_capture/BUILD.gn b/webrtc/modules/video_capture/BUILD.gn
index 90b824a..a03bb3c 100644
--- a/webrtc/modules/video_capture/BUILD.gn
+++ b/webrtc/modules/video_capture/BUILD.gn
@@ -31,7 +31,6 @@
"../../base:rtc_base_approved",
"../../common_video",
"../../system_wrappers",
- "../utility",
]
if (!build_with_chromium && is_clang) {
diff --git a/webrtc/modules/video_coding/BUILD.gn b/webrtc/modules/video_coding/BUILD.gn
index 02b0107..d46fd11 100644
--- a/webrtc/modules/video_coding/BUILD.gn
+++ b/webrtc/modules/video_coding/BUILD.gn
@@ -303,6 +303,9 @@
"../../system_wrappers:metrics_default",
"../../system_wrappers:system_wrappers",
"../../test:test_support",
+ "../../test:video_test_common",
+ "../../test:video_test_support",
+ "../video_capture",
"//third_party/gflags",
]
} # video_quality_measurement
@@ -334,6 +337,7 @@
"../../common_video:common_video",
"../../system_wrappers:system_wrappers",
"../../test:test_support",
+ "../../test:video_test_support",
]
}
@@ -356,6 +360,8 @@
"../../media:rtc_media_base",
"../../test:test_support",
"../../test:video_test_common",
+ "../../test:video_test_support",
+ "../video_capture",
]
if (rtc_use_h264) {
defines = [ "WEBRTC_VIDEOPROCESSOR_H264_TESTS" ]
@@ -431,6 +437,7 @@
"../../test:field_trial",
"../../test:test_support",
"../../test:video_test_common",
+ "../../test:video_test_support",
"../rtp_rtcp:rtp_rtcp",
"//testing/gmock",
]
diff --git a/webrtc/test/BUILD.gn b/webrtc/test/BUILD.gn
index 352eb37..0e885c8 100644
--- a/webrtc/test/BUILD.gn
+++ b/webrtc/test/BUILD.gn
@@ -37,8 +37,13 @@
"fake_texture_frame.h",
"frame_generator.cc",
"frame_generator.h",
+ "frame_generator_capturer.cc",
+ "frame_generator_capturer.h",
"frame_utils.cc",
"frame_utils.h",
+ "vcm_capturer.cc",
+ "vcm_capturer.h",
+ "video_capturer.h",
]
if (!build_with_chromium && is_clang) {
@@ -47,7 +52,9 @@
}
deps = [
+ ":video_test_support",
"../common_video",
+ "../modules/video_capture:video_capture_module",
]
}
@@ -118,22 +125,59 @@
}
}
+rtc_source_set("video_test_support") {
+ testonly = true
+
+ sources = [
+ "testsupport/frame_reader.cc",
+ "testsupport/frame_reader.h",
+ "testsupport/frame_writer.cc",
+ "testsupport/frame_writer.h",
+ "testsupport/metrics/video_metrics.cc",
+ "testsupport/metrics/video_metrics.h",
+ "testsupport/mock/mock_frame_reader.h",
+ "testsupport/mock/mock_frame_writer.h",
+ ]
+
+ deps = [
+ "../base:rtc_base_approved",
+ "../common_video",
+ "../system_wrappers",
+ "//testing/gmock",
+ "//testing/gtest",
+ "//third_party/gflags",
+ ]
+
+ public_deps = [
+ ":fileutils",
+ ]
+
+ if (!build_with_chromium && is_clang) {
+ # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
+ suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
+ }
+
+ if (is_android) {
+ deps += [ "//base:base" ]
+ }
+
+ if (is_ios) {
+ deps += [ "//webrtc/sdk:rtc_sdk_common_objc" ]
+ }
+
+ if (rtc_use_memcheck) {
+ data = valgrind_webrtc_dependencies
+ }
+}
+
rtc_source_set("test_support") {
testonly = true
sources = [
"gmock.h",
"gtest.h",
- "testsupport/frame_reader.cc",
- "testsupport/frame_reader.h",
- "testsupport/frame_writer.cc",
- "testsupport/frame_writer.h",
"testsupport/isolated_output.cc",
"testsupport/isolated_output.h",
- "testsupport/metrics/video_metrics.cc",
- "testsupport/metrics/video_metrics.h",
- "testsupport/mock/mock_frame_reader.h",
- "testsupport/mock/mock_frame_writer.h",
"testsupport/packet_reader.cc",
"testsupport/packet_reader.h",
"testsupport/perf_test.cc",
@@ -144,7 +188,6 @@
]
deps = [
- ":video_test_common",
"../base:gtest_prod",
"../base:rtc_base_approved",
"../common_video",
@@ -250,6 +293,7 @@
":fileutils_unittests",
":test_common",
":test_main",
+ ":video_test_common",
"../modules/video_capture",
"//testing/gmock",
"//testing/gtest",
@@ -292,8 +336,6 @@
"fake_network_pipe.cc",
"fake_network_pipe.h",
"fake_videorenderer.h",
- "frame_generator_capturer.cc",
- "frame_generator_capturer.h",
"layer_filtering_transport.cc",
"layer_filtering_transport.h",
"mock_transport.h",
@@ -304,9 +346,6 @@
"rtp_rtcp_observer.h",
"statistics.cc",
"statistics.h",
- "vcm_capturer.cc",
- "vcm_capturer.h",
- "video_capturer.h",
"win/run_loop_win.cc",
]
if (!is_win) {
@@ -332,8 +371,6 @@
"../modules/audio_device:mock_audio_device",
"../modules/audio_mixer:audio_mixer_impl",
"../modules/audio_processing",
- "../modules/video_capture:video_capture",
- "../modules/video_capture:video_capture_module",
"../video",
"//testing/gmock",
"//testing/gtest",
diff --git a/webrtc/voice_engine/BUILD.gn b/webrtc/voice_engine/BUILD.gn
index cb97693..07c00ea 100644
--- a/webrtc/voice_engine/BUILD.gn
+++ b/webrtc/voice_engine/BUILD.gn
@@ -348,6 +348,7 @@
"//webrtc/system_wrappers/:system_wrappers_default",
"//webrtc/test/:test_common",
"//webrtc/test/:test_support",
+ "//webrtc/test/:video_test_common",
]
sources = [