mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 13:50:40 +01:00

Adds separate priorities for audio and video retranmission. Done by adding an original type to RtpPacketToSend. Add possiblity to set TTL for audio nack, video nack and video packet separately. Oldest packet for these types are dropped when a new packet of that type is pushed to the pacer, or when the pacer switch current priority type to that priority. Effect is that: -pacer queue does not grow unlimited for these types if a TTL has been set. -an old packet is not sent. Bug: webrtc:15740 Change-Id: I38718bc570aebca54eacbded69824905f3694f41 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/331823 Commit-Queue: Per Kjellander <perkj@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/main@{#41414}
42 lines
1.5 KiB
C++
42 lines
1.5 KiB
C++
/*
|
|
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#include "modules/rtp_rtcp/source/rtp_packet_to_send.h"
|
|
|
|
#include <cstdint>
|
|
|
|
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
|
|
|
namespace webrtc {
|
|
|
|
RtpPacketToSend::RtpPacketToSend(const ExtensionManager* extensions)
|
|
: RtpPacket(extensions) {}
|
|
RtpPacketToSend::RtpPacketToSend(const ExtensionManager* extensions,
|
|
size_t capacity)
|
|
: RtpPacket(extensions, capacity) {}
|
|
RtpPacketToSend::RtpPacketToSend(const RtpPacketToSend& packet) = default;
|
|
RtpPacketToSend::RtpPacketToSend(RtpPacketToSend&& packet) = default;
|
|
|
|
RtpPacketToSend& RtpPacketToSend::operator=(const RtpPacketToSend& packet) =
|
|
default;
|
|
RtpPacketToSend& RtpPacketToSend::operator=(RtpPacketToSend&& packet) = default;
|
|
|
|
RtpPacketToSend::~RtpPacketToSend() = default;
|
|
|
|
void RtpPacketToSend::set_packet_type(RtpPacketMediaType type) {
|
|
if (packet_type_ == RtpPacketMediaType::kAudio) {
|
|
original_packet_type_ = OriginalType::kAudio;
|
|
} else if (packet_type_ == RtpPacketMediaType::kVideo) {
|
|
original_packet_type_ = OriginalType::kVideo;
|
|
}
|
|
packet_type_ = type;
|
|
}
|
|
|
|
} // namespace webrtc
|