From a9e10263044b7ef506f88d00605b3c97a23f684e Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Thu, 6 Feb 2020 10:35:58 +0100 Subject: [PATCH] Make video_replay buildable from Chromium. Bug: chromium:942546 Change-Id: Ic127e74b75ccb1fa65b317711d20344d0caee5fb Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168280 Reviewed-by: Ilya Nikolaevskiy Commit-Queue: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#30467} --- test/BUILD.gn | 108 ++++++++++++++++++++++++------------------------- video/BUILD.gn | 80 ++++++++++++++++++++---------------- 2 files changed, 99 insertions(+), 89 deletions(-) diff --git a/test/BUILD.gn b/test/BUILD.gn index 4617dd0980..fee78c9854 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -318,6 +318,60 @@ rtc_source_set("test_support") { ] } +rtc_library("video_test_support") { + testonly = true + + sources = [ + "testsupport/frame_reader.h", + "testsupport/frame_writer.h", + "testsupport/mock/mock_frame_reader.h", + "testsupport/video_frame_writer.cc", + "testsupport/video_frame_writer.h", + "testsupport/y4m_frame_reader.cc", + "testsupport/y4m_frame_writer.cc", + "testsupport/yuv_frame_reader.cc", + "testsupport/yuv_frame_writer.cc", + ] + + deps = [ + ":fileutils", + ":frame_utils", + ":test_support", + ":video_test_common", + "../api:scoped_refptr", + "../api/video:encoded_image", + "../api/video:video_frame", + "../api/video:video_frame_i420", + "../api/video_codecs:video_codecs_api", + "../common_video", + "../media:rtc_media_base", + "../modules/video_coding:video_codec_interface", + "../modules/video_coding:video_coding_utility", + "../modules/video_coding:webrtc_h264", + "../modules/video_coding:webrtc_vp8", + "../modules/video_coding:webrtc_vp9", + "../rtc_base:checks", + "../rtc_base:criticalsection", + "../rtc_base:logging", + "../rtc_base:rtc_base_approved", + "../rtc_base:rtc_event", + "../rtc_base/synchronization:sequence_checker", + "../rtc_base/system:file_wrapper", + "//third_party/abseil-cpp/absl/types:optional", + ] + + if (!is_ios) { + deps += [ "//third_party:jpeg" ] + sources += [ "testsupport/jpeg_frame_writer.cc" ] + } else { + sources += [ "testsupport/jpeg_frame_writer_ios.cc" ] + } + + if (is_android) { + deps += [ "//base" ] + } +} + if (rtc_include_tests) { rtc_library("test_main_lib") { visibility = [ "*" ] @@ -355,60 +409,6 @@ if (rtc_include_tests) { ] } - rtc_library("video_test_support") { - testonly = true - - sources = [ - "testsupport/frame_reader.h", - "testsupport/frame_writer.h", - "testsupport/mock/mock_frame_reader.h", - "testsupport/video_frame_writer.cc", - "testsupport/video_frame_writer.h", - "testsupport/y4m_frame_reader.cc", - "testsupport/y4m_frame_writer.cc", - "testsupport/yuv_frame_reader.cc", - "testsupport/yuv_frame_writer.cc", - ] - - deps = [ - ":fileutils", - ":frame_utils", - ":test_support", - ":video_test_common", - "../api:scoped_refptr", - "../api/video:encoded_image", - "../api/video:video_frame", - "../api/video:video_frame_i420", - "../api/video_codecs:video_codecs_api", - "../common_video", - "../media:rtc_media_base", - "../modules/video_coding:video_codec_interface", - "../modules/video_coding:video_coding_utility", - "../modules/video_coding:webrtc_h264", - "../modules/video_coding:webrtc_vp8", - "../modules/video_coding:webrtc_vp9", - "../rtc_base:checks", - "../rtc_base:criticalsection", - "../rtc_base:logging", - "../rtc_base:rtc_base_approved", - "../rtc_base:rtc_event", - "../rtc_base/synchronization:sequence_checker", - "../rtc_base/system:file_wrapper", - "//third_party/abseil-cpp/absl/types:optional", - ] - - if (!is_ios) { - deps += [ "//third_party:jpeg" ] - sources += [ "testsupport/jpeg_frame_writer.cc" ] - } else { - sources += [ "testsupport/jpeg_frame_writer_ios.cc" ] - } - - if (is_android) { - deps += [ "//base" ] - } - } - rtc_library("test_support_test_artifacts") { testonly = true sources = [ diff --git a/video/BUILD.gn b/video/BUILD.gn index 1878f3216c..288dddbcd4 100644 --- a/video/BUILD.gn +++ b/video/BUILD.gn @@ -239,6 +239,51 @@ rtc_library("video_stream_encoder_impl") { ] } +if (!is_component_build) { + # This target can be built from Chromium but it doesn't support + # is_component_build=true because it depends on WebRTC testonly code + # which is not part of //third_party/webrtc_overrides:webrtc_component. + rtc_executable("video_replay") { + testonly = true + sources = [ "video_replay.cc" ] + deps = [ + "../api/rtc_event_log", + "../api/task_queue:default_task_queue_factory", + "../api/test/video:function_video_factory", + "../api/transport:field_trial_based_config", + "../api/video_codecs:video_codecs_api", + "../call", + "../call:call_interfaces", + "../common_video", + "../media:rtc_internal_video_codecs", + "../rtc_base:checks", + "../rtc_base:rtc_json", + "../rtc_base:stringutils", + "../rtc_base:timeutils", + "../system_wrappers", + "../test:call_config_utils", + "../test:encoder_settings", + "../test:fake_video_codecs", + "../test:null_transport", + "../test:rtp_test_utils", + "../test:run_test", + "../test:run_test_interface", + "../test:test_common", + "../test:test_renderer", + "../test:test_support", + "../test:video_test_common", + "../test:video_test_support", + "//third_party/abseil-cpp/absl/flags:flag", + "//third_party/abseil-cpp/absl/flags:parse", + ] + if (build_with_chromium) { + # When building from Chromium, WebRTC's metrics and field trial + # implementations need to be replaced by the Chromium ones. + deps += [ "//third_party/webrtc_overrides:webrtc_component" ] + } + } +} + if (rtc_include_tests) { rtc_library("video_mocks") { testonly = true @@ -467,41 +512,6 @@ if (rtc_include_tests) { ] } - rtc_executable("video_replay") { - testonly = true - sources = [ "video_replay.cc" ] - deps = [ - "../api/rtc_event_log", - "../api/task_queue:default_task_queue_factory", - "../api/test/video:function_video_factory", - "../api/transport:field_trial_based_config", - "../api/video_codecs:video_codecs_api", - "../call", - "../call:call_interfaces", - "../common_video", - "../media:rtc_internal_video_codecs", - "../rtc_base:checks", - "../rtc_base:rtc_json", - "../rtc_base:stringutils", - "../rtc_base:timeutils", - "../system_wrappers", - "../test:call_config_utils", - "../test:encoder_settings", - "../test:fake_video_codecs", - "../test:null_transport", - "../test:rtp_test_utils", - "../test:run_test", - "../test:run_test_interface", - "../test:test_common", - "../test:test_renderer", - "../test:test_support", - "../test:video_test_common", - "../test:video_test_support", - "//third_party/abseil-cpp/absl/flags:flag", - "//third_party/abseil-cpp/absl/flags:parse", - ] - } - # TODO(pbos): Rename test suite. rtc_library("video_tests") { testonly = true