webrtc_m130/modules/rtp_rtcp/source/rtp_packet_history.cc

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

245 lines
7.7 KiB
C++
Raw Normal View History

/*
* Copyright (c) 2012 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 "modules/rtp_rtcp/source/rtp_packet_history.h"
#include <algorithm>
#include <limits>
#include <utility>
#include "modules/rtp_rtcp/source/rtp_packet_to_send.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include "system_wrappers/include/clock.h"
namespace webrtc {
namespace {
constexpr size_t kMinPacketRequestBytes = 50;
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
// Don't overwrite a packet within one second, or three RTTs, after transmission
// whichever is larger. Instead try to dynamically expand history.
constexpr int64_t kMinPacketDurationMs = 1000;
constexpr int kMinPacketDurationRtt = 3;
} // namespace
constexpr size_t RtpPacketHistory::kMaxCapacity;
Revert "Rework rtp packet history" This reverts commit 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887. Reason for revert: Breaks downstream build, due to use of std::pair constructor that some compilers appear to not support yet. See comment. Original change's description: > Rework rtp packet history > > This CL rewrites the history from the ground up, but keeps the logic > (mostly) intact. It does however lay the groundwork for adding a new > mode where TransportFeedback messages can be used to remove packets > from the history as we know the remote end has received them. > > This should both reduce memory usage and make the payload based padding > a little more likely to be useful. > > My tests show a reduction of ca 500-800kB reduction in memory usage per > rtp module. So with simulcast and/or fec this will increase. Lossy > links and long RTT will use more memory. > > I've also slightly update the interface to make usage with/without > pacer less unintuitive, and avoid making a copy of the entire RTP > packet just to find the ssrc and sequence number to put into the pacer. > > The more aggressive culling is not enabled by default. I will > wire that up in a follow-up CL, as there's some interface refactoring > required. > > Bug: webrtc:8975 > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > Reviewed-on: https://webrtc-review.googlesource.com/59441 > Commit-Queue: Erik Språng <sprang@webrtc.org> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22347} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: I2fa7efc7d008c56f7a8f77bc9958c19119f69de8 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/60880 Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org> Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22350}
2018-03-08 23:41:12 +00:00
RtpPacketHistory::StoredPacket::StoredPacket() = default;
RtpPacketHistory::StoredPacket::StoredPacket(StoredPacket&&) = default;
RtpPacketHistory::StoredPacket& RtpPacketHistory::StoredPacket::operator=(
RtpPacketHistory::StoredPacket&&) = default;
RtpPacketHistory::StoredPacket::~StoredPacket() = default;
RtpPacketHistory::RtpPacketHistory(Clock* clock)
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
: clock_(clock), store_(false), prev_index_(0), rtt_ms_(-1) {}
RtpPacketHistory::~RtpPacketHistory() {}
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
void RtpPacketHistory::SetStorePacketsStatus(bool enable,
uint16_t number_to_store) {
rtc::CritScope cs(&critsect_);
if (enable) {
if (store_) {
RTC_LOG(LS_WARNING)
<< "Purging packet history in order to re-set status.";
Free();
}
RTC_DCHECK(!store_);
Allocate(number_to_store);
} else {
Free();
Revert "Rework rtp packet history" This reverts commit 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887. Reason for revert: Breaks downstream build, due to use of std::pair constructor that some compilers appear to not support yet. See comment. Original change's description: > Rework rtp packet history > > This CL rewrites the history from the ground up, but keeps the logic > (mostly) intact. It does however lay the groundwork for adding a new > mode where TransportFeedback messages can be used to remove packets > from the history as we know the remote end has received them. > > This should both reduce memory usage and make the payload based padding > a little more likely to be useful. > > My tests show a reduction of ca 500-800kB reduction in memory usage per > rtp module. So with simulcast and/or fec this will increase. Lossy > links and long RTT will use more memory. > > I've also slightly update the interface to make usage with/without > pacer less unintuitive, and avoid making a copy of the entire RTP > packet just to find the ssrc and sequence number to put into the pacer. > > The more aggressive culling is not enabled by default. I will > wire that up in a follow-up CL, as there's some interface refactoring > required. > > Bug: webrtc:8975 > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > Reviewed-on: https://webrtc-review.googlesource.com/59441 > Commit-Queue: Erik Språng <sprang@webrtc.org> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22347} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: I2fa7efc7d008c56f7a8f77bc9958c19119f69de8 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/60880 Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org> Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22350}
2018-03-08 23:41:12 +00:00
}
Reland "Rework rtp packet history" This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 Original change's description: > Rework rtp packet history > > This CL rewrites the history from the ground up, but keeps the logic > (mostly) intact. It does however lay the groundwork for adding a new > mode where TransportFeedback messages can be used to remove packets > from the history as we know the remote end has received them. > > This should both reduce memory usage and make the payload based padding > a little more likely to be useful. > > My tests show a reduction of ca 500-800kB reduction in memory usage per > rtp module. So with simulcast and/or fec this will increase. Lossy > links and long RTT will use more memory. > > I've also slightly update the interface to make usage with/without > pacer less unintuitive, and avoid making a copy of the entire RTP > packet just to find the ssrc and sequence number to put into the pacer. > > The more aggressive culling is not enabled by default. I will > wire that up in a follow-up CL, as there's some interface refactoring > required. > > Bug: webrtc:8975 > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > Reviewed-on: https://webrtc-review.googlesource.com/59441 > Commit-Queue: Erik Språng <sprang@webrtc.org> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22347} Bug: webrtc:8975 Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b Reviewed-on: https://webrtc-review.googlesource.com/60900 Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22356}
2018-03-09 09:52:59 +01:00
}
Revert "Rework rtp packet history" This reverts commit 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887. Reason for revert: Breaks downstream build, due to use of std::pair constructor that some compilers appear to not support yet. See comment. Original change's description: > Rework rtp packet history > > This CL rewrites the history from the ground up, but keeps the logic > (mostly) intact. It does however lay the groundwork for adding a new > mode where TransportFeedback messages can be used to remove packets > from the history as we know the remote end has received them. > > This should both reduce memory usage and make the payload based padding > a little more likely to be useful. > > My tests show a reduction of ca 500-800kB reduction in memory usage per > rtp module. So with simulcast and/or fec this will increase. Lossy > links and long RTT will use more memory. > > I've also slightly update the interface to make usage with/without > pacer less unintuitive, and avoid making a copy of the entire RTP > packet just to find the ssrc and sequence number to put into the pacer. > > The more aggressive culling is not enabled by default. I will > wire that up in a follow-up CL, as there's some interface refactoring > required. > > Bug: webrtc:8975 > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > Reviewed-on: https://webrtc-review.googlesource.com/59441 > Commit-Queue: Erik Språng <sprang@webrtc.org> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22347} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: I2fa7efc7d008c56f7a8f77bc9958c19119f69de8 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/60880 Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org> Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22350}
2018-03-08 23:41:12 +00:00
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
void RtpPacketHistory::Allocate(size_t number_to_store) {
RTC_DCHECK_GT(number_to_store, 0);
RTC_DCHECK_LE(number_to_store, kMaxCapacity);
store_ = true;
stored_packets_.resize(number_to_store);
Revert "Rework rtp packet history" This reverts commit 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887. Reason for revert: Breaks downstream build, due to use of std::pair constructor that some compilers appear to not support yet. See comment. Original change's description: > Rework rtp packet history > > This CL rewrites the history from the ground up, but keeps the logic > (mostly) intact. It does however lay the groundwork for adding a new > mode where TransportFeedback messages can be used to remove packets > from the history as we know the remote end has received them. > > This should both reduce memory usage and make the payload based padding > a little more likely to be useful. > > My tests show a reduction of ca 500-800kB reduction in memory usage per > rtp module. So with simulcast and/or fec this will increase. Lossy > links and long RTT will use more memory. > > I've also slightly update the interface to make usage with/without > pacer less unintuitive, and avoid making a copy of the entire RTP > packet just to find the ssrc and sequence number to put into the pacer. > > The more aggressive culling is not enabled by default. I will > wire that up in a follow-up CL, as there's some interface refactoring > required. > > Bug: webrtc:8975 > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > Reviewed-on: https://webrtc-review.googlesource.com/59441 > Commit-Queue: Erik Språng <sprang@webrtc.org> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22347} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: I2fa7efc7d008c56f7a8f77bc9958c19119f69de8 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/60880 Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org> Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22350}
2018-03-08 23:41:12 +00:00
}
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
void RtpPacketHistory::Free() {
if (!store_) {
return;
}
stored_packets_.clear();
store_ = false;
prev_index_ = 0;
}
bool RtpPacketHistory::StorePackets() const {
rtc::CritScope cs(&critsect_);
return store_;
}
void RtpPacketHistory::PutRtpPacket(std::unique_ptr<RtpPacketToSend> packet,
StorageType type,
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
bool sent) {
RTC_DCHECK(packet);
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
rtc::CritScope cs(&critsect_);
if (!store_) {
return;
}
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
int64_t now_ms = clock_->TimeInMilliseconds();
// If index we're about to overwrite contains a packet that has not
// yet been sent (probably pending in paced sender), or if the send time is
// less than 3 round trip times ago, expand the buffer to avoid overwriting
// valid data.
StoredPacket* stored_packet = &stored_packets_[prev_index_];
int64_t packet_duration_ms =
std::max(kMinPacketDurationRtt * rtt_ms_, kMinPacketDurationMs);
if (stored_packet->packet &&
(stored_packet->send_time == 0 ||
(rtt_ms_ >= 0 &&
now_ms - stored_packet->send_time <= packet_duration_ms))) {
size_t current_size = stored_packets_.size();
if (current_size < kMaxCapacity) {
size_t expanded_size = std::max(current_size * 3 / 2, current_size + 1);
expanded_size = std::min(expanded_size, kMaxCapacity);
Allocate(expanded_size);
// Causes discontinuity, but that's OK-ish. FindSeqNum() will still work,
// but may be slower - at least until buffer has wrapped around once.
prev_index_ = current_size;
stored_packet = &stored_packets_[prev_index_];
}
}
// Store packet.
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
if (packet->capture_time_ms() <= 0)
packet->set_capture_time_ms(now_ms);
stored_packet->sequence_number = packet->SequenceNumber();
stored_packet->send_time = sent ? now_ms : 0;
stored_packet->storage_type = type;
stored_packet->has_been_retransmitted = false;
stored_packet->packet = std::move(packet);
prev_index_ = (prev_index_ + 1) % stored_packets_.size();
}
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
bool RtpPacketHistory::HasRtpPacket(uint16_t sequence_number) const {
rtc::CritScope cs(&critsect_);
if (!store_) {
return false;
}
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
int unused_index = 0;
return FindSeqNum(sequence_number, &unused_index);
}
std::unique_ptr<RtpPacketToSend> RtpPacketHistory::GetPacketAndSetSendTime(
uint16_t sequence_number,
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
int64_t min_elapsed_time_ms,
bool retransmit) {
rtc::CritScope cs(&critsect_);
if (!store_) {
return nullptr;
}
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
int index = 0;
if (!FindSeqNum(sequence_number, &index)) {
RTC_LOG(LS_WARNING) << "No match for getting seqNum " << sequence_number;
return nullptr;
}
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
RTC_DCHECK_EQ(sequence_number,
stored_packets_[index].packet->SequenceNumber());
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
// Verify elapsed time since last retrieve, but only for retransmissions and
// always send packet upon first retransmission request.
int64_t now = clock_->TimeInMilliseconds();
if (min_elapsed_time_ms > 0 && retransmit &&
stored_packets_[index].has_been_retransmitted &&
((now - stored_packets_[index].send_time) < min_elapsed_time_ms)) {
return nullptr;
}
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
if (retransmit) {
if (stored_packets_[index].storage_type == kDontRetransmit) {
// No bytes copied since this packet shouldn't be retransmitted.
return nullptr;
Reland "Rework rtp packet history" This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 Original change's description: > Rework rtp packet history > > This CL rewrites the history from the ground up, but keeps the logic > (mostly) intact. It does however lay the groundwork for adding a new > mode where TransportFeedback messages can be used to remove packets > from the history as we know the remote end has received them. > > This should both reduce memory usage and make the payload based padding > a little more likely to be useful. > > My tests show a reduction of ca 500-800kB reduction in memory usage per > rtp module. So with simulcast and/or fec this will increase. Lossy > links and long RTT will use more memory. > > I've also slightly update the interface to make usage with/without > pacer less unintuitive, and avoid making a copy of the entire RTP > packet just to find the ssrc and sequence number to put into the pacer. > > The more aggressive culling is not enabled by default. I will > wire that up in a follow-up CL, as there's some interface refactoring > required. > > Bug: webrtc:8975 > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > Reviewed-on: https://webrtc-review.googlesource.com/59441 > Commit-Queue: Erik Språng <sprang@webrtc.org> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22347} Bug: webrtc:8975 Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b Reviewed-on: https://webrtc-review.googlesource.com/60900 Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22356}
2018-03-09 09:52:59 +01:00
}
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
stored_packets_[index].has_been_retransmitted = true;
}
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
stored_packets_[index].send_time = clock_->TimeInMilliseconds();
return GetPacket(index);
}
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
std::unique_ptr<RtpPacketToSend> RtpPacketHistory::GetPacket(int index) const {
const RtpPacketToSend& stored = *stored_packets_[index].packet;
return std::unique_ptr<RtpPacketToSend>(new RtpPacketToSend(stored));
Reland "Rework rtp packet history" This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 Original change's description: > Rework rtp packet history > > This CL rewrites the history from the ground up, but keeps the logic > (mostly) intact. It does however lay the groundwork for adding a new > mode where TransportFeedback messages can be used to remove packets > from the history as we know the remote end has received them. > > This should both reduce memory usage and make the payload based padding > a little more likely to be useful. > > My tests show a reduction of ca 500-800kB reduction in memory usage per > rtp module. So with simulcast and/or fec this will increase. Lossy > links and long RTT will use more memory. > > I've also slightly update the interface to make usage with/without > pacer less unintuitive, and avoid making a copy of the entire RTP > packet just to find the ssrc and sequence number to put into the pacer. > > The more aggressive culling is not enabled by default. I will > wire that up in a follow-up CL, as there's some interface refactoring > required. > > Bug: webrtc:8975 > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > Reviewed-on: https://webrtc-review.googlesource.com/59441 > Commit-Queue: Erik Språng <sprang@webrtc.org> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22347} Bug: webrtc:8975 Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b Reviewed-on: https://webrtc-review.googlesource.com/60900 Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22356}
2018-03-09 09:52:59 +01:00
}
std::unique_ptr<RtpPacketToSend> RtpPacketHistory::GetBestFittingPacket(
size_t packet_length) const {
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
rtc::CritScope cs(&critsect_);
if (!store_)
return nullptr;
int index = FindBestFittingPacket(packet_length);
if (index < 0)
Reland "Rework rtp packet history" This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 Original change's description: > Rework rtp packet history > > This CL rewrites the history from the ground up, but keeps the logic > (mostly) intact. It does however lay the groundwork for adding a new > mode where TransportFeedback messages can be used to remove packets > from the history as we know the remote end has received them. > > This should both reduce memory usage and make the payload based padding > a little more likely to be useful. > > My tests show a reduction of ca 500-800kB reduction in memory usage per > rtp module. So with simulcast and/or fec this will increase. Lossy > links and long RTT will use more memory. > > I've also slightly update the interface to make usage with/without > pacer less unintuitive, and avoid making a copy of the entire RTP > packet just to find the ssrc and sequence number to put into the pacer. > > The more aggressive culling is not enabled by default. I will > wire that up in a follow-up CL, as there's some interface refactoring > required. > > Bug: webrtc:8975 > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > Reviewed-on: https://webrtc-review.googlesource.com/59441 > Commit-Queue: Erik Språng <sprang@webrtc.org> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22347} Bug: webrtc:8975 Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b Reviewed-on: https://webrtc-review.googlesource.com/60900 Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22356}
2018-03-09 09:52:59 +01:00
return nullptr;
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
return GetPacket(index);
}
bool RtpPacketHistory::FindSeqNum(uint16_t sequence_number, int* index) const {
if (prev_index_ > 0) {
*index = prev_index_ - 1;
} else {
*index = stored_packets_.size() - 1; // Wrap.
Revert "Rework rtp packet history" This reverts commit 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887. Reason for revert: Breaks downstream build, due to use of std::pair constructor that some compilers appear to not support yet. See comment. Original change's description: > Rework rtp packet history > > This CL rewrites the history from the ground up, but keeps the logic > (mostly) intact. It does however lay the groundwork for adding a new > mode where TransportFeedback messages can be used to remove packets > from the history as we know the remote end has received them. > > This should both reduce memory usage and make the payload based padding > a little more likely to be useful. > > My tests show a reduction of ca 500-800kB reduction in memory usage per > rtp module. So with simulcast and/or fec this will increase. Lossy > links and long RTT will use more memory. > > I've also slightly update the interface to make usage with/without > pacer less unintuitive, and avoid making a copy of the entire RTP > packet just to find the ssrc and sequence number to put into the pacer. > > The more aggressive culling is not enabled by default. I will > wire that up in a follow-up CL, as there's some interface refactoring > required. > > Bug: webrtc:8975 > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > Reviewed-on: https://webrtc-review.googlesource.com/59441 > Commit-Queue: Erik Språng <sprang@webrtc.org> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22347} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: I2fa7efc7d008c56f7a8f77bc9958c19119f69de8 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/60880 Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org> Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22350}
2018-03-08 23:41:12 +00:00
}
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
uint16_t temp_sequence_number = stored_packets_[*index].sequence_number;
Revert "Rework rtp packet history" This reverts commit 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887. Reason for revert: Breaks downstream build, due to use of std::pair constructor that some compilers appear to not support yet. See comment. Original change's description: > Rework rtp packet history > > This CL rewrites the history from the ground up, but keeps the logic > (mostly) intact. It does however lay the groundwork for adding a new > mode where TransportFeedback messages can be used to remove packets > from the history as we know the remote end has received them. > > This should both reduce memory usage and make the payload based padding > a little more likely to be useful. > > My tests show a reduction of ca 500-800kB reduction in memory usage per > rtp module. So with simulcast and/or fec this will increase. Lossy > links and long RTT will use more memory. > > I've also slightly update the interface to make usage with/without > pacer less unintuitive, and avoid making a copy of the entire RTP > packet just to find the ssrc and sequence number to put into the pacer. > > The more aggressive culling is not enabled by default. I will > wire that up in a follow-up CL, as there's some interface refactoring > required. > > Bug: webrtc:8975 > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > Reviewed-on: https://webrtc-review.googlesource.com/59441 > Commit-Queue: Erik Språng <sprang@webrtc.org> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22347} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: I2fa7efc7d008c56f7a8f77bc9958c19119f69de8 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/60880 Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org> Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22350}
2018-03-08 23:41:12 +00:00
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
int idx = *index - (temp_sequence_number - sequence_number);
if (idx >= 0 && idx < static_cast<int>(stored_packets_.size())) {
*index = idx;
temp_sequence_number = stored_packets_[*index].sequence_number;
}
if (temp_sequence_number != sequence_number) {
// We did not found a match, search all.
for (uint16_t m = 0; m < stored_packets_.size(); m++) {
if (stored_packets_[m].sequence_number == sequence_number) {
*index = m;
temp_sequence_number = stored_packets_[*index].sequence_number;
break;
}
}
}
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
return temp_sequence_number == sequence_number &&
stored_packets_[*index].packet;
}
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
int RtpPacketHistory::FindBestFittingPacket(size_t size) const {
if (size < kMinPacketRequestBytes || stored_packets_.empty())
return -1;
size_t min_diff = std::numeric_limits<size_t>::max();
int best_index = -1; // Returned unchanged if we don't find anything.
for (size_t i = 0; i < stored_packets_.size(); ++i) {
if (!stored_packets_[i].packet)
continue;
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
size_t stored_size = stored_packets_[i].packet->size();
size_t diff =
(stored_size > size) ? (stored_size - size) : (size - stored_size);
if (diff < min_diff) {
min_diff = diff;
best_index = static_cast<int>(i);
Reland "Rework rtp packet history" This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 Original change's description: > Rework rtp packet history > > This CL rewrites the history from the ground up, but keeps the logic > (mostly) intact. It does however lay the groundwork for adding a new > mode where TransportFeedback messages can be used to remove packets > from the history as we know the remote end has received them. > > This should both reduce memory usage and make the payload based padding > a little more likely to be useful. > > My tests show a reduction of ca 500-800kB reduction in memory usage per > rtp module. So with simulcast and/or fec this will increase. Lossy > links and long RTT will use more memory. > > I've also slightly update the interface to make usage with/without > pacer less unintuitive, and avoid making a copy of the entire RTP > packet just to find the ssrc and sequence number to put into the pacer. > > The more aggressive culling is not enabled by default. I will > wire that up in a follow-up CL, as there's some interface refactoring > required. > > Bug: webrtc:8975 > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > Reviewed-on: https://webrtc-review.googlesource.com/59441 > Commit-Queue: Erik Språng <sprang@webrtc.org> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22347} Bug: webrtc:8975 Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b Reviewed-on: https://webrtc-review.googlesource.com/60900 Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22356}
2018-03-09 09:52:59 +01:00
}
}
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
return best_index;
Reland "Rework rtp packet history" This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 Original change's description: > Rework rtp packet history > > This CL rewrites the history from the ground up, but keeps the logic > (mostly) intact. It does however lay the groundwork for adding a new > mode where TransportFeedback messages can be used to remove packets > from the history as we know the remote end has received them. > > This should both reduce memory usage and make the payload based padding > a little more likely to be useful. > > My tests show a reduction of ca 500-800kB reduction in memory usage per > rtp module. So with simulcast and/or fec this will increase. Lossy > links and long RTT will use more memory. > > I've also slightly update the interface to make usage with/without > pacer less unintuitive, and avoid making a copy of the entire RTP > packet just to find the ssrc and sequence number to put into the pacer. > > The more aggressive culling is not enabled by default. I will > wire that up in a follow-up CL, as there's some interface refactoring > required. > > Bug: webrtc:8975 > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > Reviewed-on: https://webrtc-review.googlesource.com/59441 > Commit-Queue: Erik Språng <sprang@webrtc.org> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22347} Bug: webrtc:8975 Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b Reviewed-on: https://webrtc-review.googlesource.com/60900 Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22356}
2018-03-09 09:52:59 +01:00
}
Revert "Reland "Rework rtp packet history"" This reverts commit 7bb37b884b197ea22e2830b043c09018c186bad5. Reason for revert: Breaks downstream projects Original change's description: > Reland "Rework rtp packet history" > > This is a reland of 6328d7cbbc8a72fdc81a766c0bf4039e1e2e7887 > > Original change's description: > > Rework rtp packet history > > > > This CL rewrites the history from the ground up, but keeps the logic > > (mostly) intact. It does however lay the groundwork for adding a new > > mode where TransportFeedback messages can be used to remove packets > > from the history as we know the remote end has received them. > > > > This should both reduce memory usage and make the payload based padding > > a little more likely to be useful. > > > > My tests show a reduction of ca 500-800kB reduction in memory usage per > > rtp module. So with simulcast and/or fec this will increase. Lossy > > links and long RTT will use more memory. > > > > I've also slightly update the interface to make usage with/without > > pacer less unintuitive, and avoid making a copy of the entire RTP > > packet just to find the ssrc and sequence number to put into the pacer. > > > > The more aggressive culling is not enabled by default. I will > > wire that up in a follow-up CL, as there's some interface refactoring > > required. > > > > Bug: webrtc:8975 > > Change-Id: I0c1bb528f32eeed0fb276b4ae77ae3235656980f > > Reviewed-on: https://webrtc-review.googlesource.com/59441 > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22347} > > Bug: webrtc:8975 > Change-Id: Ibbdbcc3c13bd58d994ad66f789a95ef9bd9bc19b > Reviewed-on: https://webrtc-review.googlesource.com/60900 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Erik Språng <sprang@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22356} TBR=danilchap@webrtc.org,sprang@webrtc.org Change-Id: Id698f5dbba6f9f871f37501d056e2b8463ebae50 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8975 Reviewed-on: https://webrtc-review.googlesource.com/61020 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22358}
2018-03-09 12:27:24 +00:00
void RtpPacketHistory::SetRtt(int64_t rtt_ms) {
rtc::CritScope cs(&critsect_);
RTC_DCHECK_GE(rtt_ms, 0);
rtt_ms_ = rtt_ms;
}
} // namespace webrtc