From df9bbbee56f4d9ecef93b3c46964b6f29803f81b Mon Sep 17 00:00:00 2001 From: "buildbot@webrtc.org" Date: Thu, 19 Jun 2014 19:54:33 +0000 Subject: [PATCH] (Auto)update libjingle 69567902-> 69568113 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6498 4adac7df-926f-26a2-2b94-8c16560cd09d --- talk/media/base/constants.h | 1 - talk/media/webrtc/constants.h | 46 +++++++++++++++++++++++++ talk/media/webrtc/webrtcvideoengine.cc | 43 ++++++++++++----------- talk/media/webrtc/webrtcvideoengine2.cc | 18 +++------- 4 files changed, 72 insertions(+), 36 deletions(-) create mode 100755 talk/media/webrtc/constants.h diff --git a/talk/media/base/constants.h b/talk/media/base/constants.h index dc5405d17..5ac1be2b6 100644 --- a/talk/media/base/constants.h +++ b/talk/media/base/constants.h @@ -47,7 +47,6 @@ extern const char kRtxCodecName[]; extern const char kRedCodecName[]; extern const char kUlpfecCodecName[]; - // Codec parameters extern const int kWildcardPayloadType; extern const char kCodecParamAssociatedPayloadType[]; diff --git a/talk/media/webrtc/constants.h b/talk/media/webrtc/constants.h new file mode 100755 index 000000000..68f664bd9 --- /dev/null +++ b/talk/media/webrtc/constants.h @@ -0,0 +1,46 @@ +/* + * libjingle + * Copyright 2014 Google Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef TALK_MEDIA_WEBRTC_CONSTANTS_H_ +#define TALK_MEDIA_WEBRTC_CONSTANTS_H_ + +namespace cricket { + +extern const int kVideoMtu; +extern const int kVideoRtpBufferSize; + +extern const char kVp8CodecName[]; + +extern const int kDefaultFramerate; +extern const int kMinVideoBitrate; +extern const int kStartVideoBitrate; +extern const int kMaxVideoBitrate; + +extern const int kCpuMonitorPeriodMs; + +} // namespace cricket + +#endif // TALK_MEDIA_WEBRTC_CONSTANTS_H_ diff --git a/talk/media/webrtc/webrtcvideoengine.cc b/talk/media/webrtc/webrtcvideoengine.cc index fd609e9a4..276b5b440 100644 --- a/talk/media/webrtc/webrtcvideoengine.cc +++ b/talk/media/webrtc/webrtcvideoengine.cc @@ -51,6 +51,7 @@ #include "talk/media/base/videocapturer.h" #include "talk/media/base/videorenderer.h" #include "talk/media/devices/filevideocapturer.h" +#include "talk/media/webrtc/constants.h" #include "talk/media/webrtc/webrtcpassthroughrender.h" #include "talk/media/webrtc/webrtctexturevideoframe.h" #include "talk/media/webrtc/webrtcvideocapturer.h" @@ -66,24 +67,26 @@ namespace cricket { +// Constants defined in talk/media/webrtc/constants.h +// TODO(pbos): Move these to a separate constants.cc file. +const int kVideoMtu = 1200; +const int kVideoRtpBufferSize = 65536; + +const char kVp8CodecName[] = "VP8"; + +const int kDefaultFramerate = 30; +const int kMinVideoBitrate = 50; +const int kStartVideoBitrate = 300; +const int kMaxVideoBitrate = 2000; + +const int kCpuMonitorPeriodMs = 2000; // 2 seconds. + static const int kDefaultLogSeverity = talk_base::LS_WARNING; -static const int kMinVideoBitrate = 50; -static const int kStartVideoBitrate = 300; -static const int kMaxVideoBitrate = 2000; - // Controlled by exp, try a super low minimum bitrate for poor connections. static const int kLowerMinBitrate = 30; -static const int kVideoMtu = 1200; - -static const int kVideoRtpBufferSize = 65536; - -static const char kVp8PayloadName[] = "VP8"; -static const char kRedPayloadName[] = "red"; -static const char kFecPayloadName[] = "ulpfec"; - static const int kDefaultNumberOfTemporalLayers = 1; // 1:1 static const int kExternalVideoPayloadTypeBase = 120; @@ -129,8 +132,6 @@ static int SeverityToFilter(int severity) { return filter; } -static const int kCpuMonitorPeriodMs = 2000; // 2 seconds. - static const bool kNotSending = false; // Default video dscp value. @@ -828,9 +829,9 @@ class WebRtcVideoChannelSendInfo : public sigslot::has_slots<> { const WebRtcVideoEngine::VideoCodecPref WebRtcVideoEngine::kVideoCodecPrefs[] = { - {kVp8PayloadName, 100, -1, 0}, - {kRedPayloadName, 116, -1, 1}, - {kFecPayloadName, 117, -1, 2}, + {kVp8CodecName, 100, -1, 0}, + {kRedCodecName, 116, -1, 1}, + {kUlpfecCodecName, 117, -1, 2}, {kRtxCodecName, 96, 100, 3}, }; @@ -1444,7 +1445,7 @@ bool WebRtcVideoEngine::RebuildCodecList(const VideoCodec& in_codec) { VideoCodec codec(pref.payload_type, pref.name, in_codec.width, in_codec.height, in_codec.framerate, static_cast(ARRAY_SIZE(kVideoCodecPrefs) - i)); - if (_stricmp(kVp8PayloadName, codec.name.c_str()) == 0) { + if (_stricmp(kVp8CodecName, codec.name.c_str()) == 0) { AddDefaultFeedbackParams(&codec); } if (pref.associated_payload_type != -1) { @@ -1705,9 +1706,9 @@ bool WebRtcVideoMediaChannel::SetSendCodecs( bool remb_enabled = remb_enabled_; for (std::vector::const_iterator iter = codecs.begin(); iter != codecs.end(); ++iter) { - if (_stricmp(iter->name.c_str(), kRedPayloadName) == 0) { + if (_stricmp(iter->name.c_str(), kRedCodecName) == 0) { send_red_type_ = iter->id; - } else if (_stricmp(iter->name.c_str(), kFecPayloadName) == 0) { + } else if (_stricmp(iter->name.c_str(), kUlpfecCodecName) == 0) { send_fec_type_ = iter->id; } else if (_stricmp(iter->name.c_str(), kRtxCodecName) == 0) { int rtx_type = iter->id; @@ -3871,7 +3872,7 @@ bool WebRtcVideoMediaChannel::SetReceiveCodecs( // We currently only support RTX associated with VP8 due to limitations // in webrtc where only one RTX payload type can be registered. valid_apt = codec_it != pt_to_codec.end() && - _stricmp(codec_it->second->plName, kVp8PayloadName) == 0; + _stricmp(codec_it->second->plName, kVp8CodecName) == 0; } if (!valid_apt) { LOG(LS_ERROR) << "The RTX codec isn't associated with a known and " diff --git a/talk/media/webrtc/webrtcvideoengine2.cc b/talk/media/webrtc/webrtcvideoengine2.cc index 716c5a885..832f9a911 100644 --- a/talk/media/webrtc/webrtcvideoengine2.cc +++ b/talk/media/webrtc/webrtcvideoengine2.cc @@ -42,6 +42,7 @@ #include "talk/base/stringutils.h" #include "talk/media/base/videocapturer.h" #include "talk/media/base/videorenderer.h" +#include "talk/media/webrtc/constants.h" #include "talk/media/webrtc/webrtcvideocapturer.h" #include "talk/media/webrtc/webrtcvideoframe.h" #include "talk/media/webrtc/webrtcvoiceengine.h" @@ -55,28 +56,17 @@ namespace cricket { -static const int kCpuMonitorPeriodMs = 2000; // 2 seconds. - // This constant is really an on/off, lower-level configurable NACK history // duration hasn't been implemented. static const int kNackHistoryMs = 1000; -static const int kDefaultFramerate = 30; -static const int kMinVideoBitrate = 50; -static const int kMaxVideoBitrate = 2000; - -static const int kVideoMtu = 1200; -static const int kVideoRtpBufferSize = 65536; - -static const char kVp8PayloadName[] = "VP8"; - static const int kDefaultRtcpReceiverReportSsrc = 1; struct VideoCodecPref { int payload_type; const char* name; int rtx_payload_type; -} kDefaultVideoCodecPref = {100, kVp8PayloadName, 96}; +} kDefaultVideoCodecPref = {100, kVp8CodecName, 96}; VideoCodecPref kRedPref = {116, kRedCodecName, -1}; VideoCodecPref kUlpfecPref = {117, kUlpfecCodecName, -1}; @@ -251,7 +241,7 @@ webrtc::VideoEncoder* WebRtcVideoEncoderFactory2::CreateVideoEncoder( } bool WebRtcVideoEncoderFactory2::SupportsCodec(const VideoCodec& codec) { - return _stricmp(codec.name.c_str(), kVp8PayloadName) == 0; + return _stricmp(codec.name.c_str(), kVp8CodecName) == 0; } WebRtcVideoEngine2::WebRtcVideoEngine2() { @@ -814,7 +804,7 @@ bool WebRtcVideoChannel2::SetRecvCodecs(const std::vector& codecs) { // TODO(pbos): Add a decoder factory which controls supported codecs. // Blocked on webrtc:2854. for (size_t i = 0; i < mapped_codecs.size(); ++i) { - if (_stricmp(mapped_codecs[i].codec.name.c_str(), kVp8PayloadName) != 0) { + if (_stricmp(mapped_codecs[i].codec.name.c_str(), kVp8CodecName) != 0) { LOG(LS_ERROR) << "SetRecvCodecs called with unsupported codec: '" << mapped_codecs[i].codec.name << "'"; return false;