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

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: Fixed bugs with ICE connection state that occur when destroying transports Created 5 years, 3 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 18 matching lines...) Expand all
67 // WARNING! SUBCLASSES MUST CALL Deinit() IN THEIR DESTRUCTORS! 70 // WARNING! SUBCLASSES MUST CALL Deinit() IN THEIR DESTRUCTORS!
68 // This is required to avoid a data race between the destructor modifying the 71 // This is required to avoid a data race between the destructor modifying the
69 // vtable, and the media channel's thread using BaseChannel as the 72 // vtable, and the media channel's thread using BaseChannel as the
70 // NetworkInterface. 73 // NetworkInterface.
71 74
72 class BaseChannel 75 class BaseChannel
73 : public rtc::MessageHandler, public sigslot::has_slots<>, 76 : public rtc::MessageHandler, public sigslot::has_slots<>,
74 public MediaChannel::NetworkInterface, 77 public MediaChannel::NetworkInterface,
75 public ConnectionStatsGetter { 78 public ConnectionStatsGetter {
76 public: 79 public:
77 BaseChannel(rtc::Thread* thread, MediaChannel* channel, BaseSession* session, 80 BaseChannel(rtc::Thread* thread,
78 const std::string& content_name, bool rtcp); 81 MediaChannel* channel,
82 TransportController* transport_controller,
83 const std::string& content_name,
84 bool rtcp);
79 virtual ~BaseChannel(); 85 virtual ~BaseChannel();
80 bool Init(); 86 bool Init();
81 // Deinit may be called multiple times and is simply ignored if it's alreay 87 // Deinit may be called multiple times and is simply ignored if it's alreay
82 // done. 88 // done.
83 void Deinit(); 89 void Deinit();
84 90
85 rtc::Thread* worker_thread() const { return worker_thread_; } 91 rtc::Thread* worker_thread() const { return worker_thread_; }
86 BaseSession* session() const { return session_; } 92 const std::string& content_name() const { return content_name_; }
87 const std::string& content_name() { return content_name_; } 93 const std::string& transport_name() const { return transport_name_; }
88 TransportChannel* transport_channel() const { 94 TransportChannel* transport_channel() const {
89 return transport_channel_; 95 return transport_channel_;
90 } 96 }
91 TransportChannel* rtcp_transport_channel() const { 97 TransportChannel* rtcp_transport_channel() const {
92 return rtcp_transport_channel_; 98 return rtcp_transport_channel_;
93 } 99 }
94 bool enabled() const { return enabled_; } 100 bool enabled() const { return enabled_; }
95 101
96 // This function returns true if we are using SRTP. 102 // This function returns true if we are using SRTP.
97 bool secure() const { return srtp_filter_.IsActive(); } 103 bool secure() const { return srtp_filter_.IsActive(); }
98 // The following function returns true if we are using 104 // The following function returns true if we are using
99 // DTLS-based keying. If you turned off SRTP later, however 105 // DTLS-based keying. If you turned off SRTP later, however
100 // you could have secure() == false and dtls_secure() == true. 106 // you could have secure() == false and dtls_secure() == true.
101 bool secure_dtls() const { return dtls_keyed_; } 107 bool secure_dtls() const { return dtls_keyed_; }
102 // This function returns true if we require secure channel for call setup. 108 // This function returns true if we require secure channel for call setup.
103 bool secure_required() const { return secure_required_; } 109 bool secure_required() const { return secure_required_; }
104 110
105 bool writable() const { return writable_; } 111 bool writable() const { return writable_; }
106 bool IsStreamMuted(uint32 ssrc); 112 bool IsStreamMuted(uint32 ssrc);
107 113
108 // Activate RTCP mux, regardless of the state so far. Once 114 // Activate RTCP mux, regardless of the state so far. Once
109 // activated, it can not be deactivated, and if the remote 115 // activated, it can not be deactivated, and if the remote
110 // description doesn't support RTCP mux, setting the remote 116 // description doesn't support RTCP mux, setting the remote
111 // description will fail. 117 // description will fail.
112 void ActivateRtcpMux(); 118 void ActivateRtcpMux();
119 bool SetTransport(const std::string& transport_name);
113 bool PushdownLocalDescription(const SessionDescription* local_desc, 120 bool PushdownLocalDescription(const SessionDescription* local_desc,
114 ContentAction action, 121 ContentAction action,
115 std::string* error_desc); 122 std::string* error_desc);
116 bool PushdownRemoteDescription(const SessionDescription* remote_desc, 123 bool PushdownRemoteDescription(const SessionDescription* remote_desc,
117 ContentAction action, 124 ContentAction action,
118 std::string* error_desc); 125 std::string* error_desc);
119 // Channel control 126 // Channel control
120 bool SetLocalContent(const MediaContentDescription* content, 127 bool SetLocalContent(const MediaContentDescription* content,
121 ContentAction action, 128 ContentAction action,
122 std::string* error_desc); 129 std::string* error_desc);
123 bool SetRemoteContent(const MediaContentDescription* content, 130 bool SetRemoteContent(const MediaContentDescription* content,
124 ContentAction action, 131 ContentAction action,
125 std::string* error_desc); 132 std::string* error_desc);
126 133
127 bool Enable(bool enable); 134 bool Enable(bool enable);
128 // Mute sending media on the stream with SSRC |ssrc| 135 // Mute sending media on the stream with SSRC |ssrc|
129 // If there is only one sending stream SSRC 0 can be used. 136 // If there is only one sending stream SSRC 0 can be used.
130 bool MuteStream(uint32 ssrc, bool mute); 137 bool MuteStream(uint32 ssrc, bool mute);
131 138
132 // Multiplexing 139 // Multiplexing
133 bool AddRecvStream(const StreamParams& sp); 140 bool AddRecvStream(const StreamParams& sp);
134 bool RemoveRecvStream(uint32 ssrc); 141 bool RemoveRecvStream(uint32 ssrc);
135 bool AddSendStream(const StreamParams& sp); 142 bool AddSendStream(const StreamParams& sp);
136 bool RemoveSendStream(uint32 ssrc); 143 bool RemoveSendStream(uint32 ssrc);
137 144
138 // Monitoring 145 // Monitoring
139 void StartConnectionMonitor(int cms); 146 void StartConnectionMonitor(int cms);
140 void StopConnectionMonitor(); 147 void StopConnectionMonitor();
141 // For ConnectionStatsGetter, used by ConnectionMonitor 148 // For ConnectionStatsGetter, used by ConnectionMonitor
142 virtual bool GetConnectionStats(ConnectionInfos* infos) override; 149 bool GetConnectionStats(ConnectionInfos* infos) override;
143 150
144 void set_srtp_signal_silent_time(uint32 silent_time) { 151 void set_srtp_signal_silent_time(uint32 silent_time) {
145 srtp_filter_.set_signal_silent_time(silent_time); 152 srtp_filter_.set_signal_silent_time(silent_time);
146 } 153 }
147 154
148 BundleFilter* bundle_filter() { return &bundle_filter_; } 155 BundleFilter* bundle_filter() { return &bundle_filter_; }
149 156
150 const std::vector<StreamParams>& local_streams() const { 157 const std::vector<StreamParams>& local_streams() const {
151 return local_streams_; 158 return local_streams_;
152 } 159 }
153 const std::vector<StreamParams>& remote_streams() const { 160 const std::vector<StreamParams>& remote_streams() const {
154 return remote_streams_; 161 return remote_streams_;
155 } 162 }
156 163
157 sigslot::signal2<BaseChannel*, bool> SignalDtlsSetupFailure; 164 sigslot::signal2<BaseChannel*, bool> SignalDtlsSetupFailure;
158 void SignalDtlsSetupFailure_w(bool rtcp); 165 void SignalDtlsSetupFailure_w(bool rtcp);
159 void SignalDtlsSetupFailure_s(bool rtcp); 166 void SignalDtlsSetupFailure_s(bool rtcp);
160 167
161 // Used for latency measurements. 168 // Used for latency measurements.
162 sigslot::signal1<BaseChannel*> SignalFirstPacketReceived; 169 sigslot::signal1<BaseChannel*> SignalFirstPacketReceived;
163 170
164 // Made public for easier testing. 171 // Made public for easier testing.
165 void SetReadyToSend(TransportChannel* channel, bool ready); 172 void SetReadyToSend(bool rtcp, bool ready);
166 173
167 // Only public for unit tests. Otherwise, consider protected. 174 // Only public for unit tests. Otherwise, consider protected.
168 virtual int SetOption(SocketType type, rtc::Socket::Option o, int val); 175 virtual int SetOption(SocketType type, rtc::Socket::Option o, int val);
169 176
170 protected: 177 protected:
171 virtual MediaChannel* media_channel() const { return media_channel_; } 178 virtual MediaChannel* media_channel() const { return media_channel_; }
172 // Sets the transport_channel_ and rtcp_transport_channel_. If 179 // Sets the |transport_channel_| (and |rtcp_transport_channel_|, if |rtcp_| is
173 // |rtcp| is false, set rtcp_transport_channel_ is set to NULL. Get 180 // true). Gets the transport channels from |transport_controller_|.
174 // the transport channels from |session|. 181 bool SetTransport_w(const std::string& transport_name);
175 // TODO(pthatcher): Pass in a Transport instead of a BaseSession.
176 bool SetTransportChannels(BaseSession* session, bool rtcp);
177 bool SetTransportChannels_w(BaseSession* session, bool rtcp);
178 void set_transport_channel(TransportChannel* transport); 182 void set_transport_channel(TransportChannel* transport);
179 void set_rtcp_transport_channel(TransportChannel* transport); 183 void set_rtcp_transport_channel(TransportChannel* transport);
180 bool was_ever_writable() const { return was_ever_writable_; } 184 bool was_ever_writable() const { return was_ever_writable_; }
181 void set_local_content_direction(MediaContentDirection direction) { 185 void set_local_content_direction(MediaContentDirection direction) {
182 local_content_direction_ = direction; 186 local_content_direction_ = direction;
183 } 187 }
184 void set_remote_content_direction(MediaContentDirection direction) { 188 void set_remote_content_direction(MediaContentDirection direction) {
185 remote_content_direction_ = direction; 189 remote_content_direction_ = direction;
186 } 190 }
187 void set_secure_required(bool secure_required) { 191 void set_secure_required(bool secure_required) {
188 secure_required_ = secure_required; 192 secure_required_ = secure_required;
189 } 193 }
190 bool IsReadyToReceive() const; 194 bool IsReadyToReceive() const;
191 bool IsReadyToSend() const; 195 bool IsReadyToSend() const;
192 rtc::Thread* signaling_thread() { return session_->signaling_thread(); } 196 rtc::Thread* signaling_thread() {
197 return transport_controller_->signaling_thread();
198 }
193 SrtpFilter* srtp_filter() { return &srtp_filter_; } 199 SrtpFilter* srtp_filter() { return &srtp_filter_; }
194 bool rtcp() const { return rtcp_; } 200 bool rtcp_transport_enabled() const { return rtcp_transport_enabled_; }
195 201
196 void ConnectToTransportChannel(TransportChannel* tc); 202 void ConnectToTransportChannel(TransportChannel* tc);
197 void DisconnectFromTransportChannel(TransportChannel* tc); 203 void DisconnectFromTransportChannel(TransportChannel* tc);
198 204
199 void FlushRtcpMessages(); 205 void FlushRtcpMessages();
200 206
201 // NetworkInterface implementation, called by MediaEngine 207 // NetworkInterface implementation, called by MediaEngine
202 virtual bool SendPacket(rtc::Buffer* packet, 208 virtual bool SendPacket(rtc::Buffer* packet,
203 rtc::DiffServCodePoint dscp); 209 rtc::DiffServCodePoint dscp);
204 virtual bool SendRtcp(rtc::Buffer* packet, 210 virtual bool SendRtcp(rtc::Buffer* packet,
205 rtc::DiffServCodePoint dscp); 211 rtc::DiffServCodePoint dscp);
206 212
207 // From TransportChannel 213 // From TransportChannel
208 void OnWritableState(TransportChannel* channel); 214 void OnWritableState(TransportChannel* channel);
209 virtual void OnChannelRead(TransportChannel* channel, 215 virtual void OnChannelRead(TransportChannel* channel,
210 const char* data, 216 const char* data,
211 size_t len, 217 size_t len,
212 const rtc::PacketTime& packet_time, 218 const rtc::PacketTime& packet_time,
213 int flags); 219 int flags);
214 void OnReadyToSend(TransportChannel* channel); 220 void OnReadyToSend(TransportChannel* channel);
215 221
216 bool PacketIsRtcp(const TransportChannel* channel, const char* data, 222 bool PacketIsRtcp(const TransportChannel* channel, const char* data,
217 size_t len); 223 size_t len);
218 bool SendPacket(bool rtcp, rtc::Buffer* packet, 224 bool SendPacket(bool rtcp, rtc::Buffer* packet,
219 rtc::DiffServCodePoint dscp); 225 rtc::DiffServCodePoint dscp);
220 virtual bool WantsPacket(bool rtcp, rtc::Buffer* packet); 226 virtual bool WantsPacket(bool rtcp, rtc::Buffer* packet);
221 void HandlePacket(bool rtcp, rtc::Buffer* packet, 227 void HandlePacket(bool rtcp, rtc::Buffer* packet,
222 const rtc::PacketTime& packet_time); 228 const rtc::PacketTime& packet_time);
223 229
224 // Apply the new local/remote session description.
225 void OnNewLocalDescription(BaseSession* session, ContentAction action);
226 void OnNewRemoteDescription(BaseSession* session, ContentAction action);
227
228 void EnableMedia_w(); 230 void EnableMedia_w();
229 void DisableMedia_w(); 231 void DisableMedia_w();
230 bool MuteStream_w(uint32 ssrc, bool mute); 232 bool MuteStream_w(uint32 ssrc, bool mute);
231 bool IsStreamMuted_w(uint32 ssrc); 233 bool IsStreamMuted_w(uint32 ssrc);
234 void UpdateWritableState_w();
232 void ChannelWritable_w(); 235 void ChannelWritable_w();
233 void ChannelNotWritable_w(); 236 void ChannelNotWritable_w();
234 bool AddRecvStream_w(const StreamParams& sp); 237 bool AddRecvStream_w(const StreamParams& sp);
235 bool RemoveRecvStream_w(uint32 ssrc); 238 bool RemoveRecvStream_w(uint32 ssrc);
236 bool AddSendStream_w(const StreamParams& sp); 239 bool AddSendStream_w(const StreamParams& sp);
237 bool RemoveSendStream_w(uint32 ssrc); 240 bool RemoveSendStream_w(uint32 ssrc);
238 virtual bool ShouldSetupDtlsSrtp() const; 241 virtual bool ShouldSetupDtlsSrtp() const;
239 // Do the DTLS key expansion and impose it on the SRTP/SRTCP filters. 242 // Do the DTLS key expansion and impose it on the SRTP/SRTCP filters.
240 // |rtcp_channel| indicates whether to set up the RTP or RTCP filter. 243 // |rtcp_channel| indicates whether to set up the RTP or RTCP filter.
241 bool SetupDtlsSrtp(bool rtcp_channel); 244 bool SetupDtlsSrtp(bool rtcp_channel);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 const std::vector<ConnectionInfo>& infos) = 0; 295 const std::vector<ConnectionInfo>& infos) = 0;
293 296
294 // Helper function for invoking bool-returning methods on the worker thread. 297 // Helper function for invoking bool-returning methods on the worker thread.
295 template <class FunctorT> 298 template <class FunctorT>
296 bool InvokeOnWorker(const FunctorT& functor) { 299 bool InvokeOnWorker(const FunctorT& functor) {
297 return worker_thread_->Invoke<bool>(functor); 300 return worker_thread_->Invoke<bool>(functor);
298 } 301 }
299 302
300 private: 303 private:
301 rtc::Thread* worker_thread_; 304 rtc::Thread* worker_thread_;
302 BaseSession* session_; 305 TransportController* transport_controller_;
303 MediaChannel* media_channel_; 306 MediaChannel* media_channel_;
304 std::vector<StreamParams> local_streams_; 307 std::vector<StreamParams> local_streams_;
305 std::vector<StreamParams> remote_streams_; 308 std::vector<StreamParams> remote_streams_;
306 309
307 const std::string content_name_; 310 const std::string content_name_;
308 bool rtcp_; 311 std::string transport_name_;
312 bool rtcp_transport_enabled_;
309 TransportChannel* transport_channel_; 313 TransportChannel* transport_channel_;
314 std::vector<std::pair<rtc::Socket::Option, int> > socket_options_;
310 TransportChannel* rtcp_transport_channel_; 315 TransportChannel* rtcp_transport_channel_;
316 std::vector<std::pair<rtc::Socket::Option, int> > rtcp_socket_options_;
311 SrtpFilter srtp_filter_; 317 SrtpFilter srtp_filter_;
312 RtcpMuxFilter rtcp_mux_filter_; 318 RtcpMuxFilter rtcp_mux_filter_;
313 BundleFilter bundle_filter_; 319 BundleFilter bundle_filter_;
314 rtc::scoped_ptr<ConnectionMonitor> connection_monitor_; 320 rtc::scoped_ptr<ConnectionMonitor> connection_monitor_;
315 bool enabled_; 321 bool enabled_;
316 bool writable_; 322 bool writable_;
317 bool rtp_ready_to_send_; 323 bool rtp_ready_to_send_;
318 bool rtcp_ready_to_send_; 324 bool rtcp_ready_to_send_;
319 bool was_ever_writable_; 325 bool was_ever_writable_;
320 MediaContentDirection local_content_direction_; 326 MediaContentDirection local_content_direction_;
321 MediaContentDirection remote_content_direction_; 327 MediaContentDirection remote_content_direction_;
322 std::set<uint32> muted_streams_; 328 std::set<uint32> muted_streams_;
323 bool has_received_packet_; 329 bool has_received_packet_;
324 bool dtls_keyed_; 330 bool dtls_keyed_;
325 bool secure_required_; 331 bool secure_required_;
326 int rtp_abs_sendtime_extn_id_; 332 int rtp_abs_sendtime_extn_id_;
327 }; 333 };
328 334
329 // VoiceChannel is a specialization that adds support for early media, DTMF, 335 // VoiceChannel is a specialization that adds support for early media, DTMF,
330 // and input/output level monitoring. 336 // and input/output level monitoring.
331 class VoiceChannel : public BaseChannel { 337 class VoiceChannel : public BaseChannel {
332 public: 338 public:
333 VoiceChannel(rtc::Thread* thread, MediaEngineInterface* media_engine, 339 VoiceChannel(rtc::Thread* thread,
334 VoiceMediaChannel* channel, BaseSession* session, 340 MediaEngineInterface* media_engine,
335 const std::string& content_name, bool rtcp); 341 VoiceMediaChannel* channel,
342 TransportController* transport_controller,
343 const std::string& content_name,
344 bool rtcp);
336 ~VoiceChannel(); 345 ~VoiceChannel();
337 bool Init(); 346 bool Init();
338 bool SetRemoteRenderer(uint32 ssrc, AudioRenderer* renderer); 347 bool SetRemoteRenderer(uint32 ssrc, AudioRenderer* renderer);
339 bool SetLocalRenderer(uint32 ssrc, AudioRenderer* renderer); 348 bool SetLocalRenderer(uint32 ssrc, AudioRenderer* renderer);
340 349
341 // downcasts a MediaChannel 350 // downcasts a MediaChannel
342 virtual VoiceMediaChannel* media_channel() const { 351 virtual VoiceMediaChannel* media_channel() const {
343 return static_cast<VoiceMediaChannel*>(BaseChannel::media_channel()); 352 return static_cast<VoiceMediaChannel*>(BaseChannel::media_channel());
344 } 353 }
345 354
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 // SetSendParameters. 441 // SetSendParameters.
433 AudioSendParameters last_send_params_; 442 AudioSendParameters last_send_params_;
434 // Last AudioRecvParameters sent down to the media_channel() via 443 // Last AudioRecvParameters sent down to the media_channel() via
435 // SetRecvParameters. 444 // SetRecvParameters.
436 AudioRecvParameters last_recv_params_; 445 AudioRecvParameters last_recv_params_;
437 }; 446 };
438 447
439 // VideoChannel is a specialization for video. 448 // VideoChannel is a specialization for video.
440 class VideoChannel : public BaseChannel { 449 class VideoChannel : public BaseChannel {
441 public: 450 public:
442 VideoChannel(rtc::Thread* thread, VideoMediaChannel* channel, 451 VideoChannel(rtc::Thread* thread,
443 BaseSession* session, const std::string& content_name, 452 VideoMediaChannel* channel,
453 TransportController* transport_controller,
454 const std::string& content_name,
444 bool rtcp); 455 bool rtcp);
445 ~VideoChannel(); 456 ~VideoChannel();
446 bool Init(); 457 bool Init();
447 458
448 // downcasts a MediaChannel 459 // downcasts a MediaChannel
449 virtual VideoMediaChannel* media_channel() const { 460 virtual VideoMediaChannel* media_channel() const {
450 return static_cast<VideoMediaChannel*>(BaseChannel::media_channel()); 461 return static_cast<VideoMediaChannel*>(BaseChannel::media_channel());
451 } 462 }
452 463
453 bool SetRenderer(uint32 ssrc, VideoRenderer* renderer); 464 bool SetRenderer(uint32 ssrc, VideoRenderer* renderer);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 // Last VideoRecvParameters sent down to the media_channel() via 542 // Last VideoRecvParameters sent down to the media_channel() via
532 // SetRecvParameters. 543 // SetRecvParameters.
533 VideoRecvParameters last_recv_params_; 544 VideoRecvParameters last_recv_params_;
534 }; 545 };
535 546
536 // DataChannel is a specialization for data. 547 // DataChannel is a specialization for data.
537 class DataChannel : public BaseChannel { 548 class DataChannel : public BaseChannel {
538 public: 549 public:
539 DataChannel(rtc::Thread* thread, 550 DataChannel(rtc::Thread* thread,
540 DataMediaChannel* media_channel, 551 DataMediaChannel* media_channel,
541 BaseSession* session, 552 TransportController* transport_controller,
542 const std::string& content_name, 553 const std::string& content_name,
543 bool rtcp); 554 bool rtcp);
544 ~DataChannel(); 555 ~DataChannel();
545 bool Init(); 556 bool Init();
546 557
547 virtual bool SendData(const SendDataParams& params, 558 virtual bool SendData(const SendDataParams& params,
548 const rtc::Buffer& payload, 559 const rtc::Buffer& payload,
549 SendDataResult* result); 560 SendDataResult* result);
550 561
551 void StartMediaMonitor(int cms); 562 void StartMediaMonitor(int cms);
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 // SetSendParameters. 665 // SetSendParameters.
655 DataSendParameters last_send_params_; 666 DataSendParameters last_send_params_;
656 // Last DataRecvParameters sent down to the media_channel() via 667 // Last DataRecvParameters sent down to the media_channel() via
657 // SetRecvParameters. 668 // SetRecvParameters.
658 DataRecvParameters last_recv_params_; 669 DataRecvParameters last_recv_params_;
659 }; 670 };
660 671
661 } // namespace cricket 672 } // namespace cricket
662 673
663 #endif // TALK_SESSION_MEDIA_CHANNEL_H_ 674 #endif // TALK_SESSION_MEDIA_CHANNEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698