OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license | |
5 * that can be found in the LICENSE file in the root of the source | |
6 * tree. An additional intellectual property rights grant can be found | |
7 * in the file PATENTS. All contributing project authors may | |
8 * be found in the AUTHORS file in the root of the source tree. | |
9 */ | |
10 | |
11 #import "RTCPeerConnection.h" | |
12 | |
13 #include "talk/app/webrtc/peerconnectioninterface.h" | |
14 | |
15 NS_ASSUME_NONNULL_BEGIN | |
16 | |
17 /** | |
18 * These objects are created by RTCPeerConnectionFactory to wrap an | |
19 * id<RTCPeerConnectionDelegate> and call methods on that interface. | |
20 */ | |
21 namespace webrtc { | |
22 | |
23 class PeerConnectionDelegateAdapter : public PeerConnectionObserver { | |
24 | |
25 public: | |
26 PeerConnectionDelegateAdapter(RTCPeerConnection *peerConnection); | |
27 virtual ~PeerConnectionDelegateAdapter(); | |
28 | |
29 /** Triggered when the SignalingState changed. */ | |
tkchin_webrtc
2016/02/05 16:15:15
You can remove all the comments here because they'
hjon_webrtc
2016/02/09 00:59:53
Done.
| |
30 void OnSignalingChange( | |
31 PeerConnectionInterface::SignalingState new_state) override; | |
32 | |
33 /** Triggered when media is received on a new stream from remote peer. */ | |
34 void OnAddStream(MediaStreamInterface *stream) override; | |
35 | |
36 /** Triggered when a remote peer closes a stream. */ | |
37 void OnRemoveStream(MediaStreamInterface *stream) override; | |
38 | |
39 /** Triggered when a remote peer opens a data channel. */ | |
40 void OnDataChannel(DataChannelInterface *data_channel) override; | |
41 | |
42 /** Triggered when renegotiation is needed, for example ICE has restarted. */ | |
43 void OnRenegotiationNeeded() override; | |
44 | |
45 // Called any time the IceConnectionState changes | |
46 void OnIceConnectionChange( | |
47 PeerConnectionInterface::IceConnectionState new_state) override; | |
48 | |
49 // Called any time the IceGatheringState changes | |
50 void OnIceGatheringChange( | |
51 PeerConnectionInterface::IceGatheringState new_state) override; | |
52 | |
53 // New ice candidate has been found. | |
54 void OnIceCandidate(const IceCandidateInterface *candidate) override; | |
55 | |
56 private: | |
57 __weak RTCPeerConnection *peer_connection_; | |
58 }; | |
59 | |
60 } // namespace webrtc | |
61 | |
62 | |
63 @interface RTCPeerConnection () | |
64 | |
65 /** The native PeerConnectionInterface created during construction. */ | |
66 @property(nonatomic, readonly) | |
67 rtc::scoped_refptr<webrtc::PeerConnectionInterface> nativePeerConnection; | |
68 | |
69 + (webrtc::PeerConnectionInterface::SignalingState)nativeSignalingStateForState: | |
70 (RTCSignalingState)state; | |
71 | |
72 + (RTCSignalingState)signalingStateForNativeState: | |
73 (webrtc::PeerConnectionInterface::SignalingState)nativeState; | |
74 | |
75 + (NSString *)stringForSignalingState:(RTCSignalingState)state; | |
76 | |
77 + (webrtc::PeerConnectionInterface::IceConnectionState) | |
78 nativeIceConnectionStateForState:(RTCIceConnectionState)state; | |
79 | |
80 + (RTCIceConnectionState)iceConnectionStateForNativeState: | |
81 (webrtc::PeerConnectionInterface::IceConnectionState)nativeState; | |
82 | |
83 + (NSString *)stringForIceConnectionState:(RTCIceConnectionState)state; | |
84 | |
85 + (webrtc::PeerConnectionInterface::IceGatheringState) | |
86 nativeIceGatheringStateForState:(RTCIceGatheringState)state; | |
87 | |
88 + (RTCIceGatheringState)iceGatheringStateForNativeState: | |
89 (webrtc::PeerConnectionInterface::IceGatheringState)nativeState; | |
90 | |
91 + (NSString *)stringForIceGatheringState:(RTCIceGatheringState)state; | |
92 | |
93 + (webrtc::PeerConnectionInterface::StatsOutputLevel) | |
94 nativeStatsOutputLevelForLevel:(RTCStatsOutputLevel)level; | |
95 | |
96 @end | |
97 | |
98 NS_ASSUME_NONNULL_END | |
OLD | NEW |