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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 void ChannelNotWritable_w(); | 229 void ChannelNotWritable_w(); |
230 bool AddRecvStream_w(const StreamParams& sp); | 230 bool AddRecvStream_w(const StreamParams& sp); |
231 bool RemoveRecvStream_w(uint32_t ssrc); | 231 bool RemoveRecvStream_w(uint32_t ssrc); |
232 bool AddSendStream_w(const StreamParams& sp); | 232 bool AddSendStream_w(const StreamParams& sp); |
233 bool RemoveSendStream_w(uint32_t ssrc); | 233 bool RemoveSendStream_w(uint32_t ssrc); |
234 virtual bool ShouldSetupDtlsSrtp() const; | 234 virtual bool ShouldSetupDtlsSrtp() const; |
235 // Do the DTLS key expansion and impose it on the SRTP/SRTCP filters. | 235 // 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. | 236 // |rtcp_channel| indicates whether to set up the RTP or RTCP filter. |
237 bool SetupDtlsSrtp(bool rtcp_channel); | 237 bool SetupDtlsSrtp(bool rtcp_channel); |
238 // Set the DTLS-SRTP cipher policy on this channel as appropriate. | 238 // Set the DTLS-SRTP cipher policy on this channel as appropriate. |
239 bool SetDtlsSrtpCryptoSuites(TransportChannel* tc, bool rtcp); | 239 bool SetDtlsSrtpCiphers(TransportChannel *tc, bool rtcp); |
240 | 240 |
241 virtual void ChangeState() = 0; | 241 virtual void ChangeState() = 0; |
242 | 242 |
243 // Gets the content info appropriate to the channel (audio or video). | 243 // Gets the content info appropriate to the channel (audio or video). |
244 virtual const ContentInfo* GetFirstContent( | 244 virtual const ContentInfo* GetFirstContent( |
245 const SessionDescription* sdesc) = 0; | 245 const SessionDescription* sdesc) = 0; |
246 bool UpdateLocalStreams_w(const std::vector<StreamParams>& streams, | 246 bool UpdateLocalStreams_w(const std::vector<StreamParams>& streams, |
247 ContentAction action, | 247 ContentAction action, |
248 std::string* error_desc); | 248 std::string* error_desc); |
249 bool UpdateRemoteStreams_w(const std::vector<StreamParams>& streams, | 249 bool UpdateRemoteStreams_w(const std::vector<StreamParams>& streams, |
(...skipping 25 matching lines...) Expand all Loading... |
275 void ActivateRtcpMux_w(); | 275 void ActivateRtcpMux_w(); |
276 bool SetRtcpMux_w(bool enable, | 276 bool SetRtcpMux_w(bool enable, |
277 ContentAction action, | 277 ContentAction action, |
278 ContentSource src, | 278 ContentSource src, |
279 std::string* error_desc); | 279 std::string* error_desc); |
280 | 280 |
281 // From MessageHandler | 281 // From MessageHandler |
282 void OnMessage(rtc::Message* pmsg) override; | 282 void OnMessage(rtc::Message* pmsg) override; |
283 | 283 |
284 // Handled in derived classes | 284 // Handled in derived classes |
285 // Get the SRTP crypto suites to use for RTP media | 285 // Get the SRTP ciphers to use for RTP media |
286 virtual void GetSrtpCryptoSuites(std::vector<int>* crypto_suites) const = 0; | 286 virtual void GetSrtpCryptoSuiteNames( |
| 287 std::vector<std::string>* ciphers) const = 0; |
287 virtual void OnConnectionMonitorUpdate(ConnectionMonitor* monitor, | 288 virtual void OnConnectionMonitorUpdate(ConnectionMonitor* monitor, |
288 const std::vector<ConnectionInfo>& infos) = 0; | 289 const std::vector<ConnectionInfo>& infos) = 0; |
289 | 290 |
290 // Helper function for invoking bool-returning methods on the worker thread. | 291 // Helper function for invoking bool-returning methods on the worker thread. |
291 template <class FunctorT> | 292 template <class FunctorT> |
292 bool InvokeOnWorker(const FunctorT& functor) { | 293 bool InvokeOnWorker(const FunctorT& functor) { |
293 return worker_thread_->Invoke<bool>(functor); | 294 return worker_thread_->Invoke<bool>(functor); |
294 } | 295 } |
295 | 296 |
296 private: | 297 private: |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 std::string* error_desc); | 400 std::string* error_desc); |
400 virtual bool SetRemoteContent_w(const MediaContentDescription* content, | 401 virtual bool SetRemoteContent_w(const MediaContentDescription* content, |
401 ContentAction action, | 402 ContentAction action, |
402 std::string* error_desc); | 403 std::string* error_desc); |
403 void HandleEarlyMediaTimeout(); | 404 void HandleEarlyMediaTimeout(); |
404 bool InsertDtmf_w(uint32_t ssrc, int event, int duration, int flags); | 405 bool InsertDtmf_w(uint32_t ssrc, int event, int duration, int flags); |
405 bool SetOutputVolume_w(uint32_t ssrc, double volume); | 406 bool SetOutputVolume_w(uint32_t ssrc, double volume); |
406 bool GetStats_w(VoiceMediaInfo* stats); | 407 bool GetStats_w(VoiceMediaInfo* stats); |
407 | 408 |
408 virtual void OnMessage(rtc::Message* pmsg); | 409 virtual void OnMessage(rtc::Message* pmsg); |
409 virtual void GetSrtpCryptoSuites(std::vector<int>* crypto_suites) const; | 410 virtual void GetSrtpCryptoSuiteNames(std::vector<std::string>* ciphers) const; |
410 virtual void OnConnectionMonitorUpdate( | 411 virtual void OnConnectionMonitorUpdate( |
411 ConnectionMonitor* monitor, const std::vector<ConnectionInfo>& infos); | 412 ConnectionMonitor* monitor, const std::vector<ConnectionInfo>& infos); |
412 virtual void OnMediaMonitorUpdate( | 413 virtual void OnMediaMonitorUpdate( |
413 VoiceMediaChannel* media_channel, const VoiceMediaInfo& info); | 414 VoiceMediaChannel* media_channel, const VoiceMediaInfo& info); |
414 void OnAudioMonitorUpdate(AudioMonitor* monitor, const AudioInfo& info); | 415 void OnAudioMonitorUpdate(AudioMonitor* monitor, const AudioInfo& info); |
415 | 416 |
416 static const int kEarlyMediaTimeout = 1000; | 417 static const int kEarlyMediaTimeout = 1000; |
417 MediaEngineInterface* media_engine_; | 418 MediaEngineInterface* media_engine_; |
418 bool received_media_; | 419 bool received_media_; |
419 rtc::scoped_ptr<VoiceMediaMonitor> media_monitor_; | 420 rtc::scoped_ptr<VoiceMediaMonitor> media_monitor_; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 bool ApplyViewRequest_w(const ViewRequest& request); | 490 bool ApplyViewRequest_w(const ViewRequest& request); |
490 | 491 |
491 bool AddScreencast_w(uint32_t ssrc, VideoCapturer* capturer); | 492 bool AddScreencast_w(uint32_t ssrc, VideoCapturer* capturer); |
492 bool RemoveScreencast_w(uint32_t ssrc); | 493 bool RemoveScreencast_w(uint32_t ssrc); |
493 void OnScreencastWindowEvent_s(uint32_t ssrc, rtc::WindowEvent we); | 494 void OnScreencastWindowEvent_s(uint32_t ssrc, rtc::WindowEvent we); |
494 bool IsScreencasting_w() const; | 495 bool IsScreencasting_w() const; |
495 void GetScreencastDetails_w(ScreencastDetailsData* d) const; | 496 void GetScreencastDetails_w(ScreencastDetailsData* d) const; |
496 bool GetStats_w(VideoMediaInfo* stats); | 497 bool GetStats_w(VideoMediaInfo* stats); |
497 | 498 |
498 virtual void OnMessage(rtc::Message* pmsg); | 499 virtual void OnMessage(rtc::Message* pmsg); |
499 virtual void GetSrtpCryptoSuites(std::vector<int>* crypto_suites) const; | 500 virtual void GetSrtpCryptoSuiteNames(std::vector<std::string>* ciphers) const; |
500 virtual void OnConnectionMonitorUpdate( | 501 virtual void OnConnectionMonitorUpdate( |
501 ConnectionMonitor* monitor, const std::vector<ConnectionInfo>& infos); | 502 ConnectionMonitor* monitor, const std::vector<ConnectionInfo>& infos); |
502 virtual void OnMediaMonitorUpdate( | 503 virtual void OnMediaMonitorUpdate( |
503 VideoMediaChannel* media_channel, const VideoMediaInfo& info); | 504 VideoMediaChannel* media_channel, const VideoMediaInfo& info); |
504 virtual void OnScreencastWindowEvent(uint32_t ssrc, rtc::WindowEvent event); | 505 virtual void OnScreencastWindowEvent(uint32_t ssrc, rtc::WindowEvent event); |
505 virtual void OnStateChange(VideoCapturer* capturer, CaptureState ev); | 506 virtual void OnStateChange(VideoCapturer* capturer, CaptureState ev); |
506 bool GetLocalSsrc(const VideoCapturer* capturer, uint32_t* ssrc); | 507 bool GetLocalSsrc(const VideoCapturer* capturer, uint32_t* ssrc); |
507 | 508 |
508 VideoRenderer* renderer_; | 509 VideoRenderer* renderer_; |
509 ScreencastMap screencast_capturers_; | 510 ScreencastMap screencast_capturers_; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 virtual bool SetLocalContent_w(const MediaContentDescription* content, | 607 virtual bool SetLocalContent_w(const MediaContentDescription* content, |
607 ContentAction action, | 608 ContentAction action, |
608 std::string* error_desc); | 609 std::string* error_desc); |
609 virtual bool SetRemoteContent_w(const MediaContentDescription* content, | 610 virtual bool SetRemoteContent_w(const MediaContentDescription* content, |
610 ContentAction action, | 611 ContentAction action, |
611 std::string* error_desc); | 612 std::string* error_desc); |
612 virtual void ChangeState(); | 613 virtual void ChangeState(); |
613 virtual bool WantsPacket(bool rtcp, rtc::Buffer* packet); | 614 virtual bool WantsPacket(bool rtcp, rtc::Buffer* packet); |
614 | 615 |
615 virtual void OnMessage(rtc::Message* pmsg); | 616 virtual void OnMessage(rtc::Message* pmsg); |
616 virtual void GetSrtpCryptoSuites(std::vector<int>* crypto_suites) const; | 617 virtual void GetSrtpCryptoSuiteNames(std::vector<std::string>* ciphers) const; |
617 virtual void OnConnectionMonitorUpdate( | 618 virtual void OnConnectionMonitorUpdate( |
618 ConnectionMonitor* monitor, const std::vector<ConnectionInfo>& infos); | 619 ConnectionMonitor* monitor, const std::vector<ConnectionInfo>& infos); |
619 virtual void OnMediaMonitorUpdate( | 620 virtual void OnMediaMonitorUpdate( |
620 DataMediaChannel* media_channel, const DataMediaInfo& info); | 621 DataMediaChannel* media_channel, const DataMediaInfo& info); |
621 virtual bool ShouldSetupDtlsSrtp() const; | 622 virtual bool ShouldSetupDtlsSrtp() const; |
622 void OnDataReceived( | 623 void OnDataReceived( |
623 const ReceiveDataParams& params, const char* data, size_t len); | 624 const ReceiveDataParams& params, const char* data, size_t len); |
624 void OnDataChannelError(uint32_t ssrc, DataMediaChannel::Error error); | 625 void OnDataChannelError(uint32_t ssrc, DataMediaChannel::Error error); |
625 void OnDataChannelReadyToSend(bool writable); | 626 void OnDataChannelReadyToSend(bool writable); |
626 void OnStreamClosedRemotely(uint32_t sid); | 627 void OnStreamClosedRemotely(uint32_t sid); |
627 | 628 |
628 rtc::scoped_ptr<DataMediaMonitor> media_monitor_; | 629 rtc::scoped_ptr<DataMediaMonitor> media_monitor_; |
629 // TODO(pthatcher): Make a separate SctpDataChannel and | 630 // TODO(pthatcher): Make a separate SctpDataChannel and |
630 // RtpDataChannel instead of using this. | 631 // RtpDataChannel instead of using this. |
631 DataChannelType data_channel_type_; | 632 DataChannelType data_channel_type_; |
632 bool ready_to_send_data_; | 633 bool ready_to_send_data_; |
633 | 634 |
634 // Last DataSendParameters sent down to the media_channel() via | 635 // Last DataSendParameters sent down to the media_channel() via |
635 // SetSendParameters. | 636 // SetSendParameters. |
636 DataSendParameters last_send_params_; | 637 DataSendParameters last_send_params_; |
637 // Last DataRecvParameters sent down to the media_channel() via | 638 // Last DataRecvParameters sent down to the media_channel() via |
638 // SetRecvParameters. | 639 // SetRecvParameters. |
639 DataRecvParameters last_recv_params_; | 640 DataRecvParameters last_recv_params_; |
640 }; | 641 }; |
641 | 642 |
642 } // namespace cricket | 643 } // namespace cricket |
643 | 644 |
644 #endif // TALK_SESSION_MEDIA_CHANNEL_H_ | 645 #endif // TALK_SESSION_MEDIA_CHANNEL_H_ |
OLD | NEW |