Chromium Code Reviews| OLD | NEW | 
|---|---|
| 1 /* | 1 /* | 
| 2 * Copyright 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2004 The WebRTC project authors. All Rights Reserved. | 
| 3 * | 3 * | 
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license | 
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source | 
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found | 
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may | 
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. | 
| 9 */ | 9 */ | 
| 10 | 10 | 
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 class BaseChannel | 73 class BaseChannel | 
| 74 : public rtc::MessageHandler, public sigslot::has_slots<>, | 74 : public rtc::MessageHandler, public sigslot::has_slots<>, | 
| 75 public MediaChannel::NetworkInterface, | 75 public MediaChannel::NetworkInterface, | 
| 76 public ConnectionStatsGetter { | 76 public ConnectionStatsGetter { | 
| 77 public: | 77 public: | 
| 78 // |rtcp| represents whether or not this channel uses RTCP. | 78 // |rtcp| represents whether or not this channel uses RTCP. | 
| 79 // If |srtp_required| is true, the channel will not send or receive any | 79 // If |srtp_required| is true, the channel will not send or receive any | 
| 80 // RTP/RTCP packets without using SRTP (either using SDES or DTLS-SRTP). | 80 // RTP/RTCP packets without using SRTP (either using SDES or DTLS-SRTP). | 
| 81 BaseChannel(rtc::Thread* worker_thread, | 81 BaseChannel(rtc::Thread* worker_thread, | 
| 82 rtc::Thread* network_thread, | 82 rtc::Thread* network_thread, | 
| 83 rtc::Thread* signaling_thread, | |
| 83 MediaChannel* channel, | 84 MediaChannel* channel, | 
| 84 TransportController* transport_controller, | |
| 85 const std::string& content_name, | 85 const std::string& content_name, | 
| 86 bool rtcp, | 86 bool rtcp, | 
| 87 bool srtp_required); | 87 bool srtp_required); | 
| 88 virtual ~BaseChannel(); | 88 virtual ~BaseChannel(); | 
| 89 bool Init_w(const std::string* bundle_transport_name); | 89 bool Init_w(TransportChannel* rtp_transport, | 
| 90 TransportChannel* rtcp_transport); | |
| 90 // Deinit may be called multiple times and is simply ignored if it's already | 91 // Deinit may be called multiple times and is simply ignored if it's already | 
| 91 // done. | 92 // done. | 
| 92 void Deinit(); | 93 void Deinit(); | 
| 93 | 94 | 
| 94 rtc::Thread* worker_thread() const { return worker_thread_; } | 95 rtc::Thread* worker_thread() const { return worker_thread_; } | 
| 95 rtc::Thread* network_thread() const { return network_thread_; } | 96 rtc::Thread* network_thread() const { return network_thread_; } | 
| 96 const std::string& content_name() const { return content_name_; } | 97 const std::string& content_name() const { return content_name_; } | 
| 97 const std::string& transport_name() const { return transport_name_; } | 98 const std::string& transport_name() const { return transport_name_; } | 
| 98 bool enabled() const { return enabled_; } | 99 bool enabled() const { return enabled_; } | 
| 99 | 100 | 
| 100 // This function returns true if we are using SRTP. | 101 // This function returns true if we are using SRTP. | 
| 101 bool secure() const { return srtp_filter_.IsActive(); } | 102 bool secure() const { return srtp_filter_.IsActive(); } | 
| 102 // The following function returns true if we are using | 103 // The following function returns true if we are using | 
| 103 // DTLS-based keying. If you turned off SRTP later, however | 104 // DTLS-based keying. If you turned off SRTP later, however | 
| 104 // you could have secure() == false and dtls_secure() == true. | 105 // you could have secure() == false and dtls_secure() == true. | 
| 105 bool secure_dtls() const { return dtls_keyed_; } | 106 bool secure_dtls() const { return dtls_keyed_; } | 
| 106 | 107 | 
| 107 bool writable() const { return writable_; } | 108 bool writable() const { return writable_; } | 
| 108 | 109 | 
| 109 // Activate RTCP mux, regardless of the state so far. Once | 110 // Activate RTCP mux, regardless of the state so far. Once | 
| 110 // activated, it can not be deactivated, and if the remote | 111 // activated, it can not be deactivated, and if the remote | 
| 111 // description doesn't support RTCP mux, setting the remote | 112 // description doesn't support RTCP mux, setting the remote | 
| 112 // description will fail. | 113 // description will fail. | 
| 113 void ActivateRtcpMux(); | 114 void ActivateRtcpMux(); | 
| 114 bool SetTransport(const std::string& transport_name); | 115 bool SetTransport(TransportChannel* rtp_transport, | 
| 116 TransportChannel* rtcp_transport); | |
| 115 bool PushdownLocalDescription(const SessionDescription* local_desc, | 117 bool PushdownLocalDescription(const SessionDescription* local_desc, | 
| 116 ContentAction action, | 118 ContentAction action, | 
| 117 std::string* error_desc); | 119 std::string* error_desc); | 
| 118 bool PushdownRemoteDescription(const SessionDescription* remote_desc, | 120 bool PushdownRemoteDescription(const SessionDescription* remote_desc, | 
| 119 ContentAction action, | 121 ContentAction action, | 
| 120 std::string* error_desc); | 122 std::string* error_desc); | 
| 121 // Channel control | 123 // Channel control | 
| 122 bool SetLocalContent(const MediaContentDescription* content, | 124 bool SetLocalContent(const MediaContentDescription* content, | 
| 123 ContentAction action, | 125 ContentAction action, | 
| 124 std::string* error_desc); | 126 std::string* error_desc); | 
| (...skipping 27 matching lines...) Expand all Loading... | |
| 152 sigslot::signal2<BaseChannel*, bool> SignalDtlsSrtpSetupFailure; | 154 sigslot::signal2<BaseChannel*, bool> SignalDtlsSrtpSetupFailure; | 
| 153 void SignalDtlsSrtpSetupFailure_n(bool rtcp); | 155 void SignalDtlsSrtpSetupFailure_n(bool rtcp); | 
| 154 void SignalDtlsSrtpSetupFailure_s(bool rtcp); | 156 void SignalDtlsSrtpSetupFailure_s(bool rtcp); | 
| 155 | 157 | 
| 156 // Used for latency measurements. | 158 // Used for latency measurements. | 
| 157 sigslot::signal1<BaseChannel*> SignalFirstPacketReceived; | 159 sigslot::signal1<BaseChannel*> SignalFirstPacketReceived; | 
| 158 | 160 | 
| 159 // Forward TransportChannel SignalSentPacket to worker thread. | 161 // Forward TransportChannel SignalSentPacket to worker thread. | 
| 160 sigslot::signal1<const rtc::SentPacket&> SignalSentPacket; | 162 sigslot::signal1<const rtc::SentPacket&> SignalSentPacket; | 
| 161 | 163 | 
| 162 // Only public for unit tests. Otherwise, consider private. | 164 // Emitted whenever the rtcp-mux is active and the rtcp-transport needs to be | 
| 
 
Taylor Brandstetter
2017/01/12 22:39:02
"needs to be destroyed" -> "can be destroyed"; ano
 
Zhi Huang
2017/01/13 00:12:47
Done.
 
 | |
| 163 TransportChannel* transport_channel() const { return transport_channel_; } | 165 // destroyed. | 
| 164 TransportChannel* rtcp_transport_channel() const { | 166 sigslot::signal1<const std::string&> SignalDestroyRtcpTransport; | 
| 165 return rtcp_transport_channel_; | 167 | 
| 166 } | 168 TransportChannel* rtp_transport() const { return rtp_transport_; } | 
| 169 TransportChannel* rtcp_transport() const { return rtcp_transport_; } | |
| 170 | |
| 171 bool NeedsRtcpTransport(); | |
| 
 
Taylor Brandstetter
2017/01/12 22:39:02
This can be private; the use in "EnableBundle" can
 
Zhi Huang
2017/01/13 00:12:47
I think the channel_unittests.cc will need to know
 
Taylor Brandstetter
2017/01/13 01:39:49
Acknowledged.
 
 | |
| 167 | 172 | 
| 168 // Made public for easier testing. | 173 // Made public for easier testing. | 
| 169 // | 174 // | 
| 170 // Updates "ready to send" for an individual channel, and informs the media | 175 // Updates "ready to send" for an individual channel, and informs the media | 
| 171 // channel that the transport is ready to send if each channel (in use) is | 176 // channel that the transport is ready to send if each channel (in use) is | 
| 172 // ready to send. This is more specific than just "writable"; it means the | 177 // ready to send. This is more specific than just "writable"; it means the | 
| 173 // last send didn't return ENOTCONN. | 178 // last send didn't return ENOTCONN. | 
| 174 // | 179 // | 
| 175 // This should be called whenever a channel's ready-to-send state changes, | 180 // This should be called whenever a channel's ready-to-send state changes, | 
| 176 // or when RTCP muxing becomes active/inactive. | 181 // or when RTCP muxing becomes active/inactive. | 
| 177 void SetTransportChannelReadyToSend(bool rtcp, bool ready); | 182 void SetTransportChannelReadyToSend(bool rtcp, bool ready); | 
| 178 | 183 | 
| 179 // Only public for unit tests. Otherwise, consider protected. | 184 // Only public for unit tests. Otherwise, consider protected. | 
| 180 int SetOption(SocketType type, rtc::Socket::Option o, int val) | 185 int SetOption(SocketType type, rtc::Socket::Option o, int val) | 
| 181 override; | 186 override; | 
| 182 int SetOption_n(SocketType type, rtc::Socket::Option o, int val); | 187 int SetOption_n(SocketType type, rtc::Socket::Option o, int val); | 
| 183 | 188 | 
| 184 SrtpFilter* srtp_filter() { return &srtp_filter_; } | 189 SrtpFilter* srtp_filter() { return &srtp_filter_; } | 
| 185 | 190 | 
| 186 virtual cricket::MediaType media_type() = 0; | 191 virtual cricket::MediaType media_type() = 0; | 
| 187 | 192 | 
| 188 bool SetCryptoOptions(const rtc::CryptoOptions& crypto_options); | 193 bool SetCryptoOptions(const rtc::CryptoOptions& crypto_options); | 
| 189 | 194 | 
| 190 // This function returns true if we require SRTP for call setup. | 195 // This function returns true if we require SRTP for call setup. | 
| 191 bool srtp_required_for_testing() const { return srtp_required_; } | 196 bool srtp_required_for_testing() const { return srtp_required_; } | 
| 192 | 197 | 
| 193 protected: | 198 protected: | 
| 194 virtual MediaChannel* media_channel() const { return media_channel_; } | 199 virtual MediaChannel* media_channel() const { return media_channel_; } | 
| 195 | 200 | 
| 196 // Sets the |transport_channel_| (and |rtcp_transport_channel_|, if | 201 // Sets the |rtp_transport_| (and |rtcp_transport_|, if | 
| 197 // |rtcp_enabled_| is true). Gets the transport channels from | 202 // |rtcp_enabled_| is true). | 
| 198 // |transport_controller_|. | |
| 199 // This method also updates writability and "ready-to-send" state. | 203 // This method also updates writability and "ready-to-send" state. | 
| 200 bool SetTransport_n(const std::string& transport_name); | 204 bool SetTransport_n(TransportChannel* rtp_transport, | 
| 205 TransportChannel* rtcp_transport); | |
| 201 | 206 | 
| 202 // This does not update writability or "ready-to-send" state; it just | 207 // This does not update writability or "ready-to-send" state; it just | 
| 203 // disconnects from the old channel and connects to the new one. | 208 // disconnects from the old channel and connects to the new one. | 
| 204 void SetTransportChannel_n(bool rtcp, TransportChannel* new_channel); | 209 void SetTransportChannel_n(bool rtcp, TransportChannel* new_transport); | 
| 205 | 210 | 
| 206 bool was_ever_writable() const { return was_ever_writable_; } | 211 bool was_ever_writable() const { return was_ever_writable_; } | 
| 207 void set_local_content_direction(MediaContentDirection direction) { | 212 void set_local_content_direction(MediaContentDirection direction) { | 
| 208 local_content_direction_ = direction; | 213 local_content_direction_ = direction; | 
| 209 } | 214 } | 
| 210 void set_remote_content_direction(MediaContentDirection direction) { | 215 void set_remote_content_direction(MediaContentDirection direction) { | 
| 211 remote_content_direction_ = direction; | 216 remote_content_direction_ = direction; | 
| 212 } | 217 } | 
| 213 // These methods verify that: | 218 // These methods verify that: | 
| 214 // * The required content description directions have been set. | 219 // * The required content description directions have been set. | 
| 215 // * The channel is enabled. | 220 // * The channel is enabled. | 
| 216 // * And for sending: | 221 // * And for sending: | 
| 217 // - The SRTP filter is active if it's needed. | 222 // - The SRTP filter is active if it's needed. | 
| 218 // - The transport has been writable before, meaning it should be at least | 223 // - The transport has been writable before, meaning it should be at least | 
| 219 // possible to succeed in sending a packet. | 224 // possible to succeed in sending a packet. | 
| 220 // | 225 // | 
| 221 // When any of these properties change, UpdateMediaSendRecvState_w should be | 226 // When any of these properties change, UpdateMediaSendRecvState_w should be | 
| 222 // called. | 227 // called. | 
| 223 bool IsReadyToReceiveMedia_w() const; | 228 bool IsReadyToReceiveMedia_w() const; | 
| 224 bool IsReadyToSendMedia_w() const; | 229 bool IsReadyToSendMedia_w() const; | 
| 225 rtc::Thread* signaling_thread() { | 230 rtc::Thread* signaling_thread() { return signaling_thread_; } | 
| 226 return transport_controller_->signaling_thread(); | |
| 227 } | |
| 228 | 231 | 
| 229 void ConnectToTransportChannel(TransportChannel* tc); | 232 void ConnectToTransportChannel(TransportChannel* tc); | 
| 230 void DisconnectFromTransportChannel(TransportChannel* tc); | 233 void DisconnectFromTransportChannel(TransportChannel* tc); | 
| 231 | 234 | 
| 232 void FlushRtcpMessages_n(); | 235 void FlushRtcpMessages_n(); | 
| 233 | 236 | 
| 234 // NetworkInterface implementation, called by MediaEngine | 237 // NetworkInterface implementation, called by MediaEngine | 
| 235 bool SendPacket(rtc::CopyOnWriteBuffer* packet, | 238 bool SendPacket(rtc::CopyOnWriteBuffer* packet, | 
| 236 const rtc::PacketOptions& options) override; | 239 const rtc::PacketOptions& options) override; | 
| 237 bool SendRtcp(rtc::CopyOnWriteBuffer* packet, | 240 bool SendRtcp(rtc::CopyOnWriteBuffer* packet, | 
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 352 const std::vector<ConnectionInfo>& infos) = 0; | 355 const std::vector<ConnectionInfo>& infos) = 0; | 
| 353 | 356 | 
| 354 // Helper function for invoking bool-returning methods on the worker thread. | 357 // Helper function for invoking bool-returning methods on the worker thread. | 
| 355 template <class FunctorT> | 358 template <class FunctorT> | 
| 356 bool InvokeOnWorker(const rtc::Location& posted_from, | 359 bool InvokeOnWorker(const rtc::Location& posted_from, | 
| 357 const FunctorT& functor) { | 360 const FunctorT& functor) { | 
| 358 return worker_thread_->Invoke<bool>(posted_from, functor); | 361 return worker_thread_->Invoke<bool>(posted_from, functor); | 
| 359 } | 362 } | 
| 360 | 363 | 
| 361 private: | 364 private: | 
| 362 bool InitNetwork_n(const std::string* bundle_transport_name); | 365 bool InitNetwork_n(TransportChannel* rtp_transport, | 
| 366 TransportChannel* rtcp_transport); | |
| 363 void DisconnectTransportChannels_n(); | 367 void DisconnectTransportChannels_n(); | 
| 364 void DestroyTransportChannels_n(); | 368 void DestroyTransportChannels_n(); | 
| 365 void SignalSentPacket_n(rtc::PacketTransportInterface* transport, | 369 void SignalSentPacket_n(rtc::PacketTransportInterface* transport, | 
| 366 const rtc::SentPacket& sent_packet); | 370 const rtc::SentPacket& sent_packet); | 
| 367 void SignalSentPacket_w(const rtc::SentPacket& sent_packet); | 371 void SignalSentPacket_w(const rtc::SentPacket& sent_packet); | 
| 368 bool IsReadyToSendMedia_n() const; | 372 bool IsReadyToSendMedia_n() const; | 
| 369 void CacheRtpAbsSendTimeHeaderExtension_n(int rtp_abs_sendtime_extn_id); | 373 void CacheRtpAbsSendTimeHeaderExtension_n(int rtp_abs_sendtime_extn_id); | 
| 370 int GetTransportOverheadPerPacket() const; | 374 int GetTransportOverheadPerPacket() const; | 
| 371 void UpdateTransportOverhead(); | 375 void UpdateTransportOverhead(); | 
| 372 | 376 | 
| 373 rtc::Thread* const worker_thread_; | 377 rtc::Thread* const worker_thread_; | 
| 374 rtc::Thread* const network_thread_; | 378 rtc::Thread* const network_thread_; | 
| 379 rtc::Thread* const signaling_thread_; | |
| 375 rtc::AsyncInvoker invoker_; | 380 rtc::AsyncInvoker invoker_; | 
| 376 | 381 | 
| 377 const std::string content_name_; | 382 const std::string content_name_; | 
| 378 std::unique_ptr<ConnectionMonitor> connection_monitor_; | 383 std::unique_ptr<ConnectionMonitor> connection_monitor_; | 
| 379 | 384 | 
| 380 // Transport related members that should be accessed from network thread. | |
| 381 TransportController* const transport_controller_; | |
| 382 std::string transport_name_; | 385 std::string transport_name_; | 
| 383 // Is RTCP used at all by this type of channel? | 386 // Is RTCP used at all by this type of channel? | 
| 384 // Expected to be true (as of typing this) for everything except data | 387 // Expected to be true (as of typing this) for everything except data | 
| 385 // channels. | 388 // channels. | 
| 386 const bool rtcp_enabled_; | 389 const bool rtcp_enabled_; | 
| 387 // TODO(johan): Replace TransportChannel* with rtc::PacketTransportInterface*. | 390 // TODO(johan): Replace TransportChannel* with rtc::PacketTransportInterface*. | 
| 388 TransportChannel* transport_channel_ = nullptr; | 391 TransportChannel* rtp_transport_ = nullptr; | 
| 389 std::vector<std::pair<rtc::Socket::Option, int> > socket_options_; | 392 std::vector<std::pair<rtc::Socket::Option, int> > socket_options_; | 
| 390 TransportChannel* rtcp_transport_channel_ = nullptr; | 393 TransportChannel* rtcp_transport_ = nullptr; | 
| 391 std::vector<std::pair<rtc::Socket::Option, int> > rtcp_socket_options_; | 394 std::vector<std::pair<rtc::Socket::Option, int> > rtcp_socket_options_; | 
| 392 SrtpFilter srtp_filter_; | 395 SrtpFilter srtp_filter_; | 
| 393 RtcpMuxFilter rtcp_mux_filter_; | 396 RtcpMuxFilter rtcp_mux_filter_; | 
| 394 BundleFilter bundle_filter_; | 397 BundleFilter bundle_filter_; | 
| 395 bool rtp_ready_to_send_ = false; | 398 bool rtp_ready_to_send_ = false; | 
| 396 bool rtcp_ready_to_send_ = false; | 399 bool rtcp_ready_to_send_ = false; | 
| 397 bool writable_ = false; | 400 bool writable_ = false; | 
| 398 bool was_ever_writable_ = false; | 401 bool was_ever_writable_ = false; | 
| 399 bool has_received_packet_ = false; | 402 bool has_received_packet_ = false; | 
| 400 bool dtls_keyed_ = false; | 403 bool dtls_keyed_ = false; | 
| (...skipping 14 matching lines...) Expand all Loading... | |
| 415 MediaContentDirection remote_content_direction_ = MD_INACTIVE; | 418 MediaContentDirection remote_content_direction_ = MD_INACTIVE; | 
| 416 CandidatePairInterface* selected_candidate_pair_; | 419 CandidatePairInterface* selected_candidate_pair_; | 
| 417 }; | 420 }; | 
| 418 | 421 | 
| 419 // VoiceChannel is a specialization that adds support for early media, DTMF, | 422 // VoiceChannel is a specialization that adds support for early media, DTMF, | 
| 420 // and input/output level monitoring. | 423 // and input/output level monitoring. | 
| 421 class VoiceChannel : public BaseChannel { | 424 class VoiceChannel : public BaseChannel { | 
| 422 public: | 425 public: | 
| 423 VoiceChannel(rtc::Thread* worker_thread, | 426 VoiceChannel(rtc::Thread* worker_thread, | 
| 424 rtc::Thread* network_thread, | 427 rtc::Thread* network_thread, | 
| 428 rtc::Thread* signaling_thread, | |
| 425 MediaEngineInterface* media_engine, | 429 MediaEngineInterface* media_engine, | 
| 426 VoiceMediaChannel* channel, | 430 VoiceMediaChannel* channel, | 
| 427 TransportController* transport_controller, | |
| 428 const std::string& content_name, | 431 const std::string& content_name, | 
| 429 bool rtcp, | 432 bool rtcp, | 
| 430 bool srtp_required); | 433 bool srtp_required); | 
| 431 ~VoiceChannel(); | 434 ~VoiceChannel(); | 
| 432 bool Init_w(const std::string* bundle_transport_name); | 435 bool Init_w(TransportChannel* rtp_transport, | 
| 436 TransportChannel* rtcp_transport); | |
| 433 | 437 | 
| 434 // Configure sending media on the stream with SSRC |ssrc| | 438 // Configure sending media on the stream with SSRC |ssrc| | 
| 435 // If there is only one sending stream SSRC 0 can be used. | 439 // If there is only one sending stream SSRC 0 can be used. | 
| 436 bool SetAudioSend(uint32_t ssrc, | 440 bool SetAudioSend(uint32_t ssrc, | 
| 437 bool enable, | 441 bool enable, | 
| 438 const AudioOptions* options, | 442 const AudioOptions* options, | 
| 439 AudioSource* source); | 443 AudioSource* source); | 
| 440 | 444 | 
| 441 // downcasts a MediaChannel | 445 // downcasts a MediaChannel | 
| 442 VoiceMediaChannel* media_channel() const override { | 446 VoiceMediaChannel* media_channel() const override { | 
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 533 AudioSendParameters last_send_params_; | 537 AudioSendParameters last_send_params_; | 
| 534 // Last AudioRecvParameters sent down to the media_channel() via | 538 // Last AudioRecvParameters sent down to the media_channel() via | 
| 535 // SetRecvParameters. | 539 // SetRecvParameters. | 
| 536 AudioRecvParameters last_recv_params_; | 540 AudioRecvParameters last_recv_params_; | 
| 537 }; | 541 }; | 
| 538 | 542 | 
| 539 // VideoChannel is a specialization for video. | 543 // VideoChannel is a specialization for video. | 
| 540 class VideoChannel : public BaseChannel { | 544 class VideoChannel : public BaseChannel { | 
| 541 public: | 545 public: | 
| 542 VideoChannel(rtc::Thread* worker_thread, | 546 VideoChannel(rtc::Thread* worker_thread, | 
| 543 rtc::Thread* netwokr_thread, | 547 rtc::Thread* network_thread, | 
| 548 rtc::Thread* signaling_thread, | |
| 544 VideoMediaChannel* channel, | 549 VideoMediaChannel* channel, | 
| 545 TransportController* transport_controller, | |
| 546 const std::string& content_name, | 550 const std::string& content_name, | 
| 547 bool rtcp, | 551 bool rtcp, | 
| 548 bool srtp_required); | 552 bool srtp_required); | 
| 549 ~VideoChannel(); | 553 ~VideoChannel(); | 
| 550 bool Init_w(const std::string* bundle_transport_name); | 554 bool Init_w(TransportChannel* rtp_transport, | 
| 555 TransportChannel* rtcp_transport); | |
| 551 | 556 | 
| 552 // downcasts a MediaChannel | 557 // downcasts a MediaChannel | 
| 553 VideoMediaChannel* media_channel() const override { | 558 VideoMediaChannel* media_channel() const override { | 
| 554 return static_cast<VideoMediaChannel*>(BaseChannel::media_channel()); | 559 return static_cast<VideoMediaChannel*>(BaseChannel::media_channel()); | 
| 555 } | 560 } | 
| 556 | 561 | 
| 557 bool SetSink(uint32_t ssrc, | 562 bool SetSink(uint32_t ssrc, | 
| 558 rtc::VideoSinkInterface<webrtc::VideoFrame>* sink); | 563 rtc::VideoSinkInterface<webrtc::VideoFrame>* sink); | 
| 559 // Get statistics about the current media session. | 564 // Get statistics about the current media session. | 
| 560 bool GetStats(VideoMediaInfo* stats); | 565 bool GetStats(VideoMediaInfo* stats); | 
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 613 // Last VideoRecvParameters sent down to the media_channel() via | 618 // Last VideoRecvParameters sent down to the media_channel() via | 
| 614 // SetRecvParameters. | 619 // SetRecvParameters. | 
| 615 VideoRecvParameters last_recv_params_; | 620 VideoRecvParameters last_recv_params_; | 
| 616 }; | 621 }; | 
| 617 | 622 | 
| 618 // RtpDataChannel is a specialization for data. | 623 // RtpDataChannel is a specialization for data. | 
| 619 class RtpDataChannel : public BaseChannel { | 624 class RtpDataChannel : public BaseChannel { | 
| 620 public: | 625 public: | 
| 621 RtpDataChannel(rtc::Thread* worker_thread, | 626 RtpDataChannel(rtc::Thread* worker_thread, | 
| 622 rtc::Thread* network_thread, | 627 rtc::Thread* network_thread, | 
| 623 DataMediaChannel* media_channel, | 628 rtc::Thread* signaling_thread, | 
| 624 TransportController* transport_controller, | 629 DataMediaChannel* channel, | 
| 625 const std::string& content_name, | 630 const std::string& content_name, | 
| 626 bool rtcp, | 631 bool rtcp, | 
| 627 bool srtp_required); | 632 bool srtp_required); | 
| 628 ~RtpDataChannel(); | 633 ~RtpDataChannel(); | 
| 629 bool Init_w(const std::string* bundle_transport_name); | 634 bool Init_w(TransportChannel* rtp_transport, | 
| 635 TransportChannel* rtcp_transport); | |
| 630 | 636 | 
| 631 virtual bool SendData(const SendDataParams& params, | 637 virtual bool SendData(const SendDataParams& params, | 
| 632 const rtc::CopyOnWriteBuffer& payload, | 638 const rtc::CopyOnWriteBuffer& payload, | 
| 633 SendDataResult* result); | 639 SendDataResult* result); | 
| 634 | 640 | 
| 635 void StartMediaMonitor(int cms); | 641 void StartMediaMonitor(int cms); | 
| 636 void StopMediaMonitor(); | 642 void StopMediaMonitor(); | 
| 637 | 643 | 
| 638 // Should be called on the signaling thread only. | 644 // Should be called on the signaling thread only. | 
| 639 bool ready_to_send_data() const { | 645 bool ready_to_send_data() const { | 
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 722 // SetSendParameters. | 728 // SetSendParameters. | 
| 723 DataSendParameters last_send_params_; | 729 DataSendParameters last_send_params_; | 
| 724 // Last DataRecvParameters sent down to the media_channel() via | 730 // Last DataRecvParameters sent down to the media_channel() via | 
| 725 // SetRecvParameters. | 731 // SetRecvParameters. | 
| 726 DataRecvParameters last_recv_params_; | 732 DataRecvParameters last_recv_params_; | 
| 727 }; | 733 }; | 
| 728 | 734 | 
| 729 } // namespace cricket | 735 } // namespace cricket | 
| 730 | 736 | 
| 731 #endif // WEBRTC_PC_CHANNEL_H_ | 737 #endif // WEBRTC_PC_CHANNEL_H_ | 
| OLD | NEW |