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

Side by Side Diff: webrtc/pc/channel.h

Issue 2812243005: Move ready to send logic from BaseChannel to RtpTransport. (Closed)
Patch Set: Remove dcheck that does not currently hold. Created 3 years, 8 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 | « webrtc/pc/BUILD.gn ('k') | webrtc/pc/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 * Copyright 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2004 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 // Only public for unit tests. Otherwise, consider private. 176 // Only public for unit tests. Otherwise, consider private.
177 DtlsTransportInternal* rtp_dtls_transport() const { 177 DtlsTransportInternal* rtp_dtls_transport() const {
178 return rtp_dtls_transport_; 178 return rtp_dtls_transport_;
179 } 179 }
180 DtlsTransportInternal* rtcp_dtls_transport() const { 180 DtlsTransportInternal* rtcp_dtls_transport() const {
181 return rtcp_dtls_transport_; 181 return rtcp_dtls_transport_;
182 } 182 }
183 183
184 bool NeedsRtcpTransport(); 184 bool NeedsRtcpTransport();
185 185
186 // Made public for easier testing. 186 // From RtpTransport - public for testing only
187 // 187 void OnTransportReadyToSend(bool ready);
188 // Updates "ready to send" for an individual channel, and informs the media
189 // channel that the transport is ready to send if each channel (in use) is
190 // ready to send. This is more specific than just "writable"; it means the
191 // last send didn't return ENOTCONN.
192 //
193 // This should be called whenever a channel's ready-to-send state changes,
194 // or when RTCP muxing becomes active/inactive.
195 void SetTransportChannelReadyToSend(bool rtcp, bool ready);
196 188
197 // Only public for unit tests. Otherwise, consider protected. 189 // Only public for unit tests. Otherwise, consider protected.
198 int SetOption(SocketType type, rtc::Socket::Option o, int val) 190 int SetOption(SocketType type, rtc::Socket::Option o, int val)
199 override; 191 override;
200 int SetOption_n(SocketType type, rtc::Socket::Option o, int val); 192 int SetOption_n(SocketType type, rtc::Socket::Option o, int val);
201 193
202 SrtpFilter* srtp_filter() { return &srtp_filter_; } 194 SrtpFilter* srtp_filter() { return &srtp_filter_; }
203 195
204 virtual cricket::MediaType media_type() = 0; 196 virtual cricket::MediaType media_type() = 0;
205 197
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 bool SendRtcp(rtc::CopyOnWriteBuffer* packet, 246 bool SendRtcp(rtc::CopyOnWriteBuffer* packet,
255 const rtc::PacketOptions& options) override; 247 const rtc::PacketOptions& options) override;
256 248
257 // From TransportChannel 249 // From TransportChannel
258 void OnWritableState(rtc::PacketTransportInternal* transport); 250 void OnWritableState(rtc::PacketTransportInternal* transport);
259 virtual void OnPacketRead(rtc::PacketTransportInternal* transport, 251 virtual void OnPacketRead(rtc::PacketTransportInternal* transport,
260 const char* data, 252 const char* data,
261 size_t len, 253 size_t len,
262 const rtc::PacketTime& packet_time, 254 const rtc::PacketTime& packet_time,
263 int flags); 255 int flags);
264 void OnReadyToSend(rtc::PacketTransportInternal* transport);
265 256
266 void OnDtlsState(DtlsTransportInternal* transport, DtlsTransportState state); 257 void OnDtlsState(DtlsTransportInternal* transport, DtlsTransportState state);
267 258
268 void OnSelectedCandidatePairChanged( 259 void OnSelectedCandidatePairChanged(
269 IceTransportInternal* ice_transport, 260 IceTransportInternal* ice_transport,
270 CandidatePairInterface* selected_candidate_pair, 261 CandidatePairInterface* selected_candidate_pair,
271 int last_sent_packet_id, 262 int last_sent_packet_id,
272 bool ready_to_send); 263 bool ready_to_send);
273 264
274 bool PacketIsRtcp(const rtc::PacketTransportInternal* transport, 265 bool PacketIsRtcp(const rtc::PacketTransportInternal* transport,
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 rtc::Thread* const network_thread_; 375 rtc::Thread* const network_thread_;
385 rtc::Thread* const signaling_thread_; 376 rtc::Thread* const signaling_thread_;
386 rtc::AsyncInvoker invoker_; 377 rtc::AsyncInvoker invoker_;
387 378
388 const std::string content_name_; 379 const std::string content_name_;
389 std::unique_ptr<ConnectionMonitor> connection_monitor_; 380 std::unique_ptr<ConnectionMonitor> connection_monitor_;
390 381
391 // Won't be set when using raw packet transports. SDP-specific thing. 382 // Won't be set when using raw packet transports. SDP-specific thing.
392 std::string transport_name_; 383 std::string transport_name_;
393 384
385 const bool rtcp_mux_required_;
386
394 // Separate DTLS/non-DTLS pointers to support using BaseChannel without DTLS. 387 // Separate DTLS/non-DTLS pointers to support using BaseChannel without DTLS.
395 // Temporary measure until more refactoring is done. 388 // Temporary measure until more refactoring is done.
396 // If non-null, "X_dtls_transport_" will always equal "X_packet_transport_". 389 // If non-null, "X_dtls_transport_" will always equal "X_packet_transport_".
397 DtlsTransportInternal* rtp_dtls_transport_ = nullptr; 390 DtlsTransportInternal* rtp_dtls_transport_ = nullptr;
398 DtlsTransportInternal* rtcp_dtls_transport_ = nullptr; 391 DtlsTransportInternal* rtcp_dtls_transport_ = nullptr;
399 webrtc::RtpTransport rtp_transport_; 392 webrtc::RtpTransport rtp_transport_;
400 std::vector<std::pair<rtc::Socket::Option, int> > socket_options_; 393 std::vector<std::pair<rtc::Socket::Option, int> > socket_options_;
401 std::vector<std::pair<rtc::Socket::Option, int> > rtcp_socket_options_; 394 std::vector<std::pair<rtc::Socket::Option, int> > rtcp_socket_options_;
402 SrtpFilter srtp_filter_; 395 SrtpFilter srtp_filter_;
403 RtcpMuxFilter rtcp_mux_filter_; 396 RtcpMuxFilter rtcp_mux_filter_;
404 BundleFilter bundle_filter_; 397 BundleFilter bundle_filter_;
405 bool rtp_ready_to_send_ = false;
406 bool rtcp_ready_to_send_ = false;
407 bool writable_ = false; 398 bool writable_ = false;
408 bool was_ever_writable_ = false; 399 bool was_ever_writable_ = false;
409 bool has_received_packet_ = false; 400 bool has_received_packet_ = false;
410 bool dtls_keyed_ = false; 401 bool dtls_keyed_ = false;
411 const bool srtp_required_ = true; 402 const bool srtp_required_ = true;
412 int rtp_abs_sendtime_extn_id_ = -1; 403 int rtp_abs_sendtime_extn_id_ = -1;
413 404
414 // MediaChannel related members that should be accessed from the worker 405 // MediaChannel related members that should be accessed from the worker
415 // thread. 406 // thread.
416 MediaChannel* const media_channel_; 407 MediaChannel* const media_channel_;
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 // SetSendParameters. 721 // SetSendParameters.
731 DataSendParameters last_send_params_; 722 DataSendParameters last_send_params_;
732 // Last DataRecvParameters sent down to the media_channel() via 723 // Last DataRecvParameters sent down to the media_channel() via
733 // SetRecvParameters. 724 // SetRecvParameters.
734 DataRecvParameters last_recv_params_; 725 DataRecvParameters last_recv_params_;
735 }; 726 };
736 727
737 } // namespace cricket 728 } // namespace cricket
738 729
739 #endif // WEBRTC_PC_CHANNEL_H_ 730 #endif // WEBRTC_PC_CHANNEL_H_
OLDNEW
« no previous file with comments | « webrtc/pc/BUILD.gn ('k') | webrtc/pc/channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698