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

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

Issue 2812243005: Move ready to send logic from BaseChannel to RtpTransport. (Closed)
Patch Set: Move Connect, Disconnect, and more ready to send logic to RtpTransport. Update tests. Introduce rtc… 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
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 bool SendRtcp(rtc::CopyOnWriteBuffer* packet, 248 bool SendRtcp(rtc::CopyOnWriteBuffer* packet,
257 const rtc::PacketOptions& options) override; 249 const rtc::PacketOptions& options) override;
258 250
259 // From TransportChannel 251 // From TransportChannel
260 void OnWritableState(rtc::PacketTransportInternal* transport); 252 void OnWritableState(rtc::PacketTransportInternal* transport);
261 virtual void OnPacketRead(rtc::PacketTransportInternal* transport, 253 virtual void OnPacketRead(rtc::PacketTransportInternal* transport,
262 const char* data, 254 const char* data,
263 size_t len, 255 size_t len,
264 const rtc::PacketTime& packet_time, 256 const rtc::PacketTime& packet_time,
265 int flags); 257 int flags);
266 void OnReadyToSend(rtc::PacketTransportInternal* transport);
267 258
268 void OnDtlsState(DtlsTransportInternal* transport, DtlsTransportState state); 259 void OnDtlsState(DtlsTransportInternal* transport, DtlsTransportState state);
269 260
270 void OnSelectedCandidatePairChanged( 261 void OnSelectedCandidatePairChanged(
271 IceTransportInternal* ice_transport, 262 IceTransportInternal* ice_transport,
272 CandidatePairInterface* selected_candidate_pair, 263 CandidatePairInterface* selected_candidate_pair,
273 int last_sent_packet_id, 264 int last_sent_packet_id,
274 bool ready_to_send); 265 bool ready_to_send);
275 266
276 bool PacketIsRtcp(const rtc::PacketTransportInternal* transport, 267 bool PacketIsRtcp(const rtc::PacketTransportInternal* transport,
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 rtc::Thread* const network_thread_; 385 rtc::Thread* const network_thread_;
395 rtc::Thread* const signaling_thread_; 386 rtc::Thread* const signaling_thread_;
396 rtc::AsyncInvoker invoker_; 387 rtc::AsyncInvoker invoker_;
397 388
398 const std::string content_name_; 389 const std::string content_name_;
399 std::unique_ptr<ConnectionMonitor> connection_monitor_; 390 std::unique_ptr<ConnectionMonitor> connection_monitor_;
400 391
401 // Won't be set when using raw packet transports. SDP-specific thing. 392 // Won't be set when using raw packet transports. SDP-specific thing.
402 std::string transport_name_; 393 std::string transport_name_;
403 394
395 const bool rtcp_mux_required_;
396
404 // Separate DTLS/non-DTLS pointers to support using BaseChannel without DTLS. 397 // Separate DTLS/non-DTLS pointers to support using BaseChannel without DTLS.
405 // Temporary measure until more refactoring is done. 398 // Temporary measure until more refactoring is done.
406 // If non-null, "X_dtls_transport_" will always equal "X_packet_transport_". 399 // If non-null, "X_dtls_transport_" will always equal "X_packet_transport_".
407 DtlsTransportInternal* rtp_dtls_transport_ = nullptr; 400 DtlsTransportInternal* rtp_dtls_transport_ = nullptr;
408 DtlsTransportInternal* rtcp_dtls_transport_ = nullptr; 401 DtlsTransportInternal* rtcp_dtls_transport_ = nullptr;
409 webrtc::RtpTransport rtp_transport_; 402 webrtc::RtpTransport rtp_transport_;
410 std::vector<std::pair<rtc::Socket::Option, int> > socket_options_; 403 std::vector<std::pair<rtc::Socket::Option, int> > socket_options_;
411 std::vector<std::pair<rtc::Socket::Option, int> > rtcp_socket_options_; 404 std::vector<std::pair<rtc::Socket::Option, int> > rtcp_socket_options_;
412 SrtpFilter srtp_filter_; 405 SrtpFilter srtp_filter_;
413 RtcpMuxFilter rtcp_mux_filter_; 406 RtcpMuxFilter rtcp_mux_filter_;
414 BundleFilter bundle_filter_; 407 BundleFilter bundle_filter_;
415 bool rtp_ready_to_send_ = false;
416 bool rtcp_ready_to_send_ = false;
417 bool writable_ = false; 408 bool writable_ = false;
418 bool was_ever_writable_ = false; 409 bool was_ever_writable_ = false;
419 bool has_received_packet_ = false; 410 bool has_received_packet_ = false;
420 bool dtls_keyed_ = false; 411 bool dtls_keyed_ = false;
421 const bool srtp_required_ = true; 412 const bool srtp_required_ = true;
422 rtc::CryptoOptions crypto_options_; 413 rtc::CryptoOptions crypto_options_;
423 int rtp_abs_sendtime_extn_id_ = -1; 414 int rtp_abs_sendtime_extn_id_ = -1;
424 415
425 // MediaChannel related members that should be accessed from the worker 416 // MediaChannel related members that should be accessed from the worker
426 // thread. 417 // thread.
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 // SetSendParameters. 735 // SetSendParameters.
745 DataSendParameters last_send_params_; 736 DataSendParameters last_send_params_;
746 // Last DataRecvParameters sent down to the media_channel() via 737 // Last DataRecvParameters sent down to the media_channel() via
747 // SetRecvParameters. 738 // SetRecvParameters.
748 DataRecvParameters last_recv_params_; 739 DataRecvParameters last_recv_params_;
749 }; 740 };
750 741
751 } // namespace cricket 742 } // namespace cricket
752 743
753 #endif // WEBRTC_PC_CHANNEL_H_ 744 #endif // WEBRTC_PC_CHANNEL_H_
OLDNEW
« no previous file with comments | « webrtc/pc/BUILD.gn ('k') | webrtc/pc/channel.cc » ('j') | webrtc/pc/channel.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698