From fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:14:29 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- .../libwebrtc/api/test/compile_all_headers.cc | 1 + .../libwebrtc/api/test/create_time_controller.cc | 43 ++++-- .../libwebrtc/api/test/create_time_controller.h | 12 +- .../api/test/create_video_codec_tester.cc | 27 ---- .../libwebrtc/api/test/create_video_codec_tester.h | 26 ---- .../api/test/mock_transformable_audio_frame.h | 3 + .../libwebrtc/api/test/mock_transformable_frame.h | 45 +++++++ .../libwebrtc/api/test/pclf/media_configuration.h | 1 - .../api/test/pclf/media_quality_test_params.h | 2 - .../api/test/peerconnection_quality_test_fixture.h | 1 - .../libwebrtc/api/test/video_codec_stats.cc | 97 -------------- third_party/libwebrtc/api/test/video_codec_stats.h | 120 ----------------- .../libwebrtc/api/test/video_codec_tester.h | 148 --------------------- 13 files changed, 88 insertions(+), 438 deletions(-) delete mode 100644 third_party/libwebrtc/api/test/create_video_codec_tester.cc delete mode 100644 third_party/libwebrtc/api/test/create_video_codec_tester.h create mode 100644 third_party/libwebrtc/api/test/mock_transformable_frame.h delete mode 100644 third_party/libwebrtc/api/test/video_codec_stats.cc delete mode 100644 third_party/libwebrtc/api/test/video_codec_stats.h delete mode 100644 third_party/libwebrtc/api/test/video_codec_tester.h (limited to 'third_party/libwebrtc/api/test') diff --git a/third_party/libwebrtc/api/test/compile_all_headers.cc b/third_party/libwebrtc/api/test/compile_all_headers.cc index 1fcf63e97b..9d375a19f2 100644 --- a/third_party/libwebrtc/api/test/compile_all_headers.cc +++ b/third_party/libwebrtc/api/test/compile_all_headers.cc @@ -43,6 +43,7 @@ #include "api/test/mock_rtpreceiver.h" #include "api/test/mock_rtpsender.h" #include "api/test/mock_session_description_interface.h" +#include "api/test/mock_transformable_frame.h" #include "api/test/mock_transformable_video_frame.h" #include "api/test/mock_video_bitrate_allocator.h" #include "api/test/mock_video_bitrate_allocator_factory.h" diff --git a/third_party/libwebrtc/api/test/create_time_controller.cc b/third_party/libwebrtc/api/test/create_time_controller.cc index 2c356cb887..7523e05208 100644 --- a/third_party/libwebrtc/api/test/create_time_controller.cc +++ b/third_party/libwebrtc/api/test/create_time_controller.cc @@ -11,10 +11,18 @@ #include "api/test/create_time_controller.h" #include +#include +#include "absl/base/nullability.h" +#include "api/enable_media_with_defaults.h" +#include "api/environment/environment.h" +#include "api/peer_connection_interface.h" #include "call/call.h" #include "call/rtp_transport_config.h" #include "call/rtp_transport_controller_send_factory_interface.h" +#include "pc/media_factory.h" +#include "rtc_base/checks.h" +#include "system_wrappers/include/clock.h" #include "test/time_controller/external_time_controller.h" #include "test/time_controller/simulated_time_controller.h" @@ -30,24 +38,37 @@ std::unique_ptr CreateSimulatedTimeController() { Timestamp::Seconds(10000)); } -std::unique_ptr CreateTimeControllerBasedCallFactory( - TimeController* time_controller) { - class TimeControllerBasedCallFactory : public CallFactoryInterface { +void EnableMediaWithDefaultsAndTimeController( + TimeController& time_controller, + PeerConnectionFactoryDependencies& deps) { + class TimeControllerBasedFactory : public MediaFactory { public: - explicit TimeControllerBasedCallFactory(TimeController* time_controller) - : time_controller_(time_controller) {} - std::unique_ptr CreateCall(const CallConfig& config) override { - RtpTransportConfig transportConfig = config.ExtractTransportConfig(); + TimeControllerBasedFactory( + absl::Nonnull clock, + absl::Nonnull> media_factory) + : clock_(clock), media_factory_(std::move(media_factory)) {} - return Call::Create(config, time_controller_->GetClock(), + std::unique_ptr CreateCall(const CallConfig& config) override { + return Call::Create(config, clock_, config.rtp_transport_controller_send_factory->Create( - transportConfig, time_controller_->GetClock())); + config.ExtractTransportConfig(), clock_)); + } + + std::unique_ptr CreateMediaEngine( + const Environment& env, + PeerConnectionFactoryDependencies& dependencies) override { + return media_factory_->CreateMediaEngine(env, dependencies); } private: - TimeController* time_controller_; + absl::Nonnull clock_; + absl::Nonnull> media_factory_; }; - return std::make_unique(time_controller); + + EnableMediaWithDefaults(deps); + RTC_CHECK(deps.media_factory); + deps.media_factory = std::make_unique( + time_controller.GetClock(), std::move(deps.media_factory)); } } // namespace webrtc diff --git a/third_party/libwebrtc/api/test/create_time_controller.h b/third_party/libwebrtc/api/test/create_time_controller.h index e7bc9cb465..c8257da650 100644 --- a/third_party/libwebrtc/api/test/create_time_controller.h +++ b/third_party/libwebrtc/api/test/create_time_controller.h @@ -12,7 +12,7 @@ #include -#include "api/call/call_factory_interface.h" +#include "api/peer_connection_interface.h" #include "api/test/time_controller.h" namespace webrtc { @@ -24,10 +24,12 @@ std::unique_ptr CreateTimeController( // Creates a time controller that runs in simulated time. std::unique_ptr CreateSimulatedTimeController(); -// This is creates a call factory that creates Call instances that are backed by -// a time controller. -std::unique_ptr CreateTimeControllerBasedCallFactory( - TimeController* time_controller); +// Adjusts media `deps` to use clock `time_controller` provides, fills media +// related dependencies, and enables media support for a PeerConnectionFactory +// created from `deps`. +void EnableMediaWithDefaultsAndTimeController( + TimeController& time_controller, + PeerConnectionFactoryDependencies& deps); } // namespace webrtc diff --git a/third_party/libwebrtc/api/test/create_video_codec_tester.cc b/third_party/libwebrtc/api/test/create_video_codec_tester.cc deleted file mode 100644 index a1efefdb48..0000000000 --- a/third_party/libwebrtc/api/test/create_video_codec_tester.cc +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2022 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "api/test/create_video_codec_tester.h" - -#include -#include - -#include "api/test/video_codec_tester.h" -#include "modules/video_coding/codecs/test/video_codec_tester_impl.h" - -namespace webrtc { -namespace test { - -std::unique_ptr CreateVideoCodecTester() { - return std::make_unique(); -} - -} // namespace test -} // namespace webrtc diff --git a/third_party/libwebrtc/api/test/create_video_codec_tester.h b/third_party/libwebrtc/api/test/create_video_codec_tester.h deleted file mode 100644 index c68864ce85..0000000000 --- a/third_party/libwebrtc/api/test/create_video_codec_tester.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef API_TEST_CREATE_VIDEO_CODEC_TESTER_H_ -#define API_TEST_CREATE_VIDEO_CODEC_TESTER_H_ - -#include - -#include "api/test/video_codec_tester.h" - -namespace webrtc { -namespace test { - -std::unique_ptr CreateVideoCodecTester(); - -} // namespace test -} // namespace webrtc - -#endif // API_TEST_CREATE_VIDEO_CODEC_TESTER_H_ diff --git a/third_party/libwebrtc/api/test/mock_transformable_audio_frame.h b/third_party/libwebrtc/api/test/mock_transformable_audio_frame.h index be703006ea..584c77fa54 100644 --- a/third_party/libwebrtc/api/test/mock_transformable_audio_frame.h +++ b/third_party/libwebrtc/api/test/mock_transformable_audio_frame.h @@ -11,6 +11,8 @@ #ifndef API_TEST_MOCK_TRANSFORMABLE_AUDIO_FRAME_H_ #define API_TEST_MOCK_TRANSFORMABLE_AUDIO_FRAME_H_ +#include + #include "api/frame_transformer_interface.h" #include "test/gmock.h" @@ -24,6 +26,7 @@ class MockTransformableAudioFrame : public TransformableAudioFrameInterface { MOCK_METHOD(uint8_t, GetPayloadType, (), (const, override)); MOCK_METHOD(uint32_t, GetSsrc, (), (const, override)); MOCK_METHOD(uint32_t, GetTimestamp, (), (const, override)); + MOCK_METHOD(std::string, GetMimeType, (), (const, override)); MOCK_METHOD(rtc::ArrayView, GetContributingSources, (), diff --git a/third_party/libwebrtc/api/test/mock_transformable_frame.h b/third_party/libwebrtc/api/test/mock_transformable_frame.h new file mode 100644 index 0000000000..df20b62295 --- /dev/null +++ b/third_party/libwebrtc/api/test/mock_transformable_frame.h @@ -0,0 +1,45 @@ +/* + * Copyright 2023 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef API_TEST_MOCK_TRANSFORMABLE_FRAME_H_ +#define API_TEST_MOCK_TRANSFORMABLE_FRAME_H_ + +#include + +#include +#include + +#include "api/array_view.h" +#include "api/frame_transformer_interface.h" +#include "api/units/timestamp.h" +#include "test/gmock.h" + +namespace webrtc { + +class MockTransformableFrame : public webrtc::TransformableFrameInterface { + public: + MOCK_METHOD(rtc::ArrayView, GetData, (), (const, override)); + MOCK_METHOD(void, SetData, (rtc::ArrayView), (override)); + MOCK_METHOD(uint8_t, GetPayloadType, (), (const, override)); + MOCK_METHOD(uint32_t, GetSsrc, (), (const, override)); + MOCK_METHOD(uint32_t, GetTimestamp, (), (const, override)); + MOCK_METHOD(void, SetRTPTimestamp, (uint32_t), (override)); + MOCK_METHOD(std::optional, + GetCaptureTimeIdentifier, + (), + (const, override)); + MOCK_METHOD(std::string, GetMimeType, (), (const, override)); +}; + +static_assert(!std::is_abstract_v, ""); + +} // namespace webrtc + +#endif // API_TEST_MOCK_TRANSFORMABLE_FRAME_H_ diff --git a/third_party/libwebrtc/api/test/pclf/media_configuration.h b/third_party/libwebrtc/api/test/pclf/media_configuration.h index 5bcb308c83..5c3440c293 100644 --- a/third_party/libwebrtc/api/test/pclf/media_configuration.h +++ b/third_party/libwebrtc/api/test/pclf/media_configuration.h @@ -24,7 +24,6 @@ #include "absl/strings/string_view.h" #include "absl/types/optional.h" #include "api/array_view.h" -#include "api/async_resolver_factory.h" #include "api/audio/audio_mixer.h" #include "api/audio_options.h" #include "api/call/call_factory_interface.h" diff --git a/third_party/libwebrtc/api/test/pclf/media_quality_test_params.h b/third_party/libwebrtc/api/test/pclf/media_quality_test_params.h index b2ccdf18c5..aad04c3eb6 100644 --- a/third_party/libwebrtc/api/test/pclf/media_quality_test_params.h +++ b/third_party/libwebrtc/api/test/pclf/media_quality_test_params.h @@ -49,8 +49,6 @@ struct PeerConnectionFactoryComponents { std::unique_ptr network_controller_factory; std::unique_ptr neteq_factory; - // Will be passed to MediaEngineInterface, that will be used in - // PeerConnectionFactory. std::unique_ptr video_encoder_factory; std::unique_ptr video_decoder_factory; rtc::scoped_refptr audio_encoder_factory; diff --git a/third_party/libwebrtc/api/test/peerconnection_quality_test_fixture.h b/third_party/libwebrtc/api/test/peerconnection_quality_test_fixture.h index 74470cdf86..034e13ff3b 100644 --- a/third_party/libwebrtc/api/test/peerconnection_quality_test_fixture.h +++ b/third_party/libwebrtc/api/test/peerconnection_quality_test_fixture.h @@ -25,7 +25,6 @@ #include "absl/strings/string_view.h" #include "absl/types/optional.h" #include "api/array_view.h" -#include "api/async_resolver_factory.h" #include "api/audio/audio_mixer.h" #include "api/call/call_factory_interface.h" #include "api/fec_controller.h" diff --git a/third_party/libwebrtc/api/test/video_codec_stats.cc b/third_party/libwebrtc/api/test/video_codec_stats.cc deleted file mode 100644 index fb7226701e..0000000000 --- a/third_party/libwebrtc/api/test/video_codec_stats.cc +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2023 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "api/test/video_codec_stats.h" - -namespace webrtc { -namespace test { - -void VideoCodecStats::Stream::LogMetrics( - MetricsLogger* logger, - std::string test_case_name, - std::map metadata) const { - logger->LogMetric("width", test_case_name, width, Unit::kCount, - webrtc::test::ImprovementDirection::kBiggerIsBetter, - metadata); - - logger->LogMetric("height", test_case_name, height, Unit::kCount, - webrtc::test::ImprovementDirection::kBiggerIsBetter, - metadata); - - logger->LogMetric( - "frame_size_bytes", test_case_name, frame_size_bytes, Unit::kBytes, - webrtc::test::ImprovementDirection::kNeitherIsBetter, metadata); - - logger->LogMetric("keyframe", test_case_name, keyframe, Unit::kCount, - webrtc::test::ImprovementDirection::kSmallerIsBetter, - metadata); - - logger->LogMetric("qp", test_case_name, qp, Unit::kUnitless, - webrtc::test::ImprovementDirection::kSmallerIsBetter, - metadata); - - logger->LogMetric( - "encode_time_ms", test_case_name, encode_time_ms, Unit::kMilliseconds, - webrtc::test::ImprovementDirection::kSmallerIsBetter, metadata); - - logger->LogMetric( - "decode_time_ms", test_case_name, decode_time_ms, Unit::kMilliseconds, - webrtc::test::ImprovementDirection::kSmallerIsBetter, metadata); - - logger->LogMetric("target_bitrate_kbps", test_case_name, target_bitrate_kbps, - Unit::kKilobitsPerSecond, - webrtc::test::ImprovementDirection::kBiggerIsBetter, - metadata); - - logger->LogMetric("target_framerate_fps", test_case_name, - target_framerate_fps, Unit::kHertz, - webrtc::test::ImprovementDirection::kBiggerIsBetter, - metadata); - - logger->LogMetric("encoded_bitrate_kbps", test_case_name, - encoded_bitrate_kbps, Unit::kKilobitsPerSecond, - webrtc::test::ImprovementDirection::kBiggerIsBetter, - metadata); - - logger->LogMetric("encoded_framerate_fps", test_case_name, - encoded_framerate_fps, Unit::kHertz, - webrtc::test::ImprovementDirection::kBiggerIsBetter, - metadata); - - logger->LogMetric("bitrate_mismatch_pct", test_case_name, - bitrate_mismatch_pct, Unit::kPercent, - webrtc::test::ImprovementDirection::kSmallerIsBetter, - metadata); - - logger->LogMetric("framerate_mismatch_pct", test_case_name, - framerate_mismatch_pct, Unit::kPercent, - webrtc::test::ImprovementDirection::kSmallerIsBetter, - metadata); - - logger->LogMetric("transmission_time_ms", test_case_name, - transmission_time_ms, Unit::kMilliseconds, - webrtc::test::ImprovementDirection::kSmallerIsBetter, - metadata); - - logger->LogMetric("psnr_y_db", test_case_name, psnr.y, Unit::kUnitless, - webrtc::test::ImprovementDirection::kBiggerIsBetter, - metadata); - - logger->LogMetric("psnr_u_db", test_case_name, psnr.u, Unit::kUnitless, - webrtc::test::ImprovementDirection::kBiggerIsBetter, - metadata); - - logger->LogMetric("psnr_v_db", test_case_name, psnr.v, Unit::kUnitless, - webrtc::test::ImprovementDirection::kBiggerIsBetter, - metadata); -} - -} // namespace test -} // namespace webrtc diff --git a/third_party/libwebrtc/api/test/video_codec_stats.h b/third_party/libwebrtc/api/test/video_codec_stats.h deleted file mode 100644 index 80f8287848..0000000000 --- a/third_party/libwebrtc/api/test/video_codec_stats.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2023 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef API_TEST_VIDEO_CODEC_STATS_H_ -#define API_TEST_VIDEO_CODEC_STATS_H_ - -#include -#include -#include - -#include "absl/types/optional.h" -#include "api/numerics/samples_stats_counter.h" -#include "api/test/metrics/metric.h" -#include "api/test/metrics/metrics_logger.h" -#include "api/units/data_rate.h" -#include "api/units/data_size.h" -#include "api/units/frequency.h" - -namespace webrtc { -namespace test { - -// Interface for encoded and/or decoded video frame and stream statistics. -class VideoCodecStats { - public: - // Filter for slicing frames. - struct Filter { - absl::optional first_frame; - absl::optional last_frame; - absl::optional spatial_idx; - absl::optional temporal_idx; - }; - - struct Frame { - int frame_num = 0; - uint32_t timestamp_rtp = 0; - - int spatial_idx = 0; - int temporal_idx = 0; - - int width = 0; - int height = 0; - DataSize frame_size = DataSize::Zero(); - bool keyframe = false; - absl::optional qp; - absl::optional base_spatial_idx; - - Timestamp encode_start = Timestamp::Zero(); - TimeDelta encode_time = TimeDelta::Zero(); - Timestamp decode_start = Timestamp::Zero(); - TimeDelta decode_time = TimeDelta::Zero(); - - struct Psnr { - double y = 0.0; - double u = 0.0; - double v = 0.0; - }; - absl::optional psnr; - - absl::optional target_bitrate; - absl::optional target_framerate; - - bool encoded = false; - bool decoded = false; - }; - - struct Stream { - SamplesStatsCounter width; - SamplesStatsCounter height; - SamplesStatsCounter frame_size_bytes; - SamplesStatsCounter keyframe; - SamplesStatsCounter qp; - - SamplesStatsCounter encode_time_ms; - SamplesStatsCounter decode_time_ms; - - SamplesStatsCounter target_bitrate_kbps; - SamplesStatsCounter target_framerate_fps; - - SamplesStatsCounter encoded_bitrate_kbps; - SamplesStatsCounter encoded_framerate_fps; - - SamplesStatsCounter bitrate_mismatch_pct; - SamplesStatsCounter framerate_mismatch_pct; - - SamplesStatsCounter transmission_time_ms; - - struct Psnr { - SamplesStatsCounter y; - SamplesStatsCounter u; - SamplesStatsCounter v; - } psnr; - - // Logs `Stream` metrics to provided `MetricsLogger`. - void LogMetrics(MetricsLogger* logger, - std::string test_case_name, - std::map metadata = {}) const; - }; - - virtual ~VideoCodecStats() = default; - - // Returns frames from interval, spatial and temporal layer specified by given - // `filter`. - virtual std::vector Slice( - absl::optional filter = absl::nullopt) const = 0; - - // Returns video statistics aggregated for given `frames`. - virtual Stream Aggregate(const std::vector& frames) const = 0; -}; - -} // namespace test -} // namespace webrtc - -#endif // API_TEST_VIDEO_CODEC_STATS_H_ diff --git a/third_party/libwebrtc/api/test/video_codec_tester.h b/third_party/libwebrtc/api/test/video_codec_tester.h deleted file mode 100644 index c2fb89e2cb..0000000000 --- a/third_party/libwebrtc/api/test/video_codec_tester.h +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (c) 2022 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef API_TEST_VIDEO_CODEC_TESTER_H_ -#define API_TEST_VIDEO_CODEC_TESTER_H_ - -#include -#include - -#include "absl/functional/any_invocable.h" -#include "absl/types/optional.h" -#include "api/test/video_codec_stats.h" -#include "api/video/encoded_image.h" -#include "api/video/resolution.h" -#include "api/video/video_frame.h" - -namespace webrtc { -namespace test { - -// Interface for a video codec tester. The interface provides minimalistic set -// of data structures that enables implementation of decode-only, encode-only -// and encode-decode tests. -class VideoCodecTester { - public: - // Pacing settings for codec input. - struct PacingSettings { - enum PacingMode { - // Pacing is not used. Frames are sent to codec back-to-back. - kNoPacing, - // Pace with the rate equal to the target video frame rate. Pacing time is - // derived from RTP timestamp. - kRealTime, - // Pace with the explicitly provided rate. - kConstantRate, - }; - PacingMode mode = PacingMode::kNoPacing; - // Pacing rate for `kConstantRate` mode. - Frequency constant_rate = Frequency::Zero(); - }; - - struct DecoderSettings { - PacingSettings pacing; - absl::optional decoder_input_base_path; - absl::optional decoder_output_base_path; - }; - - struct EncoderSettings { - PacingSettings pacing; - absl::optional encoder_input_base_path; - absl::optional encoder_output_base_path; - }; - - virtual ~VideoCodecTester() = default; - - // Interface for a raw video frames source. - class RawVideoSource { - public: - virtual ~RawVideoSource() = default; - - // Returns next frame. If no more frames to pull, returns `absl::nullopt`. - // For analysis and pacing purposes, frame must have RTP timestamp set. The - // timestamp must represent the target video frame rate and be unique. - virtual absl::optional PullFrame() = 0; - - // Returns early pulled frame with RTP timestamp equal to `timestamp_rtp`. - virtual VideoFrame GetFrame(uint32_t timestamp_rtp, - Resolution resolution) = 0; - }; - - // Interface for a coded video frames source. - class CodedVideoSource { - public: - virtual ~CodedVideoSource() = default; - - // Returns next frame. If no more frames to pull, returns `absl::nullopt`. - // For analysis and pacing purposes, frame must have RTP timestamp set. The - // timestamp must represent the target video frame rate and be unique. - virtual absl::optional PullFrame() = 0; - }; - - // Interface for a video encoder. - class Encoder { - public: - using EncodeCallback = - absl::AnyInvocable; - - virtual ~Encoder() = default; - - virtual void Initialize() = 0; - - virtual void Encode(const VideoFrame& frame, EncodeCallback callback) = 0; - - virtual void Flush() = 0; - }; - - // Interface for a video decoder. - class Decoder { - public: - using DecodeCallback = - absl::AnyInvocable; - - virtual ~Decoder() = default; - - virtual void Initialize() = 0; - - virtual void Decode(const EncodedImage& frame, DecodeCallback callback) = 0; - - virtual void Flush() = 0; - }; - - // Pulls coded video frames from `video_source` and passes them to `decoder`. - // Returns `VideoCodecTestStats` object that contains collected per-frame - // metrics. - virtual std::unique_ptr RunDecodeTest( - CodedVideoSource* video_source, - Decoder* decoder, - const DecoderSettings& decoder_settings) = 0; - - // Pulls raw video frames from `video_source` and passes them to `encoder`. - // Returns `VideoCodecTestStats` object that contains collected per-frame - // metrics. - virtual std::unique_ptr RunEncodeTest( - RawVideoSource* video_source, - Encoder* encoder, - const EncoderSettings& encoder_settings) = 0; - - // Pulls raw video frames from `video_source`, passes them to `encoder` and - // then passes encoded frames to `decoder`. Returns `VideoCodecTestStats` - // object that contains collected per-frame metrics. - virtual std::unique_ptr RunEncodeDecodeTest( - RawVideoSource* video_source, - Encoder* encoder, - Decoder* decoder, - const EncoderSettings& encoder_settings, - const DecoderSettings& decoder_settings) = 0; -}; - -} // namespace test -} // namespace webrtc - -#endif // API_TEST_VIDEO_CODEC_TESTER_H_ -- cgit v1.2.3