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 #include "talk/app/webrtc/peerconnectioninterface.h" |
| 12 |
| 13 #import "RTCPeerConnection.h" |
| 14 #import "RTCPeerConnectionDelegate.h" |
| 15 |
| 16 // These objects are created by RTCPeerConnectionFactory to wrap an |
| 17 // id<RTCPeerConnectionDelegate> and call methods on that interface. |
| 18 |
| 19 namespace webrtc { |
| 20 |
| 21 class PeerConnectionDelegateAdapter : public PeerConnectionObserver { |
| 22 |
| 23 public: |
| 24 PeerConnectionDelegateAdapter(RTCPeerConnection* peerConnection); |
| 25 virtual ~PeerConnectionDelegateAdapter(); |
| 26 |
| 27 /** Triggered when the SignalingState changed. */ |
| 28 void OnSignalingChange( |
| 29 PeerConnectionInterface::SignalingState new_state) override; |
| 30 |
| 31 /** Triggered when media is received on a new stream from remote peer. */ |
| 32 void OnAddStream(MediaStreamInterface *stream) override; |
| 33 |
| 34 /** Triggered when a remote peer closes a stream. */ |
| 35 void OnRemoveStream(MediaStreamInterface *stream) override; |
| 36 |
| 37 /** Triggered when a remote peer opens a data channel. */ |
| 38 void OnDataChannel(DataChannelInterface *data_channel) override; |
| 39 |
| 40 /** Triggered when renegotiation is needed, for example ICE has restarted. */ |
| 41 void OnRenegotiationNeeded() override; |
| 42 |
| 43 // Called any time the IceConnectionState changes |
| 44 void OnIceConnectionChange( |
| 45 PeerConnectionInterface::IceConnectionState new_state) override; |
| 46 |
| 47 // Called any time the IceGatheringState changes |
| 48 void OnIceGatheringChange( |
| 49 PeerConnectionInterface::IceGatheringState new_state) override; |
| 50 |
| 51 // New ice candidate has been found. |
| 52 void OnIceCandidate(const IceCandidateInterface *candidate) override; |
| 53 |
| 54 private: |
| 55 __weak RTCPeerConnection *peerConnection_; |
| 56 }; |
| 57 |
| 58 } // namespace webrtc |
OLD | NEW |