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