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

Unified Diff: webrtc/modules/rtp_rtcp/source/producer_fec.cc

Issue 2217383002: Use RtpPacketToSend in RtpSenderVideo (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Ported PlayoutDelay extension support. Created 4 years, 3 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/producer_fec.cc
diff --git a/webrtc/modules/rtp_rtcp/source/producer_fec.cc b/webrtc/modules/rtp_rtcp/source/producer_fec.cc
index 941773e6e31e534ea32aa4c46b849f5d0a55bba5..52a10f819187f5d48b669266cdba3493cc2b4256 100644
--- a/webrtc/modules/rtp_rtcp/source/producer_fec.cc
+++ b/webrtc/modules/rtp_rtcp/source/producer_fec.cc
@@ -17,6 +17,7 @@
#include "webrtc/base/checks.h"
#include "webrtc/modules/rtp_rtcp/source/byte_io.h"
#include "webrtc/modules/rtp_rtcp/source/forward_error_correction.h"
+#include "webrtc/modules/rtp_rtcp/source/rtp_packet_to_send.h"
#include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
namespace webrtc {
@@ -109,6 +110,21 @@ ProducerFec::~ProducerFec() {
DeleteMediaPackets();
}
+void ProducerFec::BuildRedPacket(int red_payload_type,
+ const RtpPacketToSend& media_packet,
+ RtpPacketToSend* red_packet) {
+ RTC_DCHECK_GE(red_packet->capacity(),
+ media_packet.size() + kRedForFecHeaderLength);
+ red_packet->CopyHeaderFrom(media_packet);
+ red_packet->SetPayloadType(red_payload_type);
+ uint8_t* red_payload = red_packet->AllocatePayload(
+ kRedForFecHeaderLength + media_packet.payload_size());
+ red_payload[0] = media_packet.PayloadType();
+ memcpy(&red_payload[kRedForFecHeaderLength], media_packet.payload(),
+ media_packet.payload_size());
+ red_packet->set_capture_time_ms(media_packet.capture_time_ms());
+}
+
std::unique_ptr<RedPacket> ProducerFec::BuildRedPacket(
const uint8_t* data_buffer,
size_t payload_length,
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/producer_fec.h ('k') | webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698