Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(452)

Side by Side Diff: webrtc/media/base/fakemediaengine.h

Issue 1838413002: Combining SetVideoSend and SetSource into one method. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Adding TODO. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/api/webrtcsession_unittest.cc ('k') | webrtc/media/base/mediachannel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 if (ssrc != 0 && sinks_.find(ssrc) == sinks_.end()) { 540 if (ssrc != 0 && sinks_.find(ssrc) == sinks_.end()) {
541 return false; 541 return false;
542 } 542 }
543 if (ssrc != 0) { 543 if (ssrc != 0) {
544 sinks_[ssrc] = sink; 544 sinks_[ssrc] = sink;
545 } 545 }
546 return true; 546 return true;
547 } 547 }
548 548
549 bool SetSend(bool send) override { return set_sending(send); } 549 bool SetSend(bool send) override { return set_sending(send); }
550 bool SetVideoSend(uint32_t ssrc, bool enable, 550 bool SetVideoSend(
551 const VideoOptions* options) override { 551 uint32_t ssrc,
552 bool enable,
553 const VideoOptions* options,
554 rtc::VideoSourceInterface<cricket::VideoFrame>* source) override {
552 if (!RtpHelper<VideoMediaChannel>::MuteStream(ssrc, !enable)) { 555 if (!RtpHelper<VideoMediaChannel>::MuteStream(ssrc, !enable)) {
553 return false; 556 return false;
554 } 557 }
555 if (enable && options) { 558 if (enable && options) {
556 return SetOptions(*options); 559 return SetOptions(*options);
557 } 560 }
561 sources_[ssrc] = source;
558 return true; 562 return true;
559 } 563 }
560 void SetSource(
561 uint32_t ssrc,
562 rtc::VideoSourceInterface<cricket::VideoFrame>* source) override {
563 sources_[ssrc] = source;
564 }
565 564
566 bool HasSource(uint32_t ssrc) const { 565 bool HasSource(uint32_t ssrc) const {
567 return sources_.find(ssrc) != sources_.end(); 566 return sources_.find(ssrc) != sources_.end();
568 } 567 }
569 bool AddRecvStream(const StreamParams& sp) override { 568 bool AddRecvStream(const StreamParams& sp) override {
570 if (!RtpHelper<VideoMediaChannel>::AddRecvStream(sp)) 569 if (!RtpHelper<VideoMediaChannel>::AddRecvStream(sp))
571 return false; 570 return false;
572 sinks_[sp.first_ssrc()] = NULL; 571 sinks_[sp.first_ssrc()] = NULL;
573 return true; 572 return true;
574 } 573 }
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 956
958 private: 957 private:
959 std::vector<FakeDataMediaChannel*> channels_; 958 std::vector<FakeDataMediaChannel*> channels_;
960 std::vector<DataCodec> data_codecs_; 959 std::vector<DataCodec> data_codecs_;
961 DataChannelType last_channel_type_; 960 DataChannelType last_channel_type_;
962 }; 961 };
963 962
964 } // namespace cricket 963 } // namespace cricket
965 964
966 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_ 965 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_
OLDNEW
« no previous file with comments | « webrtc/api/webrtcsession_unittest.cc ('k') | webrtc/media/base/mediachannel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698