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

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

Issue 2997983002: Completed the functionalities of SrtpTransport. (Closed)
Patch Set: Added unit tests for SrtpTransport. Created 3 years, 4 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 15 matching lines...) Expand all
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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 rtc::PacketTransportInternal* rtp_packet_transport, 372 rtc::PacketTransportInternal* rtp_packet_transport,
372 rtc::PacketTransportInternal* rtcp_packet_transport); 373 rtc::PacketTransportInternal* rtcp_packet_transport);
373 void DisconnectTransportChannels_n(); 374 void DisconnectTransportChannels_n();
374 void SignalSentPacket_n(rtc::PacketTransportInternal* transport, 375 void SignalSentPacket_n(rtc::PacketTransportInternal* transport,
375 const rtc::SentPacket& sent_packet); 376 const rtc::SentPacket& sent_packet);
376 void SignalSentPacket_w(const rtc::SentPacket& sent_packet); 377 void SignalSentPacket_w(const rtc::SentPacket& sent_packet);
377 bool IsReadyToSendMedia_n() const; 378 bool IsReadyToSendMedia_n() const;
378 void CacheRtpAbsSendTimeHeaderExtension_n(int rtp_abs_sendtime_extn_id); 379 void CacheRtpAbsSendTimeHeaderExtension_n(int rtp_abs_sendtime_extn_id);
379 int GetTransportOverheadPerPacket() const; 380 int GetTransportOverheadPerPacket() const;
380 void UpdateTransportOverhead(); 381 void UpdateTransportOverhead();
382 // Wraps the existing RtpTransport in an SrtpTransport.
383 void EnableSrtpTransport_n();
381 384
382 rtc::Thread* const worker_thread_; 385 rtc::Thread* const worker_thread_;
383 rtc::Thread* const network_thread_; 386 rtc::Thread* const network_thread_;
384 rtc::Thread* const signaling_thread_; 387 rtc::Thread* const signaling_thread_;
385 rtc::AsyncInvoker invoker_; 388 rtc::AsyncInvoker invoker_;
386 389
387 const std::string content_name_; 390 const std::string content_name_;
388 std::unique_ptr<ConnectionMonitor> connection_monitor_; 391 std::unique_ptr<ConnectionMonitor> connection_monitor_;
389 392
390 // Won't be set when using raw packet transports. SDP-specific thing. 393 // Won't be set when using raw packet transports. SDP-specific thing.
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_;
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_keyed_ = false;
409 const bool srtp_required_ = true; 413 const bool srtp_required_ = true;
410 int rtp_abs_sendtime_extn_id_ = -1; 414 int rtp_abs_sendtime_extn_id_ = -1;
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 // SetSendParameters. 732 // SetSendParameters.
729 DataSendParameters last_send_params_; 733 DataSendParameters last_send_params_;
730 // Last DataRecvParameters sent down to the media_channel() via 734 // Last DataRecvParameters sent down to the media_channel() via
731 // SetRecvParameters. 735 // SetRecvParameters.
732 DataRecvParameters last_recv_params_; 736 DataRecvParameters last_recv_params_;
733 }; 737 };
734 738
735 } // namespace cricket 739 } // namespace cricket
736 740
737 #endif // WEBRTC_PC_CHANNEL_H_ 741 #endif // WEBRTC_PC_CHANNEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698