Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: talk/session/media/channel.h

Issue 1246913005: TransportController refactoring (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Set media engine on voice channel Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
155 const std::vector<StreamParams>& remote_streams() const { 162 const std::vector<StreamParams>& remote_streams() const {
156 return remote_streams_; 163 return remote_streams_;
157 } 164 }
158 165
159 sigslot::signal2<BaseChannel*, bool> SignalDtlsSetupFailure; 166 sigslot::signal2<BaseChannel*, bool> SignalDtlsSetupFailure;
160 void SignalDtlsSetupFailure_w(bool rtcp); 167 void SignalDtlsSetupFailure_w(bool rtcp);
161 void SignalDtlsSetupFailure_s(bool rtcp); 168 void SignalDtlsSetupFailure_s(bool rtcp);
162 169
163 // Used for latency measurements. 170 // Used for latency measurements.
164 sigslot::signal1<BaseChannel*> SignalFirstPacketReceived; 171 sigslot::signal1<BaseChannel*> SignalFirstPacketReceived;
165 172
166 // Used to alert UI when the muted status changes, perhaps autonomously. 173 // Used to alert UI when the muted status changes, perhaps autonomously.
167 sigslot::repeater2<BaseChannel*, bool> SignalAutoMuted; 174 sigslot::repeater2<BaseChannel*, bool> SignalAutoMuted;
168 175
169 // Made public for easier testing. 176 // Made public for easier testing.
170 void SetReadyToSend(TransportChannel* channel, bool ready); 177 void SetReadyToSend(bool rtcp, bool ready);
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
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);
239 void UpdateWritableState_w();
234 void ChannelWritable_w(); 240 void ChannelWritable_w();
235 void ChannelNotWritable_w(); 241 void ChannelNotWritable_w();
236 bool AddRecvStream_w(const StreamParams& sp); 242 bool AddRecvStream_w(const StreamParams& sp);
237 bool RemoveRecvStream_w(uint32 ssrc); 243 bool RemoveRecvStream_w(uint32 ssrc);
238 bool AddSendStream_w(const StreamParams& sp); 244 bool AddSendStream_w(const StreamParams& sp);
239 bool RemoveSendStream_w(uint32 ssrc); 245 bool RemoveSendStream_w(uint32 ssrc);
240 virtual bool ShouldSetupDtlsSrtp() const; 246 virtual bool ShouldSetupDtlsSrtp() const;
241 // Do the DTLS key expansion and impose it on the SRTP/SRTCP filters. 247 // Do the DTLS key expansion and impose it on the SRTP/SRTCP filters.
242 // |rtcp_channel| indicates whether to set up the RTP or RTCP filter. 248 // |rtcp_channel| indicates whether to set up the RTP or RTCP filter.
243 bool SetupDtlsSrtp(bool rtcp_channel); 249 bool SetupDtlsSrtp(bool rtcp_channel);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 const std::vector<ConnectionInfo>& infos) = 0; 309 const std::vector<ConnectionInfo>& infos) = 0;
304 310
305 // Helper function for invoking bool-returning methods on the worker thread. 311 // Helper function for invoking bool-returning methods on the worker thread.
306 template <class FunctorT> 312 template <class FunctorT>
307 bool InvokeOnWorker(const FunctorT& functor) { 313 bool InvokeOnWorker(const FunctorT& functor) {
308 return worker_thread_->Invoke<bool>(functor); 314 return worker_thread_->Invoke<bool>(functor);
309 } 315 }
310 316
311 private: 317 private:
312 rtc::Thread* worker_thread_; 318 rtc::Thread* worker_thread_;
313 BaseSession* session_; 319 TransportController* transport_controller_;
314 MediaChannel* media_channel_; 320 MediaChannel* media_channel_;
315 std::vector<StreamParams> local_streams_; 321 std::vector<StreamParams> local_streams_;
316 std::vector<StreamParams> remote_streams_; 322 std::vector<StreamParams> remote_streams_;
317 323
318 const std::string content_name_; 324 const std::string content_name_;
325 std::string transport_name_;
319 bool rtcp_; 326 bool rtcp_;
320 TransportChannel* transport_channel_; 327 TransportChannel* transport_channel_;
328 std::vector<std::pair<rtc::Socket::Option, int> > socket_options_;
321 TransportChannel* rtcp_transport_channel_; 329 TransportChannel* rtcp_transport_channel_;
330 std::vector<std::pair<rtc::Socket::Option, int> > rtcp_socket_options_;
322 SrtpFilter srtp_filter_; 331 SrtpFilter srtp_filter_;
323 RtcpMuxFilter rtcp_mux_filter_; 332 RtcpMuxFilter rtcp_mux_filter_;
324 BundleFilter bundle_filter_; 333 BundleFilter bundle_filter_;
325 rtc::scoped_ptr<ConnectionMonitor> connection_monitor_; 334 rtc::scoped_ptr<ConnectionMonitor> connection_monitor_;
326 bool enabled_; 335 bool enabled_;
327 bool writable_; 336 bool writable_;
328 bool rtp_ready_to_send_; 337 bool rtp_ready_to_send_;
329 bool rtcp_ready_to_send_; 338 bool rtcp_ready_to_send_;
330 bool was_ever_writable_; 339 bool was_ever_writable_;
331 MediaContentDirection local_content_direction_; 340 MediaContentDirection local_content_direction_;
332 MediaContentDirection remote_content_direction_; 341 MediaContentDirection remote_content_direction_;
333 std::set<uint32> muted_streams_; 342 std::set<uint32> muted_streams_;
334 bool has_received_packet_; 343 bool has_received_packet_;
335 bool dtls_keyed_; 344 bool dtls_keyed_;
336 bool secure_required_; 345 bool secure_required_;
337 int rtp_abs_sendtime_extn_id_; 346 int rtp_abs_sendtime_extn_id_;
338 }; 347 };
339 348
340 // VoiceChannel is a specialization that adds support for early media, DTMF, 349 // VoiceChannel is a specialization that adds support for early media, DTMF,
341 // and input/output level monitoring. 350 // and input/output level monitoring.
342 class VoiceChannel : public BaseChannel { 351 class VoiceChannel : public BaseChannel {
343 public: 352 public:
344 VoiceChannel(rtc::Thread* thread, MediaEngineInterface* media_engine, 353 VoiceChannel(rtc::Thread* thread,
345 VoiceMediaChannel* channel, BaseSession* session, 354 MediaEngineInterface* media_engine,
346 const std::string& content_name, bool rtcp); 355 VoiceMediaChannel* channel,
356 TransportController* transport_controller,
357 const std::string& content_name,
358 bool rtcp);
347 ~VoiceChannel(); 359 ~VoiceChannel();
348 bool Init(); 360 bool Init();
349 bool SetRemoteRenderer(uint32 ssrc, AudioRenderer* renderer); 361 bool SetRemoteRenderer(uint32 ssrc, AudioRenderer* renderer);
350 bool SetLocalRenderer(uint32 ssrc, AudioRenderer* renderer); 362 bool SetLocalRenderer(uint32 ssrc, AudioRenderer* renderer);
351 363
352 // downcasts a MediaChannel 364 // downcasts a MediaChannel
353 virtual VoiceMediaChannel* media_channel() const { 365 virtual VoiceMediaChannel* media_channel() const {
354 return static_cast<VoiceMediaChannel*>(BaseChannel::media_channel()); 366 return static_cast<VoiceMediaChannel*>(BaseChannel::media_channel());
355 } 367 }
356 368
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 MediaEngineInterface* media_engine_; 456 MediaEngineInterface* media_engine_;
445 bool received_media_; 457 bool received_media_;
446 rtc::scoped_ptr<VoiceMediaMonitor> media_monitor_; 458 rtc::scoped_ptr<VoiceMediaMonitor> media_monitor_;
447 rtc::scoped_ptr<AudioMonitor> audio_monitor_; 459 rtc::scoped_ptr<AudioMonitor> audio_monitor_;
448 rtc::scoped_ptr<TypingMonitor> typing_monitor_; 460 rtc::scoped_ptr<TypingMonitor> typing_monitor_;
449 }; 461 };
450 462
451 // VideoChannel is a specialization for video. 463 // VideoChannel is a specialization for video.
452 class VideoChannel : public BaseChannel { 464 class VideoChannel : public BaseChannel {
453 public: 465 public:
454 VideoChannel(rtc::Thread* thread, VideoMediaChannel* channel, 466 VideoChannel(rtc::Thread* thread,
455 BaseSession* session, const std::string& content_name, 467 VideoMediaChannel* channel,
468 TransportController* transport_controller,
469 const std::string& content_name,
456 bool rtcp); 470 bool rtcp);
457 ~VideoChannel(); 471 ~VideoChannel();
458 bool Init(); 472 bool Init();
459 473
460 // downcasts a MediaChannel 474 // downcasts a MediaChannel
461 virtual VideoMediaChannel* media_channel() const { 475 virtual VideoMediaChannel* media_channel() const {
462 return static_cast<VideoMediaChannel*>(BaseChannel::media_channel()); 476 return static_cast<VideoMediaChannel*>(BaseChannel::media_channel());
463 } 477 }
464 478
465 bool SetRenderer(uint32 ssrc, VideoRenderer* renderer); 479 bool SetRenderer(uint32 ssrc, VideoRenderer* renderer);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 rtc::scoped_ptr<VideoMediaMonitor> media_monitor_; 550 rtc::scoped_ptr<VideoMediaMonitor> media_monitor_;
537 551
538 rtc::WindowEvent previous_we_; 552 rtc::WindowEvent previous_we_;
539 }; 553 };
540 554
541 // DataChannel is a specialization for data. 555 // DataChannel is a specialization for data.
542 class DataChannel : public BaseChannel { 556 class DataChannel : public BaseChannel {
543 public: 557 public:
544 DataChannel(rtc::Thread* thread, 558 DataChannel(rtc::Thread* thread,
545 DataMediaChannel* media_channel, 559 DataMediaChannel* media_channel,
546 BaseSession* session, 560 TransportController* transport_controller,
547 const std::string& content_name, 561 const std::string& content_name,
548 bool rtcp); 562 bool rtcp);
549 ~DataChannel(); 563 ~DataChannel();
550 bool Init(); 564 bool Init();
551 565
552 virtual bool SendData(const SendDataParams& params, 566 virtual bool SendData(const SendDataParams& params,
553 const rtc::Buffer& payload, 567 const rtc::Buffer& payload,
554 SendDataResult* result); 568 SendDataResult* result);
555 569
556 void StartMediaMonitor(int cms); 570 void StartMediaMonitor(int cms);
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 rtc::scoped_ptr<DataMediaMonitor> media_monitor_; 666 rtc::scoped_ptr<DataMediaMonitor> media_monitor_;
653 // TODO(pthatcher): Make a separate SctpDataChannel and 667 // TODO(pthatcher): Make a separate SctpDataChannel and
654 // RtpDataChannel instead of using this. 668 // RtpDataChannel instead of using this.
655 DataChannelType data_channel_type_; 669 DataChannelType data_channel_type_;
656 bool ready_to_send_data_; 670 bool ready_to_send_data_;
657 }; 671 };
658 672
659 } // namespace cricket 673 } // namespace cricket
660 674
661 #endif // TALK_SESSION_MEDIA_CHANNEL_H_ 675 #endif // TALK_SESSION_MEDIA_CHANNEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698