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 DeinitNetwork_n(); | 317 void DeinitNetwork_n(); |
318 void SignalSentPacket_n(TransportChannel* channel, | 318 void SignalSentPacket_n(TransportChannel* channel, |
319 const rtc::SentPacket& sent_packet); | 319 const rtc::SentPacket& sent_packet); |
320 void SignalSentPacket_w(const rtc::SentPacket& sent_packet); | 320 void SignalSentPacket_w(const rtc::SentPacket& sent_packet); |
321 bool IsTransportReadyToSend_n() const; | 321 bool IsTransportReadyToSend_n() const; |
322 void CacheRtpAbsSendTimeHeaderExtension_n(int rtp_abs_sendtime_extn_id); | 322 void CacheRtpAbsSendTimeHeaderExtension_n(int rtp_abs_sendtime_extn_id); |
323 | 323 |
324 rtc::Thread* const worker_thread_; | 324 rtc::Thread* const worker_thread_; |
325 rtc::Thread* const network_thread_; | 325 rtc::Thread* const network_thread_; |
326 rtc::AsyncInvoker invoker_; | 326 rtc::AsyncInvoker invoker_; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 class VoiceChannel : public BaseChannel { | 365 class VoiceChannel : public BaseChannel { |
366 public: | 366 public: |
367 VoiceChannel(rtc::Thread* worker_thread, | 367 VoiceChannel(rtc::Thread* worker_thread, |
368 rtc::Thread* network_thread, | 368 rtc::Thread* network_thread, |
369 MediaEngineInterface* media_engine, | 369 MediaEngineInterface* media_engine, |
370 VoiceMediaChannel* channel, | 370 VoiceMediaChannel* channel, |
371 TransportController* transport_controller, | 371 TransportController* transport_controller, |
372 const std::string& content_name, | 372 const std::string& content_name, |
373 bool rtcp); | 373 bool rtcp); |
374 ~VoiceChannel(); | 374 ~VoiceChannel(); |
375 bool Init_w(); | 375 bool Init_w(const std::string* bundle_transport_name); |
376 | 376 |
377 // Configure sending media on the stream with SSRC |ssrc| | 377 // Configure sending media on the stream with SSRC |ssrc| |
378 // If there is only one sending stream SSRC 0 can be used. | 378 // If there is only one sending stream SSRC 0 can be used. |
379 bool SetAudioSend(uint32_t ssrc, | 379 bool SetAudioSend(uint32_t ssrc, |
380 bool enable, | 380 bool enable, |
381 const AudioOptions* options, | 381 const AudioOptions* options, |
382 AudioSource* source); | 382 AudioSource* source); |
383 | 383 |
384 // downcasts a MediaChannel | 384 // downcasts a MediaChannel |
385 VoiceMediaChannel* media_channel() const override { | 385 VoiceMediaChannel* media_channel() const override { |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 // VideoChannel is a specialization for video. | 474 // VideoChannel is a specialization for video. |
475 class VideoChannel : public BaseChannel { | 475 class VideoChannel : public BaseChannel { |
476 public: | 476 public: |
477 VideoChannel(rtc::Thread* worker_thread, | 477 VideoChannel(rtc::Thread* worker_thread, |
478 rtc::Thread* netwokr_thread, | 478 rtc::Thread* netwokr_thread, |
479 VideoMediaChannel* channel, | 479 VideoMediaChannel* channel, |
480 TransportController* transport_controller, | 480 TransportController* transport_controller, |
481 const std::string& content_name, | 481 const std::string& content_name, |
482 bool rtcp); | 482 bool rtcp); |
483 ~VideoChannel(); | 483 ~VideoChannel(); |
484 bool Init_w(); | 484 bool Init_w(const std::string* bundle_transport_name); |
485 | 485 |
486 // downcasts a MediaChannel | 486 // downcasts a MediaChannel |
487 VideoMediaChannel* media_channel() const override { | 487 VideoMediaChannel* media_channel() const override { |
488 return static_cast<VideoMediaChannel*>(BaseChannel::media_channel()); | 488 return static_cast<VideoMediaChannel*>(BaseChannel::media_channel()); |
489 } | 489 } |
490 | 490 |
491 bool SetSink(uint32_t ssrc, rtc::VideoSinkInterface<VideoFrame>* sink); | 491 bool SetSink(uint32_t ssrc, rtc::VideoSinkInterface<VideoFrame>* sink); |
492 // Register a source. The |ssrc| must correspond to a registered | 492 // Register a source. The |ssrc| must correspond to a registered |
493 // send stream. | 493 // send stream. |
494 void SetSource(uint32_t ssrc, | 494 void SetSource(uint32_t ssrc, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 // DataChannel is a specialization for data. | 542 // DataChannel is a specialization for data. |
543 class DataChannel : public BaseChannel { | 543 class DataChannel : public BaseChannel { |
544 public: | 544 public: |
545 DataChannel(rtc::Thread* worker_thread, | 545 DataChannel(rtc::Thread* worker_thread, |
546 rtc::Thread* network_thread, | 546 rtc::Thread* network_thread, |
547 DataMediaChannel* media_channel, | 547 DataMediaChannel* media_channel, |
548 TransportController* transport_controller, | 548 TransportController* transport_controller, |
549 const std::string& content_name, | 549 const std::string& content_name, |
550 bool rtcp); | 550 bool rtcp); |
551 ~DataChannel(); | 551 ~DataChannel(); |
552 bool Init_w(); | 552 bool Init_w(const std::string* bundle_transport_name); |
553 | 553 |
554 virtual bool SendData(const SendDataParams& params, | 554 virtual bool SendData(const SendDataParams& params, |
555 const rtc::CopyOnWriteBuffer& payload, | 555 const rtc::CopyOnWriteBuffer& payload, |
556 SendDataResult* result); | 556 SendDataResult* result); |
557 | 557 |
558 void StartMediaMonitor(int cms); | 558 void StartMediaMonitor(int cms); |
559 void StopMediaMonitor(); | 559 void StopMediaMonitor(); |
560 | 560 |
561 // Should be called on the signaling thread only. | 561 // Should be called on the signaling thread only. |
562 bool ready_to_send_data() const { | 562 bool ready_to_send_data() const { |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 // SetSendParameters. | 657 // SetSendParameters. |
658 DataSendParameters last_send_params_; | 658 DataSendParameters last_send_params_; |
659 // Last DataRecvParameters sent down to the media_channel() via | 659 // Last DataRecvParameters sent down to the media_channel() via |
660 // SetRecvParameters. | 660 // SetRecvParameters. |
661 DataRecvParameters last_recv_params_; | 661 DataRecvParameters last_recv_params_; |
662 }; | 662 }; |
663 | 663 |
664 } // namespace cricket | 664 } // namespace cricket |
665 | 665 |
666 #endif // WEBRTC_PC_CHANNEL_H_ | 666 #endif // WEBRTC_PC_CHANNEL_H_ |
OLD | NEW |