Removing avoidable usages of Clock::GetRealTimeClock().
Bug: webrtc:10365 Change-Id: I56523f9b4de697b9136d7f8df74f43051c7b5b42 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130484 Reviewed-by: Åsa Persson <asapersson@webrtc.org> Commit-Queue: Sebastian Jansson <srte@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27363}
This commit is contained in:

committed by
Commit Bot

parent
bd631a00c0
commit
11c012a4ce
@ -884,7 +884,7 @@ webrtc::VideoSendStream* Call::CreateVideoSendStream(
|
|||||||
std::unique_ptr<FecController> fec_controller =
|
std::unique_ptr<FecController> fec_controller =
|
||||||
config_.fec_controller_factory
|
config_.fec_controller_factory
|
||||||
? config_.fec_controller_factory->CreateFecController()
|
? config_.fec_controller_factory->CreateFecController()
|
||||||
: absl::make_unique<FecControllerDefault>(Clock::GetRealTimeClock());
|
: absl::make_unique<FecControllerDefault>(clock_);
|
||||||
return CreateVideoSendStream(std::move(config), std::move(encoder_config),
|
return CreateVideoSendStream(std::move(config), std::move(encoder_config),
|
||||||
std::move(fec_controller));
|
std::move(fec_controller));
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,6 @@ std::vector<RtpStreamSender> CreateRtpStreamSenders(
|
|||||||
RtpRtcp::Configuration configuration;
|
RtpRtcp::Configuration configuration;
|
||||||
configuration.clock = clock;
|
configuration.clock = clock;
|
||||||
configuration.audio = false;
|
configuration.audio = false;
|
||||||
configuration.clock = Clock::GetRealTimeClock();
|
|
||||||
configuration.receiver_only = false;
|
configuration.receiver_only = false;
|
||||||
configuration.outgoing_transport = send_transport;
|
configuration.outgoing_transport = send_transport;
|
||||||
configuration.intra_frame_callback = intra_frame_callback;
|
configuration.intra_frame_callback = intra_frame_callback;
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
#include "call/call.h"
|
#include "call/call.h"
|
||||||
#include "call/fake_network_pipe.h"
|
#include "call/fake_network_pipe.h"
|
||||||
#include "modules/rtp_rtcp/include/rtp_header_parser.h"
|
#include "modules/rtp_rtcp/include/rtp_header_parser.h"
|
||||||
#include "system_wrappers/include/clock.h"
|
#include "rtc_base/time_utils.h"
|
||||||
#include "test/single_threaded_task_queue.h"
|
#include "test/single_threaded_task_queue.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
@ -42,7 +42,6 @@ DirectTransport::DirectTransport(
|
|||||||
Call* send_call,
|
Call* send_call,
|
||||||
const std::map<uint8_t, MediaType>& payload_type_map)
|
const std::map<uint8_t, MediaType>& payload_type_map)
|
||||||
: send_call_(send_call),
|
: send_call_(send_call),
|
||||||
clock_(Clock::GetRealTimeClock()),
|
|
||||||
task_queue_(task_queue),
|
task_queue_(task_queue),
|
||||||
demuxer_(payload_type_map),
|
demuxer_(payload_type_map),
|
||||||
fake_network_(std::move(pipe)) {
|
fake_network_(std::move(pipe)) {
|
||||||
@ -69,8 +68,7 @@ bool DirectTransport::SendRtp(const uint8_t* data,
|
|||||||
size_t length,
|
size_t length,
|
||||||
const PacketOptions& options) {
|
const PacketOptions& options) {
|
||||||
if (send_call_) {
|
if (send_call_) {
|
||||||
rtc::SentPacket sent_packet(options.packet_id,
|
rtc::SentPacket sent_packet(options.packet_id, rtc::TimeMillis());
|
||||||
clock_->TimeInMilliseconds());
|
|
||||||
sent_packet.info.included_in_feedback = options.included_in_feedback;
|
sent_packet.info.included_in_feedback = options.included_in_feedback;
|
||||||
sent_packet.info.included_in_allocation = options.included_in_allocation;
|
sent_packet.info.included_in_allocation = options.included_in_allocation;
|
||||||
sent_packet.info.packet_size_bytes = length;
|
sent_packet.info.packet_size_bytes = length;
|
||||||
@ -88,9 +86,9 @@ bool DirectTransport::SendRtcp(const uint8_t* data, size_t length) {
|
|||||||
|
|
||||||
void DirectTransport::SendPacket(const uint8_t* data, size_t length) {
|
void DirectTransport::SendPacket(const uint8_t* data, size_t length) {
|
||||||
MediaType media_type = demuxer_.GetMediaType(data, length);
|
MediaType media_type = demuxer_.GetMediaType(data, length);
|
||||||
int64_t send_time = clock_->TimeInMicroseconds();
|
int64_t send_time_us = rtc::TimeMicros();
|
||||||
fake_network_->DeliverPacket(media_type, rtc::CopyOnWriteBuffer(data, length),
|
fake_network_->DeliverPacket(media_type, rtc::CopyOnWriteBuffer(data, length),
|
||||||
send_time);
|
send_time_us);
|
||||||
rtc::CritScope cs(&process_lock_);
|
rtc::CritScope cs(&process_lock_);
|
||||||
if (!next_process_task_)
|
if (!next_process_task_)
|
||||||
ProcessPackets();
|
ProcessPackets();
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
class Clock;
|
|
||||||
class PacketReceiver;
|
class PacketReceiver;
|
||||||
|
|
||||||
namespace test {
|
namespace test {
|
||||||
@ -65,7 +64,6 @@ class DirectTransport : public Transport {
|
|||||||
void Start();
|
void Start();
|
||||||
|
|
||||||
Call* const send_call_;
|
Call* const send_call_;
|
||||||
Clock* const clock_;
|
|
||||||
|
|
||||||
SingleThreadedTaskQueueForTesting* const task_queue_;
|
SingleThreadedTaskQueueForTesting* const task_queue_;
|
||||||
|
|
||||||
|
@ -220,8 +220,7 @@ PacketReceiver::DeliveryStatus VideoAnalyzer::DeliverPacket(
|
|||||||
rtc::CritScope lock(&crit_);
|
rtc::CritScope lock(&crit_);
|
||||||
int64_t timestamp =
|
int64_t timestamp =
|
||||||
wrap_handler_.Unwrap(header.timestamp - rtp_timestamp_delta_);
|
wrap_handler_.Unwrap(header.timestamp - rtp_timestamp_delta_);
|
||||||
recv_times_[timestamp] =
|
recv_times_[timestamp] = clock_->CurrentNtpInMilliseconds();
|
||||||
Clock::GetRealTimeClock()->CurrentNtpInMilliseconds();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return receiver_->DeliverPacket(media_type, std::move(packet),
|
return receiver_->DeliverPacket(media_type, std::move(packet),
|
||||||
@ -254,7 +253,7 @@ bool VideoAnalyzer::SendRtp(const uint8_t* packet,
|
|||||||
RTPHeader header;
|
RTPHeader header;
|
||||||
parser.Parse(&header);
|
parser.Parse(&header);
|
||||||
|
|
||||||
int64_t current_time = Clock::GetRealTimeClock()->CurrentNtpInMilliseconds();
|
int64_t current_time = clock_->CurrentNtpInMilliseconds();
|
||||||
|
|
||||||
bool result = transport_->SendRtp(packet, length, options);
|
bool result = transport_->SendRtp(packet, length, options);
|
||||||
{
|
{
|
||||||
@ -292,8 +291,7 @@ bool VideoAnalyzer::SendRtcp(const uint8_t* packet, size_t length) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void VideoAnalyzer::OnFrame(const VideoFrame& video_frame) {
|
void VideoAnalyzer::OnFrame(const VideoFrame& video_frame) {
|
||||||
int64_t render_time_ms =
|
int64_t render_time_ms = clock_->CurrentNtpInMilliseconds();
|
||||||
Clock::GetRealTimeClock()->CurrentNtpInMilliseconds();
|
|
||||||
|
|
||||||
rtc::CritScope lock(&crit_);
|
rtc::CritScope lock(&crit_);
|
||||||
|
|
||||||
|
@ -1133,8 +1133,7 @@ VideoQualityTest::CreateSendTransport() {
|
|||||||
}
|
}
|
||||||
return absl::make_unique<test::LayerFilteringTransport>(
|
return absl::make_unique<test::LayerFilteringTransport>(
|
||||||
&task_queue_,
|
&task_queue_,
|
||||||
absl::make_unique<FakeNetworkPipe>(Clock::GetRealTimeClock(),
|
absl::make_unique<FakeNetworkPipe>(clock_, std::move(network_behavior)),
|
||||||
std::move(network_behavior)),
|
|
||||||
sender_call_.get(), kPayloadTypeVP8, kPayloadTypeVP9,
|
sender_call_.get(), kPayloadTypeVP8, kPayloadTypeVP9,
|
||||||
params_.video[0].selected_tl, params_.ss[0].selected_sl,
|
params_.video[0].selected_tl, params_.ss[0].selected_sl,
|
||||||
payload_type_map_, kVideoSendSsrcs[0],
|
payload_type_map_, kVideoSendSsrcs[0],
|
||||||
@ -1152,8 +1151,7 @@ VideoQualityTest::CreateReceiveTransport() {
|
|||||||
}
|
}
|
||||||
return absl::make_unique<test::DirectTransport>(
|
return absl::make_unique<test::DirectTransport>(
|
||||||
&task_queue_,
|
&task_queue_,
|
||||||
absl::make_unique<FakeNetworkPipe>(Clock::GetRealTimeClock(),
|
absl::make_unique<FakeNetworkPipe>(clock_, std::move(network_behavior)),
|
||||||
std::move(network_behavior)),
|
|
||||||
receiver_call_.get(), payload_type_map_);
|
receiver_call_.get(), payload_type_map_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user