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

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

Issue 2275443002: Minor fixes in FEC and RtpSender{,Video}. (pt. 2) (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@header_reader_writer-pt1-move_copy_column
Patch Set: Created 4 years, 4 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
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender_video.h ('k') | webrtc/modules/rtp_rtcp/test/testFec/test_fec.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc b/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc
index b419568293ee6cc88a3c42a250bb2402c9992bbc..a749adb358b910edd01d94e33066a51bd947ad6c 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc
@@ -26,15 +26,17 @@
#include "webrtc/modules/rtp_rtcp/source/rtp_format_vp8.h"
#include "webrtc/modules/rtp_rtcp/source/rtp_format_vp9.h"
-namespace webrtc {
+namespace {
danilchap 2016/08/23 09:16:11 keep unnammed namespace inside webrtc namespace
brandtr 2016/08/23 09:36:36 Done.
+
danilchap 2016/08/23 09:16:11 probably nicer without extra empty lines when ther
brandtr 2016/08/23 09:36:36 Done.
+constexpr size_t kRedForFecHeaderLength = 1;
-enum { REDForFECHeaderLength = 1 };
+} // namespace
+
+namespace webrtc {
RTPSenderVideo::RTPSenderVideo(Clock* clock, RTPSender* rtp_sender)
: rtp_sender_(rtp_sender),
clock_(clock),
- // Generic FEC
- producer_fec_(&fec_),
fec_bitrate_(1000, RateStatistics::kBpsScale),
video_bitrate_(1000, RateStatistics::kBpsScale) {}
@@ -177,7 +179,7 @@ void RTPSenderVideo::GenericFECStatus(bool* enable,
*payload_type_fec = fec_payload_type_;
}
-size_t RTPSenderVideo::FECPacketOverhead() const {
+size_t RTPSenderVideo::FecPacketOverhead() const {
rtc::CritScope cs(&crit_);
size_t overhead = 0;
if (red_payload_type_ != 0) {
@@ -186,11 +188,11 @@ size_t RTPSenderVideo::FECPacketOverhead() const {
// This reason for the header extensions to be included here is that
// from an FEC viewpoint, they are part of the payload to be protected.
// (The base RTP header is already protected by the FEC header.)
- return ForwardErrorCorrection::PacketOverhead() + REDForFECHeaderLength +
+ return producer_fec_.MaxPacketOverhead() + kRedForFecHeaderLength +
(rtp_sender_->RtpHeaderLength() - kRtpHeaderSize);
}
if (fec_enabled_)
- overhead += ForwardErrorCorrection::PacketOverhead();
+ overhead += producer_fec_.MaxPacketOverhead();
return overhead;
}
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender_video.h ('k') | webrtc/modules/rtp_rtcp/test/testFec/test_fec.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698