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

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

Issue 2522553002: RtpPacketizer::NextPacket fills RtpPacket instead of payload. (Closed)
Patch Set: Named kTheMagicSix Created 4 years 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/rtp_format_vp8.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_format_vp8.cc b/webrtc/modules/rtp_rtcp/source/rtp_format_vp8.cc
index 7beeb181e2f64d6542785cb76aab50c802c3964c..e8e7f2997a74b3f566e23e2e949a6f91a97c1904 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_format_vp8.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_format_vp8.cc
@@ -17,6 +17,7 @@
#include "webrtc/base/logging.h"
#include "webrtc/modules/rtp_rtcp/source/vp8_partition_aggregator.h"
+#include "webrtc/modules/rtp_rtcp/source/rtp_packet_to_send.h"
namespace webrtc {
namespace {
@@ -197,9 +198,9 @@ void RtpPacketizerVp8::SetPayloadData(
}
}
-bool RtpPacketizerVp8::NextPacket(uint8_t* buffer,
- size_t* bytes_to_send,
- bool* last_packet) {
+bool RtpPacketizerVp8::NextPacket(RtpPacketToSend* packet, bool* last_packet) {
+ RTC_DCHECK(packet);
+ RTC_DCHECK(last_packet);
if (!packets_calculated_) {
int ret = 0;
if (aggr_mode_ == kAggrPartitions && balance_) {
@@ -217,13 +218,14 @@ bool RtpPacketizerVp8::NextPacket(uint8_t* buffer,
InfoStruct packet_info = packets_.front();
packets_.pop();
+ uint8_t* buffer = packet->AllocatePayload(max_payload_len_);
int bytes = WriteHeaderAndPayload(packet_info, buffer, max_payload_len_);
if (bytes < 0) {
return false;
}
- *bytes_to_send = static_cast<size_t>(bytes);
-
+ packet->SetPayloadSize(bytes);
*last_packet = packets_.empty();
+ packet->SetMarker(*last_packet);
return true;
}
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_format_vp8.h ('k') | webrtc/modules/rtp_rtcp/source/rtp_format_vp8_test_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698