mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 05:40:42 +01:00
Format the rest
git ls-files | grep -e "\(\.h\|\.cc\)$" | grep -vE "^(rtc_base|sdk|modules|api|call|common_audio|examples|media|net|p2p|pc)/" | xargs clang-format -i ; git cl format after landing: add to .git-blame-ignore-revs Bug: webrtc:15082 Change-Id: I9c7fc4e6fbb023809fb22a89a78be713de6990d3 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/302063 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/main@{#39978}
This commit is contained in:
parent
bceec84aee
commit
7220ee97aa
24 changed files with 319 additions and 325 deletions
|
@ -24,8 +24,6 @@ ProtobufPlot::~ProtobufPlot() {}
|
||||||
|
|
||||||
void ProtobufPlot::Draw() {}
|
void ProtobufPlot::Draw() {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ProtobufPlotCollection::ProtobufPlotCollection() {}
|
ProtobufPlotCollection::ProtobufPlotCollection() {}
|
||||||
|
|
||||||
ProtobufPlotCollection::~ProtobufPlotCollection() {}
|
ProtobufPlotCollection::~ProtobufPlotCollection() {}
|
||||||
|
|
|
@ -32,8 +32,8 @@ namespace webrtc {
|
||||||
namespace metrics_impl {
|
namespace metrics_impl {
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
void NoOp(const Ts&...) {}
|
void NoOp(const Ts&...) {}
|
||||||
}
|
} // namespace metrics_impl
|
||||||
}
|
} // namespace webrtc
|
||||||
|
|
||||||
#if RTC_METRICS_ENABLED
|
#if RTC_METRICS_ENABLED
|
||||||
#define EXPECT_METRIC_EQ(val1, val2) EXPECT_EQ(val1, val2)
|
#define EXPECT_METRIC_EQ(val1, val2) EXPECT_EQ(val1, val2)
|
||||||
|
@ -46,12 +46,16 @@ void NoOp(const Ts&...) {}
|
||||||
#define EXPECT_METRIC_THAT(value, matcher) EXPECT_THAT(value, matcher)
|
#define EXPECT_METRIC_THAT(value, matcher) EXPECT_THAT(value, matcher)
|
||||||
#else
|
#else
|
||||||
#define EXPECT_METRIC_EQ(val1, val2) webrtc::metrics_impl::NoOp(val1, val2)
|
#define EXPECT_METRIC_EQ(val1, val2) webrtc::metrics_impl::NoOp(val1, val2)
|
||||||
#define EXPECT_METRIC_EQ_WAIT(val1, val2, timeout) webrtc::metrics_impl::NoOp(val1, val2, timeout)
|
#define EXPECT_METRIC_EQ_WAIT(val1, val2, timeout) \
|
||||||
|
webrtc::metrics_impl::NoOp(val1, val2, timeout)
|
||||||
#define EXPECT_METRIC_GT(val1, val2) webrtc::metrics_impl::NoOp(val1, val2)
|
#define EXPECT_METRIC_GT(val1, val2) webrtc::metrics_impl::NoOp(val1, val2)
|
||||||
#define EXPECT_METRIC_LE(val1, val2) webrtc::metrics_impl::NoOp(val1, val2)
|
#define EXPECT_METRIC_LE(val1, val2) webrtc::metrics_impl::NoOp(val1, val2)
|
||||||
#define EXPECT_METRIC_TRUE(condition) webrtc::metrics_impl::NoOp(condition || true)
|
#define EXPECT_METRIC_TRUE(condition) \
|
||||||
#define EXPECT_METRIC_FALSE(condition) webrtc::metrics_impl::NoOp(condition && false)
|
webrtc::metrics_impl::NoOp(condition || true)
|
||||||
#define EXPECT_METRIC_THAT(value, matcher) webrtc::metrics_impl::NoOp(value, testing::_)
|
#define EXPECT_METRIC_FALSE(condition) \
|
||||||
|
webrtc::metrics_impl::NoOp(condition && false)
|
||||||
|
#define EXPECT_METRIC_THAT(value, matcher) \
|
||||||
|
webrtc::metrics_impl::NoOp(value, testing::_)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if RTC_METRICS_ENABLED
|
#if RTC_METRICS_ENABLED
|
||||||
|
@ -278,17 +282,23 @@ void NoOp(const Ts&...) {}
|
||||||
// This section defines no-op alternatives to the metrics macros when
|
// This section defines no-op alternatives to the metrics macros when
|
||||||
// RTC_METRICS_ENABLED is defined.
|
// RTC_METRICS_ENABLED is defined.
|
||||||
|
|
||||||
#define RTC_HISTOGRAM_COUNTS_100(name, sample) webrtc::metrics_impl::NoOp(name, sample)
|
#define RTC_HISTOGRAM_COUNTS_100(name, sample) \
|
||||||
|
webrtc::metrics_impl::NoOp(name, sample)
|
||||||
|
|
||||||
#define RTC_HISTOGRAM_COUNTS_200(name, sample) webrtc::metrics_impl::NoOp(name, sample)
|
#define RTC_HISTOGRAM_COUNTS_200(name, sample) \
|
||||||
|
webrtc::metrics_impl::NoOp(name, sample)
|
||||||
|
|
||||||
#define RTC_HISTOGRAM_COUNTS_500(name, sample) webrtc::metrics_impl::NoOp(name, sample)
|
#define RTC_HISTOGRAM_COUNTS_500(name, sample) \
|
||||||
|
webrtc::metrics_impl::NoOp(name, sample)
|
||||||
|
|
||||||
#define RTC_HISTOGRAM_COUNTS_1000(name, sample) webrtc::metrics_impl::NoOp(name, sample)
|
#define RTC_HISTOGRAM_COUNTS_1000(name, sample) \
|
||||||
|
webrtc::metrics_impl::NoOp(name, sample)
|
||||||
|
|
||||||
#define RTC_HISTOGRAM_COUNTS_10000(name, sample) webrtc::metrics_impl::NoOp(name, sample)
|
#define RTC_HISTOGRAM_COUNTS_10000(name, sample) \
|
||||||
|
webrtc::metrics_impl::NoOp(name, sample)
|
||||||
|
|
||||||
#define RTC_HISTOGRAM_COUNTS_100000(name, sample) webrtc::metrics_impl::NoOp(name, sample)
|
#define RTC_HISTOGRAM_COUNTS_100000(name, sample) \
|
||||||
|
webrtc::metrics_impl::NoOp(name, sample)
|
||||||
|
|
||||||
#define RTC_HISTOGRAM_COUNTS(name, sample, min, max, bucket_count) \
|
#define RTC_HISTOGRAM_COUNTS(name, sample, min, max, bucket_count) \
|
||||||
webrtc::metrics_impl::NoOp(name, sample, min, max, bucket_count)
|
webrtc::metrics_impl::NoOp(name, sample, min, max, bucket_count)
|
||||||
|
@ -296,31 +306,41 @@ void NoOp(const Ts&...) {}
|
||||||
#define RTC_HISTOGRAM_COUNTS_LINEAR(name, sample, min, max, bucket_count) \
|
#define RTC_HISTOGRAM_COUNTS_LINEAR(name, sample, min, max, bucket_count) \
|
||||||
webrtc::metrics_impl::NoOp(name, sample, min, max, bucket_count)
|
webrtc::metrics_impl::NoOp(name, sample, min, max, bucket_count)
|
||||||
|
|
||||||
#define RTC_HISTOGRAM_COUNTS_SPARSE_100(name, sample) webrtc::metrics_impl::NoOp(name, sample)
|
#define RTC_HISTOGRAM_COUNTS_SPARSE_100(name, sample) \
|
||||||
|
webrtc::metrics_impl::NoOp(name, sample)
|
||||||
|
|
||||||
#define RTC_HISTOGRAM_COUNTS_SPARSE_200(name, sample) webrtc::metrics_impl::NoOp(name, sample)
|
#define RTC_HISTOGRAM_COUNTS_SPARSE_200(name, sample) \
|
||||||
|
webrtc::metrics_impl::NoOp(name, sample)
|
||||||
|
|
||||||
#define RTC_HISTOGRAM_COUNTS_SPARSE_500(name, sample) webrtc::metrics_impl::NoOp(name, sample)
|
#define RTC_HISTOGRAM_COUNTS_SPARSE_500(name, sample) \
|
||||||
|
webrtc::metrics_impl::NoOp(name, sample)
|
||||||
|
|
||||||
#define RTC_HISTOGRAM_COUNTS_SPARSE_1000(name, sample) webrtc::metrics_impl::NoOp(name, sample)
|
#define RTC_HISTOGRAM_COUNTS_SPARSE_1000(name, sample) \
|
||||||
|
webrtc::metrics_impl::NoOp(name, sample)
|
||||||
|
|
||||||
#define RTC_HISTOGRAM_COUNTS_SPARSE_10000(name, sample) webrtc::metrics_impl::NoOp(name, sample)
|
#define RTC_HISTOGRAM_COUNTS_SPARSE_10000(name, sample) \
|
||||||
|
webrtc::metrics_impl::NoOp(name, sample)
|
||||||
|
|
||||||
#define RTC_HISTOGRAM_COUNTS_SPARSE_100000(name, sample) webrtc::metrics_impl::NoOp(name, sample)
|
#define RTC_HISTOGRAM_COUNTS_SPARSE_100000(name, sample) \
|
||||||
|
webrtc::metrics_impl::NoOp(name, sample)
|
||||||
|
|
||||||
#define RTC_HISTOGRAM_COUNTS_SPARSE(name, sample, min, max, bucket_count) \
|
#define RTC_HISTOGRAM_COUNTS_SPARSE(name, sample, min, max, bucket_count) \
|
||||||
webrtc::metrics_impl::NoOp(name, sample, min, max, bucket_count)
|
webrtc::metrics_impl::NoOp(name, sample, min, max, bucket_count)
|
||||||
|
|
||||||
#define RTC_HISTOGRAM_PERCENTAGE_SPARSE(name, sample) webrtc::metrics_impl::NoOp(name, sample)
|
#define RTC_HISTOGRAM_PERCENTAGE_SPARSE(name, sample) \
|
||||||
|
webrtc::metrics_impl::NoOp(name, sample)
|
||||||
|
|
||||||
#define RTC_HISTOGRAM_BOOLEAN_SPARSE(name, sample) webrtc::metrics_impl::NoOp(name, sample)
|
#define RTC_HISTOGRAM_BOOLEAN_SPARSE(name, sample) \
|
||||||
|
webrtc::metrics_impl::NoOp(name, sample)
|
||||||
|
|
||||||
#define RTC_HISTOGRAM_ENUMERATION_SPARSE(name, sample, boundary) \
|
#define RTC_HISTOGRAM_ENUMERATION_SPARSE(name, sample, boundary) \
|
||||||
webrtc::metrics_impl::NoOp(name, sample, boundary)
|
webrtc::metrics_impl::NoOp(name, sample, boundary)
|
||||||
|
|
||||||
#define RTC_HISTOGRAM_PERCENTAGE(name, sample) webrtc::metrics_impl::NoOp(name, sample)
|
#define RTC_HISTOGRAM_PERCENTAGE(name, sample) \
|
||||||
|
webrtc::metrics_impl::NoOp(name, sample)
|
||||||
|
|
||||||
#define RTC_HISTOGRAM_BOOLEAN(name, sample) webrtc::metrics_impl::NoOp(name, sample)
|
#define RTC_HISTOGRAM_BOOLEAN(name, sample) \
|
||||||
|
webrtc::metrics_impl::NoOp(name, sample)
|
||||||
|
|
||||||
#define RTC_HISTOGRAM_ENUMERATION(name, sample, boundary) \
|
#define RTC_HISTOGRAM_ENUMERATION(name, sample, boundary) \
|
||||||
webrtc::metrics_impl::NoOp(name, sample, boundary)
|
webrtc::metrics_impl::NoOp(name, sample, boundary)
|
||||||
|
@ -332,11 +352,14 @@ void NoOp(const Ts&...) {}
|
||||||
#define RTC_HISTOGRAM_COMMON_BLOCK_SLOW(name, sample, factory_get_invocation) \
|
#define RTC_HISTOGRAM_COMMON_BLOCK_SLOW(name, sample, factory_get_invocation) \
|
||||||
webrtc::metrics_impl::NoOp(name, sample, factory_get_invocation)
|
webrtc::metrics_impl::NoOp(name, sample, factory_get_invocation)
|
||||||
|
|
||||||
#define RTC_HISTOGRAMS_COUNTS_100(index, name, sample) webrtc::metrics_impl::NoOp(index, name, sample)
|
#define RTC_HISTOGRAMS_COUNTS_100(index, name, sample) \
|
||||||
|
webrtc::metrics_impl::NoOp(index, name, sample)
|
||||||
|
|
||||||
#define RTC_HISTOGRAMS_COUNTS_200(index, name, sample) webrtc::metrics_impl::NoOp(index, name, sample)
|
#define RTC_HISTOGRAMS_COUNTS_200(index, name, sample) \
|
||||||
|
webrtc::metrics_impl::NoOp(index, name, sample)
|
||||||
|
|
||||||
#define RTC_HISTOGRAMS_COUNTS_500(index, name, sample) webrtc::metrics_impl::NoOp(index, name, sample)
|
#define RTC_HISTOGRAMS_COUNTS_500(index, name, sample) \
|
||||||
|
webrtc::metrics_impl::NoOp(index, name, sample)
|
||||||
|
|
||||||
#define RTC_HISTOGRAMS_COUNTS_1000(index, name, sample) \
|
#define RTC_HISTOGRAMS_COUNTS_1000(index, name, sample) \
|
||||||
webrtc::metrics_impl::NoOp(index, name, sample)
|
webrtc::metrics_impl::NoOp(index, name, sample)
|
||||||
|
@ -350,7 +373,8 @@ void NoOp(const Ts&...) {}
|
||||||
#define RTC_HISTOGRAMS_ENUMERATION(index, name, sample, boundary) \
|
#define RTC_HISTOGRAMS_ENUMERATION(index, name, sample, boundary) \
|
||||||
webrtc::metrics_impl::NoOp(index, name, sample, boundary)
|
webrtc::metrics_impl::NoOp(index, name, sample, boundary)
|
||||||
|
|
||||||
#define RTC_HISTOGRAMS_PERCENTAGE(index, name, sample) webrtc::metrics_impl::NoOp(index, name, sample)
|
#define RTC_HISTOGRAMS_PERCENTAGE(index, name, sample) \
|
||||||
|
webrtc::metrics_impl::NoOp(index, name, sample)
|
||||||
|
|
||||||
#define RTC_HISTOGRAMS_COMMON(index, name, sample, macro_invocation) \
|
#define RTC_HISTOGRAMS_COMMON(index, name, sample, macro_invocation) \
|
||||||
webrtc::metrics_impl::NoOp(index, name, sample, macro_invocation)
|
webrtc::metrics_impl::NoOp(index, name, sample, macro_invocation)
|
||||||
|
|
|
@ -233,7 +233,6 @@ class CallTest : public ::testing::Test, public RtpPacketSinkInterface {
|
||||||
rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory_;
|
rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory_;
|
||||||
test::FakeVideoRenderer fake_renderer_;
|
test::FakeVideoRenderer fake_renderer_;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
absl::optional<RtpExtension> GetRtpExtensionByUri(
|
absl::optional<RtpExtension> GetRtpExtensionByUri(
|
||||||
const std::string& uri) const;
|
const std::string& uri) const;
|
||||||
|
|
|
@ -261,7 +261,7 @@ void FakeEncoder::SetRatesLocked(const RateControlParameters& parameters) {
|
||||||
uint32_t bitrate = current_rate_settings_.bitrate.GetBitrate(
|
uint32_t bitrate = current_rate_settings_.bitrate.GetBitrate(
|
||||||
spatial_idx, temporal_idx);
|
spatial_idx, temporal_idx);
|
||||||
bitrate = static_cast<uint32_t>(
|
bitrate = static_cast<uint32_t>(
|
||||||
(bitrate * int64_t{max_target_bitrate_kbps_}) /
|
(bitrate* int64_t{max_target_bitrate_kbps_}) /
|
||||||
allocated_bitrate_kbps);
|
allocated_bitrate_kbps);
|
||||||
current_rate_settings_.bitrate.SetBitrate(spatial_idx, temporal_idx,
|
current_rate_settings_.bitrate.SetBitrate(spatial_idx, temporal_idx,
|
||||||
bitrate);
|
bitrate);
|
||||||
|
|
|
@ -92,8 +92,8 @@ void FuzzGainController(test::FuzzDataHelper* fuzz_data, GainControlImpl* gci) {
|
||||||
FuzzGainControllerConfig(fuzz_data, gci);
|
FuzzGainControllerConfig(fuzz_data, gci);
|
||||||
|
|
||||||
// The audio buffer is used for both capture and render.
|
// The audio buffer is used for both capture and render.
|
||||||
AudioBuffer audio(sample_rate_hz, num_channels, sample_rate_hz,
|
AudioBuffer audio(sample_rate_hz, num_channels, sample_rate_hz, num_channels,
|
||||||
num_channels, sample_rate_hz, num_channels);
|
sample_rate_hz, num_channels);
|
||||||
|
|
||||||
std::vector<int16_t> packed_render_audio(samples_per_frame);
|
std::vector<int16_t> packed_render_audio(samples_per_frame);
|
||||||
|
|
||||||
|
|
|
@ -7,14 +7,13 @@
|
||||||
* in the file PATENTS. All contributing project authors may
|
* in the file PATENTS. All contributing project authors may
|
||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
#include "modules/rtp_rtcp/source/video_rtp_depacketizer_av1.h"
|
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "api/array_view.h"
|
#include "api/array_view.h"
|
||||||
|
#include "modules/rtp_rtcp/source/video_rtp_depacketizer_av1.h"
|
||||||
#include "test/fuzzers/fuzz_data_helper.h"
|
#include "test/fuzzers/fuzz_data_helper.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
|
@ -142,8 +142,7 @@ TcpMessageRouteImpl::TcpMessageRouteImpl(Clock* clock,
|
||||||
|
|
||||||
void TcpMessageRouteImpl::SendMessage(size_t size,
|
void TcpMessageRouteImpl::SendMessage(size_t size,
|
||||||
std::function<void()> on_received) {
|
std::function<void()> on_received) {
|
||||||
task_queue_->PostTask(
|
task_queue_->PostTask([this, size, handler = std::move(on_received)] {
|
||||||
[this, size, handler = std::move(on_received)] {
|
|
||||||
// If we are currently sending a message we won't reset the connection,
|
// If we are currently sending a message we won't reset the connection,
|
||||||
// we'll act as if the messages are sent in the same TCP stream. This is
|
// we'll act as if the messages are sent in the same TCP stream. This is
|
||||||
// intended to simulate recreation of a TCP session for each message
|
// intended to simulate recreation of a TCP session for each message
|
||||||
|
|
|
@ -113,7 +113,6 @@ void FakeNetworkSocket::OnPacketReceived(EmulatedIpPacket packet) {
|
||||||
socket_server_->WakeUp();
|
socket_server_->WakeUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
rtc::SocketAddress FakeNetworkSocket::GetLocalAddress() const {
|
rtc::SocketAddress FakeNetworkSocket::GetLocalAddress() const {
|
||||||
RTC_DCHECK_RUN_ON(thread_);
|
RTC_DCHECK_RUN_ON(thread_);
|
||||||
return local_addr_;
|
return local_addr_;
|
||||||
|
@ -317,6 +316,5 @@ void FakeNetworkSocketServer::WakeUp() {
|
||||||
wakeup_.Set();
|
wakeup_.Set();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace test
|
} // namespace test
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
|
@ -32,7 +32,6 @@ class FakeNetworkSocketServer : public rtc::SocketServer {
|
||||||
explicit FakeNetworkSocketServer(EndpointsContainer* endpoints_controller);
|
explicit FakeNetworkSocketServer(EndpointsContainer* endpoints_controller);
|
||||||
~FakeNetworkSocketServer() override;
|
~FakeNetworkSocketServer() override;
|
||||||
|
|
||||||
|
|
||||||
// rtc::SocketFactory methods:
|
// rtc::SocketFactory methods:
|
||||||
rtc::Socket* CreateSocket(int family, int type) override;
|
rtc::Socket* CreateSocket(int family, int type) override;
|
||||||
|
|
||||||
|
|
|
@ -32,9 +32,7 @@ class ActionReceiver : public EmulatedNetworkReceiverInterface {
|
||||||
explicit ActionReceiver(std::function<void()> action) : action_(action) {}
|
explicit ActionReceiver(std::function<void()> action) : action_(action) {}
|
||||||
~ActionReceiver() override = default;
|
~ActionReceiver() override = default;
|
||||||
|
|
||||||
void OnPacketReceived(EmulatedIpPacket packet) override {
|
void OnPacketReceived(EmulatedIpPacket packet) override { action_(); }
|
||||||
action_();
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::function<void()> action_;
|
std::function<void()> action_;
|
||||||
|
|
|
@ -106,7 +106,7 @@ class LambdaPeerConnectionObserver final : public PeerConnectionObserver {
|
||||||
handler(candidates);
|
handler(candidates);
|
||||||
}
|
}
|
||||||
void OnAddTrack(rtc::scoped_refptr<RtpReceiverInterface> receiver,
|
void OnAddTrack(rtc::scoped_refptr<RtpReceiverInterface> receiver,
|
||||||
const std::vector<rtc::scoped_refptr<MediaStreamInterface> >&
|
const std::vector<rtc::scoped_refptr<MediaStreamInterface>>&
|
||||||
streams) override {
|
streams) override {
|
||||||
for (const auto& handler : handlers_->on_add_track)
|
for (const auto& handler : handlers_->on_add_track)
|
||||||
handler(receiver, streams);
|
handler(receiver, streams);
|
||||||
|
|
|
@ -61,7 +61,8 @@ TEST(RemoteEstimateEndToEnd, OfferedCapabilityIsInAnswer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(RemoteEstimateEndToEnd, AudioUsesAbsSendTimeExtension) {
|
TEST(RemoteEstimateEndToEnd, AudioUsesAbsSendTimeExtension) {
|
||||||
// Defined before PeerScenario so it gets destructed after, to avoid use after free.
|
// Defined before PeerScenario so it gets destructed after, to avoid use after
|
||||||
|
// free.
|
||||||
std::atomic<bool> received_abs_send_time(false);
|
std::atomic<bool> received_abs_send_time(false);
|
||||||
PeerScenario s(*test_info_);
|
PeerScenario s(*test_info_);
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,6 @@ struct VideoFramePair {
|
||||||
int repeated = 0;
|
int repeated = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct VideoFramesStats {
|
struct VideoFramesStats {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
SampleStats<double> pixels;
|
SampleStats<double> pixels;
|
||||||
|
|
|
@ -106,7 +106,6 @@ TEST(VideoStreamTest, ReceivesVp8SimulcastFrames) {
|
||||||
c->encoder.simulcast_streams = {webrtc::ScalabilityMode::kL1T1,
|
c->encoder.simulcast_streams = {webrtc::ScalabilityMode::kL1T1,
|
||||||
webrtc::ScalabilityMode::kL1T1,
|
webrtc::ScalabilityMode::kL1T1,
|
||||||
webrtc::ScalabilityMode::kL1T1};
|
webrtc::ScalabilityMode::kL1T1};
|
||||||
|
|
||||||
});
|
});
|
||||||
s.RunFor(kRunTime);
|
s.RunFor(kRunTime);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
#include "test/testsupport/file_utils.h"
|
#include "test/testsupport/file_utils.h"
|
||||||
|
|
||||||
|
|
||||||
#if defined(WEBRTC_POSIX)
|
#if defined(WEBRTC_POSIX)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -37,8 +37,7 @@ class VideoEncoderProxyFactory : public VideoEncoderFactory {
|
||||||
: encoder_(encoder),
|
: encoder_(encoder),
|
||||||
encoder_selector_(encoder_selector),
|
encoder_selector_(encoder_selector),
|
||||||
num_simultaneous_encoder_instances_(0),
|
num_simultaneous_encoder_instances_(0),
|
||||||
max_num_simultaneous_encoder_instances_(0) {
|
max_num_simultaneous_encoder_instances_(0) {}
|
||||||
}
|
|
||||||
|
|
||||||
// Unused by tests.
|
// Unused by tests.
|
||||||
std::vector<SdpVideoFormat> GetSupportedFormats() const override {
|
std::vector<SdpVideoFormat> GetSupportedFormats() const override {
|
||||||
|
|
|
@ -98,8 +98,7 @@ TEST_F(CallOperationEndToEndTest, RendersSingleDelayedFrame) {
|
||||||
|
|
||||||
test::FrameForwarder frame_forwarder;
|
test::FrameForwarder frame_forwarder;
|
||||||
|
|
||||||
SendTask(
|
SendTask(task_queue(), [this, &renderer, &frame_forwarder]() {
|
||||||
task_queue(), [this, &renderer, &frame_forwarder]() {
|
|
||||||
CreateCalls();
|
CreateCalls();
|
||||||
CreateSendTransport(BuiltInNetworkBehaviorConfig(),
|
CreateSendTransport(BuiltInNetworkBehaviorConfig(),
|
||||||
/*observer=*/nullptr);
|
/*observer=*/nullptr);
|
||||||
|
@ -119,8 +118,8 @@ TEST_F(CallOperationEndToEndTest, RendersSingleDelayedFrame) {
|
||||||
std::unique_ptr<test::FrameGeneratorInterface> frame_generator(
|
std::unique_ptr<test::FrameGeneratorInterface> frame_generator(
|
||||||
test::CreateSquareFrameGenerator(kWidth, kHeight, absl::nullopt,
|
test::CreateSquareFrameGenerator(kWidth, kHeight, absl::nullopt,
|
||||||
absl::nullopt));
|
absl::nullopt));
|
||||||
GetVideoSendStream()->SetSource(
|
GetVideoSendStream()->SetSource(&frame_forwarder,
|
||||||
&frame_forwarder, DegradationPreference::MAINTAIN_FRAMERATE);
|
DegradationPreference::MAINTAIN_FRAMERATE);
|
||||||
|
|
||||||
test::FrameGeneratorInterface::VideoFrameData frame_data =
|
test::FrameGeneratorInterface::VideoFrameData frame_data =
|
||||||
frame_generator->NextFrame();
|
frame_generator->NextFrame();
|
||||||
|
@ -159,8 +158,8 @@ TEST_F(CallOperationEndToEndTest, TransmitsFirstFrame) {
|
||||||
std::unique_ptr<test::DirectTransport> sender_transport;
|
std::unique_ptr<test::DirectTransport> sender_transport;
|
||||||
std::unique_ptr<test::DirectTransport> receiver_transport;
|
std::unique_ptr<test::DirectTransport> receiver_transport;
|
||||||
|
|
||||||
SendTask(
|
SendTask(task_queue(), [this, &renderer, &frame_generator,
|
||||||
task_queue(), [this, &renderer, &frame_generator, &frame_forwarder]() {
|
&frame_forwarder]() {
|
||||||
CreateCalls();
|
CreateCalls();
|
||||||
CreateSendTransport(BuiltInNetworkBehaviorConfig(),
|
CreateSendTransport(BuiltInNetworkBehaviorConfig(),
|
||||||
/*observer=*/nullptr);
|
/*observer=*/nullptr);
|
||||||
|
@ -176,10 +175,9 @@ TEST_F(CallOperationEndToEndTest, TransmitsFirstFrame) {
|
||||||
|
|
||||||
frame_generator = test::CreateSquareFrameGenerator(
|
frame_generator = test::CreateSquareFrameGenerator(
|
||||||
test::VideoTestConstants::kDefaultWidth,
|
test::VideoTestConstants::kDefaultWidth,
|
||||||
test::VideoTestConstants::kDefaultHeight, absl::nullopt,
|
test::VideoTestConstants::kDefaultHeight, absl::nullopt, absl::nullopt);
|
||||||
absl::nullopt);
|
GetVideoSendStream()->SetSource(&frame_forwarder,
|
||||||
GetVideoSendStream()->SetSource(
|
DegradationPreference::MAINTAIN_FRAMERATE);
|
||||||
&frame_forwarder, DegradationPreference::MAINTAIN_FRAMERATE);
|
|
||||||
test::FrameGeneratorInterface::VideoFrameData frame_data =
|
test::FrameGeneratorInterface::VideoFrameData frame_data =
|
||||||
frame_generator->NextFrame();
|
frame_generator->NextFrame();
|
||||||
VideoFrame frame = VideoFrame::Builder()
|
VideoFrame frame = VideoFrame::Builder()
|
||||||
|
|
|
@ -94,18 +94,15 @@ void NetworkStateEndToEndTest::VerifyNewVideoSendStreamsRespectNetworkState(
|
||||||
Transport* transport) {
|
Transport* transport) {
|
||||||
test::VideoEncoderProxyFactory encoder_factory(encoder);
|
test::VideoEncoderProxyFactory encoder_factory(encoder);
|
||||||
|
|
||||||
SendTask(task_queue(),
|
SendTask(task_queue(), [this, network_to_bring_up, &encoder_factory,
|
||||||
[this, network_to_bring_up, &encoder_factory, transport]() {
|
transport]() {
|
||||||
CreateSenderCall(Call::Config(send_event_log_.get()));
|
CreateSenderCall(Call::Config(send_event_log_.get()));
|
||||||
sender_call_->SignalChannelNetworkState(network_to_bring_up,
|
sender_call_->SignalChannelNetworkState(network_to_bring_up, kNetworkUp);
|
||||||
kNetworkUp);
|
|
||||||
|
|
||||||
CreateSendConfig(1, 0, 0, transport);
|
CreateSendConfig(1, 0, 0, transport);
|
||||||
GetVideoSendConfig()->encoder_settings.encoder_factory =
|
GetVideoSendConfig()->encoder_settings.encoder_factory = &encoder_factory;
|
||||||
&encoder_factory;
|
|
||||||
CreateVideoStreams();
|
CreateVideoStreams();
|
||||||
CreateFrameGeneratorCapturer(
|
CreateFrameGeneratorCapturer(test::VideoTestConstants::kDefaultFramerate,
|
||||||
test::VideoTestConstants::kDefaultFramerate,
|
|
||||||
test::VideoTestConstants::kDefaultWidth,
|
test::VideoTestConstants::kDefaultWidth,
|
||||||
test::VideoTestConstants::kDefaultHeight);
|
test::VideoTestConstants::kDefaultHeight);
|
||||||
|
|
||||||
|
|
|
@ -95,23 +95,22 @@ TEST_F(SsrcEndToEndTest, UnknownRtpPacketTriggersUndemuxablePacketHandler) {
|
||||||
std::unique_ptr<test::DirectTransport> receive_transport;
|
std::unique_ptr<test::DirectTransport> receive_transport;
|
||||||
std::unique_ptr<PacketInputObserver> input_observer;
|
std::unique_ptr<PacketInputObserver> input_observer;
|
||||||
|
|
||||||
SendTask(
|
SendTask(task_queue(), [this, &send_transport, &receive_transport,
|
||||||
task_queue(),
|
&input_observer]() {
|
||||||
[this, &send_transport, &receive_transport, &input_observer]() {
|
|
||||||
CreateCalls();
|
CreateCalls();
|
||||||
|
|
||||||
send_transport = std::make_unique<test::DirectTransport>(
|
send_transport = std::make_unique<test::DirectTransport>(
|
||||||
task_queue(),
|
task_queue(),
|
||||||
std::make_unique<FakeNetworkPipe>(
|
std::make_unique<FakeNetworkPipe>(
|
||||||
Clock::GetRealTimeClock(), std::make_unique<SimulatedNetwork>(
|
Clock::GetRealTimeClock(),
|
||||||
BuiltInNetworkBehaviorConfig())),
|
std::make_unique<SimulatedNetwork>(BuiltInNetworkBehaviorConfig())),
|
||||||
sender_call_.get(), payload_type_map_, GetRegisteredExtensions(),
|
sender_call_.get(), payload_type_map_, GetRegisteredExtensions(),
|
||||||
GetRegisteredExtensions());
|
GetRegisteredExtensions());
|
||||||
receive_transport = std::make_unique<test::DirectTransport>(
|
receive_transport = std::make_unique<test::DirectTransport>(
|
||||||
task_queue(),
|
task_queue(),
|
||||||
std::make_unique<FakeNetworkPipe>(
|
std::make_unique<FakeNetworkPipe>(
|
||||||
Clock::GetRealTimeClock(), std::make_unique<SimulatedNetwork>(
|
Clock::GetRealTimeClock(),
|
||||||
BuiltInNetworkBehaviorConfig())),
|
std::make_unique<SimulatedNetwork>(BuiltInNetworkBehaviorConfig())),
|
||||||
receiver_call_.get(), payload_type_map_, GetRegisteredExtensions(),
|
receiver_call_.get(), payload_type_map_, GetRegisteredExtensions(),
|
||||||
GetRegisteredExtensions());
|
GetRegisteredExtensions());
|
||||||
input_observer =
|
input_observer =
|
||||||
|
@ -123,8 +122,7 @@ TEST_F(SsrcEndToEndTest, UnknownRtpPacketTriggersUndemuxablePacketHandler) {
|
||||||
CreateMatchingReceiveConfigs(receive_transport.get());
|
CreateMatchingReceiveConfigs(receive_transport.get());
|
||||||
|
|
||||||
CreateVideoStreams();
|
CreateVideoStreams();
|
||||||
CreateFrameGeneratorCapturer(
|
CreateFrameGeneratorCapturer(test::VideoTestConstants::kDefaultFramerate,
|
||||||
test::VideoTestConstants::kDefaultFramerate,
|
|
||||||
test::VideoTestConstants::kDefaultWidth,
|
test::VideoTestConstants::kDefaultWidth,
|
||||||
test::VideoTestConstants::kDefaultHeight);
|
test::VideoTestConstants::kDefaultHeight);
|
||||||
Start();
|
Start();
|
||||||
|
|
|
@ -516,8 +516,7 @@ TEST_F(StatsEndToEndTest, MAYBE_ContentTypeSwitches) {
|
||||||
|
|
||||||
VideoEncoderConfig encoder_config_with_screenshare;
|
VideoEncoderConfig encoder_config_with_screenshare;
|
||||||
|
|
||||||
SendTask(
|
SendTask(task_queue(), [this, &test, &send_config, &recv_config,
|
||||||
task_queue(), [this, &test, &send_config, &recv_config,
|
|
||||||
&encoder_config_with_screenshare]() {
|
&encoder_config_with_screenshare]() {
|
||||||
CreateSenderCall(send_config);
|
CreateSenderCall(send_config);
|
||||||
CreateReceiverCall(recv_config);
|
CreateReceiverCall(recv_config);
|
||||||
|
@ -535,8 +534,7 @@ TEST_F(StatsEndToEndTest, MAYBE_ContentTypeSwitches) {
|
||||||
test::VideoTestConstants::kNackRtpHistoryMs;
|
test::VideoTestConstants::kNackRtpHistoryMs;
|
||||||
video_receive_configs_[0].renderer = &test;
|
video_receive_configs_[0].renderer = &test;
|
||||||
// RTT needed for RemoteNtpTimeEstimator for the receive stream.
|
// RTT needed for RemoteNtpTimeEstimator for the receive stream.
|
||||||
video_receive_configs_[0].rtp.rtcp_xr.receiver_reference_time_report =
|
video_receive_configs_[0].rtp.rtcp_xr.receiver_reference_time_report = true;
|
||||||
true;
|
|
||||||
// Start with realtime video.
|
// Start with realtime video.
|
||||||
GetVideoEncoderConfig()->content_type =
|
GetVideoEncoderConfig()->content_type =
|
||||||
VideoEncoderConfig::ContentType::kRealtimeVideo;
|
VideoEncoderConfig::ContentType::kRealtimeVideo;
|
||||||
|
@ -546,8 +544,7 @@ TEST_F(StatsEndToEndTest, MAYBE_ContentTypeSwitches) {
|
||||||
VideoEncoderConfig::ContentType::kScreen;
|
VideoEncoderConfig::ContentType::kScreen;
|
||||||
|
|
||||||
CreateVideoStreams();
|
CreateVideoStreams();
|
||||||
CreateFrameGeneratorCapturer(
|
CreateFrameGeneratorCapturer(test::VideoTestConstants::kDefaultFramerate,
|
||||||
test::VideoTestConstants::kDefaultFramerate,
|
|
||||||
test::VideoTestConstants::kDefaultWidth,
|
test::VideoTestConstants::kDefaultWidth,
|
||||||
test::VideoTestConstants::kDefaultHeight);
|
test::VideoTestConstants::kDefaultHeight);
|
||||||
Start();
|
Start();
|
||||||
|
|
|
@ -255,14 +255,12 @@ void PictureIdTest::SetupEncoder(VideoEncoderFactory* encoder_factory,
|
||||||
observer_.reset(
|
observer_.reset(
|
||||||
new PictureIdObserver(PayloadStringToCodecType(payload_name)));
|
new PictureIdObserver(PayloadStringToCodecType(payload_name)));
|
||||||
|
|
||||||
SendTask(
|
SendTask(task_queue(), [this, encoder_factory, payload_name]() {
|
||||||
task_queue(), [this, encoder_factory, payload_name]() {
|
|
||||||
CreateCalls();
|
CreateCalls();
|
||||||
CreateSendTransport(BuiltInNetworkBehaviorConfig(), observer_.get());
|
CreateSendTransport(BuiltInNetworkBehaviorConfig(), observer_.get());
|
||||||
CreateSendConfig(test::VideoTestConstants::kNumSimulcastStreams, 0, 0,
|
CreateSendConfig(test::VideoTestConstants::kNumSimulcastStreams, 0, 0,
|
||||||
send_transport_.get());
|
send_transport_.get());
|
||||||
GetVideoSendConfig()->encoder_settings.encoder_factory =
|
GetVideoSendConfig()->encoder_settings.encoder_factory = encoder_factory;
|
||||||
encoder_factory;
|
|
||||||
GetVideoSendConfig()->rtp.payload_name = payload_name;
|
GetVideoSendConfig()->rtp.payload_name = payload_name;
|
||||||
GetVideoEncoderConfig()->codec_type =
|
GetVideoEncoderConfig()->codec_type =
|
||||||
PayloadStringToCodecType(payload_name);
|
PayloadStringToCodecType(payload_name);
|
||||||
|
|
|
@ -743,8 +743,7 @@ VideoSendStream::Stats SendStatisticsProxy::GetStats() {
|
||||||
PurgeOldStats();
|
PurgeOldStats();
|
||||||
stats_.input_frame_rate =
|
stats_.input_frame_rate =
|
||||||
uma_container_->input_frame_rate_tracker_.ComputeRate();
|
uma_container_->input_frame_rate_tracker_.ComputeRate();
|
||||||
stats_.frames =
|
stats_.frames = uma_container_->input_frame_rate_tracker_.TotalSampleCount();
|
||||||
uma_container_->input_frame_rate_tracker_.TotalSampleCount();
|
|
||||||
stats_.content_type =
|
stats_.content_type =
|
||||||
content_type_ == VideoEncoderConfig::ContentType::kRealtimeVideo
|
content_type_ == VideoEncoderConfig::ContentType::kRealtimeVideo
|
||||||
? VideoContentType::UNSPECIFIED
|
? VideoContentType::UNSPECIFIED
|
||||||
|
|
|
@ -1644,11 +1644,10 @@ TEST_F(VideoSendStreamTest, ChangingNetworkRoute) {
|
||||||
new_route.remote = rtc::RouteEndpoint::CreateWithNetworkId(20);
|
new_route.remote = rtc::RouteEndpoint::CreateWithNetworkId(20);
|
||||||
BitrateConstraints bitrate_config;
|
BitrateConstraints bitrate_config;
|
||||||
|
|
||||||
SendTask(task_queue_,
|
SendTask(task_queue_, [this, &new_route, &bitrate_config]() {
|
||||||
[this, &new_route, &bitrate_config]() {
|
|
||||||
RTC_DCHECK_RUN_ON(&task_queue_thread_);
|
RTC_DCHECK_RUN_ON(&task_queue_thread_);
|
||||||
call_->GetTransportControllerSend()->OnNetworkRouteChanged(
|
call_->GetTransportControllerSend()->OnNetworkRouteChanged("transport",
|
||||||
"transport", new_route);
|
new_route);
|
||||||
bitrate_config.start_bitrate_bps = kStartBitrateBps;
|
bitrate_config.start_bitrate_bps = kStartBitrateBps;
|
||||||
call_->GetTransportControllerSend()->SetSdpBitrateParameters(
|
call_->GetTransportControllerSend()->SetSdpBitrateParameters(
|
||||||
bitrate_config);
|
bitrate_config);
|
||||||
|
@ -1657,8 +1656,7 @@ TEST_F(VideoSendStreamTest, ChangingNetworkRoute) {
|
||||||
EXPECT_TRUE(Wait())
|
EXPECT_TRUE(Wait())
|
||||||
<< "Timed out while waiting for start bitrate to be exceeded.";
|
<< "Timed out while waiting for start bitrate to be exceeded.";
|
||||||
|
|
||||||
SendTask(
|
SendTask(task_queue_, [this, &new_route, &bitrate_config]() {
|
||||||
task_queue_, [this, &new_route, &bitrate_config]() {
|
|
||||||
RTC_DCHECK_RUN_ON(&task_queue_thread_);
|
RTC_DCHECK_RUN_ON(&task_queue_thread_);
|
||||||
bitrate_config.start_bitrate_bps = -1;
|
bitrate_config.start_bitrate_bps = -1;
|
||||||
bitrate_config.max_bitrate_bps = kNewMaxBitrateBps;
|
bitrate_config.max_bitrate_bps = kNewMaxBitrateBps;
|
||||||
|
@ -1669,8 +1667,8 @@ TEST_F(VideoSendStreamTest, ChangingNetworkRoute) {
|
||||||
// that id.
|
// that id.
|
||||||
new_route.local = rtc::RouteEndpoint::CreateWithNetworkId(
|
new_route.local = rtc::RouteEndpoint::CreateWithNetworkId(
|
||||||
new_route.local.network_id() + 1);
|
new_route.local.network_id() + 1);
|
||||||
call_->GetTransportControllerSend()->OnNetworkRouteChanged(
|
call_->GetTransportControllerSend()->OnNetworkRouteChanged("transport",
|
||||||
"transport", new_route);
|
new_route);
|
||||||
EXPECT_GE(call_->GetStats().send_bandwidth_bps, kStartBitrateBps);
|
EXPECT_GE(call_->GetStats().send_bandwidth_bps, kStartBitrateBps);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -4013,16 +4011,15 @@ TEST_F(VideoSendStreamTest, SwitchesToScreenshareAndBack) {
|
||||||
auto reset_fun = [this](const VideoSendStream::Config& send_stream_config,
|
auto reset_fun = [this](const VideoSendStream::Config& send_stream_config,
|
||||||
const VideoEncoderConfig& encoder_config,
|
const VideoEncoderConfig& encoder_config,
|
||||||
test::BaseTest* test) {
|
test::BaseTest* test) {
|
||||||
SendTask(task_queue(),
|
SendTask(task_queue(), [this, &send_stream_config, &encoder_config,
|
||||||
[this, &send_stream_config, &encoder_config, &test]() {
|
&test]() {
|
||||||
Stop();
|
Stop();
|
||||||
DestroyVideoSendStreams();
|
DestroyVideoSendStreams();
|
||||||
SetVideoSendConfig(send_stream_config);
|
SetVideoSendConfig(send_stream_config);
|
||||||
SetVideoEncoderConfig(encoder_config);
|
SetVideoEncoderConfig(encoder_config);
|
||||||
CreateVideoSendStreams();
|
CreateVideoSendStreams();
|
||||||
SetVideoDegradation(DegradationPreference::MAINTAIN_RESOLUTION);
|
SetVideoDegradation(DegradationPreference::MAINTAIN_RESOLUTION);
|
||||||
test->OnVideoStreamsCreated(GetVideoSendStream(),
|
test->OnVideoStreamsCreated(GetVideoSendStream(), video_receive_streams_);
|
||||||
video_receive_streams_);
|
|
||||||
Start();
|
Start();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -785,8 +785,7 @@ void VideoStreamEncoder::Stop() {
|
||||||
|
|
||||||
rtc::Event shutdown_event;
|
rtc::Event shutdown_event;
|
||||||
absl::Cleanup shutdown = [&shutdown_event] { shutdown_event.Set(); };
|
absl::Cleanup shutdown = [&shutdown_event] { shutdown_event.Set(); };
|
||||||
encoder_queue_.PostTask(
|
encoder_queue_.PostTask([this, shutdown = std::move(shutdown)] {
|
||||||
[this, shutdown = std::move(shutdown)] {
|
|
||||||
RTC_DCHECK_RUN_ON(&encoder_queue_);
|
RTC_DCHECK_RUN_ON(&encoder_queue_);
|
||||||
if (resource_adaptation_processor_) {
|
if (resource_adaptation_processor_) {
|
||||||
stream_resource_manager_.StopManagedResources();
|
stream_resource_manager_.StopManagedResources();
|
||||||
|
@ -915,8 +914,8 @@ void VideoStreamEncoder::ConfigureEncoder(VideoEncoderConfig config,
|
||||||
size_t max_data_payload_length,
|
size_t max_data_payload_length,
|
||||||
SetParametersCallback callback) {
|
SetParametersCallback callback) {
|
||||||
RTC_DCHECK_RUN_ON(worker_queue_);
|
RTC_DCHECK_RUN_ON(worker_queue_);
|
||||||
encoder_queue_.PostTask(
|
encoder_queue_.PostTask([this, config = std::move(config),
|
||||||
[this, config = std::move(config), max_data_payload_length,
|
max_data_payload_length,
|
||||||
callback = std::move(callback)]() mutable {
|
callback = std::move(callback)]() mutable {
|
||||||
RTC_DCHECK_RUN_ON(&encoder_queue_);
|
RTC_DCHECK_RUN_ON(&encoder_queue_);
|
||||||
RTC_DCHECK(sink_);
|
RTC_DCHECK(sink_);
|
||||||
|
|
Loading…
Reference in a new issue