OLD | NEW |
---|---|
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
169 | 169 |
170 SrtpFilter* srtp_filter() { return &srtp_filter_; } | 170 SrtpFilter* srtp_filter() { return &srtp_filter_; } |
171 | 171 |
172 protected: | 172 protected: |
173 virtual MediaChannel* media_channel() const { return media_channel_; } | 173 virtual MediaChannel* media_channel() const { return media_channel_; } |
174 // Sets the |transport_channel_| (and |rtcp_transport_channel_|, if |rtcp_| is | 174 // Sets the |transport_channel_| (and |rtcp_transport_channel_|, if |rtcp_| is |
175 // true). Gets the transport channels from |transport_controller_|. | 175 // true). Gets the transport channels from |transport_controller_|. |
176 bool SetTransport_w(const std::string& transport_name); | 176 bool SetTransport_w(const std::string& transport_name); |
177 void set_transport_channel(TransportChannel* transport); | 177 void set_transport_channel(TransportChannel* transport); |
178 void set_rtcp_transport_channel(TransportChannel* transport); | 178 void set_rtcp_transport_channel(TransportChannel* transport); |
179 bool was_ever_writable() const { return was_ever_writable_; } | 179 bool dtls_srtp_setup_pending() const { return dtls_srtp_setup_pending_; } |
180 void set_local_content_direction(MediaContentDirection direction) { | 180 void set_local_content_direction(MediaContentDirection direction) { |
181 local_content_direction_ = direction; | 181 local_content_direction_ = direction; |
182 } | 182 } |
183 void set_remote_content_direction(MediaContentDirection direction) { | 183 void set_remote_content_direction(MediaContentDirection direction) { |
184 remote_content_direction_ = direction; | 184 remote_content_direction_ = direction; |
185 } | 185 } |
186 void set_secure_required(bool secure_required) { | 186 void set_secure_required(bool secure_required) { |
187 secure_required_ = secure_required; | 187 secure_required_ = secure_required; |
188 } | 188 } |
189 bool IsReadyToReceive() const; | 189 bool IsReadyToReceive() const; |
(...skipping 16 matching lines...) Expand all Loading... | |
206 | 206 |
207 // From TransportChannel | 207 // From TransportChannel |
208 void OnWritableState(TransportChannel* channel); | 208 void OnWritableState(TransportChannel* channel); |
209 virtual void OnChannelRead(TransportChannel* channel, | 209 virtual void OnChannelRead(TransportChannel* channel, |
210 const char* data, | 210 const char* data, |
211 size_t len, | 211 size_t len, |
212 const rtc::PacketTime& packet_time, | 212 const rtc::PacketTime& packet_time, |
213 int flags); | 213 int flags); |
214 void OnReadyToSend(TransportChannel* channel); | 214 void OnReadyToSend(TransportChannel* channel); |
215 | 215 |
216 void OnDtlsState(TransportChannel* channel, DtlsTransportState state); | |
217 | |
216 bool PacketIsRtcp(const TransportChannel* channel, const char* data, | 218 bool PacketIsRtcp(const TransportChannel* channel, const char* data, |
217 size_t len); | 219 size_t len); |
218 bool SendPacket(bool rtcp, | 220 bool SendPacket(bool rtcp, |
219 rtc::Buffer* packet, | 221 rtc::Buffer* packet, |
220 const rtc::PacketOptions& options); | 222 const rtc::PacketOptions& options); |
221 virtual bool WantsPacket(bool rtcp, rtc::Buffer* packet); | 223 virtual bool WantsPacket(bool rtcp, rtc::Buffer* packet); |
222 void HandlePacket(bool rtcp, rtc::Buffer* packet, | 224 void HandlePacket(bool rtcp, rtc::Buffer* packet, |
223 const rtc::PacketTime& packet_time); | 225 const rtc::PacketTime& packet_time); |
224 | 226 |
225 void EnableMedia_w(); | 227 void EnableMedia_w(); |
226 void DisableMedia_w(); | 228 void DisableMedia_w(); |
227 void UpdateWritableState_w(); | 229 void UpdateWritableState_w(); |
228 void ChannelWritable_w(); | 230 void ChannelWritable_w(); |
229 void ChannelNotWritable_w(); | 231 void ChannelNotWritable_w(); |
230 bool AddRecvStream_w(const StreamParams& sp); | 232 bool AddRecvStream_w(const StreamParams& sp); |
231 bool RemoveRecvStream_w(uint32_t ssrc); | 233 bool RemoveRecvStream_w(uint32_t ssrc); |
232 bool AddSendStream_w(const StreamParams& sp); | 234 bool AddSendStream_w(const StreamParams& sp); |
233 bool RemoveSendStream_w(uint32_t ssrc); | 235 bool RemoveSendStream_w(uint32_t ssrc); |
234 virtual bool ShouldSetupDtlsSrtp() const; | 236 virtual bool ShouldSetupDtlsSrtp() const; |
235 // Do the DTLS key expansion and impose it on the SRTP/SRTCP filters. | 237 // Do the DTLS key expansion and impose it on the SRTP/SRTCP filters. |
236 // |rtcp_channel| indicates whether to set up the RTP or RTCP filter. | 238 // |rtcp_channel| indicates whether to set up the RTP or RTCP filter. |
237 bool SetupDtlsSrtp(bool rtcp_channel); | 239 bool SetupDtlsSrtp(bool rtcp_channel); |
240 void TrySetupDtlsSrtp_w(); | |
238 // Set the DTLS-SRTP cipher policy on this channel as appropriate. | 241 // Set the DTLS-SRTP cipher policy on this channel as appropriate. |
239 bool SetDtlsSrtpCryptoSuites(TransportChannel* tc, bool rtcp); | 242 bool SetDtlsSrtpCryptoSuites(TransportChannel* tc, bool rtcp); |
240 | 243 |
241 virtual void ChangeState() = 0; | 244 virtual void ChangeState() = 0; |
242 | 245 |
243 // Gets the content info appropriate to the channel (audio or video). | 246 // Gets the content info appropriate to the channel (audio or video). |
244 virtual const ContentInfo* GetFirstContent( | 247 virtual const ContentInfo* GetFirstContent( |
245 const SessionDescription* sdesc) = 0; | 248 const SessionDescription* sdesc) = 0; |
246 bool UpdateLocalStreams_w(const std::vector<StreamParams>& streams, | 249 bool UpdateLocalStreams_w(const std::vector<StreamParams>& streams, |
247 ContentAction action, | 250 ContentAction action, |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
308 TransportChannel* rtcp_transport_channel_; | 311 TransportChannel* rtcp_transport_channel_; |
309 std::vector<std::pair<rtc::Socket::Option, int> > rtcp_socket_options_; | 312 std::vector<std::pair<rtc::Socket::Option, int> > rtcp_socket_options_; |
310 SrtpFilter srtp_filter_; | 313 SrtpFilter srtp_filter_; |
311 RtcpMuxFilter rtcp_mux_filter_; | 314 RtcpMuxFilter rtcp_mux_filter_; |
312 BundleFilter bundle_filter_; | 315 BundleFilter bundle_filter_; |
313 rtc::scoped_ptr<ConnectionMonitor> connection_monitor_; | 316 rtc::scoped_ptr<ConnectionMonitor> connection_monitor_; |
314 bool enabled_; | 317 bool enabled_; |
315 bool writable_; | 318 bool writable_; |
316 bool rtp_ready_to_send_; | 319 bool rtp_ready_to_send_; |
317 bool rtcp_ready_to_send_; | 320 bool rtcp_ready_to_send_; |
318 bool was_ever_writable_; | 321 bool dtls_srtp_setup_pending_; |
pthatcher1
2015/11/30 20:23:11
It feels like this should go right under srtp_filt
pthatcher1
2015/11/30 20:23:11
And "dtls" isn't really relevant. It's more wheth
guoweis_webrtc
2015/12/01 22:05:12
Done.
| |
319 MediaContentDirection local_content_direction_; | 322 MediaContentDirection local_content_direction_; |
320 MediaContentDirection remote_content_direction_; | 323 MediaContentDirection remote_content_direction_; |
321 bool has_received_packet_; | 324 bool has_received_packet_; |
322 bool dtls_keyed_; | 325 bool dtls_keyed_; |
323 bool secure_required_; | 326 bool secure_required_; |
324 int rtp_abs_sendtime_extn_id_; | 327 int rtp_abs_sendtime_extn_id_; |
325 }; | 328 }; |
326 | 329 |
327 // VoiceChannel is a specialization that adds support for early media, DTMF, | 330 // VoiceChannel is a specialization that adds support for early media, DTMF, |
328 // and input/output level monitoring. | 331 // and input/output level monitoring. |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
635 // SetSendParameters. | 638 // SetSendParameters. |
636 DataSendParameters last_send_params_; | 639 DataSendParameters last_send_params_; |
637 // Last DataRecvParameters sent down to the media_channel() via | 640 // Last DataRecvParameters sent down to the media_channel() via |
638 // SetRecvParameters. | 641 // SetRecvParameters. |
639 DataRecvParameters last_recv_params_; | 642 DataRecvParameters last_recv_params_; |
640 }; | 643 }; |
641 | 644 |
642 } // namespace cricket | 645 } // namespace cricket |
643 | 646 |
644 #endif // TALK_SESSION_MEDIA_CHANNEL_H_ | 647 #endif // TALK_SESSION_MEDIA_CHANNEL_H_ |
OLD | NEW |