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

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

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

Powered by Google App Engine
This is Rietveld 408576698