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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 bool SetTransportChannels_w(BaseSession* session, bool rtcp); | 182 bool SetTransportChannels_w(BaseSession* session, bool rtcp); |
183 void set_transport_channel(TransportChannel* transport); | 183 void set_transport_channel(TransportChannel* transport); |
184 void set_rtcp_transport_channel(TransportChannel* transport); | 184 void set_rtcp_transport_channel(TransportChannel* transport); |
185 bool was_ever_writable() const { return was_ever_writable_; } | 185 bool was_ever_writable() const { return was_ever_writable_; } |
186 void set_local_content_direction(MediaContentDirection direction) { | 186 void set_local_content_direction(MediaContentDirection direction) { |
187 local_content_direction_ = direction; | 187 local_content_direction_ = direction; |
188 } | 188 } |
189 void set_remote_content_direction(MediaContentDirection direction) { | 189 void set_remote_content_direction(MediaContentDirection direction) { |
190 remote_content_direction_ = direction; | 190 remote_content_direction_ = direction; |
191 } | 191 } |
| 192 void set_secure_required(bool secure_required) { |
| 193 secure_required_ = secure_required; |
| 194 } |
192 bool IsReadyToReceive() const; | 195 bool IsReadyToReceive() const; |
193 bool IsReadyToSend() const; | 196 bool IsReadyToSend() const; |
194 rtc::Thread* signaling_thread() { return session_->signaling_thread(); } | 197 rtc::Thread* signaling_thread() { return session_->signaling_thread(); } |
195 SrtpFilter* srtp_filter() { return &srtp_filter_; } | 198 SrtpFilter* srtp_filter() { return &srtp_filter_; } |
196 bool rtcp() const { return rtcp_; } | 199 bool rtcp() const { return rtcp_; } |
197 | 200 |
198 void ConnectToTransportChannel(TransportChannel* tc); | 201 void ConnectToTransportChannel(TransportChannel* tc); |
199 void DisconnectFromTransportChannel(TransportChannel* tc); | 202 void DisconnectFromTransportChannel(TransportChannel* tc); |
200 | 203 |
201 void FlushRtcpMessages(); | 204 void FlushRtcpMessages(); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 | 251 |
249 // Gets the content info appropriate to the channel (audio or video). | 252 // Gets the content info appropriate to the channel (audio or video). |
250 virtual const ContentInfo* GetFirstContent( | 253 virtual const ContentInfo* GetFirstContent( |
251 const SessionDescription* sdesc) = 0; | 254 const SessionDescription* sdesc) = 0; |
252 bool UpdateLocalStreams_w(const std::vector<StreamParams>& streams, | 255 bool UpdateLocalStreams_w(const std::vector<StreamParams>& streams, |
253 ContentAction action, | 256 ContentAction action, |
254 std::string* error_desc); | 257 std::string* error_desc); |
255 bool UpdateRemoteStreams_w(const std::vector<StreamParams>& streams, | 258 bool UpdateRemoteStreams_w(const std::vector<StreamParams>& streams, |
256 ContentAction action, | 259 ContentAction action, |
257 std::string* error_desc); | 260 std::string* error_desc); |
258 bool SetBaseLocalContent_w(const MediaContentDescription* content, | |
259 ContentAction action, | |
260 std::string* error_desc); | |
261 virtual bool SetLocalContent_w(const MediaContentDescription* content, | 261 virtual bool SetLocalContent_w(const MediaContentDescription* content, |
262 ContentAction action, | 262 ContentAction action, |
263 std::string* error_desc) = 0; | 263 std::string* error_desc) = 0; |
264 bool SetBaseRemoteContent_w(const MediaContentDescription* content, | |
265 ContentAction action, | |
266 std::string* error_desc); | |
267 virtual bool SetRemoteContent_w(const MediaContentDescription* content, | 264 virtual bool SetRemoteContent_w(const MediaContentDescription* content, |
268 ContentAction action, | 265 ContentAction action, |
269 std::string* error_desc) = 0; | 266 std::string* error_desc) = 0; |
| 267 bool SetRtpTransportParameters_w(const MediaContentDescription* content, |
| 268 ContentAction action, |
| 269 ContentSource src, |
| 270 std::string* error_desc); |
270 | 271 |
271 // Helper method to get RTP Absoulute SendTime extension header id if | 272 // Helper method to get RTP Absoulute SendTime extension header id if |
272 // present in remote supported extensions list. | 273 // present in remote supported extensions list. |
273 void MaybeCacheRtpAbsSendTimeHeaderExtension( | 274 void MaybeCacheRtpAbsSendTimeHeaderExtension( |
274 const std::vector<RtpHeaderExtension>& extensions); | 275 const std::vector<RtpHeaderExtension>& extensions); |
275 | 276 |
276 bool SetRecvRtpHeaderExtensions_w(const MediaContentDescription* content, | |
277 MediaChannel* media_channel, | |
278 std::string* error_desc); | |
279 bool SetSendRtpHeaderExtensions_w(const MediaContentDescription* content, | |
280 MediaChannel* media_channel, | |
281 std::string* error_desc); | |
282 | |
283 bool CheckSrtpConfig(const std::vector<CryptoParams>& cryptos, | 277 bool CheckSrtpConfig(const std::vector<CryptoParams>& cryptos, |
284 bool* dtls, | 278 bool* dtls, |
285 std::string* error_desc); | 279 std::string* error_desc); |
286 bool SetSrtp_w(const std::vector<CryptoParams>& params, | 280 bool SetSrtp_w(const std::vector<CryptoParams>& params, |
287 ContentAction action, | 281 ContentAction action, |
288 ContentSource src, | 282 ContentSource src, |
289 std::string* error_desc); | 283 std::string* error_desc); |
290 void ActivateRtcpMux_w(); | 284 void ActivateRtcpMux_w(); |
291 bool SetRtcpMux_w(bool enable, | 285 bool SetRtcpMux_w(bool enable, |
292 ContentAction action, | 286 ContentAction action, |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 void OnVoiceChannelError(uint32 ssrc, VoiceMediaChannel::Error error); | 433 void OnVoiceChannelError(uint32 ssrc, VoiceMediaChannel::Error error); |
440 void SendLastMediaError(); | 434 void SendLastMediaError(); |
441 void OnSrtpError(uint32 ssrc, SrtpFilter::Mode mode, SrtpFilter::Error error); | 435 void OnSrtpError(uint32 ssrc, SrtpFilter::Mode mode, SrtpFilter::Error error); |
442 | 436 |
443 static const int kEarlyMediaTimeout = 1000; | 437 static const int kEarlyMediaTimeout = 1000; |
444 MediaEngineInterface* media_engine_; | 438 MediaEngineInterface* media_engine_; |
445 bool received_media_; | 439 bool received_media_; |
446 rtc::scoped_ptr<VoiceMediaMonitor> media_monitor_; | 440 rtc::scoped_ptr<VoiceMediaMonitor> media_monitor_; |
447 rtc::scoped_ptr<AudioMonitor> audio_monitor_; | 441 rtc::scoped_ptr<AudioMonitor> audio_monitor_; |
448 rtc::scoped_ptr<TypingMonitor> typing_monitor_; | 442 rtc::scoped_ptr<TypingMonitor> typing_monitor_; |
| 443 |
| 444 // Last AudioSendParameters sent down to the media_channel() via |
| 445 // SetSendParameters. |
| 446 AudioSendParameters last_send_params_; |
| 447 // Last AudioRecvParameters sent down to the media_channel() via |
| 448 // SetRecvParameters. |
| 449 AudioRecvParameters last_recv_params_; |
449 }; | 450 }; |
450 | 451 |
451 // VideoChannel is a specialization for video. | 452 // VideoChannel is a specialization for video. |
452 class VideoChannel : public BaseChannel { | 453 class VideoChannel : public BaseChannel { |
453 public: | 454 public: |
454 VideoChannel(rtc::Thread* thread, VideoMediaChannel* channel, | 455 VideoChannel(rtc::Thread* thread, VideoMediaChannel* channel, |
455 BaseSession* session, const std::string& content_name, | 456 BaseSession* session, const std::string& content_name, |
456 bool rtcp); | 457 bool rtcp); |
457 ~VideoChannel(); | 458 ~VideoChannel(); |
458 bool Init(); | 459 bool Init(); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 bool GetLocalSsrc(const VideoCapturer* capturer, uint32* ssrc); | 530 bool GetLocalSsrc(const VideoCapturer* capturer, uint32* ssrc); |
530 | 531 |
531 void OnVideoChannelError(uint32 ssrc, VideoMediaChannel::Error error); | 532 void OnVideoChannelError(uint32 ssrc, VideoMediaChannel::Error error); |
532 void OnSrtpError(uint32 ssrc, SrtpFilter::Mode mode, SrtpFilter::Error error); | 533 void OnSrtpError(uint32 ssrc, SrtpFilter::Mode mode, SrtpFilter::Error error); |
533 | 534 |
534 VideoRenderer* renderer_; | 535 VideoRenderer* renderer_; |
535 ScreencastMap screencast_capturers_; | 536 ScreencastMap screencast_capturers_; |
536 rtc::scoped_ptr<VideoMediaMonitor> media_monitor_; | 537 rtc::scoped_ptr<VideoMediaMonitor> media_monitor_; |
537 | 538 |
538 rtc::WindowEvent previous_we_; | 539 rtc::WindowEvent previous_we_; |
| 540 |
| 541 // Last VideoSendParameters sent down to the media_channel() via |
| 542 // SetSendParameters. |
| 543 VideoSendParameters last_send_params_; |
| 544 // Last VideoRecvParameters sent down to the media_channel() via |
| 545 // SetRecvParameters. |
| 546 VideoRecvParameters last_recv_params_; |
539 }; | 547 }; |
540 | 548 |
541 // DataChannel is a specialization for data. | 549 // DataChannel is a specialization for data. |
542 class DataChannel : public BaseChannel { | 550 class DataChannel : public BaseChannel { |
543 public: | 551 public: |
544 DataChannel(rtc::Thread* thread, | 552 DataChannel(rtc::Thread* thread, |
545 DataMediaChannel* media_channel, | 553 DataMediaChannel* media_channel, |
546 BaseSession* session, | 554 BaseSession* session, |
547 const std::string& content_name, | 555 const std::string& content_name, |
548 bool rtcp); | 556 bool rtcp); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 void OnDataChannelError(uint32 ssrc, DataMediaChannel::Error error); | 655 void OnDataChannelError(uint32 ssrc, DataMediaChannel::Error error); |
648 void OnDataChannelReadyToSend(bool writable); | 656 void OnDataChannelReadyToSend(bool writable); |
649 void OnSrtpError(uint32 ssrc, SrtpFilter::Mode mode, SrtpFilter::Error error); | 657 void OnSrtpError(uint32 ssrc, SrtpFilter::Mode mode, SrtpFilter::Error error); |
650 void OnStreamClosedRemotely(uint32 sid); | 658 void OnStreamClosedRemotely(uint32 sid); |
651 | 659 |
652 rtc::scoped_ptr<DataMediaMonitor> media_monitor_; | 660 rtc::scoped_ptr<DataMediaMonitor> media_monitor_; |
653 // TODO(pthatcher): Make a separate SctpDataChannel and | 661 // TODO(pthatcher): Make a separate SctpDataChannel and |
654 // RtpDataChannel instead of using this. | 662 // RtpDataChannel instead of using this. |
655 DataChannelType data_channel_type_; | 663 DataChannelType data_channel_type_; |
656 bool ready_to_send_data_; | 664 bool ready_to_send_data_; |
| 665 |
| 666 // Last DataSendParameters sent down to the media_channel() via |
| 667 // SetSendParameters. |
| 668 DataSendParameters last_send_params_; |
| 669 // Last DataRecvParameters sent down to the media_channel() via |
| 670 // SetRecvParameters. |
| 671 DataRecvParameters last_recv_params_; |
657 }; | 672 }; |
658 | 673 |
659 } // namespace cricket | 674 } // namespace cricket |
660 | 675 |
661 #endif // TALK_SESSION_MEDIA_CHANNEL_H_ | 676 #endif // TALK_SESSION_MEDIA_CHANNEL_H_ |
OLD | NEW |