Add support for creating HW codecs in the VideoProcessor tests.
This CL adds the ability to _create_ HW codecs (Android and iOS) in the
VideoProcessor integration tests. Since the VideoProcessor class is not thread
safe yet, this CL does not add the ability to _use_ HW codecs in the tests. A
follow-up CL is planned that will add this ability.
This CL further adds a separate build target which is used to separate the
"plot" versions of the integration tests from the "correctness" versions. The
former will be run manually on devices, whereas the latter are used on the
trybots/buildbots to find regressions in the SW codecs. The underlying test
is the same, however.
BUG=webrtc:6634
Review-Url: https://codereview.webrtc.org/2695653002
Cr-Commit-Position: refs/heads/master@{#16716}
diff --git a/webrtc/modules/video_coding/BUILD.gn b/webrtc/modules/video_coding/BUILD.gn
index a3ad4b3..e8ac671 100644
--- a/webrtc/modules/video_coding/BUILD.gn
+++ b/webrtc/modules/video_coding/BUILD.gn
@@ -341,13 +341,13 @@
]
}
- rtc_source_set("video_coding_modules_tests") {
+ rtc_source_set("video_coding_videoprocessor_integration_test") {
testonly = true
+
sources = [
- "codecs/test/videoprocessor_integrationtest.cc",
"codecs/test/videoprocessor_integrationtest.h",
- "codecs/vp8/test/vp8_impl_unittest.cc",
]
+
deps = [
":video_codecs_test_framework",
":video_coding",
@@ -355,18 +355,123 @@
":webrtc_vp8",
":webrtc_vp9",
"../..:webrtc_common",
+ "../../base:rtc_base_approved",
+ "../../media:rtc_media",
+ "../../test:test_support",
+ "../../test:video_test_support",
+ ]
+
+ if (is_android) {
+ sources += [
+ "codecs/test/android_test_initializer.cc",
+ "codecs/test/android_test_initializer.h",
+ ]
+
+ deps += [
+ "../../base:rtc_base_approved",
+ "../../sdk/android:libjingle_peerconnection_jni",
+ "//base",
+ ]
+ }
+
+ if (is_ios || is_mac) {
+ deps += [
+ "../../media:rtc_media_base",
+ "../../sdk:webrtc_h264_video_toolbox",
+ ]
+ }
+ }
+
+ rtc_source_set("video_coding_modules_tests") {
+ testonly = true
+
+ sources = [
+ "codecs/test/videoprocessor_integrationtest.cc",
+ "codecs/vp8/test/vp8_impl_unittest.cc",
+ ]
+
+ deps = [
+ ":video_coding_videoprocessor_integration_test",
+ ":webrtc_vp8",
"../../api:video_frame_api",
"../../base:rtc_base_approved",
"../../common_video:common_video",
- "../../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" ]
}
+
+ 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" ]
+ }
+ }
+
+ plot_videoprocessor_integrationtest_resources = [
+ "//resources/foreman_128x96.yuv",
+ "//resources/foreman_160x120.yuv",
+ "//resources/foreman_176x144.yuv",
+ "//resources/foreman_320x240.yuv",
+ "//resources/foreman_cif.yuv",
+ ]
+
+ if (is_ios || is_mac) {
+ bundle_data("plot_videoprocessor_integrationtest_bundle_data") {
+ testonly = true
+ sources = plot_videoprocessor_integrationtest_resources
+ outputs = [
+ "{{bundle_resources_dir}}/{{source_file_part}}",
+ ]
+ }
+ }
+
+ # This executable is meant for local codec perf testing and should not be run
+ # on the trybots/buildbots, hence the existence of this special build target.
+ rtc_test("plot_videoprocessor_integrationtest") {
+ testonly = true
+
+ sources = [
+ "codecs/test/plot_videoprocessor_integrationtest.cc",
+ ]
+
+ deps = [
+ ":video_coding_videoprocessor_integration_test",
+ "../../test:test_main",
+ "../../test:video_test_common",
+ "../video_capture",
+ ]
+
+ data = plot_videoprocessor_integrationtest_resources
+
+ if (is_android) {
+ deps += [
+ "../../base:rtc_base_approved",
+
+ # TODO(brandtr): Figure out if the java dep below could be moved into
+ # :video_coding_videoprocessor_integration_test, where it belongs.
+ # When that is done, support for Android HW codecs can be added to the
+ # modules_tests target as well.
+ "../../sdk/android:libjingle_peerconnection_java",
+ "../../sdk/android:libjingle_peerconnection_jni",
+ "//base",
+ "//testing/android/native_test:native_test_support",
+ ]
+
+ shard_timeout = 900
+ }
+
+ if (is_ios || is_mac) {
+ deps += [ ":plot_videoprocessor_integrationtest_bundle_data" ]
+ }
+
+ # TODO(brandtr): Remove this define when the modules_tests target properly
+ # loads the Java classes mentioned above.
+ defines = [ "WEBRTC_VIDEOPROCESSOR_INTEGRATIONTEST_HW_CODECS_ENABLED" ]
+
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" ]