Index: talk/media/webrtc/webrtcvideoengine2.cc |
diff --git a/talk/media/webrtc/webrtcvideoengine2.cc b/talk/media/webrtc/webrtcvideoengine2.cc |
index d68d6192dbe4d818400cca524b246fdf86e80329..0a2152e5e4c891494f34df4a271acb13aa3ec90f 100644 |
--- a/talk/media/webrtc/webrtcvideoengine2.cc |
+++ b/talk/media/webrtc/webrtcvideoengine2.cc |
@@ -43,6 +43,7 @@ |
#include "webrtc/base/logging.h" |
#include "webrtc/base/stringutils.h" |
#include "webrtc/call.h" |
+#include "webrtc/modules/video_coding/codecs/h264/include/h264.h" |
#include "webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h" |
#include "webrtc/system_wrappers/interface/field_trial.h" |
#include "webrtc/system_wrappers/interface/trace_event.h" |
@@ -157,6 +158,10 @@ bool CodecIsInternallySupported(const std::string& codec_name) { |
webrtc::field_trial::FindFullName("WebRTC-SupportVP9"); |
return group_name == "Enabled" || group_name == "EnabledByFlag"; |
} |
+ if (CodecNamesEq(codec_name, kH264CodecName)) { |
+ return webrtc::H264Encoder::IsSupported() && |
+ webrtc::H264Decoder::IsSupported(); |
+ } |
return false; |
} |
@@ -316,8 +321,6 @@ static const int kDefaultQpMax = 56; |
static const int kDefaultRtcpReceiverReportSsrc = 1; |
-const char kH264CodecName[] = "H264"; |
- |
const int kMinBandwidthBps = 30000; |
const int kStartBandwidthBps = 300000; |
const int kMaxBandwidthBps = 2000000; |
@@ -331,6 +334,10 @@ std::vector<VideoCodec> DefaultVideoCodecList() { |
} |
codecs.push_back(MakeVideoCodecWithDefaultFeedbackParams(kDefaultVp8PlType, |
kVp8CodecName)); |
+ if (CodecIsInternallySupported(kH264CodecName)) { |
+ codecs.push_back(MakeVideoCodecWithDefaultFeedbackParams(kDefaultH264PlType, |
+ kH264CodecName)); |
+ } |
codecs.push_back( |
VideoCodec::CreateRtxCodec(kDefaultRtxVp8PlType, kDefaultVp8PlType)); |
codecs.push_back(VideoCodec(kDefaultRedPlType, kRedCodecName)); |
@@ -1876,6 +1883,9 @@ WebRtcVideoChannel2::WebRtcVideoSendStream::CreateVideoEncoder( |
} else if (type == webrtc::kVideoCodecVP9) { |
return AllocatedEncoder( |
webrtc::VideoEncoder::Create(webrtc::VideoEncoder::kVp9), type, false); |
+ } else if (type == webrtc::kVideoCodecH264) { |
+ return AllocatedEncoder( |
+ webrtc::VideoEncoder::Create(webrtc::VideoEncoder::kH264), type, false); |
} |
// This shouldn't happen, we should not be trying to create something we don't |
@@ -2284,6 +2294,11 @@ WebRtcVideoChannel2::WebRtcVideoReceiveStream::CreateOrReuseVideoDecoder( |
webrtc::VideoDecoder::Create(webrtc::VideoDecoder::kVp9), type, false); |
} |
+ if (type == webrtc::kVideoCodecH264) { |
+ return AllocatedDecoder( |
+ webrtc::VideoDecoder::Create(webrtc::VideoDecoder::kH264), type, false); |
+ } |
+ |
// This shouldn't happen, we should not be trying to create something we don't |
// support. |
DCHECK(false); |