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. | |
80 bool Initialize( | 78 bool Initialize( |
81 const PeerConnectionInterface::RTCConfiguration& configuration, | 79 const PeerConnectionInterface::RTCConfiguration& configuration, |
82 const MediaConstraintsInterface* constraints, | 80 const MediaConstraintsInterface* constraints, |
83 PortAllocatorFactoryInterface* allocator_factory, | 81 PortAllocatorFactoryInterface* allocator_factory, |
84 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, | 82 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, |
85 PeerConnectionObserver* observer); | 83 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 | |
94 rtc::scoped_refptr<StreamCollectionInterface> local_streams() override; | 84 rtc::scoped_refptr<StreamCollectionInterface> local_streams() override; |
95 rtc::scoped_refptr<StreamCollectionInterface> remote_streams() override; | 85 rtc::scoped_refptr<StreamCollectionInterface> remote_streams() override; |
96 bool AddStream(MediaStreamInterface* local_stream) override; | 86 bool AddStream(MediaStreamInterface* local_stream) override; |
97 void RemoveStream(MediaStreamInterface* local_stream) override; | 87 void RemoveStream(MediaStreamInterface* local_stream) override; |
98 | 88 |
99 virtual WebRtcSession* session() { return session_.get(); } | 89 virtual WebRtcSession* session() { return session_.get(); } |
100 | 90 |
101 rtc::scoped_refptr<DtmfSenderInterface> CreateDtmfSender( | 91 rtc::scoped_refptr<DtmfSenderInterface> CreateDtmfSender( |
102 AudioTrackInterface* track) override; | 92 AudioTrackInterface* track) override; |
103 | 93 |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 // because its destruction fires signals (such as VoiceChannelDestroyed) | 387 // because its destruction fires signals (such as VoiceChannelDestroyed) |
398 // which will trigger some final actions in PeerConnection... | 388 // which will trigger some final actions in PeerConnection... |
399 rtc::scoped_ptr<WebRtcSession> session_; | 389 rtc::scoped_ptr<WebRtcSession> session_; |
400 // ... But stats_ depends on session_ so it should be destroyed even earlier. | 390 // ... But stats_ depends on session_ so it should be destroyed even earlier. |
401 rtc::scoped_ptr<StatsCollector> stats_; | 391 rtc::scoped_ptr<StatsCollector> stats_; |
402 }; | 392 }; |
403 | 393 |
404 } // namespace webrtc | 394 } // namespace webrtc |
405 | 395 |
406 #endif // TALK_APP_WEBRTC_PEERCONNECTION_H_ | 396 #endif // TALK_APP_WEBRTC_PEERCONNECTION_H_ |
OLD | NEW |