Chromium Code Reviews| 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 SetDtlsSrtpCiphers(TransportChannel *tc, bool rtcp); | 239 bool SetDtlsSrtpCryptoSuites(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 26 matching lines...) Expand all Loading... | |
| 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 ciphers to use for RTP media | 285 // Get the SRTP ciphers to use for RTP media |
| 286 virtual void GetSrtpCryptoSuiteNames( | 286 virtual void GetSrtpCryptoSuites(std::vector<int>* ciphers) const = 0; |
|
pthatcher1
2015/11/11 19:59:40
Should we use an enum instead of an int?
guoweis_webrtc
2015/11/17 01:21:15
just like SSL, the integer is well defined and we
| |
| 287 std::vector<std::string>* ciphers) const = 0; | |
| 288 virtual void OnConnectionMonitorUpdate(ConnectionMonitor* monitor, | 287 virtual void OnConnectionMonitorUpdate(ConnectionMonitor* monitor, |
| 289 const std::vector<ConnectionInfo>& infos) = 0; | 288 const std::vector<ConnectionInfo>& infos) = 0; |
| 290 | 289 |
| 291 // Helper function for invoking bool-returning methods on the worker thread. | 290 // Helper function for invoking bool-returning methods on the worker thread. |
| 292 template <class FunctorT> | 291 template <class FunctorT> |
| 293 bool InvokeOnWorker(const FunctorT& functor) { | 292 bool InvokeOnWorker(const FunctorT& functor) { |
| 294 return worker_thread_->Invoke<bool>(functor); | 293 return worker_thread_->Invoke<bool>(functor); |
| 295 } | 294 } |
| 296 | 295 |
| 297 private: | 296 private: |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 400 std::string* error_desc); | 399 std::string* error_desc); |
| 401 virtual bool SetRemoteContent_w(const MediaContentDescription* content, | 400 virtual bool SetRemoteContent_w(const MediaContentDescription* content, |
| 402 ContentAction action, | 401 ContentAction action, |
| 403 std::string* error_desc); | 402 std::string* error_desc); |
| 404 void HandleEarlyMediaTimeout(); | 403 void HandleEarlyMediaTimeout(); |
| 405 bool InsertDtmf_w(uint32_t ssrc, int event, int duration, int flags); | 404 bool InsertDtmf_w(uint32_t ssrc, int event, int duration, int flags); |
| 406 bool SetOutputVolume_w(uint32_t ssrc, double volume); | 405 bool SetOutputVolume_w(uint32_t ssrc, double volume); |
| 407 bool GetStats_w(VoiceMediaInfo* stats); | 406 bool GetStats_w(VoiceMediaInfo* stats); |
| 408 | 407 |
| 409 virtual void OnMessage(rtc::Message* pmsg); | 408 virtual void OnMessage(rtc::Message* pmsg); |
| 410 virtual void GetSrtpCryptoSuiteNames(std::vector<std::string>* ciphers) const; | 409 virtual void GetSrtpCryptoSuites(std::vector<int>* ciphers) const; |
|
pthatcher1
2015/11/11 19:59:40
Shouldn't the variable name be crypto_suites? Her
guoweis_webrtc
2015/11/17 01:21:15
Done.
| |
| 411 virtual void OnConnectionMonitorUpdate( | 410 virtual void OnConnectionMonitorUpdate( |
| 412 ConnectionMonitor* monitor, const std::vector<ConnectionInfo>& infos); | 411 ConnectionMonitor* monitor, const std::vector<ConnectionInfo>& infos); |
| 413 virtual void OnMediaMonitorUpdate( | 412 virtual void OnMediaMonitorUpdate( |
| 414 VoiceMediaChannel* media_channel, const VoiceMediaInfo& info); | 413 VoiceMediaChannel* media_channel, const VoiceMediaInfo& info); |
| 415 void OnAudioMonitorUpdate(AudioMonitor* monitor, const AudioInfo& info); | 414 void OnAudioMonitorUpdate(AudioMonitor* monitor, const AudioInfo& info); |
| 416 | 415 |
| 417 static const int kEarlyMediaTimeout = 1000; | 416 static const int kEarlyMediaTimeout = 1000; |
| 418 MediaEngineInterface* media_engine_; | 417 MediaEngineInterface* media_engine_; |
| 419 bool received_media_; | 418 bool received_media_; |
| 420 rtc::scoped_ptr<VoiceMediaMonitor> media_monitor_; | 419 rtc::scoped_ptr<VoiceMediaMonitor> media_monitor_; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 490 bool ApplyViewRequest_w(const ViewRequest& request); | 489 bool ApplyViewRequest_w(const ViewRequest& request); |
| 491 | 490 |
| 492 bool AddScreencast_w(uint32_t ssrc, VideoCapturer* capturer); | 491 bool AddScreencast_w(uint32_t ssrc, VideoCapturer* capturer); |
| 493 bool RemoveScreencast_w(uint32_t ssrc); | 492 bool RemoveScreencast_w(uint32_t ssrc); |
| 494 void OnScreencastWindowEvent_s(uint32_t ssrc, rtc::WindowEvent we); | 493 void OnScreencastWindowEvent_s(uint32_t ssrc, rtc::WindowEvent we); |
| 495 bool IsScreencasting_w() const; | 494 bool IsScreencasting_w() const; |
| 496 void GetScreencastDetails_w(ScreencastDetailsData* d) const; | 495 void GetScreencastDetails_w(ScreencastDetailsData* d) const; |
| 497 bool GetStats_w(VideoMediaInfo* stats); | 496 bool GetStats_w(VideoMediaInfo* stats); |
| 498 | 497 |
| 499 virtual void OnMessage(rtc::Message* pmsg); | 498 virtual void OnMessage(rtc::Message* pmsg); |
| 500 virtual void GetSrtpCryptoSuiteNames(std::vector<std::string>* ciphers) const; | 499 virtual void GetSrtpCryptoSuites(std::vector<int>* ciphers) const; |
| 501 virtual void OnConnectionMonitorUpdate( | 500 virtual void OnConnectionMonitorUpdate( |
| 502 ConnectionMonitor* monitor, const std::vector<ConnectionInfo>& infos); | 501 ConnectionMonitor* monitor, const std::vector<ConnectionInfo>& infos); |
| 503 virtual void OnMediaMonitorUpdate( | 502 virtual void OnMediaMonitorUpdate( |
| 504 VideoMediaChannel* media_channel, const VideoMediaInfo& info); | 503 VideoMediaChannel* media_channel, const VideoMediaInfo& info); |
| 505 virtual void OnScreencastWindowEvent(uint32_t ssrc, rtc::WindowEvent event); | 504 virtual void OnScreencastWindowEvent(uint32_t ssrc, rtc::WindowEvent event); |
| 506 virtual void OnStateChange(VideoCapturer* capturer, CaptureState ev); | 505 virtual void OnStateChange(VideoCapturer* capturer, CaptureState ev); |
| 507 bool GetLocalSsrc(const VideoCapturer* capturer, uint32_t* ssrc); | 506 bool GetLocalSsrc(const VideoCapturer* capturer, uint32_t* ssrc); |
| 508 | 507 |
| 509 VideoRenderer* renderer_; | 508 VideoRenderer* renderer_; |
| 510 ScreencastMap screencast_capturers_; | 509 ScreencastMap screencast_capturers_; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 607 virtual bool SetLocalContent_w(const MediaContentDescription* content, | 606 virtual bool SetLocalContent_w(const MediaContentDescription* content, |
| 608 ContentAction action, | 607 ContentAction action, |
| 609 std::string* error_desc); | 608 std::string* error_desc); |
| 610 virtual bool SetRemoteContent_w(const MediaContentDescription* content, | 609 virtual bool SetRemoteContent_w(const MediaContentDescription* content, |
| 611 ContentAction action, | 610 ContentAction action, |
| 612 std::string* error_desc); | 611 std::string* error_desc); |
| 613 virtual void ChangeState(); | 612 virtual void ChangeState(); |
| 614 virtual bool WantsPacket(bool rtcp, rtc::Buffer* packet); | 613 virtual bool WantsPacket(bool rtcp, rtc::Buffer* packet); |
| 615 | 614 |
| 616 virtual void OnMessage(rtc::Message* pmsg); | 615 virtual void OnMessage(rtc::Message* pmsg); |
| 617 virtual void GetSrtpCryptoSuiteNames(std::vector<std::string>* ciphers) const; | 616 virtual void GetSrtpCryptoSuites(std::vector<int>* ciphers) const; |
| 618 virtual void OnConnectionMonitorUpdate( | 617 virtual void OnConnectionMonitorUpdate( |
| 619 ConnectionMonitor* monitor, const std::vector<ConnectionInfo>& infos); | 618 ConnectionMonitor* monitor, const std::vector<ConnectionInfo>& infos); |
| 620 virtual void OnMediaMonitorUpdate( | 619 virtual void OnMediaMonitorUpdate( |
| 621 DataMediaChannel* media_channel, const DataMediaInfo& info); | 620 DataMediaChannel* media_channel, const DataMediaInfo& info); |
| 622 virtual bool ShouldSetupDtlsSrtp() const; | 621 virtual bool ShouldSetupDtlsSrtp() const; |
| 623 void OnDataReceived( | 622 void OnDataReceived( |
| 624 const ReceiveDataParams& params, const char* data, size_t len); | 623 const ReceiveDataParams& params, const char* data, size_t len); |
| 625 void OnDataChannelError(uint32_t ssrc, DataMediaChannel::Error error); | 624 void OnDataChannelError(uint32_t ssrc, DataMediaChannel::Error error); |
| 626 void OnDataChannelReadyToSend(bool writable); | 625 void OnDataChannelReadyToSend(bool writable); |
| 627 void OnStreamClosedRemotely(uint32_t sid); | 626 void OnStreamClosedRemotely(uint32_t sid); |
| 628 | 627 |
| 629 rtc::scoped_ptr<DataMediaMonitor> media_monitor_; | 628 rtc::scoped_ptr<DataMediaMonitor> media_monitor_; |
| 630 // TODO(pthatcher): Make a separate SctpDataChannel and | 629 // TODO(pthatcher): Make a separate SctpDataChannel and |
| 631 // RtpDataChannel instead of using this. | 630 // RtpDataChannel instead of using this. |
| 632 DataChannelType data_channel_type_; | 631 DataChannelType data_channel_type_; |
| 633 bool ready_to_send_data_; | 632 bool ready_to_send_data_; |
| 634 | 633 |
| 635 // Last DataSendParameters sent down to the media_channel() via | 634 // Last DataSendParameters sent down to the media_channel() via |
| 636 // SetSendParameters. | 635 // SetSendParameters. |
| 637 DataSendParameters last_send_params_; | 636 DataSendParameters last_send_params_; |
| 638 // Last DataRecvParameters sent down to the media_channel() via | 637 // Last DataRecvParameters sent down to the media_channel() via |
| 639 // SetRecvParameters. | 638 // SetRecvParameters. |
| 640 DataRecvParameters last_recv_params_; | 639 DataRecvParameters last_recv_params_; |
| 641 }; | 640 }; |
| 642 | 641 |
| 643 } // namespace cricket | 642 } // namespace cricket |
| 644 | 643 |
| 645 #endif // TALK_SESSION_MEDIA_CHANNEL_H_ | 644 #endif // TALK_SESSION_MEDIA_CHANNEL_H_ |
| OLD | NEW |