Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 15 matching lines...) Expand all Loading... | |
| 26 #include "webrtc/media/base/videosinkinterface.h" | 26 #include "webrtc/media/base/videosinkinterface.h" |
| 27 #include "webrtc/media/base/videosourceinterface.h" | 27 #include "webrtc/media/base/videosourceinterface.h" |
| 28 #include "webrtc/p2p/base/dtlstransportinternal.h" | 28 #include "webrtc/p2p/base/dtlstransportinternal.h" |
| 29 #include "webrtc/p2p/base/packettransportinternal.h" | 29 #include "webrtc/p2p/base/packettransportinternal.h" |
| 30 #include "webrtc/p2p/base/transportcontroller.h" | 30 #include "webrtc/p2p/base/transportcontroller.h" |
| 31 #include "webrtc/p2p/client/socketmonitor.h" | 31 #include "webrtc/p2p/client/socketmonitor.h" |
| 32 #include "webrtc/pc/audiomonitor.h" | 32 #include "webrtc/pc/audiomonitor.h" |
| 33 #include "webrtc/pc/mediamonitor.h" | 33 #include "webrtc/pc/mediamonitor.h" |
| 34 #include "webrtc/pc/mediasession.h" | 34 #include "webrtc/pc/mediasession.h" |
| 35 #include "webrtc/pc/rtcpmuxfilter.h" | 35 #include "webrtc/pc/rtcpmuxfilter.h" |
| 36 #include "webrtc/pc/rtptransportinternal.h" | |
| 37 #include "webrtc/pc/srtpfilter.h" | 36 #include "webrtc/pc/srtpfilter.h" |
| 38 #include "webrtc/rtc_base/asyncinvoker.h" | 37 #include "webrtc/rtc_base/asyncinvoker.h" |
| 39 #include "webrtc/rtc_base/asyncudpsocket.h" | 38 #include "webrtc/rtc_base/asyncudpsocket.h" |
| 40 #include "webrtc/rtc_base/criticalsection.h" | 39 #include "webrtc/rtc_base/criticalsection.h" |
| 41 #include "webrtc/rtc_base/network.h" | 40 #include "webrtc/rtc_base/network.h" |
| 42 #include "webrtc/rtc_base/sigslot.h" | 41 #include "webrtc/rtc_base/sigslot.h" |
| 43 #include "webrtc/rtc_base/window.h" | 42 #include "webrtc/rtc_base/window.h" |
| 44 | 43 |
| 45 namespace webrtc { | 44 namespace webrtc { |
| 46 class AudioSinkInterface; | 45 class AudioSinkInterface; |
| 46 class RtpTransportInternal; | |
| 47 class SrtpTransport; | |
| 47 } // namespace webrtc | 48 } // namespace webrtc |
| 48 | 49 |
| 49 namespace cricket { | 50 namespace cricket { |
| 50 | 51 |
| 51 struct CryptoParams; | 52 struct CryptoParams; |
| 52 class MediaContentDescription; | 53 class MediaContentDescription; |
| 53 | 54 |
| 54 // BaseChannel contains logic common to voice and video, including enable, | 55 // BaseChannel contains logic common to voice and video, including enable, |
| 55 // marshaling calls to a worker and network threads, and connection and media | 56 // marshaling calls to a worker and network threads, and connection and media |
| 56 // monitors. | 57 // monitors. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 92 // done. | 93 // done. |
| 93 void Deinit(); | 94 void Deinit(); |
| 94 | 95 |
| 95 rtc::Thread* worker_thread() const { return worker_thread_; } | 96 rtc::Thread* worker_thread() const { return worker_thread_; } |
| 96 rtc::Thread* network_thread() const { return network_thread_; } | 97 rtc::Thread* network_thread() const { return network_thread_; } |
| 97 const std::string& content_name() const { return content_name_; } | 98 const std::string& content_name() const { return content_name_; } |
| 98 // TODO(deadbeef): This is redundant; remove this. | 99 // TODO(deadbeef): This is redundant; remove this. |
| 99 const std::string& transport_name() const { return transport_name_; } | 100 const std::string& transport_name() const { return transport_name_; } |
| 100 bool enabled() const { return enabled_; } | 101 bool enabled() const { return enabled_; } |
| 101 | 102 |
| 102 // This function returns true if we are using SRTP. | 103 // This function returns true if we are using SRTP. |
|
Taylor Brandstetter
2017/08/26 02:40:39
nit: Should update this comment.
Zhi Huang
2017/08/29 18:40:34
Done.
| |
| 103 bool secure() const { return srtp_filter_.IsActive(); } | 104 bool secure_sdes() const { return srtp_filter_.IsActive(); } |
|
pthatcher
2017/08/28 21:42:56
While we're changing the method name, can we make
Zhi Huang
2017/08/29 18:40:34
Done.
| |
| 104 // The following function returns true if we are using | 105 // The following function returns true if we are using |
| 105 // DTLS-based keying. If you turned off SRTP later, however | 106 // DTLS-based keying. If you turned off SRTP later, however |
| 106 // you could have secure() == false and dtls_secure() == true. | 107 // you could have secure() == false and dtls_secure() == true. |
| 107 bool secure_dtls() const { return dtls_keyed_; } | 108 bool secure_dtls() const { return dtls_active_; } |
| 109 | |
| 110 bool secure() const { return secure_sdes() || secure_dtls(); } | |
|
pthatcher
2017/08/28 21:42:56
Would "srtp_active" be a good name here, to along
Zhi Huang
2017/08/29 18:40:34
It sounds good to me.
| |
| 108 | 111 |
| 109 bool writable() const { return writable_; } | 112 bool writable() const { return writable_; } |
| 110 | 113 |
| 111 // Set the transport(s), and update writability and "ready-to-send" state. | 114 // Set the transport(s), and update writability and "ready-to-send" state. |
| 112 // |rtp_transport| must be non-null. | 115 // |rtp_transport| must be non-null. |
| 113 // |rtcp_transport| must be supplied if NeedsRtcpTransport() is true (meaning | 116 // |rtcp_transport| must be supplied if NeedsRtcpTransport() is true (meaning |
| 114 // RTCP muxing is not fully active yet). | 117 // RTCP muxing is not fully active yet). |
| 115 // |rtp_transport| and |rtcp_transport| must share the same transport name as | 118 // |rtp_transport| and |rtcp_transport| must share the same transport name as |
| 116 // well. | 119 // well. |
| 117 // Can not start with "rtc::PacketTransportInternal" and switch to | 120 // Can not start with "rtc::PacketTransportInternal" and switch to |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 391 std::string transport_name_; | 394 std::string transport_name_; |
| 392 | 395 |
| 393 const bool rtcp_mux_required_; | 396 const bool rtcp_mux_required_; |
| 394 | 397 |
| 395 // Separate DTLS/non-DTLS pointers to support using BaseChannel without DTLS. | 398 // Separate DTLS/non-DTLS pointers to support using BaseChannel without DTLS. |
| 396 // Temporary measure until more refactoring is done. | 399 // Temporary measure until more refactoring is done. |
| 397 // If non-null, "X_dtls_transport_" will always equal "X_packet_transport_". | 400 // If non-null, "X_dtls_transport_" will always equal "X_packet_transport_". |
| 398 DtlsTransportInternal* rtp_dtls_transport_ = nullptr; | 401 DtlsTransportInternal* rtp_dtls_transport_ = nullptr; |
| 399 DtlsTransportInternal* rtcp_dtls_transport_ = nullptr; | 402 DtlsTransportInternal* rtcp_dtls_transport_ = nullptr; |
| 400 std::unique_ptr<webrtc::RtpTransportInternal> rtp_transport_; | 403 std::unique_ptr<webrtc::RtpTransportInternal> rtp_transport_; |
| 404 webrtc::SrtpTransport* srtp_transport_ = nullptr; | |
| 401 std::vector<std::pair<rtc::Socket::Option, int> > socket_options_; | 405 std::vector<std::pair<rtc::Socket::Option, int> > socket_options_; |
| 402 std::vector<std::pair<rtc::Socket::Option, int> > rtcp_socket_options_; | 406 std::vector<std::pair<rtc::Socket::Option, int> > rtcp_socket_options_; |
| 403 SrtpFilter srtp_filter_; | 407 SrtpFilter srtp_filter_; |
|
pthatcher
2017/08/28 21:42:56
It feels like this really should be renamed to Sde
Zhi Huang
2017/08/29 18:40:34
What about sdes_negotiator_? I plan to rename the
| |
| 404 RtcpMuxFilter rtcp_mux_filter_; | 408 RtcpMuxFilter rtcp_mux_filter_; |
| 405 bool writable_ = false; | 409 bool writable_ = false; |
| 406 bool was_ever_writable_ = false; | 410 bool was_ever_writable_ = false; |
| 407 bool has_received_packet_ = false; | 411 bool has_received_packet_ = false; |
| 408 bool dtls_keyed_ = false; | 412 bool dtls_active_ = false; |
| 409 const bool srtp_required_ = true; | 413 const bool srtp_required_ = true; |
| 410 int rtp_abs_sendtime_extn_id_ = -1; | |
| 411 | 414 |
| 412 // MediaChannel related members that should be accessed from the worker | 415 // MediaChannel related members that should be accessed from the worker |
| 413 // thread. | 416 // thread. |
| 414 MediaChannel* const media_channel_; | 417 MediaChannel* const media_channel_; |
| 415 // Currently the |enabled_| flag is accessed from the signaling thread as | 418 // Currently the |enabled_| flag is accessed from the signaling thread as |
| 416 // well, but it can be changed only when signaling thread does a synchronous | 419 // well, but it can be changed only when signaling thread does a synchronous |
| 417 // call to the worker thread, so it should be safe. | 420 // call to the worker thread, so it should be safe. |
| 418 bool enabled_ = false; | 421 bool enabled_ = false; |
| 419 std::vector<StreamParams> local_streams_; | 422 std::vector<StreamParams> local_streams_; |
| 420 std::vector<StreamParams> remote_streams_; | 423 std::vector<StreamParams> remote_streams_; |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 728 // SetSendParameters. | 731 // SetSendParameters. |
| 729 DataSendParameters last_send_params_; | 732 DataSendParameters last_send_params_; |
| 730 // Last DataRecvParameters sent down to the media_channel() via | 733 // Last DataRecvParameters sent down to the media_channel() via |
| 731 // SetRecvParameters. | 734 // SetRecvParameters. |
| 732 DataRecvParameters last_recv_params_; | 735 DataRecvParameters last_recv_params_; |
| 733 }; | 736 }; |
| 734 | 737 |
| 735 } // namespace cricket | 738 } // namespace cricket |
| 736 | 739 |
| 737 #endif // WEBRTC_PC_CHANNEL_H_ | 740 #endif // WEBRTC_PC_CHANNEL_H_ |
| OLD | NEW |