mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 05:40:42 +01:00
Cleanup expired experiment WebRTC-SCM-Timestamp
Bug: webrtc:5773 Change-Id: I4950c70865c7f458324d11b74dd1043e93bc10f6 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/347882 Reviewed-by: Jonas Oreland <jonaso@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Per Kjellander <perkj@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42145}
This commit is contained in:
parent
cc3ce280fe
commit
58cccc62cc
5 changed files with 17 additions and 69 deletions
|
@ -117,9 +117,6 @@ ACTIVE_FIELD_TRIALS: FrozenSet[FieldTrial] = frozenset([
|
||||||
FieldTrial('WebRTC-RtcEventLogEncodeNetEqSetMinimumDelayKillSwitch',
|
FieldTrial('WebRTC-RtcEventLogEncodeNetEqSetMinimumDelayKillSwitch',
|
||||||
'webrtc:14763',
|
'webrtc:14763',
|
||||||
date(2024, 4, 1)),
|
date(2024, 4, 1)),
|
||||||
FieldTrial('WebRTC-SCM-Timestamp',
|
|
||||||
'webrtc:5773',
|
|
||||||
date(2024, 4, 1)),
|
|
||||||
FieldTrial('WebRTC-SetCodecPreferences-ReceiveOnlyFilterInsteadOfThrow',
|
FieldTrial('WebRTC-SetCodecPreferences-ReceiveOnlyFilterInsteadOfThrow',
|
||||||
'webrtc:15396',
|
'webrtc:15396',
|
||||||
date(2024, 12, 1)),
|
date(2024, 12, 1)),
|
||||||
|
|
|
@ -21,12 +21,6 @@
|
||||||
|
|
||||||
namespace rtc {
|
namespace rtc {
|
||||||
|
|
||||||
// Returns true if the experiement "WebRTC-SCM-Timestamp" is explicitly
|
|
||||||
// disabled.
|
|
||||||
static bool IsScmTimeStampExperimentDisabled() {
|
|
||||||
return webrtc::field_trial::IsDisabled("WebRTC-SCM-Timestamp");
|
|
||||||
}
|
|
||||||
|
|
||||||
AsyncUDPSocket* AsyncUDPSocket::Create(Socket* socket,
|
AsyncUDPSocket* AsyncUDPSocket::Create(Socket* socket,
|
||||||
const SocketAddress& bind_address) {
|
const SocketAddress& bind_address) {
|
||||||
std::unique_ptr<Socket> owned_socket(socket);
|
std::unique_ptr<Socket> owned_socket(socket);
|
||||||
|
@ -133,15 +127,9 @@ void AsyncUDPSocket::OnReadEvent(Socket* socket) {
|
||||||
receive_buffer.arrival_time = webrtc::Timestamp::Micros(rtc::TimeMicros());
|
receive_buffer.arrival_time = webrtc::Timestamp::Micros(rtc::TimeMicros());
|
||||||
} else {
|
} else {
|
||||||
if (!socket_time_offset_) {
|
if (!socket_time_offset_) {
|
||||||
// Estimate timestamp offset from first packet arrival time unless
|
// Estimate timestamp offset from first packet arrival time.
|
||||||
// disabled
|
|
||||||
bool estimate_time_offset = !IsScmTimeStampExperimentDisabled();
|
|
||||||
if (estimate_time_offset) {
|
|
||||||
socket_time_offset_ = webrtc::Timestamp::Micros(rtc::TimeMicros()) -
|
socket_time_offset_ = webrtc::Timestamp::Micros(rtc::TimeMicros()) -
|
||||||
*receive_buffer.arrival_time;
|
*receive_buffer.arrival_time;
|
||||||
} else {
|
|
||||||
socket_time_offset_ = webrtc::TimeDelta::Micros(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
*receive_buffer.arrival_time += *socket_time_offset_;
|
*receive_buffer.arrival_time += *socket_time_offset_;
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,12 +148,6 @@ class ScopedSetTrue {
|
||||||
bool* value_;
|
bool* value_;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Returns true if the experiement "WebRTC-SCM-Timestamp" is explicitly
|
|
||||||
// disabled.
|
|
||||||
bool IsScmTimeStampExperimentDisabled() {
|
|
||||||
return webrtc::field_trial::IsDisabled("WebRTC-SCM-Timestamp");
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
namespace rtc {
|
namespace rtc {
|
||||||
|
@ -163,8 +157,7 @@ PhysicalSocket::PhysicalSocket(PhysicalSocketServer* ss, SOCKET s)
|
||||||
s_(s),
|
s_(s),
|
||||||
error_(0),
|
error_(0),
|
||||||
state_((s == INVALID_SOCKET) ? CS_CLOSED : CS_CONNECTED),
|
state_((s == INVALID_SOCKET) ? CS_CLOSED : CS_CONNECTED),
|
||||||
resolver_(nullptr),
|
resolver_(nullptr) {
|
||||||
read_scm_timestamp_experiment_(!IsScmTimeStampExperimentDisabled()) {
|
|
||||||
if (s_ != INVALID_SOCKET) {
|
if (s_ != INVALID_SOCKET) {
|
||||||
SetEnabledEvents(DE_READ | DE_WRITE);
|
SetEnabledEvents(DE_READ | DE_WRITE);
|
||||||
|
|
||||||
|
@ -523,7 +516,6 @@ int PhysicalSocket::DoReadFromSocket(void* buffer,
|
||||||
|
|
||||||
#if defined(WEBRTC_POSIX)
|
#if defined(WEBRTC_POSIX)
|
||||||
int received = 0;
|
int received = 0;
|
||||||
if (read_scm_timestamp_experiment_) {
|
|
||||||
iovec iov = {.iov_base = buffer, .iov_len = length};
|
iovec iov = {.iov_base = buffer, .iov_len = length};
|
||||||
msghdr msg = {.msg_iov = &iov, .msg_iovlen = 1};
|
msghdr msg = {.msg_iov = &iov, .msg_iovlen = 1};
|
||||||
if (out_addr) {
|
if (out_addr) {
|
||||||
|
@ -567,19 +559,6 @@ int PhysicalSocket::DoReadFromSocket(void* buffer,
|
||||||
if (out_addr) {
|
if (out_addr) {
|
||||||
SocketAddressFromSockAddrStorage(addr_storage, out_addr);
|
SocketAddressFromSockAddrStorage(addr_storage, out_addr);
|
||||||
}
|
}
|
||||||
} else { // !read_scm_timestamp_experiment_
|
|
||||||
if (out_addr) {
|
|
||||||
received = ::recvfrom(s_, static_cast<char*>(buffer),
|
|
||||||
static_cast<int>(length), 0, addr, &addr_len);
|
|
||||||
SocketAddressFromSockAddrStorage(addr_storage, out_addr);
|
|
||||||
} else {
|
|
||||||
received =
|
|
||||||
::recv(s_, static_cast<char*>(buffer), static_cast<int>(length), 0);
|
|
||||||
}
|
|
||||||
if (timestamp) {
|
|
||||||
*timestamp = GetSocketRecvTimestamp(s_);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return received;
|
return received;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
@ -852,14 +831,11 @@ bool SocketDispatcher::Initialize() {
|
||||||
ioctlsocket(s_, FIONBIO, &argp);
|
ioctlsocket(s_, FIONBIO, &argp);
|
||||||
#elif defined(WEBRTC_POSIX)
|
#elif defined(WEBRTC_POSIX)
|
||||||
fcntl(s_, F_SETFL, fcntl(s_, F_GETFL, 0) | O_NONBLOCK);
|
fcntl(s_, F_SETFL, fcntl(s_, F_GETFL, 0) | O_NONBLOCK);
|
||||||
if (!IsScmTimeStampExperimentDisabled()) {
|
|
||||||
int value = 1;
|
int value = 1;
|
||||||
// Attempt to get receive packet timestamp from the socket.
|
// Attempt to get receive packet timestamp from the socket.
|
||||||
if (::setsockopt(s_, SOL_SOCKET, SO_TIMESTAMP, &value, sizeof(value)) !=
|
if (::setsockopt(s_, SOL_SOCKET, SO_TIMESTAMP, &value, sizeof(value)) != 0) {
|
||||||
0) {
|
|
||||||
RTC_DLOG(LS_ERROR) << "::setsockopt failed. errno: " << LAST_SYSTEM_ERROR;
|
RTC_DLOG(LS_ERROR) << "::setsockopt failed. errno: " << LAST_SYSTEM_ERROR;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(WEBRTC_IOS)
|
#if defined(WEBRTC_IOS)
|
||||||
|
@ -868,10 +844,11 @@ bool SocketDispatcher::Initialize() {
|
||||||
// we attempt to write to such a socket, SIGPIPE will be raised, which by
|
// we attempt to write to such a socket, SIGPIPE will be raised, which by
|
||||||
// default will terminate the process, which we don't want. By specifying
|
// default will terminate the process, which we don't want. By specifying
|
||||||
// this socket option, SIGPIPE will be disabled for the socket.
|
// this socket option, SIGPIPE will be disabled for the socket.
|
||||||
int value = 1;
|
value = 1;
|
||||||
if (::setsockopt(s_, SOL_SOCKET, SO_NOSIGPIPE, &value, sizeof(value)) != 0) {
|
if (::setsockopt(s_, SOL_SOCKET, SO_NOSIGPIPE, &value, sizeof(value)) != 0) {
|
||||||
RTC_DLOG(LS_ERROR) << "::setsockopt failed. errno: " << LAST_SYSTEM_ERROR;
|
RTC_DLOG(LS_ERROR) << "::setsockopt failed. errno: " << LAST_SYSTEM_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
ss_->Add(this);
|
ss_->Add(this);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -252,7 +252,6 @@ class PhysicalSocket : public Socket, public sigslot::has_slots<> {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const bool read_scm_timestamp_experiment_;
|
|
||||||
uint8_t enabled_events_ = 0;
|
uint8_t enabled_events_ = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -471,19 +471,6 @@ TEST_F(PhysicalSocketTest, TestSocketRecvTimestampIPv6) {
|
||||||
SocketTest::TestSocketRecvTimestampIPv6();
|
SocketTest::TestSocketRecvTimestampIPv6();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(WEBRTC_MAC)
|
|
||||||
TEST_F(PhysicalSocketTest, TestSocketRecvTimestampIPv4ScmExperimentDisabled) {
|
|
||||||
MAYBE_SKIP_IPV4;
|
|
||||||
webrtc::test::ScopedFieldTrials trial("WebRTC-SCM-Timestamp/Disabled/");
|
|
||||||
SocketTest::TestSocketRecvTimestampIPv4();
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_F(PhysicalSocketTest, TestSocketRecvTimestampIPv6ScmExperimentDisabled) {
|
|
||||||
webrtc::test::ScopedFieldTrials trial("WebRTC-SCM-Timestamp/Disabled/");
|
|
||||||
SocketTest::TestSocketRecvTimestampIPv6();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(WEBRTC_MAC) && !defined(WEBRTC_IOS)
|
#if !defined(WEBRTC_MAC) && !defined(WEBRTC_IOS)
|
||||||
// TODO(bugs.webrtc.org/15368): IpV4 fails on IOS and MAC. IPV6 works.
|
// TODO(bugs.webrtc.org/15368): IpV4 fails on IOS and MAC. IPV6 works.
|
||||||
TEST_F(PhysicalSocketTest, TestSocketSendRecvWithEcnIPv4) {
|
TEST_F(PhysicalSocketTest, TestSocketSendRecvWithEcnIPv4) {
|
||||||
|
|
Loading…
Reference in a new issue