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

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

Issue 1766653002: Replace SetCapturer and SetCaptureDevice by SetSource. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebased, no longer any proxy object changes. Created 4 years, 8 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 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 virtual bool SetVideoSend(uint32_t ssrc, bool enable, 520 virtual bool SetVideoSend(uint32_t ssrc, bool enable,
521 const VideoOptions* options) { 521 const VideoOptions* options) {
522 if (!RtpHelper<VideoMediaChannel>::MuteStream(ssrc, !enable)) { 522 if (!RtpHelper<VideoMediaChannel>::MuteStream(ssrc, !enable)) {
523 return false; 523 return false;
524 } 524 }
525 if (enable && options) { 525 if (enable && options) {
526 return SetOptions(*options); 526 return SetOptions(*options);
527 } 527 }
528 return true; 528 return true;
529 } 529 }
530 virtual bool SetCapturer(uint32_t ssrc, VideoCapturer* capturer) { 530 void SetSource(
531 capturers_[ssrc] = capturer; 531 uint32_t ssrc,
532 return true; 532 rtc::VideoSourceInterface<cricket::VideoFrame>* source) override {
533 sources_[ssrc] = source;
533 } 534 }
534 bool HasCapturer(uint32_t ssrc) const { 535
535 return capturers_.find(ssrc) != capturers_.end(); 536 bool HasSource(uint32_t ssrc) const {
537 return sources_.find(ssrc) != sources_.end();
536 } 538 }
537 virtual bool AddRecvStream(const StreamParams& sp) { 539 virtual bool AddRecvStream(const StreamParams& sp) {
538 if (!RtpHelper<VideoMediaChannel>::AddRecvStream(sp)) 540 if (!RtpHelper<VideoMediaChannel>::AddRecvStream(sp))
539 return false; 541 return false;
540 sinks_[sp.first_ssrc()] = NULL; 542 sinks_[sp.first_ssrc()] = NULL;
541 return true; 543 return true;
542 } 544 }
543 virtual bool RemoveRecvStream(uint32_t ssrc) { 545 virtual bool RemoveRecvStream(uint32_t ssrc) {
544 if (!RtpHelper<VideoMediaChannel>::RemoveRecvStream(ssrc)) 546 if (!RtpHelper<VideoMediaChannel>::RemoveRecvStream(ssrc))
545 return false; 547 return false;
(...skipping 27 matching lines...) Expand all
573 } 575 }
574 bool SetMaxSendBandwidth(int bps) { 576 bool SetMaxSendBandwidth(int bps) {
575 max_bps_ = bps; 577 max_bps_ = bps;
576 return true; 578 return true;
577 } 579 }
578 580
579 FakeVideoEngine* engine_; 581 FakeVideoEngine* engine_;
580 std::vector<VideoCodec> recv_codecs_; 582 std::vector<VideoCodec> recv_codecs_;
581 std::vector<VideoCodec> send_codecs_; 583 std::vector<VideoCodec> send_codecs_;
582 std::map<uint32_t, rtc::VideoSinkInterface<VideoFrame>*> sinks_; 584 std::map<uint32_t, rtc::VideoSinkInterface<VideoFrame>*> sinks_;
583 std::map<uint32_t, VideoCapturer*> capturers_; 585 std::map<uint32_t, rtc::VideoSourceInterface<VideoFrame>*> sources_;
584 VideoOptions options_; 586 VideoOptions options_;
585 int max_bps_; 587 int max_bps_;
586 }; 588 };
587 589
588 // Dummy option class, needed for the DataTraits abstraction in 590 // Dummy option class, needed for the DataTraits abstraction in
589 // channel_unittest.c. 591 // channel_unittest.c.
590 class DataOptions {}; 592 class DataOptions {};
591 593
592 class FakeDataMediaChannel : public RtpHelper<DataMediaChannel> { 594 class FakeDataMediaChannel : public RtpHelper<DataMediaChannel> {
593 public: 595 public:
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 907
906 private: 908 private:
907 std::vector<FakeDataMediaChannel*> channels_; 909 std::vector<FakeDataMediaChannel*> channels_;
908 std::vector<DataCodec> data_codecs_; 910 std::vector<DataCodec> data_codecs_;
909 DataChannelType last_channel_type_; 911 DataChannelType last_channel_type_;
910 }; 912 };
911 913
912 } // namespace cricket 914 } // namespace cricket
913 915
914 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_ 916 #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