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

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

Issue 2889453002: Move bundle filter from BaseChannel to RtpTransport. (Closed)
Patch Set: Created 3 years, 7 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 | « no previous file | webrtc/pc/channel.cc » ('j') | webrtc/pc/rtptransport.cc » ('J')
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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 bool RemoveRecvStream(uint32_t ssrc); 142 bool RemoveRecvStream(uint32_t ssrc);
143 bool AddSendStream(const StreamParams& sp); 143 bool AddSendStream(const StreamParams& sp);
144 bool RemoveSendStream(uint32_t ssrc); 144 bool RemoveSendStream(uint32_t ssrc);
145 145
146 // Monitoring 146 // Monitoring
147 void StartConnectionMonitor(int cms); 147 void StartConnectionMonitor(int cms);
148 void StopConnectionMonitor(); 148 void StopConnectionMonitor();
149 // For ConnectionStatsGetter, used by ConnectionMonitor 149 // For ConnectionStatsGetter, used by ConnectionMonitor
150 bool GetConnectionStats(ConnectionInfos* infos) override; 150 bool GetConnectionStats(ConnectionInfos* infos) override;
151 151
152 BundleFilter* bundle_filter() { return &bundle_filter_; }
153
154 const std::vector<StreamParams>& local_streams() const { 152 const std::vector<StreamParams>& local_streams() const {
155 return local_streams_; 153 return local_streams_;
156 } 154 }
157 const std::vector<StreamParams>& remote_streams() const { 155 const std::vector<StreamParams>& remote_streams() const {
158 return remote_streams_; 156 return remote_streams_;
159 } 157 }
160 158
161 sigslot::signal2<BaseChannel*, bool> SignalDtlsSrtpSetupFailure; 159 sigslot::signal2<BaseChannel*, bool> SignalDtlsSrtpSetupFailure;
162 void SignalDtlsSrtpSetupFailure_n(bool rtcp); 160 void SignalDtlsSrtpSetupFailure_n(bool rtcp);
163 void SignalDtlsSrtpSetupFailure_s(bool rtcp); 161 void SignalDtlsSrtpSetupFailure_s(bool rtcp);
(...skipping 27 matching lines...) Expand all
191 override; 189 override;
192 int SetOption_n(SocketType type, rtc::Socket::Option o, int val); 190 int SetOption_n(SocketType type, rtc::Socket::Option o, int val);
193 191
194 SrtpFilter* srtp_filter() { return &srtp_filter_; } 192 SrtpFilter* srtp_filter() { return &srtp_filter_; }
195 193
196 virtual cricket::MediaType media_type() = 0; 194 virtual cricket::MediaType media_type() = 0;
197 195
198 // This function returns true if we require SRTP for call setup. 196 // This function returns true if we require SRTP for call setup.
199 bool srtp_required_for_testing() const { return srtp_required_; } 197 bool srtp_required_for_testing() const { return srtp_required_; }
200 198
199 // Public for testing.
200 bool HandlesPayloadType(int payload_type);
Taylor Brandstetter 2017/05/17 02:12:42 const?
Zach Stein 2017/05/30 19:08:38 Done.
201
201 protected: 202 protected:
202 virtual MediaChannel* media_channel() const { return media_channel_; } 203 virtual MediaChannel* media_channel() const { return media_channel_; }
203 204
204 void SetTransports_n(DtlsTransportInternal* rtp_dtls_transport, 205 void SetTransports_n(DtlsTransportInternal* rtp_dtls_transport,
205 DtlsTransportInternal* rtcp_dtls_transport, 206 DtlsTransportInternal* rtcp_dtls_transport,
206 rtc::PacketTransportInternal* rtp_packet_transport, 207 rtc::PacketTransportInternal* rtp_packet_transport,
207 rtc::PacketTransportInternal* rtcp_packet_transport); 208 rtc::PacketTransportInternal* rtcp_packet_transport);
208 209
209 // This does not update writability or "ready-to-send" state; it just 210 // This does not update writability or "ready-to-send" state; it just
210 // disconnects from the old channel and connects to the new one. 211 // disconnects from the old channel and connects to the new one.
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 virtual void OnConnectionMonitorUpdate(ConnectionMonitor* monitor, 351 virtual void OnConnectionMonitorUpdate(ConnectionMonitor* monitor,
351 const std::vector<ConnectionInfo>& infos) = 0; 352 const std::vector<ConnectionInfo>& infos) = 0;
352 353
353 // Helper function for invoking bool-returning methods on the worker thread. 354 // Helper function for invoking bool-returning methods on the worker thread.
354 template <class FunctorT> 355 template <class FunctorT>
355 bool InvokeOnWorker(const rtc::Location& posted_from, 356 bool InvokeOnWorker(const rtc::Location& posted_from,
356 const FunctorT& functor) { 357 const FunctorT& functor) {
357 return worker_thread_->Invoke<bool>(posted_from, functor); 358 return worker_thread_->Invoke<bool>(posted_from, functor);
358 } 359 }
359 360
361 void AddHandledPayloadType(int payload_type);
362
360 private: 363 private:
361 bool InitNetwork_n(DtlsTransportInternal* rtp_dtls_transport, 364 bool InitNetwork_n(DtlsTransportInternal* rtp_dtls_transport,
362 DtlsTransportInternal* rtcp_dtls_transport, 365 DtlsTransportInternal* rtcp_dtls_transport,
363 rtc::PacketTransportInternal* rtp_packet_transport, 366 rtc::PacketTransportInternal* rtp_packet_transport,
364 rtc::PacketTransportInternal* rtcp_packet_transport); 367 rtc::PacketTransportInternal* rtcp_packet_transport);
365 void DisconnectTransportChannels_n(); 368 void DisconnectTransportChannels_n();
366 void SignalSentPacket_n(rtc::PacketTransportInternal* transport, 369 void SignalSentPacket_n(rtc::PacketTransportInternal* transport,
367 const rtc::SentPacket& sent_packet); 370 const rtc::SentPacket& sent_packet);
368 void SignalSentPacket_w(const rtc::SentPacket& sent_packet); 371 void SignalSentPacket_w(const rtc::SentPacket& sent_packet);
369 bool IsReadyToSendMedia_n() const; 372 bool IsReadyToSendMedia_n() const;
(...skipping 17 matching lines...) Expand all
387 // Separate DTLS/non-DTLS pointers to support using BaseChannel without DTLS. 390 // Separate DTLS/non-DTLS pointers to support using BaseChannel without DTLS.
388 // Temporary measure until more refactoring is done. 391 // Temporary measure until more refactoring is done.
389 // If non-null, "X_dtls_transport_" will always equal "X_packet_transport_". 392 // If non-null, "X_dtls_transport_" will always equal "X_packet_transport_".
390 DtlsTransportInternal* rtp_dtls_transport_ = nullptr; 393 DtlsTransportInternal* rtp_dtls_transport_ = nullptr;
391 DtlsTransportInternal* rtcp_dtls_transport_ = nullptr; 394 DtlsTransportInternal* rtcp_dtls_transport_ = nullptr;
392 webrtc::RtpTransport rtp_transport_; 395 webrtc::RtpTransport rtp_transport_;
393 std::vector<std::pair<rtc::Socket::Option, int> > socket_options_; 396 std::vector<std::pair<rtc::Socket::Option, int> > socket_options_;
394 std::vector<std::pair<rtc::Socket::Option, int> > rtcp_socket_options_; 397 std::vector<std::pair<rtc::Socket::Option, int> > rtcp_socket_options_;
395 SrtpFilter srtp_filter_; 398 SrtpFilter srtp_filter_;
396 RtcpMuxFilter rtcp_mux_filter_; 399 RtcpMuxFilter rtcp_mux_filter_;
397 BundleFilter bundle_filter_;
398 bool writable_ = false; 400 bool writable_ = false;
399 bool was_ever_writable_ = false; 401 bool was_ever_writable_ = false;
400 bool has_received_packet_ = false; 402 bool has_received_packet_ = false;
401 bool dtls_keyed_ = false; 403 bool dtls_keyed_ = false;
402 const bool srtp_required_ = true; 404 const bool srtp_required_ = true;
403 int rtp_abs_sendtime_extn_id_ = -1; 405 int rtp_abs_sendtime_extn_id_ = -1;
404 406
405 // MediaChannel related members that should be accessed from the worker 407 // MediaChannel related members that should be accessed from the worker
406 // thread. 408 // thread.
407 MediaChannel* const media_channel_; 409 MediaChannel* const media_channel_;
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 // SetSendParameters. 723 // SetSendParameters.
722 DataSendParameters last_send_params_; 724 DataSendParameters last_send_params_;
723 // Last DataRecvParameters sent down to the media_channel() via 725 // Last DataRecvParameters sent down to the media_channel() via
724 // SetRecvParameters. 726 // SetRecvParameters.
725 DataRecvParameters last_recv_params_; 727 DataRecvParameters last_recv_params_;
726 }; 728 };
727 729
728 } // namespace cricket 730 } // namespace cricket
729 731
730 #endif // WEBRTC_PC_CHANNEL_H_ 732 #endif // WEBRTC_PC_CHANNEL_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/pc/channel.cc » ('j') | webrtc/pc/rtptransport.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698