diff --git a/talk/app/webrtc/mediaconstraintsinterface.h b/talk/app/webrtc/mediaconstraintsinterface.h index bc3872ce47..48022dd89d 100644 --- a/talk/app/webrtc/mediaconstraintsinterface.h +++ b/talk/app/webrtc/mediaconstraintsinterface.h @@ -112,10 +112,13 @@ class MediaConstraintsInterface { // stripped by Chrome before passed down to Libjingle. static const char kInternalConstraintPrefix[]; - // This constraint is for internal use only, representing the Chrome command - // line flag. So it is prefixed with "internal" so JS values will be removed. + // These constraints are for internal use only, representing Chrome command + // line flags. So they are prefixed with "internal" so JS values will be + // removed. // Used by a local audio source. static const char kInternalAecDump[]; // internalAecDump + // Used for disabling security and use plain RTP. + static const char kInternalDisableEncryption[]; // internalDisableEncryption protected: // Dtor protected as objects shouldn't be deleted via this interface diff --git a/talk/app/webrtc/webrtcsession.cc b/talk/app/webrtc/webrtcsession.cc index 83f8912828..ff331a9e06 100644 --- a/talk/app/webrtc/webrtcsession.cc +++ b/talk/app/webrtc/webrtcsession.cc @@ -69,6 +69,9 @@ const char MediaConstraintsInterface::kEnableRtpDataChannels[] = const char MediaConstraintsInterface::kEnableSctpDataChannels[] = "internalSctpDataChannels"; +const char MediaConstraintsInterface::kInternalDisableEncryption[] = + "internalDisableEncryption"; + // Error messages const char kSetLocalSdpFailed[] = "SetLocalDescription failed: "; const char kSetRemoteSdpFailed[] = "SetRemoteDescription failed: "; @@ -488,6 +491,15 @@ bool WebRtcSession::Initialize( webrtc_session_desc_factory_->SignalIdentityReady.connect( this, &WebRtcSession::OnIdentityReady); + + // Disable encryption if kDisableEncryption is set. + if (FindConstraint( + constraints, + MediaConstraintsInterface::kInternalDisableEncryption, + &value, NULL) && value) { + webrtc_session_desc_factory_->set_secure(cricket::SEC_DISABLED); + } + return true; } diff --git a/talk/app/webrtc/webrtcsession_unittest.cc b/talk/app/webrtc/webrtcsession_unittest.cc index acbc92439b..c47fb177f7 100644 --- a/talk/app/webrtc/webrtcsession_unittest.cc +++ b/talk/app/webrtc/webrtcsession_unittest.cc @@ -1877,8 +1877,10 @@ TEST_F(WebRtcSessionTest, VerifyCryptoParamsInSDP) { } TEST_F(WebRtcSessionTest, VerifyNoCryptoParamsInSDP) { + constraints_.reset(new FakeConstraints()); + constraints_->AddOptional( + webrtc::MediaConstraintsInterface::kInternalDisableEncryption, true); Init(NULL); - session_->set_secure_policy(cricket::SEC_DISABLED); mediastream_signaling_.SendAudioVideoStream1(); scoped_ptr offer( CreateOffer(NULL)); @@ -2342,9 +2344,11 @@ TEST_F(WebRtcSessionTest, TestCryptoAfterSetLocalDescription) { // This test verifies the crypto parameter when security is disabled. TEST_F(WebRtcSessionTest, TestCryptoAfterSetLocalDescriptionWithDisabled) { + constraints_.reset(new FakeConstraints()); + constraints_->AddOptional( + webrtc::MediaConstraintsInterface::kInternalDisableEncryption, true); Init(NULL); mediastream_signaling_.SendAudioVideoStream1(); - session_->set_secure_policy(cricket::SEC_DISABLED); talk_base::scoped_ptr offer( CreateOffer(NULL)); diff --git a/talk/base/natsocketfactory.cc b/talk/base/natsocketfactory.cc index a7c4240b3e..1686f206e8 100644 --- a/talk/base/natsocketfactory.cc +++ b/talk/base/natsocketfactory.cc @@ -85,7 +85,7 @@ size_t UnpackAddressFromNAT(const char* buf, size_t buf_size, class NATSocket : public AsyncSocket, public sigslot::has_slots<> { public: explicit NATSocket(NATInternalSocketFactory* sf, int family, int type) - : sf_(sf), family_(family), type_(type), async_(true), connected_(false), + : sf_(sf), family_(family), type_(type), connected_(false), socket_(NULL), buf_(NULL), size_(0) { } @@ -312,7 +312,6 @@ class NATSocket : public AsyncSocket, public sigslot::has_slots<> { NATInternalSocketFactory* sf_; int family_; int type_; - bool async_; bool connected_; SocketAddress remote_addr_; SocketAddress server_addr_; // address of the NAT server diff --git a/talk/media/base/rtpdataengine_unittest.cc b/talk/media/base/rtpdataengine_unittest.cc index 37ea968df1..bc46818978 100644 --- a/talk/media/base/rtpdataengine_unittest.cc +++ b/talk/media/base/rtpdataengine_unittest.cc @@ -299,8 +299,7 @@ TEST_F(RtpDataMediaChannelTest, SendData) { EXPECT_EQ(header0.timestamp + 180000, header1.timestamp); } -// See: https://code.google.com/p/webrtc/issues/detail?id=2409 -TEST_F(RtpDataMediaChannelTest, DISABLED_SendDataMultipleClocks) { +TEST_F(RtpDataMediaChannelTest, SendDataMultipleClocks) { // Timings owned by RtpDataEngines. FakeTiming* timing1 = new FakeTiming(); talk_base::scoped_ptr dme1(CreateEngine(timing1)); diff --git a/talk/media/webrtc/webrtcmediaengine.h b/talk/media/webrtc/webrtcmediaengine.h index a2ee658761..5690ca0db0 100644 --- a/talk/media/webrtc/webrtcmediaengine.h +++ b/talk/media/webrtc/webrtcmediaengine.h @@ -87,10 +87,13 @@ class WebRtcMediaEngine : public cricket::MediaEngineInterface { virtual SoundclipMedia* CreateSoundclip() OVERRIDE { return delegate_->CreateSoundclip(); } - virtual bool SetAudioOptions(int options) OVERRIDE { + virtual AudioOptions GetAudioOptions() const OVERRIDE { + return delegate_->GetAudioOptions(); + } + virtual bool SetAudioOptions(const AudioOptions& options) OVERRIDE { return delegate_->SetAudioOptions(options); } - virtual bool SetVideoOptions(int options) OVERRIDE { + virtual bool SetVideoOptions(const VideoOptions& options) OVERRIDE { return delegate_->SetVideoOptions(options); } virtual bool SetAudioDelayOffset(int offset) OVERRIDE {