summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorperkj@webrtc.org <perkj@webrtc.org>2014-11-04 11:31:29 +0000
committerperkj@webrtc.org <perkj@webrtc.org>2014-11-04 11:31:29 +0000
commit42536c6027e2446aced33365a6719169e97876dc (patch)
tree6f0398769e096ede6a464dea3281568f5ffabb5d
parentb428c1d8bc72749e3abb70f8dc4438e8cbf8cb82 (diff)
downloadtalk-42536c6027e2446aced33365a6719169e97876dc.tar.gz
Prepare for removal of PeerConnectionObserver::OnError.
Prepare for removal of constraints to PeerConnection::AddStream. OnError has never been implemented and has been removed from the spec. Also, constraints to PeerConnection::AddStream has also been removed from the spec and have never been implemented. R=pbos@webrtc.org Review URL: https://webrtc-codereview.appspot.com/23319004 git-svn-id: http://webrtc.googlecode.com/svn/trunk/talk@7605 4adac7df-926f-26a2-2b94-8c16560cd09d
-rw-r--r--app/webrtc/java/jni/peerconnection_jni.cc14
-rw-r--r--app/webrtc/java/src/org/webrtc/PeerConnection.java11
-rw-r--r--app/webrtc/javatests/src/org/webrtc/PeerConnectionTest.java7
-rw-r--r--app/webrtc/objc/RTCPeerConnection.mm6
-rw-r--r--app/webrtc/objc/RTCPeerConnectionObserver.h2
-rw-r--r--app/webrtc/objc/RTCPeerConnectionObserver.mm4
-rw-r--r--app/webrtc/objc/public/RTCPeerConnection.h3
-rw-r--r--app/webrtc/objc/public/RTCPeerConnectionDelegate.h3
-rw-r--r--app/webrtc/objctests/RTCPeerConnectionSyncObserver.m5
-rw-r--r--app/webrtc/objctests/RTCPeerConnectionTest.mm3
-rw-r--r--app/webrtc/peerconnection.cc4
-rw-r--r--app/webrtc/peerconnection.h3
-rw-r--r--app/webrtc/peerconnection_unittest.cc3
-rw-r--r--app/webrtc/peerconnectionfactory_unittest.cc3
-rw-r--r--app/webrtc/peerconnectioninterface.h17
-rw-r--r--app/webrtc/peerconnectioninterface_unittest.cc11
-rw-r--r--app/webrtc/peerconnectionproxy.h3
-rw-r--r--app/webrtc/test/peerconnectiontestwrapper.cc2
-rw-r--r--app/webrtc/test/peerconnectiontestwrapper.h1
-rw-r--r--examples/android/src/org/appspot/apprtc/PeerConnectionClient.java11
-rw-r--r--examples/objc/AppRTCDemo/APPRTCConnectionManager.m12
-rw-r--r--examples/peerconnection/client/conductor.cc11
-rw-r--r--examples/peerconnection/client/conductor.h3
23 files changed, 40 insertions, 102 deletions
diff --git a/app/webrtc/java/jni/peerconnection_jni.cc b/app/webrtc/java/jni/peerconnection_jni.cc
index d82a54f..fb36cf8 100644
--- a/app/webrtc/java/jni/peerconnection_jni.cc
+++ b/app/webrtc/java/jni/peerconnection_jni.cc
@@ -586,13 +586,6 @@ class PCOJava : public PeerConnectionObserver {
CHECK_EXCEPTION(jni()) << "error during CallVoidMethod";
}
- virtual void OnError() OVERRIDE {
- ScopedLocalRefFrame local_ref_frame(jni());
- jmethodID m = GetMethodID(jni(), *j_observer_class_, "onError", "()V");
- jni()->CallVoidMethod(*j_observer_global_, m);
- CHECK_EXCEPTION(jni()) << "error during CallVoidMethod";
- }
-
virtual void OnSignalingChange(
PeerConnectionInterface::SignalingState new_state) OVERRIDE {
ScopedLocalRefFrame local_ref_frame(jni());
@@ -3144,12 +3137,9 @@ JOW(jboolean, PeerConnection_nativeAddIceCandidate)(
}
JOW(jboolean, PeerConnection_nativeAddLocalStream)(
- JNIEnv* jni, jobject j_pc, jlong native_stream, jobject j_constraints) {
- scoped_ptr<ConstraintsWrapper> constraints(
- new ConstraintsWrapper(jni, j_constraints));
+ JNIEnv* jni, jobject j_pc, jlong native_stream) {
return ExtractNativePC(jni, j_pc)->AddStream(
- reinterpret_cast<MediaStreamInterface*>(native_stream),
- constraints.get());
+ reinterpret_cast<MediaStreamInterface*>(native_stream));
}
JOW(void, PeerConnection_nativeRemoveLocalStream)(
diff --git a/app/webrtc/java/src/org/webrtc/PeerConnection.java b/app/webrtc/java/src/org/webrtc/PeerConnection.java
index c2617de..3aef6ff 100644
--- a/app/webrtc/java/src/org/webrtc/PeerConnection.java
+++ b/app/webrtc/java/src/org/webrtc/PeerConnection.java
@@ -71,9 +71,6 @@ public class PeerConnection {
/** Triggered when a new ICE candidate has been found. */
public void onIceCandidate(IceCandidate candidate);
- /** Triggered on any error. */
- public void onError();
-
/** Triggered when media is received on a new stream from remote peer. */
public void onAddStream(MediaStream stream);
@@ -147,9 +144,8 @@ public class PeerConnection {
candidate.sdpMid, candidate.sdpMLineIndex, candidate.sdp);
}
- public boolean addStream(
- MediaStream stream, MediaConstraints constraints) {
- boolean ret = nativeAddLocalStream(stream.nativeStream, constraints);
+ public boolean addStream(MediaStream stream) {
+ boolean ret = nativeAddLocalStream(stream.nativeStream);
if (!ret) {
return false;
}
@@ -194,8 +190,7 @@ public class PeerConnection {
private native boolean nativeAddIceCandidate(
String sdpMid, int sdpMLineIndex, String iceCandidateSdp);
- private native boolean nativeAddLocalStream(
- long nativeStream, MediaConstraints constraints);
+ private native boolean nativeAddLocalStream(long nativeStream);
private native void nativeRemoveLocalStream(long nativeStream);
diff --git a/app/webrtc/javatests/src/org/webrtc/PeerConnectionTest.java b/app/webrtc/javatests/src/org/webrtc/PeerConnectionTest.java
index 240e996..048d92b 100644
--- a/app/webrtc/javatests/src/org/webrtc/PeerConnectionTest.java
+++ b/app/webrtc/javatests/src/org/webrtc/PeerConnectionTest.java
@@ -117,11 +117,6 @@ public class PeerConnectionTest extends TestCase {
++expectedErrors;
}
- @Override
- public synchronized void onError() {
- assertTrue(--expectedErrors >= 0);
- }
-
public synchronized void expectSetSize() {
if (RENDER_TO_GUI) {
// When new frames are delivered to the GUI renderer we don't get
@@ -489,7 +484,7 @@ public class PeerConnectionTest extends TestCase {
lMS.addTrack(videoTrack);
lMS.addTrack(factory.createAudioTrack(
audioTrackId, factory.createAudioSource(new MediaConstraints())));
- pc.addStream(lMS, new MediaConstraints());
+ pc.addStream(lMS);
return new WeakReference<MediaStream>(lMS);
}
diff --git a/app/webrtc/objc/RTCPeerConnection.mm b/app/webrtc/objc/RTCPeerConnection.mm
index 72ba373..925de73 100644
--- a/app/webrtc/objc/RTCPeerConnection.mm
+++ b/app/webrtc/objc/RTCPeerConnection.mm
@@ -151,10 +151,8 @@ class RTCStatsObserver : public StatsObserver {
return self.peerConnection->AddIceCandidate(iceCandidate.get());
}
-- (BOOL)addStream:(RTCMediaStream*)stream
- constraints:(RTCMediaConstraints*)constraints {
- BOOL ret = self.peerConnection->AddStream(stream.mediaStream,
- constraints.constraints);
+- (BOOL)addStream:(RTCMediaStream*)stream {
+ BOOL ret = self.peerConnection->AddStream(stream.mediaStream);
if (!ret) {
return NO;
}
diff --git a/app/webrtc/objc/RTCPeerConnectionObserver.h b/app/webrtc/objc/RTCPeerConnectionObserver.h
index f66b567..8378ff8 100644
--- a/app/webrtc/objc/RTCPeerConnectionObserver.h
+++ b/app/webrtc/objc/RTCPeerConnectionObserver.h
@@ -41,8 +41,6 @@ class RTCPeerConnectionObserver : public PeerConnectionObserver {
RTCPeerConnectionObserver(RTCPeerConnection* peerConnection);
virtual ~RTCPeerConnectionObserver();
- virtual void OnError() OVERRIDE;
-
// Triggered when the SignalingState changed.
virtual void OnSignalingChange(
PeerConnectionInterface::SignalingState new_state) OVERRIDE;
diff --git a/app/webrtc/objc/RTCPeerConnectionObserver.mm b/app/webrtc/objc/RTCPeerConnectionObserver.mm
index a0206e5..f4cab7f 100644
--- a/app/webrtc/objc/RTCPeerConnectionObserver.mm
+++ b/app/webrtc/objc/RTCPeerConnectionObserver.mm
@@ -46,10 +46,6 @@ RTCPeerConnectionObserver::RTCPeerConnectionObserver(
RTCPeerConnectionObserver::~RTCPeerConnectionObserver() {
}
-void RTCPeerConnectionObserver::OnError() {
- [_peerConnection.delegate peerConnectionOnError:_peerConnection];
-}
-
void RTCPeerConnectionObserver::OnSignalingChange(
PeerConnectionInterface::SignalingState new_state) {
RTCSignalingState state =
diff --git a/app/webrtc/objc/public/RTCPeerConnection.h b/app/webrtc/objc/public/RTCPeerConnection.h
index 32a9830..6d47f77 100644
--- a/app/webrtc/objc/public/RTCPeerConnection.h
+++ b/app/webrtc/objc/public/RTCPeerConnection.h
@@ -64,8 +64,7 @@
// Add a new MediaStream to be sent on this PeerConnection.
// Note that a SessionDescription negotiation is needed before the
// remote peer can receive the stream.
-- (BOOL)addStream:(RTCMediaStream *)stream
- constraints:(RTCMediaConstraints *)constraints;
+- (BOOL)addStream:(RTCMediaStream *)stream;
// Remove a MediaStream from this PeerConnection.
// Note that a SessionDescription negotiation is need before the
diff --git a/app/webrtc/objc/public/RTCPeerConnectionDelegate.h b/app/webrtc/objc/public/RTCPeerConnectionDelegate.h
index 4b177d5..ee6ec7a 100644
--- a/app/webrtc/objc/public/RTCPeerConnectionDelegate.h
+++ b/app/webrtc/objc/public/RTCPeerConnectionDelegate.h
@@ -38,9 +38,6 @@
// implemented to get messages from PeerConnection.
@protocol RTCPeerConnectionDelegate<NSObject>
-// Triggered when there is an error.
-- (void)peerConnectionOnError:(RTCPeerConnection *)peerConnection;
-
// Triggered when the SignalingState changed.
- (void)peerConnection:(RTCPeerConnection *)peerConnection
signalingStateChanged:(RTCSignalingState)stateChanged;
diff --git a/app/webrtc/objctests/RTCPeerConnectionSyncObserver.m b/app/webrtc/objctests/RTCPeerConnectionSyncObserver.m
index c3f898a..fbcf217 100644
--- a/app/webrtc/objctests/RTCPeerConnectionSyncObserver.m
+++ b/app/webrtc/objctests/RTCPeerConnectionSyncObserver.m
@@ -151,11 +151,6 @@
#pragma mark - RTCPeerConnectionDelegate methods
-- (void)peerConnectionOnError:(RTCPeerConnection*)peerConnection {
- NSLog(@"RTCPeerConnectionDelegate::onError");
- NSAssert(--_expectedErrors >= 0, @"Unexpected error");
-}
-
- (void)peerConnection:(RTCPeerConnection*)peerConnection
signalingStateChanged:(RTCSignalingState)stateChanged {
int expectedState = [self popFirstElementAsInt:_expectedSignalingChanges];
diff --git a/app/webrtc/objctests/RTCPeerConnectionTest.mm b/app/webrtc/objctests/RTCPeerConnectionTest.mm
index 909503a..6c5950b 100644
--- a/app/webrtc/objctests/RTCPeerConnectionTest.mm
+++ b/app/webrtc/objctests/RTCPeerConnectionTest.mm
@@ -89,8 +89,7 @@
[localMediaStream addVideoTrack:videoTrack];
RTCAudioTrack* audioTrack = [factory audioTrackWithID:audioTrackID];
[localMediaStream addAudioTrack:audioTrack];
- RTCMediaConstraints* constraints = [[RTCMediaConstraints alloc] init];
- [pc addStream:localMediaStream constraints:constraints];
+ [pc addStream:localMediaStream];
return localMediaStream;
}
diff --git a/app/webrtc/peerconnection.cc b/app/webrtc/peerconnection.cc
index 4799489..64ddcad 100644
--- a/app/webrtc/peerconnection.cc
+++ b/app/webrtc/peerconnection.cc
@@ -404,8 +404,7 @@ PeerConnection::remote_streams() {
return mediastream_signaling_->remote_streams();
}
-bool PeerConnection::AddStream(MediaStreamInterface* local_stream,
- const MediaConstraintsInterface* constraints) {
+bool PeerConnection::AddStream(MediaStreamInterface* local_stream) {
if (IsClosed()) {
return false;
}
@@ -413,7 +412,6 @@ bool PeerConnection::AddStream(MediaStreamInterface* local_stream,
local_stream))
return false;
- // TODO(perkj): Implement support for MediaConstraints in AddStream.
if (!mediastream_signaling_->AddLocalStream(local_stream)) {
return false;
}
diff --git a/app/webrtc/peerconnection.h b/app/webrtc/peerconnection.h
index fb03802..68aa154 100644
--- a/app/webrtc/peerconnection.h
+++ b/app/webrtc/peerconnection.h
@@ -65,8 +65,7 @@ class PeerConnection : public PeerConnectionInterface,
PeerConnectionObserver* observer);
virtual rtc::scoped_refptr<StreamCollectionInterface> local_streams();
virtual rtc::scoped_refptr<StreamCollectionInterface> remote_streams();
- virtual bool AddStream(MediaStreamInterface* local_stream,
- const MediaConstraintsInterface* constraints);
+ virtual bool AddStream(MediaStreamInterface* local_stream);
virtual void RemoveStream(MediaStreamInterface* local_stream);
virtual rtc::scoped_refptr<DtmfSenderInterface> CreateDtmfSender(
diff --git a/app/webrtc/peerconnection_unittest.cc b/app/webrtc/peerconnection_unittest.cc
index ce745de..c250eea 100644
--- a/app/webrtc/peerconnection_unittest.cc
+++ b/app/webrtc/peerconnection_unittest.cc
@@ -179,7 +179,7 @@ class PeerConnectionTestClientBase
stream->AddTrack(CreateLocalVideoTrack(stream_label));
}
- EXPECT_TRUE(peer_connection_->AddStream(stream, NULL));
+ EXPECT_TRUE(peer_connection_->AddStream(stream));
}
size_t NumberOfLocalMediaStreams() {
@@ -426,7 +426,6 @@ class PeerConnectionTestClientBase
}
// PeerConnectionObserver callbacks.
- virtual void OnError() {}
virtual void OnMessage(const std::string&) {}
virtual void OnSignalingMessage(const std::string& /*msg*/) {}
virtual void OnSignalingChange(
diff --git a/app/webrtc/peerconnectionfactory_unittest.cc b/app/webrtc/peerconnectionfactory_unittest.cc
index 5995c46..e687b8b 100644
--- a/app/webrtc/peerconnectionfactory_unittest.cc
+++ b/app/webrtc/peerconnectionfactory_unittest.cc
@@ -40,6 +40,7 @@
#include "webrtc/base/thread.h"
using webrtc::FakeVideoTrackRenderer;
+using webrtc::DataChannelInterface;
using webrtc::MediaStreamInterface;
using webrtc::PeerConnectionFactoryInterface;
using webrtc::PeerConnectionInterface;
@@ -83,13 +84,13 @@ static const char kTurnIceServerWithIPv6Address[] =
class NullPeerConnectionObserver : public PeerConnectionObserver {
public:
- virtual void OnError() {}
virtual void OnMessage(const std::string& msg) {}
virtual void OnSignalingMessage(const std::string& msg) {}
virtual void OnSignalingChange(
PeerConnectionInterface::SignalingState new_state) {}
virtual void OnAddStream(MediaStreamInterface* stream) {}
virtual void OnRemoveStream(MediaStreamInterface* stream) {}
+ virtual void OnDataChannel(DataChannelInterface* data_channel) {}
virtual void OnRenegotiationNeeded() {}
virtual void OnIceConnectionChange(
PeerConnectionInterface::IceConnectionState new_state) {}
diff --git a/app/webrtc/peerconnectioninterface.h b/app/webrtc/peerconnectioninterface.h
index 6ef4847..edbf6e3 100644
--- a/app/webrtc/peerconnectioninterface.h
+++ b/app/webrtc/peerconnectioninterface.h
@@ -252,11 +252,17 @@ class PeerConnectionInterface : public rtc::RefCountInterface {
virtual rtc::scoped_refptr<StreamCollectionInterface>
remote_streams() = 0;
+ // Deprecated:
+ // TODO(perkj): Remove once its not used by Chrome.
+ virtual bool AddStream(MediaStreamInterface* stream,
+ const MediaConstraintsInterface* constraints) {
+ return AddStream(stream);
+ }
+
// Add a new MediaStream to be sent on this PeerConnection.
// Note that a SessionDescription negotiation is needed before the
// remote peer can receive the stream.
- virtual bool AddStream(MediaStreamInterface* stream,
- const MediaConstraintsInterface* constraints) = 0;
+ virtual bool AddStream(MediaStreamInterface* stream) = 0;
// Remove a MediaStream from this PeerConnection.
// Note that a SessionDescription negotiation is need before the
@@ -344,7 +350,9 @@ class PeerConnectionObserver {
kIceState,
};
- virtual void OnError() = 0;
+ // Deprecated.
+ // TODO(perkj): Remove once its not used by Chrome.
+ virtual void OnError() {}
// Triggered when the SignalingState changed.
virtual void OnSignalingChange(
@@ -361,8 +369,7 @@ class PeerConnectionObserver {
virtual void OnRemoveStream(MediaStreamInterface* stream) = 0;
// Triggered when a remote peer open a data channel.
- // TODO(perkj): Make pure virtual.
- virtual void OnDataChannel(DataChannelInterface* data_channel) {}
+ virtual void OnDataChannel(DataChannelInterface* data_channel) = 0;
// Triggered when renegotiation is needed, for example the ICE has restarted.
virtual void OnRenegotiationNeeded() = 0;
diff --git a/app/webrtc/peerconnectioninterface_unittest.cc b/app/webrtc/peerconnectioninterface_unittest.cc
index bf60673..3be6280 100644
--- a/app/webrtc/peerconnectioninterface_unittest.cc
+++ b/app/webrtc/peerconnectioninterface_unittest.cc
@@ -132,7 +132,6 @@ class MockPeerConnectionObserver : public PeerConnectionObserver {
state_ = pc_->signaling_state();
}
}
- virtual void OnError() {}
virtual void OnSignalingChange(
PeerConnectionInterface::SignalingState new_state) {
EXPECT_EQ(pc_->signaling_state(), new_state);
@@ -320,7 +319,7 @@ class PeerConnectionInterfaceTest : public testing::Test {
scoped_refptr<VideoTrackInterface> video_track(
pc_factory_->CreateVideoTrack(label + "v0", video_source));
stream->AddTrack(video_track.get());
- EXPECT_TRUE(pc_->AddStream(stream, NULL));
+ EXPECT_TRUE(pc_->AddStream(stream));
EXPECT_TRUE_WAIT(observer_.renegotiation_needed_, kTimeout);
observer_.renegotiation_needed_ = false;
}
@@ -332,7 +331,7 @@ class PeerConnectionInterfaceTest : public testing::Test {
scoped_refptr<AudioTrackInterface> audio_track(
pc_factory_->CreateAudioTrack(label + "a0", NULL));
stream->AddTrack(audio_track.get());
- EXPECT_TRUE(pc_->AddStream(stream, NULL));
+ EXPECT_TRUE(pc_->AddStream(stream));
EXPECT_TRUE_WAIT(observer_.renegotiation_needed_, kTimeout);
observer_.renegotiation_needed_ = false;
}
@@ -350,7 +349,7 @@ class PeerConnectionInterfaceTest : public testing::Test {
scoped_refptr<VideoTrackInterface> video_track(
pc_factory_->CreateVideoTrack(video_track_label, NULL));
stream->AddTrack(video_track.get());
- EXPECT_TRUE(pc_->AddStream(stream, NULL));
+ EXPECT_TRUE(pc_->AddStream(stream));
EXPECT_TRUE_WAIT(observer_.renegotiation_needed_, kTimeout);
observer_.renegotiation_needed_ = false;
}
@@ -574,7 +573,7 @@ TEST_F(PeerConnectionInterfaceTest, AddStreams) {
pc_factory_->CreateAudioTrack(
kStreamLabel3, static_cast<AudioSourceInterface*>(NULL)));
stream->AddTrack(audio_track.get());
- EXPECT_TRUE(pc_->AddStream(stream, NULL));
+ EXPECT_TRUE(pc_->AddStream(stream));
EXPECT_EQ(3u, pc_->local_streams()->count());
// Remove the third stream.
@@ -1180,7 +1179,7 @@ TEST_F(PeerConnectionInterfaceTest, CloseAndTestMethods) {
pc_->Close();
pc_->RemoveStream(local_stream);
- EXPECT_FALSE(pc_->AddStream(local_stream, NULL));
+ EXPECT_FALSE(pc_->AddStream(local_stream));
ASSERT_FALSE(local_stream->GetAudioTracks().empty());
rtc::scoped_refptr<webrtc::DtmfSenderInterface> dtmf_sender(
diff --git a/app/webrtc/peerconnectionproxy.h b/app/webrtc/peerconnectionproxy.h
index ed26eb8..852d852 100644
--- a/app/webrtc/peerconnectionproxy.h
+++ b/app/webrtc/peerconnectionproxy.h
@@ -39,8 +39,7 @@ BEGIN_PROXY_MAP(PeerConnection)
local_streams)
PROXY_METHOD0(rtc::scoped_refptr<StreamCollectionInterface>,
remote_streams)
- PROXY_METHOD2(bool, AddStream, MediaStreamInterface*,
- const MediaConstraintsInterface*)
+ PROXY_METHOD1(bool, AddStream, MediaStreamInterface*)
PROXY_METHOD1(void, RemoveStream, MediaStreamInterface*)
PROXY_METHOD1(rtc::scoped_refptr<DtmfSenderInterface>,
CreateDtmfSender, AudioTrackInterface*)
diff --git a/app/webrtc/test/peerconnectiontestwrapper.cc b/app/webrtc/test/peerconnectiontestwrapper.cc
index 24932b8..e3b8015 100644
--- a/app/webrtc/test/peerconnectiontestwrapper.cc
+++ b/app/webrtc/test/peerconnectiontestwrapper.cc
@@ -253,7 +253,7 @@ void PeerConnectionTestWrapper::GetAndAddUserMedia(
bool video, const webrtc::FakeConstraints& video_constraints) {
rtc::scoped_refptr<webrtc::MediaStreamInterface> stream =
GetUserMedia(audio, audio_constraints, video, video_constraints);
- EXPECT_TRUE(peer_connection_->AddStream(stream, NULL));
+ EXPECT_TRUE(peer_connection_->AddStream(stream));
}
rtc::scoped_refptr<webrtc::MediaStreamInterface>
diff --git a/app/webrtc/test/peerconnectiontestwrapper.h b/app/webrtc/test/peerconnectiontestwrapper.h
index d4a0e4e..d8299ec 100644
--- a/app/webrtc/test/peerconnectiontestwrapper.h
+++ b/app/webrtc/test/peerconnectiontestwrapper.h
@@ -57,7 +57,6 @@ class PeerConnectionTestWrapper
const webrtc::DataChannelInit& init);
// Implements PeerConnectionObserver.
- virtual void OnError() {}
virtual void OnSignalingChange(
webrtc::PeerConnectionInterface::SignalingState new_state) {}
virtual void OnStateChange(
diff --git a/examples/android/src/org/appspot/apprtc/PeerConnectionClient.java b/examples/android/src/org/appspot/apprtc/PeerConnectionClient.java
index daea5fb..9c917bb 100644
--- a/examples/android/src/org/appspot/apprtc/PeerConnectionClient.java
+++ b/examples/android/src/org/appspot/apprtc/PeerConnectionClient.java
@@ -110,7 +110,7 @@ public class PeerConnectionClient {
if (videoConstraints != null) {
videoMediaStream = factory.createLocalMediaStream("ARDAMSVideo");
videoMediaStream.addTrack(createVideoTrack(useFrontFacingCamera));
- pc.addStream(videoMediaStream, new MediaConstraints());
+ pc.addStream(videoMediaStream);
}
if (appRtcParameters.audioConstraints != null) {
@@ -118,7 +118,7 @@ public class PeerConnectionClient {
lMS.addTrack(factory.createAudioTrack(
"ARDAMSa0",
factory.createAudioSource(appRtcParameters.audioConstraints)));
- pc.addStream(lMS, new MediaConstraints());
+ pc.addStream(lMS);
}
}
@@ -409,7 +409,7 @@ public class PeerConnectionClient {
useFrontFacingCamera = !useFrontFacingCamera;
VideoTrack newTrack = createVideoTrack(useFrontFacingCamera);
videoMediaStream.addTrack(newTrack);
- pc.addStream(videoMediaStream, new MediaConstraints());
+ pc.addStream(videoMediaStream);
SessionDescription remoteDesc = pc.getRemoteDescription();
if (localSdp == null || remoteDesc == null) {
@@ -441,11 +441,6 @@ public class PeerConnectionClient {
}
@Override
- public void onError() {
- reportError("PeerConnection error!");
- }
-
- @Override
public void onSignalingChange(
PeerConnection.SignalingState newState) {
Log.d(TAG, "SignalingState: " + newState);
diff --git a/examples/objc/AppRTCDemo/APPRTCConnectionManager.m b/examples/objc/AppRTCDemo/APPRTCConnectionManager.m
index b411a62..9a39528 100644
--- a/examples/objc/AppRTCDemo/APPRTCConnectionManager.m
+++ b/examples/objc/AppRTCDemo/APPRTCConnectionManager.m
@@ -170,7 +170,7 @@
#endif
[lms addAudioTrack:[self.peerConnectionFactory audioTrackWithID:@"ARDAMSa0"]];
- [self.peerConnection addStream:lms constraints:constraints];
+ [self.peerConnection addStream:lms];
[self.logger logMessage:@"onICEServers - added local stream."];
}
@@ -243,16 +243,6 @@
#pragma mark - RTCPeerConnectionDelegate
-- (void)peerConnectionOnError:(RTCPeerConnection*)peerConnection {
- dispatch_async(dispatch_get_main_queue(), ^{
- NSString* message = @"PeerConnection error";
- NSLog(@"%@", message);
- NSAssert(NO, @"PeerConnection failed.");
- [self.delegate connectionManager:self
- didErrorWithMessage:message];
- });
-}
-
- (void)peerConnection:(RTCPeerConnection*)peerConnection
signalingStateChanged:(RTCSignalingState)stateChanged {
dispatch_async(dispatch_get_main_queue(), ^{
diff --git a/examples/peerconnection/client/conductor.cc b/examples/peerconnection/client/conductor.cc
index f49aee6..e81f7fc 100644
--- a/examples/peerconnection/client/conductor.cc
+++ b/examples/peerconnection/client/conductor.cc
@@ -137,11 +137,6 @@ void Conductor::EnsureStreamingUI() {
// PeerConnectionObserver implementation.
//
-void Conductor::OnError() {
- LOG(LS_ERROR) << __FUNCTION__;
- main_wnd_->QueueUIThreadCallback(PEER_CONNECTION_ERROR, NULL);
-}
-
// Called when a remote stream is added
void Conductor::OnAddStream(webrtc::MediaStreamInterface* stream) {
LOG(INFO) << __FUNCTION__ << " " << stream->label();
@@ -373,7 +368,7 @@ void Conductor::AddStreams() {
stream->AddTrack(audio_track);
stream->AddTrack(video_track);
- if (!peer_connection_->AddStream(stream, NULL)) {
+ if (!peer_connection_->AddStream(stream)) {
LOG(LS_ERROR) << "Adding stream to PeerConnection failed";
}
typedef std::pair<std::string,
@@ -440,10 +435,6 @@ void Conductor::UIThreadCallback(int msg_id, void* data) {
break;
}
- case PEER_CONNECTION_ERROR:
- main_wnd_->MessageBox("Error", "an unknown error occurred", true);
- break;
-
case NEW_STREAM_ADDED: {
webrtc::MediaStreamInterface* stream =
reinterpret_cast<webrtc::MediaStreamInterface*>(
diff --git a/examples/peerconnection/client/conductor.h b/examples/peerconnection/client/conductor.h
index 0aff531..3ef5253 100644
--- a/examples/peerconnection/client/conductor.h
+++ b/examples/peerconnection/client/conductor.h
@@ -58,7 +58,6 @@ class Conductor
MEDIA_CHANNELS_INITIALIZED = 1,
PEER_CONNECTION_CLOSED,
SEND_MESSAGE_TO_PEER,
- PEER_CONNECTION_ERROR,
NEW_STREAM_ADDED,
STREAM_REMOVED,
};
@@ -80,11 +79,11 @@ class Conductor
//
// PeerConnectionObserver implementation.
//
- virtual void OnError();
virtual void OnStateChange(
webrtc::PeerConnectionObserver::StateType state_changed) {}
virtual void OnAddStream(webrtc::MediaStreamInterface* stream);
virtual void OnRemoveStream(webrtc::MediaStreamInterface* stream);
+ virtual void OnDataChannel(webrtc::DataChannelInterface* channel) {}
virtual void OnRenegotiationNeeded() {}
virtual void OnIceChange() {}
virtual void OnIceCandidate(const webrtc::IceCandidateInterface* candidate);