Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Unified Diff: webrtc/api/objc/RTCPeerConnectionDelegate.h

Issue 1640993002: Update API for Objective-C RTCPeerConnection. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix some style issues Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698