Index: webrtc/api/objc/RTCPeerConnectionDelegate.h |
diff --git a/webrtc/api/objc/RTCPeerConnectionDelegate.h b/webrtc/api/objc/RTCPeerConnectionDelegate.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..34d11075e0eab16fc2684a33ebcf0f479b3a0790 |
--- /dev/null |
+++ b/webrtc/api/objc/RTCPeerConnectionDelegate.h |
@@ -0,0 +1,86 @@ |
+/* |
+ * Copyright 2015 The WebRTC project authors. All Rights Reserved. |
+ * |
+ * Use of this source code is governed by a BSD-style license |
+ * that can be found in the LICENSE file in the root of the source |
+ * tree. An additional intellectual property rights grant can be found |
+ * in the file PATENTS. All contributing project authors may |
+ * be found in the AUTHORS file in the root of the source tree. |
+ */ |
+ |
+#import <Foundation/Foundation.h> |
+ |
+#import "webrtc/api/objc/RTCPeerConnection.h" |
+ |
+@class RTCDataChannel; |
+@class RTCIceCandidate; |
+@class RTCMediaStream; |
+@class RTCPeerConnection; |
+ |
+/** Represents the signaling state of the peer connection. */ |
+typedef NS_ENUM(NSInteger, RTCSignalingState) { |
+ RTCSignalingStateStable, |
+ RTCSignalingStateHaveLocalOffer, |
+ RTCSignalingStateHaveLocalPrAnswer, |
+ RTCSignalingStateHaveRemoteOffer, |
+ RTCSignalingStateHaveRemotePrAnswer, |
+ RTCSignalingStateClosed, |
+}; |
+ |
+/** Represents the ice connection state of the peer connection. */ |
+typedef NS_ENUM(NSInteger, RTCIceConnectionState) { |
+ RTCIceConnectionStateNew, |
+ RTCIceConnectionStateChecking, |
+ RTCIceConnectionStateConnected, |
+ RTCIceConnectionStateCompleted, |
+ RTCIceConnectionStateFailed, |
+ RTCIceConnectionStateDisconnected, |
+ RTCIceConnectionStateClosed, |
+ RTCIceConnectionStateMax, |
+}; |
+ |
+/** Represents the ice gathering state of the peer connection. */ |
+typedef NS_ENUM(NSInteger, RTCIceGatheringState) { |
+ RTCIceGatheringStateNew, |
+ RTCIceGatheringStateGathering, |
+ RTCIceGatheringStateComplete, |
+}; |
+ |
+NS_ASSUME_NONNULL_BEGIN |
+ |
+@protocol RTCPeerConnectionDelegate<NSObject> |
tkchin_webrtc
2016/02/01 10:00:02
space after protocol name
Delegate <NSObject>
hjon_webrtc
2016/02/04 00:58:38
Done.
|
+ |
+/** Triggered when the SignalingState changed. */ |
tkchin_webrtc
2016/02/01 10:00:02
nit: Triggered is a weird word. Called when the Si
hjon_webrtc
2016/02/04 00:58:38
Done.
|
+- (void)peerConnection:(RTCPeerConnection *)peerConnection |
+ signalingStateChanged:(RTCSignalingState)stateChanged; |
tkchin_webrtc
2016/02/01 10:00:02
minimum 4 spaces from left (break the : alignment)
hjon_webrtc
2016/02/04 00:58:38
Done.
|
+ |
+/** Triggered when media is received on a new stream from remote peer. */ |
+- (void)peerConnection:(RTCPeerConnection *)peerConnection |
+ addedStream:(RTCMediaStream *)stream; |
+ |
+/** Triggered when a remote peer closes a stream. */ |
+- (void)peerConnection:(RTCPeerConnection *)peerConnection |
+ removedStream:(RTCMediaStream *)stream; |
+ |
+/** Triggered when renegotiation is needed, for example ICE has restarted. */ |
+- (void)peerConnectionNeedsRenegotiation:(RTCPeerConnection *)peerConnection; |
+ |
+/** Called any time the IceConnectionState changes. */ |
+- (void)peerConnection:(RTCPeerConnection *)peerConnection |
+ iceConnectionStateChanged:(RTCIceConnectionState)newState; |
+ |
+/** Called any time the IceGatheringState changes. */ |
+- (void)peerConnection:(RTCPeerConnection *)peerConnection |
+ iceGatheringStateChanged:(RTCIceGatheringState)newState; |
+ |
+/** New ice candidate has been found. */ |
+- (void)peerConnection:(RTCPeerConnection *)peerConnection |
+ receivedIceCandidate:(RTCIceCandidate *)candidate; |
tkchin_webrtc
2016/02/01 10:00:02
ditto
hjon_webrtc
2016/02/04 00:58:38
Done.
|
+ |
+/** New data channel has been opened. */ |
+- (void)peerConnection:(RTCPeerConnection *)peerConnection |
+ didOpenDataChannel:(RTCDataChannel *)dataChannel; |
+ |
+@end |
+ |
+NS_ASSUME_NONNULL_END |