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

Unified Diff: webrtc/video/video_send_stream.cc

Issue 1692783005: Revert of Don't send FEC for H.264 with NACK enabled. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 10 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/video/end_to_end_tests.cc ('k') | webrtc/video/video_send_stream_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/video_send_stream.cc
diff --git a/webrtc/video/video_send_stream.cc b/webrtc/video/video_send_stream.cc
index 959508570dc441d82e31e89a4f54a4bcbfcb5aa9..5c3f74fd7e815a7fdf13b194a82130b8698dc2f2 100644
--- a/webrtc/video/video_send_stream.cc
+++ b/webrtc/video/video_send_stream.cc
@@ -106,35 +106,6 @@
}
namespace {
-
-VideoCodecType PayloadNameToCodecType(const std::string& payload_name) {
- if (payload_name == "VP8")
- return kVideoCodecVP8;
- if (payload_name == "VP9")
- return kVideoCodecVP9;
- if (payload_name == "H264")
- return kVideoCodecH264;
- return kVideoCodecGeneric;
-}
-
-bool PayloadTypeSupportsSkippingFecPackets(const std::string& payload_name) {
- switch (PayloadNameToCodecType(payload_name)) {
- case kVideoCodecVP8:
- case kVideoCodecVP9:
- return true;
- case kVideoCodecH264:
- case kVideoCodecGeneric:
- return false;
- case kVideoCodecI420:
- case kVideoCodecRED:
- case kVideoCodecULPFEC:
- case kVideoCodecUnknown:
- RTC_NOTREACHED();
- return false;
- }
- RTC_NOTREACHED();
- return false;
-}
CpuOveruseOptions GetCpuOveruseOptions(bool full_overuse_time) {
CpuOveruseOptions options;
@@ -244,19 +215,7 @@
// Enable NACK, FEC or both.
const bool enable_protection_nack = config_.rtp.nack.rtp_history_ms > 0;
- bool enable_protection_fec = config_.rtp.fec.red_payload_type != -1;
- // Payload types without picture ID cannot determine that a stream is complete
- // without retransmitting FEC, so using FEC + NACK for H.264 (for instance) is
- // a waste of bandwidth since FEC packets still have to be transmitted. Note
- // that this is not the case with FLEXFEC.
- if (enable_protection_nack &&
- !PayloadTypeSupportsSkippingFecPackets(
- config_.encoder_settings.payload_name)) {
- LOG(LS_WARNING) << "Transmitting payload type without picture ID using"
- "NACK+FEC is a waste of bandwidth since FEC packets "
- "also have to be retransmitted. Disabling FEC.";
- enable_protection_fec = false;
- }
+ const bool enable_protection_fec = config_.rtp.fec.red_payload_type != -1;
// TODO(changbin): Should set RTX for RED mapping in RTP sender in future.
vie_channel_.SetProtectionMode(enable_protection_nack, enable_protection_fec,
config_.rtp.fec.red_payload_type,
@@ -365,8 +324,15 @@
VideoCodec video_codec;
memset(&video_codec, 0, sizeof(video_codec));
- video_codec.codecType =
- PayloadNameToCodecType(config_.encoder_settings.payload_name);
+ if (config_.encoder_settings.payload_name == "VP8") {
+ video_codec.codecType = kVideoCodecVP8;
+ } else if (config_.encoder_settings.payload_name == "VP9") {
+ video_codec.codecType = kVideoCodecVP9;
+ } else if (config_.encoder_settings.payload_name == "H264") {
+ video_codec.codecType = kVideoCodecH264;
+ } else {
+ video_codec.codecType = kVideoCodecGeneric;
+ }
switch (config.content_type) {
case VideoEncoderConfig::ContentType::kRealtimeVideo:
« no previous file with comments | « webrtc/video/end_to_end_tests.cc ('k') | webrtc/video/video_send_stream_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698