Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(991)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtcp_packet/compound_packet.cc

Issue 1582323005: [rtp_rtcp] Append functionality moved from base RtcpPacket class to CompoundPacket (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/rtp_rtcp/source/rtcp_packet/compound_packet.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_packet/compound_packet.cc b/webrtc/modules/rtp_rtcp/source/rtcp_packet/compound_packet.cc
index 8f5afd5dd176e8a6c1426d77a924b1ef98809254..eead45d37018b75fb4629cfc1a9a138a560d1f73 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_packet/compound_packet.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_packet/compound_packet.cc
@@ -10,18 +10,33 @@
#include "webrtc/modules/rtp_rtcp/source/rtcp_packet/compound_packet.h"
+#include "webrtc/base/checks.h"
+
namespace webrtc {
namespace rtcp {
+void CompoundPacket::Append(RtcpPacket* packet) {
+ RTC_CHECK(packet);
+ appended_packets_.push_back(packet);
+}
+
bool CompoundPacket::Create(uint8_t* packet,
size_t* index,
size_t max_length,
RtcpPacket::PacketReadyCallback* callback) const {
+ for (RtcpPacket* appended : appended_packets_) {
+ if (!appended->Create(packet, index, max_length, callback))
+ return false;
+ }
return true;
}
size_t CompoundPacket::BlockLength() const {
- return 0;
+ size_t block_length = 0;
+ for (RtcpPacket* appended : appended_packets_) {
+ block_length += appended->BlockLength();
+ }
+ return block_length;
}
} // namespace rtcp

Powered by Google App Engine
This is Rietveld 408576698