From 8dd16259287f58f9273002717ec4d27e97127719 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:43:14 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- .../libwebrtc/api/test/mock_frame_transformer.h | 45 ++++++++++++++++++++++ .../api/test/mock_peerconnectioninterface.h | 4 ++ .../api/test/mock_video_decoder_factory.h | 13 +++++-- third_party/libwebrtc/api/test/pclf/BUILD.gn | 2 + third_party/libwebrtc/api/test/video/BUILD.gn | 1 + .../test/video/function_video_decoder_factory.h | 19 +++++---- 6 files changed, 73 insertions(+), 11 deletions(-) create mode 100644 third_party/libwebrtc/api/test/mock_frame_transformer.h (limited to 'third_party/libwebrtc/api/test') diff --git a/third_party/libwebrtc/api/test/mock_frame_transformer.h b/third_party/libwebrtc/api/test/mock_frame_transformer.h new file mode 100644 index 0000000000..8f438bdf9e --- /dev/null +++ b/third_party/libwebrtc/api/test/mock_frame_transformer.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2020 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_FRAME_TRANSFORMER_H_ +#define API_TEST_MOCK_FRAME_TRANSFORMER_H_ + +#include +#include + +#include "api/frame_transformer_interface.h" +#include "test/gmock.h" + +namespace webrtc { + +class MockFrameTransformer : public FrameTransformerInterface { + public: + MOCK_METHOD(void, + Transform, + (std::unique_ptr), + (override)); + MOCK_METHOD(void, + RegisterTransformedFrameCallback, + (rtc::scoped_refptr), + (override)); + MOCK_METHOD(void, + RegisterTransformedFrameSinkCallback, + (rtc::scoped_refptr, uint32_t), + (override)); + MOCK_METHOD(void, UnregisterTransformedFrameCallback, (), (override)); + MOCK_METHOD(void, + UnregisterTransformedFrameSinkCallback, + (uint32_t), + (override)); +}; + +} // namespace webrtc + +#endif // API_TEST_MOCK_FRAME_TRANSFORMER_H_ diff --git a/third_party/libwebrtc/api/test/mock_peerconnectioninterface.h b/third_party/libwebrtc/api/test/mock_peerconnectioninterface.h index ccc6ce46b1..22a77d7dfe 100644 --- a/third_party/libwebrtc/api/test/mock_peerconnectioninterface.h +++ b/third_party/libwebrtc/api/test/mock_peerconnectioninterface.h @@ -177,6 +177,10 @@ class MockPeerConnectionInterface : public webrtc::PeerConnectionInterface { (const std::vector&), (override)); MOCK_METHOD(RTCError, SetBitrate, (const BitrateSettings&), (override)); + MOCK_METHOD(void, + ReconfigureBandwidthEstimation, + (const BandwidthEstimationSettings&), + (override)); MOCK_METHOD(void, SetAudioPlayout, (bool), (override)); MOCK_METHOD(void, SetAudioRecording, (bool), (override)); MOCK_METHOD(rtc::scoped_refptr, diff --git a/third_party/libwebrtc/api/test/mock_video_decoder_factory.h b/third_party/libwebrtc/api/test/mock_video_decoder_factory.h index 6150d9f8b5..48d96ea58b 100644 --- a/third_party/libwebrtc/api/test/mock_video_decoder_factory.h +++ b/third_party/libwebrtc/api/test/mock_video_decoder_factory.h @@ -14,6 +14,7 @@ #include #include +#include "api/environment/environment.h" #include "api/video_codecs/sdp_video_format.h" #include "api/video_codecs/video_decoder.h" #include "api/video_codecs/video_decoder_factory.h" @@ -21,17 +22,21 @@ namespace webrtc { -class MockVideoDecoderFactory : public webrtc::VideoDecoderFactory { +class MockVideoDecoderFactory : public VideoDecoderFactory { public: ~MockVideoDecoderFactory() override { Die(); } - MOCK_METHOD(std::vector, + MOCK_METHOD(std::vector, GetSupportedFormats, (), (const, override)); - MOCK_METHOD(std::unique_ptr, + MOCK_METHOD(std::unique_ptr, + Create, + (const Environment&, const SdpVideoFormat&), + (override)); + MOCK_METHOD(std::unique_ptr, CreateVideoDecoder, - (const webrtc::SdpVideoFormat&), + (const SdpVideoFormat&), (override)); MOCK_METHOD(void, Die, ()); }; diff --git a/third_party/libwebrtc/api/test/pclf/BUILD.gn b/third_party/libwebrtc/api/test/pclf/BUILD.gn index 4f62984e83..68f1688556 100644 --- a/third_party/libwebrtc/api/test/pclf/BUILD.gn +++ b/third_party/libwebrtc/api/test/pclf/BUILD.gn @@ -74,6 +74,8 @@ rtc_library("media_quality_test_params") { "../../../api/transport:network_control", "../../../api/video_codecs:video_codecs_api", "../../../modules/audio_processing:api", + "../../../p2p:connection", + "../../../p2p:port_allocator", "../../../p2p:rtc_p2p", "../../../rtc_base:network", "../../../rtc_base:rtc_certificate_generator", diff --git a/third_party/libwebrtc/api/test/video/BUILD.gn b/third_party/libwebrtc/api/test/video/BUILD.gn index 0eae85aef3..cf6dd599c9 100644 --- a/third_party/libwebrtc/api/test/video/BUILD.gn +++ b/third_party/libwebrtc/api/test/video/BUILD.gn @@ -18,6 +18,7 @@ rtc_library("function_video_factory") { deps = [ "../../../rtc_base:checks", + "../../environment", "../../video_codecs:video_codecs_api", ] } diff --git a/third_party/libwebrtc/api/test/video/function_video_decoder_factory.h b/third_party/libwebrtc/api/test/video/function_video_decoder_factory.h index 2145c71bff..2f2eeb5886 100644 --- a/third_party/libwebrtc/api/test/video/function_video_decoder_factory.h +++ b/third_party/libwebrtc/api/test/video/function_video_decoder_factory.h @@ -16,6 +16,7 @@ #include #include +#include "api/environment/environment.h" #include "api/video_codecs/sdp_video_format.h" #include "api/video_codecs/video_decoder.h" #include "api/video_codecs/video_decoder_factory.h" @@ -29,17 +30,20 @@ class FunctionVideoDecoderFactory final : public VideoDecoderFactory { public: explicit FunctionVideoDecoderFactory( std::function()> create) - : create_([create = std::move(create)](const SdpVideoFormat&) { + : create_([create = std::move(create)](const Environment&, + const SdpVideoFormat&) { return create(); }) {} explicit FunctionVideoDecoderFactory( - std::function(const SdpVideoFormat&)> + std::function(const Environment&, + const SdpVideoFormat&)> create) : create_(std::move(create)) {} FunctionVideoDecoderFactory( std::function()> create, std::vector sdp_video_formats) - : create_([create = std::move(create)](const SdpVideoFormat&) { + : create_([create = std::move(create)](const Environment&, + const SdpVideoFormat&) { return create(); }), sdp_video_formats_(std::move(sdp_video_formats)) {} @@ -48,13 +52,14 @@ class FunctionVideoDecoderFactory final : public VideoDecoderFactory { return sdp_video_formats_; } - std::unique_ptr CreateVideoDecoder( - const SdpVideoFormat& format) override { - return create_(format); + std::unique_ptr Create(const Environment& env, + const SdpVideoFormat& format) override { + return create_(env, format); } private: - const std::function(const SdpVideoFormat&)> + const std::function(const Environment& env, + const SdpVideoFormat&)> create_; const std::vector sdp_video_formats_; }; -- cgit v1.2.3