mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 05:40:42 +01:00
Format ^(api|call|common_audio|examples|media|net|p2p|pc)/
half of the remaining folders git ls-files | grep -e "\(\.h\|\.cc\)$" | grep -E "^(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: I8b2cac13f4587d3ce9b2fccc7362967283f57ea2 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/302062 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#39977}
This commit is contained in:
parent
32b64e895c
commit
bceec84aee
36 changed files with 112 additions and 95 deletions
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
#include "api/audio_codecs/audio_decoder.h"
|
#include "api/audio_codecs/audio_decoder.h"
|
||||||
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
|
|
@ -32,8 +32,9 @@ AudioEncoderMultiChannelOpusConfig::AudioEncoderMultiChannelOpusConfig(
|
||||||
const AudioEncoderMultiChannelOpusConfig&) = default;
|
const AudioEncoderMultiChannelOpusConfig&) = default;
|
||||||
AudioEncoderMultiChannelOpusConfig::~AudioEncoderMultiChannelOpusConfig() =
|
AudioEncoderMultiChannelOpusConfig::~AudioEncoderMultiChannelOpusConfig() =
|
||||||
default;
|
default;
|
||||||
AudioEncoderMultiChannelOpusConfig& AudioEncoderMultiChannelOpusConfig::
|
AudioEncoderMultiChannelOpusConfig&
|
||||||
operator=(const AudioEncoderMultiChannelOpusConfig&) = default;
|
AudioEncoderMultiChannelOpusConfig::operator=(
|
||||||
|
const AudioEncoderMultiChannelOpusConfig&) = default;
|
||||||
|
|
||||||
bool AudioEncoderMultiChannelOpusConfig::IsOk() const {
|
bool AudioEncoderMultiChannelOpusConfig::IsOk() const {
|
||||||
if (frame_size_ms <= 0 || frame_size_ms % 10 != 0)
|
if (frame_size_ms <= 0 || frame_size_ms % 10 != 0)
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "api/media_stream_interface.h"
|
#include "api/media_stream_interface.h"
|
||||||
|
|
||||||
#include "api/media_types.h"
|
#include "api/media_types.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "api/neteq/default_neteq_controller_factory.h"
|
#include "api/neteq/default_neteq_controller_factory.h"
|
||||||
|
|
||||||
#include "modules/audio_coding/neteq/decision_logic.h"
|
#include "modules/audio_coding/neteq/decision_logic.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
|
|
@ -163,7 +163,9 @@ class RTC_EXPORT RTCStats {
|
||||||
return std::make_unique<this_class>(*this); \
|
return std::make_unique<this_class>(*this); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
const char* this_class::type() const { return this_class::kType; } \
|
const char* this_class::type() const { \
|
||||||
|
return this_class::kType; \
|
||||||
|
} \
|
||||||
\
|
\
|
||||||
std::vector<const webrtc::RTCStatsMemberInterface*> \
|
std::vector<const webrtc::RTCStatsMemberInterface*> \
|
||||||
this_class::MembersOfThisObjectAndAncestors( \
|
this_class::MembersOfThisObjectAndAncestors( \
|
||||||
|
@ -194,7 +196,9 @@ class RTC_EXPORT RTCStats {
|
||||||
return std::make_unique<this_class>(*this); \
|
return std::make_unique<this_class>(*this); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
const char* this_class::type() const { return this_class::kType; } \
|
const char* this_class::type() const { \
|
||||||
|
return this_class::kType; \
|
||||||
|
} \
|
||||||
\
|
\
|
||||||
std::vector<const webrtc::RTCStatsMemberInterface*> \
|
std::vector<const webrtc::RTCStatsMemberInterface*> \
|
||||||
this_class::MembersOfThisObjectAndAncestors( \
|
this_class::MembersOfThisObjectAndAncestors( \
|
||||||
|
|
|
@ -8,9 +8,10 @@
|
||||||
* 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 "api/units/timestamp.h"
|
||||||
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
#include "api/units/timestamp.h"
|
|
||||||
#include "test/gtest.h"
|
#include "test/gtest.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include "api/video_codecs/video_encoder.h"
|
#include "api/video_codecs/video_encoder.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#include "rtc_base/checks.h"
|
#include "rtc_base/checks.h"
|
||||||
|
|
|
@ -8,10 +8,11 @@
|
||||||
* 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 "api/voip/voip_engine_factory.h"
|
||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "api/task_queue/default_task_queue_factory.h"
|
#include "api/task_queue/default_task_queue_factory.h"
|
||||||
#include "api/voip/voip_engine_factory.h"
|
|
||||||
#include "modules/audio_device/include/mock_audio_device.h"
|
#include "modules/audio_device/include/mock_audio_device.h"
|
||||||
#include "modules/audio_processing/include/mock_audio_processing.h"
|
#include "modules/audio_processing/include/mock_audio_processing.h"
|
||||||
#include "test/gtest.h"
|
#include "test/gtest.h"
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
#define CALL_ADAPTATION_TEST_MOCK_RESOURCE_LISTENER_H_
|
#define CALL_ADAPTATION_TEST_MOCK_RESOURCE_LISTENER_H_
|
||||||
|
|
||||||
#include "api/adaptation/resource.h"
|
#include "api/adaptation/resource.h"
|
||||||
|
|
||||||
#include "test/gmock.h"
|
#include "test/gmock.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
|
@ -93,9 +93,7 @@ class FlexfecReceiveStreamTest : public ::testing::Test {
|
||||||
receive_stream_->RegisterWithTransport(&rtp_stream_receiver_controller_);
|
receive_stream_->RegisterWithTransport(&rtp_stream_receiver_controller_);
|
||||||
}
|
}
|
||||||
|
|
||||||
~FlexfecReceiveStreamTest() {
|
~FlexfecReceiveStreamTest() { receive_stream_->UnregisterFromTransport(); }
|
||||||
receive_stream_->UnregisterFromTransport();
|
|
||||||
}
|
|
||||||
|
|
||||||
rtc::AutoThread main_thread_;
|
rtc::AutoThread main_thread_;
|
||||||
MockTransport rtcp_send_transport_;
|
MockTransport rtcp_send_transport_;
|
||||||
|
|
|
@ -711,7 +711,6 @@ TEST_F(RtpDemuxerTest, AssociatingByRsidAndBySsrcCannotTriggerDoubleCall) {
|
||||||
EXPECT_TRUE(demuxer_.OnRtpPacket(*packet));
|
EXPECT_TRUE(demuxer_.OnRtpPacket(*packet));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// If one sink is associated with SSRC x, and another sink with RSID y, then if
|
// If one sink is associated with SSRC x, and another sink with RSID y, then if
|
||||||
// we receive a packet with both SSRC x and RSID y, route that to only the sink
|
// we receive a packet with both SSRC x and RSID y, route that to only the sink
|
||||||
// for RSID y since we believe RSID tags to be more trustworthy than signaled
|
// for RSID y since we believe RSID tags to be more trustworthy than signaled
|
||||||
|
|
|
@ -923,14 +923,14 @@ int RtpVideoSender::ProtectionRequest(const FecProtectionParams* delta_params,
|
||||||
*sent_nack_rate_bps = 0;
|
*sent_nack_rate_bps = 0;
|
||||||
*sent_fec_rate_bps = 0;
|
*sent_fec_rate_bps = 0;
|
||||||
for (const RtpStreamSender& stream : rtp_streams_) {
|
for (const RtpStreamSender& stream : rtp_streams_) {
|
||||||
stream.rtp_rtcp->SetFecProtectionParams(*delta_params, *key_params);
|
stream.rtp_rtcp->SetFecProtectionParams(*delta_params, *key_params);
|
||||||
|
|
||||||
auto send_bitrate = stream.rtp_rtcp->GetSendRates();
|
auto send_bitrate = stream.rtp_rtcp->GetSendRates();
|
||||||
*sent_video_rate_bps += send_bitrate[RtpPacketMediaType::kVideo].bps();
|
*sent_video_rate_bps += send_bitrate[RtpPacketMediaType::kVideo].bps();
|
||||||
*sent_fec_rate_bps +=
|
*sent_fec_rate_bps +=
|
||||||
send_bitrate[RtpPacketMediaType::kForwardErrorCorrection].bps();
|
send_bitrate[RtpPacketMediaType::kForwardErrorCorrection].bps();
|
||||||
*sent_nack_rate_bps +=
|
*sent_nack_rate_bps +=
|
||||||
send_bitrate[RtpPacketMediaType::kRetransmission].bps();
|
send_bitrate[RtpPacketMediaType::kRetransmission].bps();
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,10 +157,10 @@ class SincResampler {
|
||||||
// Data from the source is copied into this buffer for each processing pass.
|
// Data from the source is copied into this buffer for each processing pass.
|
||||||
std::unique_ptr<float[], AlignedFreeDeleter> input_buffer_;
|
std::unique_ptr<float[], AlignedFreeDeleter> input_buffer_;
|
||||||
|
|
||||||
// Stores the runtime selection of which Convolve function to use.
|
// Stores the runtime selection of which Convolve function to use.
|
||||||
// TODO(ajm): Move to using a global static which must only be initialized
|
// TODO(ajm): Move to using a global static which must only be initialized
|
||||||
// once by the user. We're not doing this initially, because we don't have
|
// once by the user. We're not doing this initially, because we don't have
|
||||||
// e.g. a LazyInstance helper in webrtc.
|
// e.g. a LazyInstance helper in webrtc.
|
||||||
typedef float (*ConvolveProc)(const float*,
|
typedef float (*ConvolveProc)(const float*,
|
||||||
const float*,
|
const float*,
|
||||||
const float*,
|
const float*,
|
||||||
|
|
|
@ -286,11 +286,11 @@ Appendix :
|
||||||
w[] and ip[] are compatible with all routines.
|
w[] and ip[] are compatible with all routines.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "common_audio/third_party/ooura/fft_size_256/fft4g.h"
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#include "common_audio/third_party/ooura/fft_size_256/fft4g.h"
|
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
#ifndef COMMON_AUDIO_THIRD_PARTY_OOURA_FFT_SIZE_256_FFT4G_H_
|
#ifndef COMMON_AUDIO_THIRD_PARTY_OOURA_FFT_SIZE_256_FFT4G_H_
|
||||||
#define COMMON_AUDIO_THIRD_PARTY_OOURA_FFT_SIZE_256_FFT4G_H_
|
#define COMMON_AUDIO_THIRD_PARTY_OOURA_FFT_SIZE_256_FFT4G_H_
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
// Refer to fft4g.c for documentation.
|
// Refer to fft4g.c for documentation.
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#include "rtc_base/checks.h"
|
#include "rtc_base/checks.h"
|
||||||
|
|
|
@ -10,9 +10,8 @@
|
||||||
|
|
||||||
#include "examples/androidnativeapi/jni/android_call_client.h"
|
#include "examples/androidnativeapi/jni/android_call_client.h"
|
||||||
|
|
||||||
#include <utility>
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "api/peer_connection_interface.h"
|
#include "api/peer_connection_interface.h"
|
||||||
#include "api/rtc_event_log/rtc_event_log_factory.h"
|
#include "api/rtc_event_log/rtc_event_log_factory.h"
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
|
@ -303,8 +303,7 @@ inline bool RemoveStreamBySsrc(StreamParamsVec* streams, uint32_t ssrc) {
|
||||||
return RemoveStream(
|
return RemoveStream(
|
||||||
streams, [&ssrc](const StreamParams& sp) { return sp.has_ssrc(ssrc); });
|
streams, [&ssrc](const StreamParams& sp) { return sp.has_ssrc(ssrc); });
|
||||||
}
|
}
|
||||||
inline bool RemoveStreamByIds(StreamParamsVec* streams,
|
inline bool RemoveStreamByIds(StreamParamsVec* streams, const std::string& id) {
|
||||||
const std::string& id) {
|
|
||||||
return RemoveStream(streams,
|
return RemoveStream(streams,
|
||||||
[&id](const StreamParams& sp) { return sp.id == id; });
|
[&id](const StreamParams& sp) { return sp.id == id; });
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,8 +40,8 @@ struct Fraction {
|
||||||
// Determines number of output pixels if both width and height of an input of
|
// Determines number of output pixels if both width and height of an input of
|
||||||
// `input_pixels` pixels is scaled with the fraction numerator / denominator.
|
// `input_pixels` pixels is scaled with the fraction numerator / denominator.
|
||||||
int scale_pixel_count(int input_pixels) {
|
int scale_pixel_count(int input_pixels) {
|
||||||
return (numerator * numerator * static_cast<int64_t>(input_pixels))
|
return (numerator * numerator * static_cast<int64_t>(input_pixels)) /
|
||||||
/ (denominator * denominator);
|
(denominator * denominator);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -202,8 +202,7 @@ int FakeWebRtcVideoEncoder::GetNumEncodedFrames() {
|
||||||
|
|
||||||
// Video encoder factory.
|
// Video encoder factory.
|
||||||
FakeWebRtcVideoEncoderFactory::FakeWebRtcVideoEncoderFactory()
|
FakeWebRtcVideoEncoderFactory::FakeWebRtcVideoEncoderFactory()
|
||||||
: num_created_encoders_(0),
|
: num_created_encoders_(0), vp8_factory_mode_(false) {}
|
||||||
vp8_factory_mode_(false) {}
|
|
||||||
|
|
||||||
std::vector<webrtc::SdpVideoFormat>
|
std::vector<webrtc::SdpVideoFormat>
|
||||||
FakeWebRtcVideoEncoderFactory::GetSupportedFormats() const {
|
FakeWebRtcVideoEncoderFactory::GetSupportedFormats() const {
|
||||||
|
|
|
@ -89,10 +89,10 @@ std::string DataChunk::ToString() const {
|
||||||
rtc::StringBuilder sb;
|
rtc::StringBuilder sb;
|
||||||
sb << "DATA, type=" << (options().is_unordered ? "unordered" : "ordered")
|
sb << "DATA, type=" << (options().is_unordered ? "unordered" : "ordered")
|
||||||
<< "::"
|
<< "::"
|
||||||
<< (*options().is_beginning && *options().is_end
|
<< (*options().is_beginning && *options().is_end ? "complete"
|
||||||
? "complete"
|
: *options().is_beginning ? "first"
|
||||||
: *options().is_beginning ? "first"
|
: *options().is_end ? "last"
|
||||||
: *options().is_end ? "last" : "middle")
|
: "middle")
|
||||||
<< ", tsn=" << *tsn() << ", sid=" << *stream_id() << ", ssn=" << *ssn()
|
<< ", tsn=" << *tsn() << ", sid=" << *stream_id() << ", ssn=" << *ssn()
|
||||||
<< ", ppid=" << *ppid() << ", length=" << payload().size();
|
<< ", ppid=" << *ppid() << ", length=" << payload().size();
|
||||||
return sb.Release();
|
return sb.Release();
|
||||||
|
|
|
@ -92,10 +92,10 @@ std::string IDataChunk::ToString() const {
|
||||||
rtc::StringBuilder sb;
|
rtc::StringBuilder sb;
|
||||||
sb << "I-DATA, type=" << (options().is_unordered ? "unordered" : "ordered")
|
sb << "I-DATA, type=" << (options().is_unordered ? "unordered" : "ordered")
|
||||||
<< "::"
|
<< "::"
|
||||||
<< (*options().is_beginning && *options().is_end
|
<< (*options().is_beginning && *options().is_end ? "complete"
|
||||||
? "complete"
|
: *options().is_beginning ? "first"
|
||||||
: *options().is_beginning ? "first"
|
: *options().is_end ? "last"
|
||||||
: *options().is_end ? "last" : "middle")
|
: "middle")
|
||||||
<< ", tsn=" << *tsn() << ", stream_id=" << *stream_id()
|
<< ", tsn=" << *tsn() << ", stream_id=" << *stream_id()
|
||||||
<< ", message_id=" << *message_id();
|
<< ", message_id=" << *message_id();
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,6 @@ rtc::AsyncResolverInterface* BasicAsyncResolverFactory::Create() {
|
||||||
return new rtc::AsyncResolver();
|
return new rtc::AsyncResolver();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::unique_ptr<webrtc::AsyncDnsResolverInterface>
|
std::unique_ptr<webrtc::AsyncDnsResolverInterface>
|
||||||
WrappingAsyncDnsResolverFactory::Create() {
|
WrappingAsyncDnsResolverFactory::Create() {
|
||||||
return std::make_unique<WrappingAsyncDnsResolver>(wrapped_factory_->Create());
|
return std::make_unique<WrappingAsyncDnsResolver>(wrapped_factory_->Create());
|
||||||
|
|
|
@ -36,16 +36,16 @@ struct ConnectionInfo {
|
||||||
ConnectionInfo(const ConnectionInfo&);
|
ConnectionInfo(const ConnectionInfo&);
|
||||||
~ConnectionInfo();
|
~ConnectionInfo();
|
||||||
|
|
||||||
bool best_connection; // Is this the best connection we have?
|
bool best_connection; // Is this the best connection we have?
|
||||||
bool writable; // Has this connection received a STUN response?
|
bool writable; // Has this connection received a STUN response?
|
||||||
bool receiving; // Has this connection received anything?
|
bool receiving; // Has this connection received anything?
|
||||||
bool timeout; // Has this connection timed out?
|
bool timeout; // Has this connection timed out?
|
||||||
size_t rtt; // The STUN RTT for this connection.
|
size_t rtt; // The STUN RTT for this connection.
|
||||||
size_t sent_discarded_bytes; // Number of outgoing bytes discarded due to
|
size_t sent_discarded_bytes; // Number of outgoing bytes discarded due to
|
||||||
// socket errors.
|
// socket errors.
|
||||||
size_t sent_total_bytes; // Total bytes sent on this connection. Does not
|
size_t sent_total_bytes; // Total bytes sent on this connection. Does not
|
||||||
// include discarded bytes.
|
// include discarded bytes.
|
||||||
size_t sent_bytes_second; // Bps over the last measurement interval.
|
size_t sent_bytes_second; // Bps over the last measurement interval.
|
||||||
size_t sent_discarded_packets; // Number of outgoing packets discarded due to
|
size_t sent_discarded_packets; // Number of outgoing packets discarded due to
|
||||||
// socket errors.
|
// socket errors.
|
||||||
size_t sent_total_packets; // Number of total outgoing packets attempted for
|
size_t sent_total_packets; // Number of total outgoing packets attempted for
|
||||||
|
|
|
@ -35,7 +35,7 @@ const int STUN_INITIAL_RTO = 250; // milliseconds
|
||||||
// The timeout doubles each retransmission, up to this many times
|
// The timeout doubles each retransmission, up to this many times
|
||||||
// RFC 5389 says SHOULD retransmit 7 times.
|
// RFC 5389 says SHOULD retransmit 7 times.
|
||||||
// This has been 8 for years (not sure why).
|
// This has been 8 for years (not sure why).
|
||||||
const int STUN_MAX_RETRANSMISSIONS = 8; // Total sends: 9
|
const int STUN_MAX_RETRANSMISSIONS = 8; // Total sends: 9
|
||||||
|
|
||||||
// We also cap the doubling, even though the standard doesn't say to.
|
// We also cap the doubling, even though the standard doesn't say to.
|
||||||
// This has been 1.6 seconds for years, but for networks that
|
// This has been 1.6 seconds for years, but for networks that
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "p2p/base/transport_description.h"
|
#include "p2p/base/transport_description.h"
|
||||||
|
|
||||||
#include "test/gtest.h"
|
#include "test/gtest.h"
|
||||||
|
|
||||||
using webrtc::RTCErrorType;
|
using webrtc::RTCErrorType;
|
||||||
|
|
|
@ -2380,5 +2380,4 @@ TEST_F(VideoChannelDoubleThreadTest, SocketOptionsMergedOnSetTransport) {
|
||||||
Base::SocketOptionsMergedOnSetTransport();
|
Base::SocketOptionsMergedOnSetTransport();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// TODO(pthatcher): TestSetReceiver?
|
// TODO(pthatcher): TestSetReceiver?
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
|
@ -634,20 +634,18 @@ RTCError PeerConnection::Initialize(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Network thread initialization.
|
// Network thread initialization.
|
||||||
transport_controller_copy_ =
|
transport_controller_copy_ = network_thread()->BlockingCall([&] {
|
||||||
network_thread()->BlockingCall([&] {
|
RTC_DCHECK_RUN_ON(network_thread());
|
||||||
RTC_DCHECK_RUN_ON(network_thread());
|
network_thread_safety_ = PendingTaskSafetyFlag::Create();
|
||||||
network_thread_safety_ = PendingTaskSafetyFlag::Create();
|
InitializePortAllocatorResult pa_result =
|
||||||
InitializePortAllocatorResult pa_result = InitializePortAllocator_n(
|
InitializePortAllocator_n(stun_servers, turn_servers, configuration);
|
||||||
stun_servers, turn_servers, configuration);
|
// Send information about IPv4/IPv6 status.
|
||||||
// Send information about IPv4/IPv6 status.
|
PeerConnectionAddressFamilyCounter address_family =
|
||||||
PeerConnectionAddressFamilyCounter address_family =
|
pa_result.enable_ipv6 ? kPeerConnection_IPv6 : kPeerConnection_IPv4;
|
||||||
pa_result.enable_ipv6 ? kPeerConnection_IPv6 : kPeerConnection_IPv4;
|
RTC_HISTOGRAM_ENUMERATION("WebRTC.PeerConnection.IPMetrics", address_family,
|
||||||
RTC_HISTOGRAM_ENUMERATION("WebRTC.PeerConnection.IPMetrics",
|
kPeerConnectionAddressFamilyCounter_Max);
|
||||||
address_family,
|
return InitializeTransportController_n(configuration, dependencies);
|
||||||
kPeerConnectionAddressFamilyCounter_Max);
|
});
|
||||||
return InitializeTransportController_n(configuration, dependencies);
|
|
||||||
});
|
|
||||||
|
|
||||||
configuration_ = configuration;
|
configuration_ = configuration;
|
||||||
|
|
||||||
|
|
|
@ -265,9 +265,7 @@ class PeerConnection : public PeerConnectionInternal,
|
||||||
}
|
}
|
||||||
rtc::Thread* worker_thread() const final { return context_->worker_thread(); }
|
rtc::Thread* worker_thread() const final { return context_->worker_thread(); }
|
||||||
|
|
||||||
std::string session_id() const override {
|
std::string session_id() const override { return session_id_; }
|
||||||
return session_id_;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool initial_offerer() const override {
|
bool initial_offerer() const override {
|
||||||
RTC_DCHECK_RUN_ON(signaling_thread());
|
RTC_DCHECK_RUN_ON(signaling_thread());
|
||||||
|
|
52
pc/proxy.h
52
pc/proxy.h
|
@ -200,8 +200,12 @@ class ConstMethodCall {
|
||||||
typedef class_name##Interface C; \
|
typedef class_name##Interface C; \
|
||||||
\
|
\
|
||||||
public: \
|
public: \
|
||||||
const INTERNAL_CLASS* internal() const { return c(); } \
|
const INTERNAL_CLASS* internal() const { \
|
||||||
INTERNAL_CLASS* internal() { return c(); }
|
return c(); \
|
||||||
|
} \
|
||||||
|
INTERNAL_CLASS* internal() { \
|
||||||
|
return c(); \
|
||||||
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
// clang-format would put the semicolon alone,
|
// clang-format would put the semicolon alone,
|
||||||
|
@ -245,9 +249,15 @@ class ConstMethodCall {
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
private: \
|
private: \
|
||||||
const INTERNAL_CLASS* c() const { return c_.get(); } \
|
const INTERNAL_CLASS* c() const { \
|
||||||
INTERNAL_CLASS* c() { return c_.get(); } \
|
return c_.get(); \
|
||||||
void DestroyInternal() { c_ = nullptr; } \
|
} \
|
||||||
|
INTERNAL_CLASS* c() { \
|
||||||
|
return c_.get(); \
|
||||||
|
} \
|
||||||
|
void DestroyInternal() { \
|
||||||
|
c_ = nullptr; \
|
||||||
|
} \
|
||||||
rtc::scoped_refptr<INTERNAL_CLASS> c_;
|
rtc::scoped_refptr<INTERNAL_CLASS> c_;
|
||||||
|
|
||||||
// Note: This doesn't use a unique_ptr, because it intends to handle a corner
|
// Note: This doesn't use a unique_ptr, because it intends to handle a corner
|
||||||
|
@ -264,9 +274,15 @@ class ConstMethodCall {
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
private: \
|
private: \
|
||||||
const INTERNAL_CLASS* c() const { return c_; } \
|
const INTERNAL_CLASS* c() const { \
|
||||||
INTERNAL_CLASS* c() { return c_; } \
|
return c_; \
|
||||||
void DestroyInternal() { delete c_; } \
|
} \
|
||||||
|
INTERNAL_CLASS* c() { \
|
||||||
|
return c_; \
|
||||||
|
} \
|
||||||
|
void DestroyInternal() { \
|
||||||
|
delete c_; \
|
||||||
|
} \
|
||||||
INTERNAL_CLASS* c_;
|
INTERNAL_CLASS* c_;
|
||||||
|
|
||||||
#define BEGIN_PRIMARY_PROXY_MAP(class_name) \
|
#define BEGIN_PRIMARY_PROXY_MAP(class_name) \
|
||||||
|
@ -292,16 +308,20 @@ class ConstMethodCall {
|
||||||
primary_thread, secondary_thread, std::move(c)); \
|
primary_thread, secondary_thread, std::move(c)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PROXY_PRIMARY_THREAD_DESTRUCTOR() \
|
#define PROXY_PRIMARY_THREAD_DESTRUCTOR() \
|
||||||
private: \
|
private: \
|
||||||
rtc::Thread* destructor_thread() const { return primary_thread_; } \
|
rtc::Thread* destructor_thread() const { \
|
||||||
\
|
return primary_thread_; \
|
||||||
|
} \
|
||||||
|
\
|
||||||
public: // NOLINTNEXTLINE
|
public: // NOLINTNEXTLINE
|
||||||
|
|
||||||
#define PROXY_SECONDARY_THREAD_DESTRUCTOR() \
|
#define PROXY_SECONDARY_THREAD_DESTRUCTOR() \
|
||||||
private: \
|
private: \
|
||||||
rtc::Thread* destructor_thread() const { return secondary_thread_; } \
|
rtc::Thread* destructor_thread() const { \
|
||||||
\
|
return secondary_thread_; \
|
||||||
|
} \
|
||||||
|
\
|
||||||
public: // NOLINTNEXTLINE
|
public: // NOLINTNEXTLINE
|
||||||
|
|
||||||
#if defined(RTC_DISABLE_PROXY_TRACE_EVENTS)
|
#if defined(RTC_DISABLE_PROXY_TRACE_EVENTS)
|
||||||
|
|
|
@ -873,8 +873,7 @@ ProduceRemoteInboundRtpStreamStatsFromReportBlockData(
|
||||||
}
|
}
|
||||||
remote_inbound->total_round_trip_time =
|
remote_inbound->total_round_trip_time =
|
||||||
report_block_data.sum_rtts().seconds<double>();
|
report_block_data.sum_rtts().seconds<double>();
|
||||||
remote_inbound->round_trip_time_measurements =
|
remote_inbound->round_trip_time_measurements = report_block_data.num_rtts();
|
||||||
report_block_data.num_rtts();
|
|
||||||
|
|
||||||
std::string local_id = RTCOutboundRtpStreamStatsIDFromSSRC(
|
std::string local_id = RTCOutboundRtpStreamStatsIDFromSSRC(
|
||||||
transport_id, media_type, report_block.source_ssrc);
|
transport_id, media_type, report_block.source_ssrc);
|
||||||
|
|
|
@ -4764,13 +4764,11 @@ RTCError SdpOfferAnswerHandler::PushdownMediaDescription(
|
||||||
// - crbug.com/1187289
|
// - crbug.com/1187289
|
||||||
for (const auto& entry : channels) {
|
for (const auto& entry : channels) {
|
||||||
std::string error;
|
std::string error;
|
||||||
bool success =
|
bool success = context_->worker_thread()->BlockingCall([&]() {
|
||||||
context_->worker_thread()->BlockingCall([&]() {
|
return (source == cricket::CS_LOCAL)
|
||||||
return (source == cricket::CS_LOCAL)
|
? entry.first->SetLocalContent(entry.second, type, error)
|
||||||
? entry.first->SetLocalContent(entry.second, type, error)
|
: entry.first->SetRemoteContent(entry.second, type, error);
|
||||||
: entry.first->SetRemoteContent(entry.second, type,
|
});
|
||||||
error);
|
|
||||||
});
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
return RTCError(RTCErrorType::INVALID_PARAMETER, error);
|
return RTCError(RTCErrorType::INVALID_PARAMETER, error);
|
||||||
}
|
}
|
||||||
|
|
|
@ -281,8 +281,7 @@ std::vector<const ContentGroup*> SessionDescription::GetGroupsByName(
|
||||||
return content_groups;
|
return content_groups;
|
||||||
}
|
}
|
||||||
|
|
||||||
ContentInfo::~ContentInfo() {
|
ContentInfo::~ContentInfo() {}
|
||||||
}
|
|
||||||
|
|
||||||
// Copy operator.
|
// Copy operator.
|
||||||
ContentInfo::ContentInfo(const ContentInfo& o)
|
ContentInfo::ContentInfo(const ContentInfo& o)
|
||||||
|
|
Loading…
Reference in a new issue