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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 if (ssrc != 0 && sinks_.find(ssrc) == sinks_.end()) { | 512 if (ssrc != 0 && sinks_.find(ssrc) == sinks_.end()) { |
513 return false; | 513 return false; |
514 } | 514 } |
515 if (ssrc != 0) { | 515 if (ssrc != 0) { |
516 sinks_[ssrc] = sink; | 516 sinks_[ssrc] = sink; |
517 } | 517 } |
518 return true; | 518 return true; |
519 } | 519 } |
520 | 520 |
521 bool SetSend(bool send) override { return set_sending(send); } | 521 bool SetSend(bool send) override { return set_sending(send); } |
522 bool SetVideoSend(uint32_t ssrc, bool enable, | 522 bool SetVideoSend( |
523 const VideoOptions* options) override { | 523 uint32_t ssrc, |
| 524 bool enable, |
| 525 const VideoOptions* options, |
| 526 rtc::VideoSourceInterface<cricket::VideoFrame>* source) override { |
524 if (!RtpHelper<VideoMediaChannel>::MuteStream(ssrc, !enable)) { | 527 if (!RtpHelper<VideoMediaChannel>::MuteStream(ssrc, !enable)) { |
525 return false; | 528 return false; |
526 } | 529 } |
527 if (enable && options) { | 530 if (enable && options) { |
528 return SetOptions(*options); | 531 return SetOptions(*options); |
529 } | 532 } |
| 533 sources_[ssrc] = source; |
530 return true; | 534 return true; |
531 } | 535 } |
532 void SetSource( | |
533 uint32_t ssrc, | |
534 rtc::VideoSourceInterface<cricket::VideoFrame>* source) override { | |
535 sources_[ssrc] = source; | |
536 } | |
537 | 536 |
538 bool HasSource(uint32_t ssrc) const { | 537 bool HasSource(uint32_t ssrc) const { |
539 return sources_.find(ssrc) != sources_.end(); | 538 return sources_.find(ssrc) != sources_.end(); |
540 } | 539 } |
541 bool AddRecvStream(const StreamParams& sp) override { | 540 bool AddRecvStream(const StreamParams& sp) override { |
542 if (!RtpHelper<VideoMediaChannel>::AddRecvStream(sp)) | 541 if (!RtpHelper<VideoMediaChannel>::AddRecvStream(sp)) |
543 return false; | 542 return false; |
544 sinks_[sp.first_ssrc()] = NULL; | 543 sinks_[sp.first_ssrc()] = NULL; |
545 return true; | 544 return true; |
546 } | 545 } |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
911 | 910 |
912 private: | 911 private: |
913 std::vector<FakeDataMediaChannel*> channels_; | 912 std::vector<FakeDataMediaChannel*> channels_; |
914 std::vector<DataCodec> data_codecs_; | 913 std::vector<DataCodec> data_codecs_; |
915 DataChannelType last_channel_type_; | 914 DataChannelType last_channel_type_; |
916 }; | 915 }; |
917 | 916 |
918 } // namespace cricket | 917 } // namespace cricket |
919 | 918 |
920 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_ | 919 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_ |
OLD | NEW |