OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 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 12 matching lines...) Expand all Loading... |
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | 23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | 24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 */ | 26 */ |
27 | 27 |
28 #ifndef TALK_SESSION_MEDIA_CHANNEL_H_ | 28 #ifndef TALK_SESSION_MEDIA_CHANNEL_H_ |
29 #define TALK_SESSION_MEDIA_CHANNEL_H_ | 29 #define TALK_SESSION_MEDIA_CHANNEL_H_ |
30 | 30 |
31 #include <string> | 31 #include <string> |
32 #include <vector> | 32 #include <vector> |
| 33 #include <map> |
| 34 #include <set> |
| 35 #include <utility> |
33 | 36 |
34 #include "talk/media/base/mediachannel.h" | 37 #include "talk/media/base/mediachannel.h" |
35 #include "talk/media/base/mediaengine.h" | 38 #include "talk/media/base/mediaengine.h" |
36 #include "talk/media/base/streamparams.h" | 39 #include "talk/media/base/streamparams.h" |
37 #include "talk/media/base/videocapturer.h" | 40 #include "talk/media/base/videocapturer.h" |
38 #include "webrtc/p2p/base/session.h" | 41 #include "webrtc/p2p/base/transportcontroller.h" |
39 #include "webrtc/p2p/client/socketmonitor.h" | 42 #include "webrtc/p2p/client/socketmonitor.h" |
40 #include "talk/session/media/audiomonitor.h" | 43 #include "talk/session/media/audiomonitor.h" |
41 #include "talk/session/media/bundlefilter.h" | 44 #include "talk/session/media/bundlefilter.h" |
42 #include "talk/session/media/mediamonitor.h" | 45 #include "talk/session/media/mediamonitor.h" |
43 #include "talk/session/media/mediasession.h" | 46 #include "talk/session/media/mediasession.h" |
44 #include "talk/session/media/rtcpmuxfilter.h" | 47 #include "talk/session/media/rtcpmuxfilter.h" |
45 #include "talk/session/media/srtpfilter.h" | 48 #include "talk/session/media/srtpfilter.h" |
46 #include "webrtc/base/asyncudpsocket.h" | 49 #include "webrtc/base/asyncudpsocket.h" |
47 #include "webrtc/base/criticalsection.h" | 50 #include "webrtc/base/criticalsection.h" |
48 #include "webrtc/base/network.h" | 51 #include "webrtc/base/network.h" |
(...skipping 20 matching lines...) Expand all Loading... |
69 // WARNING! SUBCLASSES MUST CALL Deinit() IN THEIR DESTRUCTORS! | 72 // WARNING! SUBCLASSES MUST CALL Deinit() IN THEIR DESTRUCTORS! |
70 // This is required to avoid a data race between the destructor modifying the | 73 // This is required to avoid a data race between the destructor modifying the |
71 // vtable, and the media channel's thread using BaseChannel as the | 74 // vtable, and the media channel's thread using BaseChannel as the |
72 // NetworkInterface. | 75 // NetworkInterface. |
73 | 76 |
74 class BaseChannel | 77 class BaseChannel |
75 : public rtc::MessageHandler, public sigslot::has_slots<>, | 78 : public rtc::MessageHandler, public sigslot::has_slots<>, |
76 public MediaChannel::NetworkInterface, | 79 public MediaChannel::NetworkInterface, |
77 public ConnectionStatsGetter { | 80 public ConnectionStatsGetter { |
78 public: | 81 public: |
79 BaseChannel(rtc::Thread* thread, MediaChannel* channel, BaseSession* session, | 82 BaseChannel(rtc::Thread* thread, |
80 const std::string& content_name, bool rtcp); | 83 MediaChannel* channel, |
| 84 TransportController* transport_controller, |
| 85 const std::string& content_name, |
| 86 bool rtcp); |
81 virtual ~BaseChannel(); | 87 virtual ~BaseChannel(); |
82 bool Init(); | 88 bool Init(); |
83 // Deinit may be called multiple times and is simply ignored if it's alreay | 89 // Deinit may be called multiple times and is simply ignored if it's alreay |
84 // done. | 90 // done. |
85 void Deinit(); | 91 void Deinit(); |
86 | 92 |
87 rtc::Thread* worker_thread() const { return worker_thread_; } | 93 rtc::Thread* worker_thread() const { return worker_thread_; } |
88 BaseSession* session() const { return session_; } | 94 const std::string& content_name() const { return content_name_; } |
89 const std::string& content_name() { return content_name_; } | 95 const std::string& transport_name() const { return transport_name_; } |
90 TransportChannel* transport_channel() const { | 96 TransportChannel* transport_channel() const { |
91 return transport_channel_; | 97 return transport_channel_; |
92 } | 98 } |
93 TransportChannel* rtcp_transport_channel() const { | 99 TransportChannel* rtcp_transport_channel() const { |
94 return rtcp_transport_channel_; | 100 return rtcp_transport_channel_; |
95 } | 101 } |
96 bool enabled() const { return enabled_; } | 102 bool enabled() const { return enabled_; } |
97 | 103 |
98 // This function returns true if we are using SRTP. | 104 // This function returns true if we are using SRTP. |
99 bool secure() const { return srtp_filter_.IsActive(); } | 105 bool secure() const { return srtp_filter_.IsActive(); } |
100 // The following function returns true if we are using | 106 // The following function returns true if we are using |
101 // DTLS-based keying. If you turned off SRTP later, however | 107 // DTLS-based keying. If you turned off SRTP later, however |
102 // you could have secure() == false and dtls_secure() == true. | 108 // you could have secure() == false and dtls_secure() == true. |
103 bool secure_dtls() const { return dtls_keyed_; } | 109 bool secure_dtls() const { return dtls_keyed_; } |
104 // This function returns true if we require secure channel for call setup. | 110 // This function returns true if we require secure channel for call setup. |
105 bool secure_required() const { return secure_required_; } | 111 bool secure_required() const { return secure_required_; } |
106 | 112 |
107 bool writable() const { return writable_; } | 113 bool writable() const { return writable_; } |
108 bool IsStreamMuted(uint32 ssrc); | 114 bool IsStreamMuted(uint32 ssrc); |
109 | 115 |
110 // Activate RTCP mux, regardless of the state so far. Once | 116 // Activate RTCP mux, regardless of the state so far. Once |
111 // activated, it can not be deactivated, and if the remote | 117 // activated, it can not be deactivated, and if the remote |
112 // description doesn't support RTCP mux, setting the remote | 118 // description doesn't support RTCP mux, setting the remote |
113 // description will fail. | 119 // description will fail. |
114 void ActivateRtcpMux(); | 120 void ActivateRtcpMux(); |
| 121 bool SetTransport(const std::string& transport_name); |
115 bool PushdownLocalDescription(const SessionDescription* local_desc, | 122 bool PushdownLocalDescription(const SessionDescription* local_desc, |
116 ContentAction action, | 123 ContentAction action, |
117 std::string* error_desc); | 124 std::string* error_desc); |
118 bool PushdownRemoteDescription(const SessionDescription* remote_desc, | 125 bool PushdownRemoteDescription(const SessionDescription* remote_desc, |
119 ContentAction action, | 126 ContentAction action, |
120 std::string* error_desc); | 127 std::string* error_desc); |
121 // Channel control | 128 // Channel control |
122 bool SetLocalContent(const MediaContentDescription* content, | 129 bool SetLocalContent(const MediaContentDescription* content, |
123 ContentAction action, | 130 ContentAction action, |
124 std::string* error_desc); | 131 std::string* error_desc); |
125 bool SetRemoteContent(const MediaContentDescription* content, | 132 bool SetRemoteContent(const MediaContentDescription* content, |
126 ContentAction action, | 133 ContentAction action, |
127 std::string* error_desc); | 134 std::string* error_desc); |
128 | 135 |
129 bool Enable(bool enable); | 136 bool Enable(bool enable); |
130 // Mute sending media on the stream with SSRC |ssrc| | 137 // Mute sending media on the stream with SSRC |ssrc| |
131 // If there is only one sending stream SSRC 0 can be used. | 138 // If there is only one sending stream SSRC 0 can be used. |
132 bool MuteStream(uint32 ssrc, bool mute); | 139 bool MuteStream(uint32 ssrc, bool mute); |
133 | 140 |
134 // Multiplexing | 141 // Multiplexing |
135 bool AddRecvStream(const StreamParams& sp); | 142 bool AddRecvStream(const StreamParams& sp); |
136 bool RemoveRecvStream(uint32 ssrc); | 143 bool RemoveRecvStream(uint32 ssrc); |
137 bool AddSendStream(const StreamParams& sp); | 144 bool AddSendStream(const StreamParams& sp); |
138 bool RemoveSendStream(uint32 ssrc); | 145 bool RemoveSendStream(uint32 ssrc); |
139 | 146 |
140 // Monitoring | 147 // Monitoring |
141 void StartConnectionMonitor(int cms); | 148 void StartConnectionMonitor(int cms); |
142 void StopConnectionMonitor(); | 149 void StopConnectionMonitor(); |
143 // For ConnectionStatsGetter, used by ConnectionMonitor | 150 // For ConnectionStatsGetter, used by ConnectionMonitor |
144 virtual bool GetConnectionStats(ConnectionInfos* infos) override; | 151 bool GetConnectionStats(ConnectionInfos* infos) override; |
145 | 152 |
146 void set_srtp_signal_silent_time(uint32 silent_time) { | 153 void set_srtp_signal_silent_time(uint32 silent_time) { |
147 srtp_filter_.set_signal_silent_time(silent_time); | 154 srtp_filter_.set_signal_silent_time(silent_time); |
148 } | 155 } |
149 | 156 |
150 BundleFilter* bundle_filter() { return &bundle_filter_; } | 157 BundleFilter* bundle_filter() { return &bundle_filter_; } |
151 | 158 |
152 const std::vector<StreamParams>& local_streams() const { | 159 const std::vector<StreamParams>& local_streams() const { |
153 return local_streams_; | 160 return local_streams_; |
154 } | 161 } |
(...skipping 16 matching lines...) Expand all Loading... |
171 | 178 |
172 // Only public for unit tests. Otherwise, consider protected. | 179 // Only public for unit tests. Otherwise, consider protected. |
173 virtual int SetOption(SocketType type, rtc::Socket::Option o, int val); | 180 virtual int SetOption(SocketType type, rtc::Socket::Option o, int val); |
174 | 181 |
175 protected: | 182 protected: |
176 virtual MediaChannel* media_channel() const { return media_channel_; } | 183 virtual MediaChannel* media_channel() const { return media_channel_; } |
177 // Sets the transport_channel_ and rtcp_transport_channel_. If | 184 // Sets the transport_channel_ and rtcp_transport_channel_. If |
178 // |rtcp| is false, set rtcp_transport_channel_ is set to NULL. Get | 185 // |rtcp| is false, set rtcp_transport_channel_ is set to NULL. Get |
179 // the transport channels from |session|. | 186 // the transport channels from |session|. |
180 // TODO(pthatcher): Pass in a Transport instead of a BaseSession. | 187 // TODO(pthatcher): Pass in a Transport instead of a BaseSession. |
181 bool SetTransportChannels(BaseSession* session, bool rtcp); | 188 bool SetTransportChannels(const std::string& transport_name, bool rtcp); |
182 bool SetTransportChannels_w(BaseSession* session, bool rtcp); | 189 bool SetTransportChannels_w(const std::string& transport_name, bool rtcp); |
183 void set_transport_channel(TransportChannel* transport); | 190 void set_transport_channel(TransportChannel* transport); |
184 void set_rtcp_transport_channel(TransportChannel* transport); | 191 void set_rtcp_transport_channel(TransportChannel* transport); |
185 bool was_ever_writable() const { return was_ever_writable_; } | 192 bool was_ever_writable() const { return was_ever_writable_; } |
186 void set_local_content_direction(MediaContentDirection direction) { | 193 void set_local_content_direction(MediaContentDirection direction) { |
187 local_content_direction_ = direction; | 194 local_content_direction_ = direction; |
188 } | 195 } |
189 void set_remote_content_direction(MediaContentDirection direction) { | 196 void set_remote_content_direction(MediaContentDirection direction) { |
190 remote_content_direction_ = direction; | 197 remote_content_direction_ = direction; |
191 } | 198 } |
192 bool IsReadyToReceive() const; | 199 bool IsReadyToReceive() const; |
193 bool IsReadyToSend() const; | 200 bool IsReadyToSend() const; |
194 rtc::Thread* signaling_thread() { return session_->signaling_thread(); } | 201 rtc::Thread* signaling_thread() { |
| 202 return transport_controller_->signaling_thread(); |
| 203 } |
195 SrtpFilter* srtp_filter() { return &srtp_filter_; } | 204 SrtpFilter* srtp_filter() { return &srtp_filter_; } |
196 bool rtcp() const { return rtcp_; } | 205 bool rtcp() const { return rtcp_; } |
197 | 206 |
198 void ConnectToTransportChannel(TransportChannel* tc); | 207 void ConnectToTransportChannel(TransportChannel* tc); |
199 void DisconnectFromTransportChannel(TransportChannel* tc); | 208 void DisconnectFromTransportChannel(TransportChannel* tc); |
200 | 209 |
201 void FlushRtcpMessages(); | 210 void FlushRtcpMessages(); |
202 | 211 |
203 // NetworkInterface implementation, called by MediaEngine | 212 // NetworkInterface implementation, called by MediaEngine |
204 virtual bool SendPacket(rtc::Buffer* packet, | 213 virtual bool SendPacket(rtc::Buffer* packet, |
(...skipping 11 matching lines...) Expand all Loading... |
216 void OnReadyToSend(TransportChannel* channel); | 225 void OnReadyToSend(TransportChannel* channel); |
217 | 226 |
218 bool PacketIsRtcp(const TransportChannel* channel, const char* data, | 227 bool PacketIsRtcp(const TransportChannel* channel, const char* data, |
219 size_t len); | 228 size_t len); |
220 bool SendPacket(bool rtcp, rtc::Buffer* packet, | 229 bool SendPacket(bool rtcp, rtc::Buffer* packet, |
221 rtc::DiffServCodePoint dscp); | 230 rtc::DiffServCodePoint dscp); |
222 virtual bool WantsPacket(bool rtcp, rtc::Buffer* packet); | 231 virtual bool WantsPacket(bool rtcp, rtc::Buffer* packet); |
223 void HandlePacket(bool rtcp, rtc::Buffer* packet, | 232 void HandlePacket(bool rtcp, rtc::Buffer* packet, |
224 const rtc::PacketTime& packet_time); | 233 const rtc::PacketTime& packet_time); |
225 | 234 |
226 // Apply the new local/remote session description. | |
227 void OnNewLocalDescription(BaseSession* session, ContentAction action); | |
228 void OnNewRemoteDescription(BaseSession* session, ContentAction action); | |
229 | |
230 void EnableMedia_w(); | 235 void EnableMedia_w(); |
231 void DisableMedia_w(); | 236 void DisableMedia_w(); |
232 virtual bool MuteStream_w(uint32 ssrc, bool mute); | 237 virtual bool MuteStream_w(uint32 ssrc, bool mute); |
233 bool IsStreamMuted_w(uint32 ssrc); | 238 bool IsStreamMuted_w(uint32 ssrc); |
234 void ChannelWritable_w(); | 239 void ChannelWritable_w(); |
235 void ChannelNotWritable_w(); | 240 void ChannelNotWritable_w(); |
236 bool AddRecvStream_w(const StreamParams& sp); | 241 bool AddRecvStream_w(const StreamParams& sp); |
237 bool RemoveRecvStream_w(uint32 ssrc); | 242 bool RemoveRecvStream_w(uint32 ssrc); |
238 bool AddSendStream_w(const StreamParams& sp); | 243 bool AddSendStream_w(const StreamParams& sp); |
239 bool RemoveSendStream_w(uint32 ssrc); | 244 bool RemoveSendStream_w(uint32 ssrc); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 const std::vector<ConnectionInfo>& infos) = 0; | 308 const std::vector<ConnectionInfo>& infos) = 0; |
304 | 309 |
305 // Helper function for invoking bool-returning methods on the worker thread. | 310 // Helper function for invoking bool-returning methods on the worker thread. |
306 template <class FunctorT> | 311 template <class FunctorT> |
307 bool InvokeOnWorker(const FunctorT& functor) { | 312 bool InvokeOnWorker(const FunctorT& functor) { |
308 return worker_thread_->Invoke<bool>(functor); | 313 return worker_thread_->Invoke<bool>(functor); |
309 } | 314 } |
310 | 315 |
311 private: | 316 private: |
312 rtc::Thread* worker_thread_; | 317 rtc::Thread* worker_thread_; |
313 BaseSession* session_; | 318 TransportController* transport_controller_; |
314 MediaChannel* media_channel_; | 319 MediaChannel* media_channel_; |
315 std::vector<StreamParams> local_streams_; | 320 std::vector<StreamParams> local_streams_; |
316 std::vector<StreamParams> remote_streams_; | 321 std::vector<StreamParams> remote_streams_; |
317 | 322 |
318 const std::string content_name_; | 323 const std::string content_name_; |
| 324 std::string transport_name_; |
319 bool rtcp_; | 325 bool rtcp_; |
320 TransportChannel* transport_channel_; | 326 TransportChannel* transport_channel_; |
| 327 std::vector<std::pair<rtc::Socket::Option, int> > socket_options_; |
321 TransportChannel* rtcp_transport_channel_; | 328 TransportChannel* rtcp_transport_channel_; |
| 329 std::vector<std::pair<rtc::Socket::Option, int> > rtcp_socket_options_; |
322 SrtpFilter srtp_filter_; | 330 SrtpFilter srtp_filter_; |
323 RtcpMuxFilter rtcp_mux_filter_; | 331 RtcpMuxFilter rtcp_mux_filter_; |
324 BundleFilter bundle_filter_; | 332 BundleFilter bundle_filter_; |
325 rtc::scoped_ptr<ConnectionMonitor> connection_monitor_; | 333 rtc::scoped_ptr<ConnectionMonitor> connection_monitor_; |
326 bool enabled_; | 334 bool enabled_; |
327 bool writable_; | 335 bool writable_; |
328 bool rtp_ready_to_send_; | 336 bool rtp_ready_to_send_; |
329 bool rtcp_ready_to_send_; | 337 bool rtcp_ready_to_send_; |
330 bool was_ever_writable_; | 338 bool was_ever_writable_; |
331 MediaContentDirection local_content_direction_; | 339 MediaContentDirection local_content_direction_; |
332 MediaContentDirection remote_content_direction_; | 340 MediaContentDirection remote_content_direction_; |
333 std::set<uint32> muted_streams_; | 341 std::set<uint32> muted_streams_; |
334 bool has_received_packet_; | 342 bool has_received_packet_; |
335 bool dtls_keyed_; | 343 bool dtls_keyed_; |
336 bool secure_required_; | 344 bool secure_required_; |
337 int rtp_abs_sendtime_extn_id_; | 345 int rtp_abs_sendtime_extn_id_; |
338 }; | 346 }; |
339 | 347 |
340 // VoiceChannel is a specialization that adds support for early media, DTMF, | 348 // VoiceChannel is a specialization that adds support for early media, DTMF, |
341 // and input/output level monitoring. | 349 // and input/output level monitoring. |
342 class VoiceChannel : public BaseChannel { | 350 class VoiceChannel : public BaseChannel { |
343 public: | 351 public: |
344 VoiceChannel(rtc::Thread* thread, MediaEngineInterface* media_engine, | 352 VoiceChannel(rtc::Thread* thread, |
345 VoiceMediaChannel* channel, BaseSession* session, | 353 MediaEngineInterface* media_engine, |
346 const std::string& content_name, bool rtcp); | 354 VoiceMediaChannel* channel, |
| 355 TransportController* transport_controller, |
| 356 const std::string& content_name, |
| 357 bool rtcp); |
347 ~VoiceChannel(); | 358 ~VoiceChannel(); |
348 bool Init(); | 359 bool Init(); |
349 bool SetRemoteRenderer(uint32 ssrc, AudioRenderer* renderer); | 360 bool SetRemoteRenderer(uint32 ssrc, AudioRenderer* renderer); |
350 bool SetLocalRenderer(uint32 ssrc, AudioRenderer* renderer); | 361 bool SetLocalRenderer(uint32 ssrc, AudioRenderer* renderer); |
351 | 362 |
352 // downcasts a MediaChannel | 363 // downcasts a MediaChannel |
353 virtual VoiceMediaChannel* media_channel() const { | 364 virtual VoiceMediaChannel* media_channel() const { |
354 return static_cast<VoiceMediaChannel*>(BaseChannel::media_channel()); | 365 return static_cast<VoiceMediaChannel*>(BaseChannel::media_channel()); |
355 } | 366 } |
356 | 367 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 MediaEngineInterface* media_engine_; | 455 MediaEngineInterface* media_engine_; |
445 bool received_media_; | 456 bool received_media_; |
446 rtc::scoped_ptr<VoiceMediaMonitor> media_monitor_; | 457 rtc::scoped_ptr<VoiceMediaMonitor> media_monitor_; |
447 rtc::scoped_ptr<AudioMonitor> audio_monitor_; | 458 rtc::scoped_ptr<AudioMonitor> audio_monitor_; |
448 rtc::scoped_ptr<TypingMonitor> typing_monitor_; | 459 rtc::scoped_ptr<TypingMonitor> typing_monitor_; |
449 }; | 460 }; |
450 | 461 |
451 // VideoChannel is a specialization for video. | 462 // VideoChannel is a specialization for video. |
452 class VideoChannel : public BaseChannel { | 463 class VideoChannel : public BaseChannel { |
453 public: | 464 public: |
454 VideoChannel(rtc::Thread* thread, VideoMediaChannel* channel, | 465 VideoChannel(rtc::Thread* thread, |
455 BaseSession* session, const std::string& content_name, | 466 VideoMediaChannel* channel, |
| 467 TransportController* transport_controller, |
| 468 const std::string& content_name, |
456 bool rtcp); | 469 bool rtcp); |
457 ~VideoChannel(); | 470 ~VideoChannel(); |
458 bool Init(); | 471 bool Init(); |
459 | 472 |
460 // downcasts a MediaChannel | 473 // downcasts a MediaChannel |
461 virtual VideoMediaChannel* media_channel() const { | 474 virtual VideoMediaChannel* media_channel() const { |
462 return static_cast<VideoMediaChannel*>(BaseChannel::media_channel()); | 475 return static_cast<VideoMediaChannel*>(BaseChannel::media_channel()); |
463 } | 476 } |
464 | 477 |
465 bool SetRenderer(uint32 ssrc, VideoRenderer* renderer); | 478 bool SetRenderer(uint32 ssrc, VideoRenderer* renderer); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 rtc::scoped_ptr<VideoMediaMonitor> media_monitor_; | 549 rtc::scoped_ptr<VideoMediaMonitor> media_monitor_; |
537 | 550 |
538 rtc::WindowEvent previous_we_; | 551 rtc::WindowEvent previous_we_; |
539 }; | 552 }; |
540 | 553 |
541 // DataChannel is a specialization for data. | 554 // DataChannel is a specialization for data. |
542 class DataChannel : public BaseChannel { | 555 class DataChannel : public BaseChannel { |
543 public: | 556 public: |
544 DataChannel(rtc::Thread* thread, | 557 DataChannel(rtc::Thread* thread, |
545 DataMediaChannel* media_channel, | 558 DataMediaChannel* media_channel, |
546 BaseSession* session, | 559 TransportController* transport_controller, |
547 const std::string& content_name, | 560 const std::string& content_name, |
548 bool rtcp); | 561 bool rtcp); |
549 ~DataChannel(); | 562 ~DataChannel(); |
550 bool Init(); | 563 bool Init(); |
551 | 564 |
552 virtual bool SendData(const SendDataParams& params, | 565 virtual bool SendData(const SendDataParams& params, |
553 const rtc::Buffer& payload, | 566 const rtc::Buffer& payload, |
554 SendDataResult* result); | 567 SendDataResult* result); |
555 | 568 |
556 void StartMediaMonitor(int cms); | 569 void StartMediaMonitor(int cms); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 rtc::scoped_ptr<DataMediaMonitor> media_monitor_; | 665 rtc::scoped_ptr<DataMediaMonitor> media_monitor_; |
653 // TODO(pthatcher): Make a separate SctpDataChannel and | 666 // TODO(pthatcher): Make a separate SctpDataChannel and |
654 // RtpDataChannel instead of using this. | 667 // RtpDataChannel instead of using this. |
655 DataChannelType data_channel_type_; | 668 DataChannelType data_channel_type_; |
656 bool ready_to_send_data_; | 669 bool ready_to_send_data_; |
657 }; | 670 }; |
658 | 671 |
659 } // namespace cricket | 672 } // namespace cricket |
660 | 673 |
661 #endif // TALK_SESSION_MEDIA_CHANNEL_H_ | 674 #endif // TALK_SESSION_MEDIA_CHANNEL_H_ |
OLD | NEW |