OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 // PeerConnection implements the PeerConnectionInterface interface. | 69 // PeerConnection implements the PeerConnectionInterface interface. |
70 // It uses WebRtcSession to implement the PeerConnection functionality. | 70 // It uses WebRtcSession to implement the PeerConnection functionality. |
71 class PeerConnection : public PeerConnectionInterface, | 71 class PeerConnection : public PeerConnectionInterface, |
72 public IceObserver, | 72 public IceObserver, |
73 public rtc::MessageHandler, | 73 public rtc::MessageHandler, |
74 public sigslot::has_slots<> { | 74 public sigslot::has_slots<> { |
75 public: | 75 public: |
76 explicit PeerConnection(PeerConnectionFactory* factory); | 76 explicit PeerConnection(PeerConnectionFactory* factory); |
77 | 77 |
| 78 // TODO(deadbeef): Remove this overload of Initialize once everyone is moved |
| 79 // to the new version. |
78 bool Initialize( | 80 bool Initialize( |
79 const PeerConnectionInterface::RTCConfiguration& configuration, | 81 const PeerConnectionInterface::RTCConfiguration& configuration, |
80 const MediaConstraintsInterface* constraints, | 82 const MediaConstraintsInterface* constraints, |
81 PortAllocatorFactoryInterface* allocator_factory, | 83 PortAllocatorFactoryInterface* allocator_factory, |
82 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, | 84 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, |
83 PeerConnectionObserver* observer); | 85 PeerConnectionObserver* observer); |
| 86 |
| 87 bool Initialize( |
| 88 const PeerConnectionInterface::RTCConfiguration& configuration, |
| 89 const MediaConstraintsInterface* constraints, |
| 90 rtc::scoped_ptr<cricket::PortAllocator> allocator, |
| 91 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, |
| 92 PeerConnectionObserver* observer); |
| 93 |
84 rtc::scoped_refptr<StreamCollectionInterface> local_streams() override; | 94 rtc::scoped_refptr<StreamCollectionInterface> local_streams() override; |
85 rtc::scoped_refptr<StreamCollectionInterface> remote_streams() override; | 95 rtc::scoped_refptr<StreamCollectionInterface> remote_streams() override; |
86 bool AddStream(MediaStreamInterface* local_stream) override; | 96 bool AddStream(MediaStreamInterface* local_stream) override; |
87 void RemoveStream(MediaStreamInterface* local_stream) override; | 97 void RemoveStream(MediaStreamInterface* local_stream) override; |
88 | 98 |
89 virtual WebRtcSession* session() { return session_.get(); } | 99 virtual WebRtcSession* session() { return session_.get(); } |
90 | 100 |
91 rtc::scoped_refptr<DtmfSenderInterface> CreateDtmfSender( | 101 rtc::scoped_refptr<DtmfSenderInterface> CreateDtmfSender( |
92 AudioTrackInterface* track) override; | 102 AudioTrackInterface* track) override; |
93 | 103 |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 // because its destruction fires signals (such as VoiceChannelDestroyed) | 397 // because its destruction fires signals (such as VoiceChannelDestroyed) |
388 // which will trigger some final actions in PeerConnection... | 398 // which will trigger some final actions in PeerConnection... |
389 rtc::scoped_ptr<WebRtcSession> session_; | 399 rtc::scoped_ptr<WebRtcSession> session_; |
390 // ... But stats_ depends on session_ so it should be destroyed even earlier. | 400 // ... But stats_ depends on session_ so it should be destroyed even earlier. |
391 rtc::scoped_ptr<StatsCollector> stats_; | 401 rtc::scoped_ptr<StatsCollector> stats_; |
392 }; | 402 }; |
393 | 403 |
394 } // namespace webrtc | 404 } // namespace webrtc |
395 | 405 |
396 #endif // TALK_APP_WEBRTC_PEERCONNECTION_H_ | 406 #endif // TALK_APP_WEBRTC_PEERCONNECTION_H_ |
OLD | NEW |