Delete webrtc::PacketTime and backwards compatibility.

This is a followup to
https://webrtc-review.googlesource.com/c/src/+/91840, which needed
transitional methods while updating downstream code. This cl completes
the deletion, and can be landed after downstream code is updated.

Bug: webtrc:9584
Change-Id: I4d3654748973a4757a8d79bb93f524c630a0eca3
Reviewed-on: https://webrtc-review.googlesource.com/93285
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24329}
This commit is contained in:
Niels Möller
2018-08-17 09:49:20 +02:00
committed by Commit Bot
parent b3b47ad7e6
commit f189c48c86
6 changed files with 4 additions and 111 deletions

View File

@ -20,7 +20,6 @@ rtc_source_set("call_interfaces") {
"call_config.h",
"flexfec_receive_stream.cc",
"flexfec_receive_stream.h",
"packet_receiver.cc",
"packet_receiver.h",
"syncable.cc",
"syncable.h",

View File

@ -44,23 +44,6 @@ NetworkPacket::NetworkPacket(rtc::CopyOnWriteBuffer packet,
media_type_(media_type),
packet_time_us_(packet_time_us) {}
NetworkPacket::NetworkPacket(rtc::CopyOnWriteBuffer packet,
int64_t send_time,
int64_t arrival_time,
absl::optional<PacketOptions> packet_options,
bool is_rtcp,
MediaType media_type,
absl::optional<PacketTime> packet_time)
: NetworkPacket(packet,
send_time,
arrival_time,
packet_options,
is_rtcp,
media_type,
packet_time
? absl::optional<int64_t>(packet_time->timestamp)
: absl::nullopt) {}
NetworkPacket::NetworkPacket(NetworkPacket&& o)
: packet_(std::move(o.packet_)),
send_time_(o.send_time_),
@ -215,25 +198,11 @@ bool FakeNetworkPipe::EnqueuePacket(rtc::CopyOnWriteBuffer packet,
bool is_rtcp,
MediaType media_type,
absl::optional<int64_t> packet_time_us) {
absl::optional<PacketTime> packet_time;
if (packet_time_us) {
packet_time = PacketTime(*packet_time_us, -1);
}
return EnqueuePacket(packet, options, is_rtcp, media_type, packet_time);
}
bool FakeNetworkPipe::EnqueuePacket(rtc::CopyOnWriteBuffer packet,
absl::optional<PacketOptions> options,
bool is_rtcp,
MediaType media_type,
absl::optional<PacketTime> packet_time) {
int64_t time_now_us = clock_->TimeInMicroseconds();
rtc::CritScope crit(&process_lock_);
size_t packet_size = packet.size();
NetworkPacket net_packet(
std::move(packet), time_now_us, time_now_us, options, is_rtcp, media_type,
packet_time ? absl::optional<int64_t>(packet_time->timestamp)
: absl::nullopt);
NetworkPacket net_packet(std::move(packet), time_now_us, time_now_us, options,
is_rtcp, media_type, packet_time_us);
packets_in_flight_.emplace_back(StoredPacket(std::move(net_packet)));
int64_t packet_id = reinterpret_cast<uint64_t>(&packets_in_flight_.back());

View File

@ -43,14 +43,6 @@ class NetworkPacket {
bool is_rtcp,
MediaType media_type,
absl::optional<int64_t> packet_time_us);
// TODO(nisse): Deprecated.
NetworkPacket(rtc::CopyOnWriteBuffer packet,
int64_t send_time,
int64_t arrival_time,
absl::optional<PacketOptions> packet_options,
bool is_rtcp,
MediaType media_type,
absl::optional<PacketTime> packet_time);
// Disallow copy constructor and copy assignment (no deep copies of |data_|).
NetworkPacket(const NetworkPacket&) = delete;
@ -74,10 +66,6 @@ class NetworkPacket {
bool is_rtcp() const { return is_rtcp_; }
MediaType media_type() const { return media_type_; }
absl::optional<int64_t> packet_time_us() const { return packet_time_us_; }
// TODO(nisse): Deprecated.
PacketTime packet_time() const {
return PacketTime(packet_time_us_.value_or(-1), -1);
}
private:
rtc::CopyOnWriteBuffer packet_;
@ -218,19 +206,11 @@ class FakeNetworkPipe : public Transport, public PacketReceiver, public Module {
MediaType media_type,
absl::optional<int64_t> packet_time_us);
// TODO(nisse): Deprecated. Delete as soon as overrides in downstream code are
// updated.
virtual bool EnqueuePacket(rtc::CopyOnWriteBuffer packet,
absl::optional<PacketOptions> options,
bool is_rtcp,
MediaType media_type,
absl::optional<PacketTime> packet_time);
bool EnqueuePacket(rtc::CopyOnWriteBuffer packet,
absl::optional<PacketOptions> options,
bool is_rtcp,
MediaType media_type) {
return EnqueuePacket(packet, options, is_rtcp, media_type,
absl::optional<PacketTime>());
return EnqueuePacket(packet, options, is_rtcp, media_type, absl::nullopt);
}
void DeliverNetworkPacket(NetworkPacket* packet)
RTC_EXCLUSIVE_LOCKS_REQUIRED(config_lock_);

View File

@ -1,31 +0,0 @@
/*
* Copyright (c) 2018 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.
*/
#include "call/packet_receiver.h"
namespace webrtc {
PacketReceiver::DeliveryStatus PacketReceiver::DeliverPacket(
MediaType media_type,
rtc::CopyOnWriteBuffer packet,
int64_t packet_time_us) {
return DeliverPacket(media_type, packet, PacketTime(packet_time_us, -1));
}
// TODO(bugs.webrtc.org/9584): Deprecated. Over the transition, default
// implementations are used, and subclasses must override one or the other.
PacketReceiver::DeliveryStatus PacketReceiver::DeliverPacket(
MediaType media_type,
rtc::CopyOnWriteBuffer packet,
const PacketTime& packet_time) {
return DeliverPacket(media_type, packet, packet_time.timestamp);
}
} // namespace webrtc

View File

@ -31,13 +31,7 @@ class PacketReceiver {
virtual DeliveryStatus DeliverPacket(MediaType media_type,
rtc::CopyOnWriteBuffer packet,
int64_t packet_time_us);
// TODO(bugs.webrtc.org/9584): Deprecated. Over the transition, default
// implementations are used, and subclasses must override one or the other.
virtual DeliveryStatus DeliverPacket(MediaType media_type,
rtc::CopyOnWriteBuffer packet,
const PacketTime& packet_time);
int64_t packet_time_us) = 0;
protected:
virtual ~PacketReceiver() {}

View File

@ -404,24 +404,6 @@ struct OverUseDetectorOptions {
double initial_var_noise;
};
// TODO(nisse): This struct is phased out, delete as soon as down stream code is
// updated.
// This structure will have the information about when packet is actually
// received by socket.
struct PacketTime {
PacketTime() : timestamp(-1), not_before(-1) {}
PacketTime(int64_t timestamp, int64_t not_before)
: timestamp(timestamp), not_before(not_before) {}
int64_t timestamp; // Receive time after socket delivers the data.
int64_t not_before; // Earliest possible time the data could have arrived,
// indicating the potential error in the |timestamp|
// value,in case the system is busy.
// For example, the time of the last select() call.
// If unknown, this value will be set to zero.
};
// Minimum and maximum playout delay values from capture to render.
// These are best effort values.
//