OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2004 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 | 41 |
42 namespace webrtc { | 42 namespace webrtc { |
43 class AudioSinkInterface; | 43 class AudioSinkInterface; |
44 } // namespace webrtc | 44 } // namespace webrtc |
45 | 45 |
46 namespace cricket { | 46 namespace cricket { |
47 | 47 |
48 struct CryptoParams; | 48 struct CryptoParams; |
49 class MediaContentDescription; | 49 class MediaContentDescription; |
50 | 50 |
51 // BaseChannel contains logic common to voice and video, including | 51 // BaseChannel contains logic common to voice and video, including enable, |
52 // enable, marshaling calls to a worker and network threads, and | 52 // marshaling calls to a worker and network threads, and connection and media |
53 // connection and media monitors. | 53 // monitors. |
| 54 // |
54 // BaseChannel assumes signaling and other threads are allowed to make | 55 // BaseChannel assumes signaling and other threads are allowed to make |
55 // synchronous calls to the worker thread, the worker thread makes synchronous | 56 // synchronous calls to the worker thread, the worker thread makes synchronous |
56 // calls only to the network thread, and the network thread can't be blocked by | 57 // calls only to the network thread, and the network thread can't be blocked by |
57 // other threads. | 58 // other threads. |
58 // All methods with _n suffix must be called on network thread, | 59 // All methods with _n suffix must be called on network thread, |
59 // methods with _w suffix - on worker thread | 60 // methods with _w suffix on worker thread |
60 // and methods with _s suffix on signaling thread. | 61 // and methods with _s suffix on signaling thread. |
61 // Network and worker threads may be the same thread. | 62 // Network and worker threads may be the same thread. |
62 // | 63 // |
63 // WARNING! SUBCLASSES MUST CALL Deinit() IN THEIR DESTRUCTORS! | 64 // WARNING! SUBCLASSES MUST CALL Deinit() IN THEIR DESTRUCTORS! |
64 // This is required to avoid a data race between the destructor modifying the | 65 // This is required to avoid a data race between the destructor modifying the |
65 // vtable, and the media channel's thread using BaseChannel as the | 66 // vtable, and the media channel's thread using BaseChannel as the |
66 // NetworkInterface. | 67 // NetworkInterface. |
67 | 68 |
68 class BaseChannel | 69 class BaseChannel |
69 : public rtc::MessageHandler, public sigslot::has_slots<>, | 70 : public rtc::MessageHandler, public sigslot::has_slots<>, |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 virtual cricket::MediaType media_type() = 0; | 181 virtual cricket::MediaType media_type() = 0; |
181 | 182 |
182 bool SetCryptoOptions(const rtc::CryptoOptions& crypto_options); | 183 bool SetCryptoOptions(const rtc::CryptoOptions& crypto_options); |
183 | 184 |
184 protected: | 185 protected: |
185 virtual MediaChannel* media_channel() const { return media_channel_; } | 186 virtual MediaChannel* media_channel() const { return media_channel_; } |
186 | 187 |
187 // Sets the |transport_channel_| (and |rtcp_transport_channel_|, if | 188 // Sets the |transport_channel_| (and |rtcp_transport_channel_|, if |
188 // |rtcp_enabled_| is true). Gets the transport channels from | 189 // |rtcp_enabled_| is true). Gets the transport channels from |
189 // |transport_controller_|. | 190 // |transport_controller_|. |
| 191 // This method also updates writability and "ready-to-send" state. |
190 bool SetTransport_n(const std::string& transport_name); | 192 bool SetTransport_n(const std::string& transport_name); |
191 | 193 |
192 void SetTransportChannel_n(TransportChannel* transport); | 194 // This does not update writability or "ready-to-send" state; it just |
193 void SetRtcpTransportChannel_n(TransportChannel* transport, | 195 // disconnects from the old channel and connects to the new one. |
194 bool update_writablity); | 196 void SetTransportChannel_n(bool rtcp, TransportChannel* new_channel); |
195 | 197 |
196 bool was_ever_writable() const { return was_ever_writable_; } | 198 bool was_ever_writable() const { return was_ever_writable_; } |
197 void set_local_content_direction(MediaContentDirection direction) { | 199 void set_local_content_direction(MediaContentDirection direction) { |
198 local_content_direction_ = direction; | 200 local_content_direction_ = direction; |
199 } | 201 } |
200 void set_remote_content_direction(MediaContentDirection direction) { | 202 void set_remote_content_direction(MediaContentDirection direction) { |
201 remote_content_direction_ = direction; | 203 remote_content_direction_ = direction; |
202 } | 204 } |
203 void set_secure_required(bool secure_required) { | 205 void set_secure_required(bool secure_required) { |
204 secure_required_ = secure_required; | 206 secure_required_ = secure_required; |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 // SetSendParameters. | 721 // SetSendParameters. |
720 DataSendParameters last_send_params_; | 722 DataSendParameters last_send_params_; |
721 // Last DataRecvParameters sent down to the media_channel() via | 723 // Last DataRecvParameters sent down to the media_channel() via |
722 // SetRecvParameters. | 724 // SetRecvParameters. |
723 DataRecvParameters last_recv_params_; | 725 DataRecvParameters last_recv_params_; |
724 }; | 726 }; |
725 | 727 |
726 } // namespace cricket | 728 } // namespace cricket |
727 | 729 |
728 #endif // WEBRTC_PC_CHANNEL_H_ | 730 #endif // WEBRTC_PC_CHANNEL_H_ |
OLD | NEW |