OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 virtual bool SetVideoSend(uint32_t ssrc, bool enable, | 506 virtual bool SetVideoSend(uint32_t ssrc, bool enable, |
507 const VideoOptions* options) { | 507 const VideoOptions* options) { |
508 if (!RtpHelper<VideoMediaChannel>::MuteStream(ssrc, !enable)) { | 508 if (!RtpHelper<VideoMediaChannel>::MuteStream(ssrc, !enable)) { |
509 return false; | 509 return false; |
510 } | 510 } |
511 if (enable && options) { | 511 if (enable && options) { |
512 return SetOptions(*options); | 512 return SetOptions(*options); |
513 } | 513 } |
514 return true; | 514 return true; |
515 } | 515 } |
516 virtual bool SetCapturer(uint32_t ssrc, VideoCapturer* capturer) { | 516 void SetSource( |
517 capturers_[ssrc] = capturer; | 517 uint32_t ssrc, |
518 return true; | 518 rtc::VideoSourceInterface<cricket::VideoFrame>* source) override { |
| 519 sources_[ssrc] = source; |
519 } | 520 } |
520 bool HasCapturer(uint32_t ssrc) const { | 521 |
521 return capturers_.find(ssrc) != capturers_.end(); | 522 bool HasSource(uint32_t ssrc) const { |
| 523 return sources_.find(ssrc) != sources_.end(); |
522 } | 524 } |
523 virtual bool AddRecvStream(const StreamParams& sp) { | 525 virtual bool AddRecvStream(const StreamParams& sp) { |
524 if (!RtpHelper<VideoMediaChannel>::AddRecvStream(sp)) | 526 if (!RtpHelper<VideoMediaChannel>::AddRecvStream(sp)) |
525 return false; | 527 return false; |
526 sinks_[sp.first_ssrc()] = NULL; | 528 sinks_[sp.first_ssrc()] = NULL; |
527 return true; | 529 return true; |
528 } | 530 } |
529 virtual bool RemoveRecvStream(uint32_t ssrc) { | 531 virtual bool RemoveRecvStream(uint32_t ssrc) { |
530 if (!RtpHelper<VideoMediaChannel>::RemoveRecvStream(ssrc)) | 532 if (!RtpHelper<VideoMediaChannel>::RemoveRecvStream(ssrc)) |
531 return false; | 533 return false; |
(...skipping 27 matching lines...) Expand all Loading... |
559 } | 561 } |
560 bool SetMaxSendBandwidth(int bps) { | 562 bool SetMaxSendBandwidth(int bps) { |
561 max_bps_ = bps; | 563 max_bps_ = bps; |
562 return true; | 564 return true; |
563 } | 565 } |
564 | 566 |
565 FakeVideoEngine* engine_; | 567 FakeVideoEngine* engine_; |
566 std::vector<VideoCodec> recv_codecs_; | 568 std::vector<VideoCodec> recv_codecs_; |
567 std::vector<VideoCodec> send_codecs_; | 569 std::vector<VideoCodec> send_codecs_; |
568 std::map<uint32_t, rtc::VideoSinkInterface<VideoFrame>*> sinks_; | 570 std::map<uint32_t, rtc::VideoSinkInterface<VideoFrame>*> sinks_; |
569 std::map<uint32_t, VideoCapturer*> capturers_; | 571 std::map<uint32_t, rtc::VideoSourceInterface<VideoFrame>*> sources_; |
570 VideoOptions options_; | 572 VideoOptions options_; |
571 int max_bps_; | 573 int max_bps_; |
572 }; | 574 }; |
573 | 575 |
574 // Dummy option class, needed for the DataTraits abstraction in | 576 // Dummy option class, needed for the DataTraits abstraction in |
575 // channel_unittest.c. | 577 // channel_unittest.c. |
576 class DataOptions {}; | 578 class DataOptions {}; |
577 | 579 |
578 class FakeDataMediaChannel : public RtpHelper<DataMediaChannel> { | 580 class FakeDataMediaChannel : public RtpHelper<DataMediaChannel> { |
579 public: | 581 public: |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 | 894 |
893 private: | 895 private: |
894 std::vector<FakeDataMediaChannel*> channels_; | 896 std::vector<FakeDataMediaChannel*> channels_; |
895 std::vector<DataCodec> data_codecs_; | 897 std::vector<DataCodec> data_codecs_; |
896 DataChannelType last_channel_type_; | 898 DataChannelType last_channel_type_; |
897 }; | 899 }; |
898 | 900 |
899 } // namespace cricket | 901 } // namespace cricket |
900 | 902 |
901 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_ | 903 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_ |
OLD | NEW |