| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 public MediaChannel::NetworkInterface, | 70 public MediaChannel::NetworkInterface, |
| 71 public ConnectionStatsGetter { | 71 public ConnectionStatsGetter { |
| 72 public: | 72 public: |
| 73 BaseChannel(rtc::Thread* worker_thread, | 73 BaseChannel(rtc::Thread* worker_thread, |
| 74 rtc::Thread* network_thread, | 74 rtc::Thread* network_thread, |
| 75 MediaChannel* channel, | 75 MediaChannel* channel, |
| 76 TransportController* transport_controller, | 76 TransportController* transport_controller, |
| 77 const std::string& content_name, | 77 const std::string& content_name, |
| 78 bool rtcp); | 78 bool rtcp); |
| 79 virtual ~BaseChannel(); | 79 virtual ~BaseChannel(); |
| 80 bool Init_w(); | 80 bool Init_w(const std::string* bundle_transport_name); |
| 81 // Deinit may be called multiple times and is simply ignored if it's already | 81 // Deinit may be called multiple times and is simply ignored if it's already |
| 82 // done. | 82 // done. |
| 83 void Deinit(); | 83 void Deinit(); |
| 84 | 84 |
| 85 rtc::Thread* worker_thread() const { return worker_thread_; } | 85 rtc::Thread* worker_thread() const { return worker_thread_; } |
| 86 rtc::Thread* network_thread() const { return network_thread_; } | 86 rtc::Thread* network_thread() const { return network_thread_; } |
| 87 const std::string& content_name() const { return content_name_; } | 87 const std::string& content_name() const { return content_name_; } |
| 88 const std::string& transport_name() const { return transport_name_; } | 88 const std::string& transport_name() const { return transport_name_; } |
| 89 bool enabled() const { return enabled_; } | 89 bool enabled() const { return enabled_; } |
| 90 | 90 |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 virtual void OnConnectionMonitorUpdate(ConnectionMonitor* monitor, | 306 virtual void OnConnectionMonitorUpdate(ConnectionMonitor* monitor, |
| 307 const std::vector<ConnectionInfo>& infos) = 0; | 307 const std::vector<ConnectionInfo>& infos) = 0; |
| 308 | 308 |
| 309 // Helper function for invoking bool-returning methods on the worker thread. | 309 // Helper function for invoking bool-returning methods on the worker thread. |
| 310 template <class FunctorT> | 310 template <class FunctorT> |
| 311 bool InvokeOnWorker(const FunctorT& functor) { | 311 bool InvokeOnWorker(const FunctorT& functor) { |
| 312 return worker_thread_->Invoke<bool>(functor); | 312 return worker_thread_->Invoke<bool>(functor); |
| 313 } | 313 } |
| 314 | 314 |
| 315 private: | 315 private: |
| 316 bool InitNetwork_n(); | 316 bool InitNetwork_n(const std::string* bundle_transport_name); |
| 317 void DisconnectTransportChannels_n(); | 317 void DisconnectTransportChannels_n(); |
| 318 void DestroyTransportChannels_n(); | 318 void DestroyTransportChannels_n(); |
| 319 void SignalSentPacket_n(TransportChannel* channel, | 319 void SignalSentPacket_n(TransportChannel* channel, |
| 320 const rtc::SentPacket& sent_packet); | 320 const rtc::SentPacket& sent_packet); |
| 321 void SignalSentPacket_w(const rtc::SentPacket& sent_packet); | 321 void SignalSentPacket_w(const rtc::SentPacket& sent_packet); |
| 322 bool IsTransportReadyToSend_n() const; | 322 bool IsTransportReadyToSend_n() const; |
| 323 void CacheRtpAbsSendTimeHeaderExtension_n(int rtp_abs_sendtime_extn_id); | 323 void CacheRtpAbsSendTimeHeaderExtension_n(int rtp_abs_sendtime_extn_id); |
| 324 | 324 |
| 325 rtc::Thread* const worker_thread_; | 325 rtc::Thread* const worker_thread_; |
| 326 rtc::Thread* const network_thread_; | 326 rtc::Thread* const network_thread_; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 class VoiceChannel : public BaseChannel { | 366 class VoiceChannel : public BaseChannel { |
| 367 public: | 367 public: |
| 368 VoiceChannel(rtc::Thread* worker_thread, | 368 VoiceChannel(rtc::Thread* worker_thread, |
| 369 rtc::Thread* network_thread, | 369 rtc::Thread* network_thread, |
| 370 MediaEngineInterface* media_engine, | 370 MediaEngineInterface* media_engine, |
| 371 VoiceMediaChannel* channel, | 371 VoiceMediaChannel* channel, |
| 372 TransportController* transport_controller, | 372 TransportController* transport_controller, |
| 373 const std::string& content_name, | 373 const std::string& content_name, |
| 374 bool rtcp); | 374 bool rtcp); |
| 375 ~VoiceChannel(); | 375 ~VoiceChannel(); |
| 376 bool Init_w(); | 376 bool Init_w(const std::string* bundle_transport_name); |
| 377 | 377 |
| 378 // Configure sending media on the stream with SSRC |ssrc| | 378 // Configure sending media on the stream with SSRC |ssrc| |
| 379 // If there is only one sending stream SSRC 0 can be used. | 379 // If there is only one sending stream SSRC 0 can be used. |
| 380 bool SetAudioSend(uint32_t ssrc, | 380 bool SetAudioSend(uint32_t ssrc, |
| 381 bool enable, | 381 bool enable, |
| 382 const AudioOptions* options, | 382 const AudioOptions* options, |
| 383 AudioSource* source); | 383 AudioSource* source); |
| 384 | 384 |
| 385 // downcasts a MediaChannel | 385 // downcasts a MediaChannel |
| 386 VoiceMediaChannel* media_channel() const override { | 386 VoiceMediaChannel* media_channel() const override { |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 // VideoChannel is a specialization for video. | 482 // VideoChannel is a specialization for video. |
| 483 class VideoChannel : public BaseChannel { | 483 class VideoChannel : public BaseChannel { |
| 484 public: | 484 public: |
| 485 VideoChannel(rtc::Thread* worker_thread, | 485 VideoChannel(rtc::Thread* worker_thread, |
| 486 rtc::Thread* netwokr_thread, | 486 rtc::Thread* netwokr_thread, |
| 487 VideoMediaChannel* channel, | 487 VideoMediaChannel* channel, |
| 488 TransportController* transport_controller, | 488 TransportController* transport_controller, |
| 489 const std::string& content_name, | 489 const std::string& content_name, |
| 490 bool rtcp); | 490 bool rtcp); |
| 491 ~VideoChannel(); | 491 ~VideoChannel(); |
| 492 bool Init_w(); | 492 bool Init_w(const std::string* bundle_transport_name); |
| 493 | 493 |
| 494 // downcasts a MediaChannel | 494 // downcasts a MediaChannel |
| 495 VideoMediaChannel* media_channel() const override { | 495 VideoMediaChannel* media_channel() const override { |
| 496 return static_cast<VideoMediaChannel*>(BaseChannel::media_channel()); | 496 return static_cast<VideoMediaChannel*>(BaseChannel::media_channel()); |
| 497 } | 497 } |
| 498 | 498 |
| 499 bool SetSink(uint32_t ssrc, rtc::VideoSinkInterface<VideoFrame>* sink); | 499 bool SetSink(uint32_t ssrc, rtc::VideoSinkInterface<VideoFrame>* sink); |
| 500 // Register a source. The |ssrc| must correspond to a registered | 500 // Register a source. The |ssrc| must correspond to a registered |
| 501 // send stream. | 501 // send stream. |
| 502 void SetSource(uint32_t ssrc, | 502 void SetSource(uint32_t ssrc, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 // DataChannel is a specialization for data. | 557 // DataChannel is a specialization for data. |
| 558 class DataChannel : public BaseChannel { | 558 class DataChannel : public BaseChannel { |
| 559 public: | 559 public: |
| 560 DataChannel(rtc::Thread* worker_thread, | 560 DataChannel(rtc::Thread* worker_thread, |
| 561 rtc::Thread* network_thread, | 561 rtc::Thread* network_thread, |
| 562 DataMediaChannel* media_channel, | 562 DataMediaChannel* media_channel, |
| 563 TransportController* transport_controller, | 563 TransportController* transport_controller, |
| 564 const std::string& content_name, | 564 const std::string& content_name, |
| 565 bool rtcp); | 565 bool rtcp); |
| 566 ~DataChannel(); | 566 ~DataChannel(); |
| 567 bool Init_w(); | 567 bool Init_w(const std::string* bundle_transport_name); |
| 568 | 568 |
| 569 virtual bool SendData(const SendDataParams& params, | 569 virtual bool SendData(const SendDataParams& params, |
| 570 const rtc::CopyOnWriteBuffer& payload, | 570 const rtc::CopyOnWriteBuffer& payload, |
| 571 SendDataResult* result); | 571 SendDataResult* result); |
| 572 | 572 |
| 573 void StartMediaMonitor(int cms); | 573 void StartMediaMonitor(int cms); |
| 574 void StopMediaMonitor(); | 574 void StopMediaMonitor(); |
| 575 | 575 |
| 576 // Should be called on the signaling thread only. | 576 // Should be called on the signaling thread only. |
| 577 bool ready_to_send_data() const { | 577 bool ready_to_send_data() const { |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 // SetSendParameters. | 672 // SetSendParameters. |
| 673 DataSendParameters last_send_params_; | 673 DataSendParameters last_send_params_; |
| 674 // Last DataRecvParameters sent down to the media_channel() via | 674 // Last DataRecvParameters sent down to the media_channel() via |
| 675 // SetRecvParameters. | 675 // SetRecvParameters. |
| 676 DataRecvParameters last_recv_params_; | 676 DataRecvParameters last_recv_params_; |
| 677 }; | 677 }; |
| 678 | 678 |
| 679 } // namespace cricket | 679 } // namespace cricket |
| 680 | 680 |
| 681 #endif // WEBRTC_PC_CHANNEL_H_ | 681 #endif // WEBRTC_PC_CHANNEL_H_ |
| OLD | NEW |