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

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

Issue 1830213002: Remove WVoE::SetAudioDeviceModule() - it is now set in ctor. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: removed Construct() method Created 4 years, 9 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
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 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 // Flag used by optionsmessagehandler_unittest for checking whether any 675 // Flag used by optionsmessagehandler_unittest for checking whether any
676 // relevant setting has been updated. 676 // relevant setting has been updated.
677 // TODO(thaloun): Replace with explicit checks of before & after values. 677 // TODO(thaloun): Replace with explicit checks of before & after values.
678 bool options_changed_; 678 bool options_changed_;
679 bool fail_create_channel_; 679 bool fail_create_channel_;
680 RtpCapabilities capabilities_; 680 RtpCapabilities capabilities_;
681 }; 681 };
682 682
683 class FakeVoiceEngine : public FakeBaseEngine { 683 class FakeVoiceEngine : public FakeBaseEngine {
684 public: 684 public:
685 FakeVoiceEngine() 685 explicit FakeVoiceEngine(webrtc::AudioDeviceModule* adm)
686 : output_volume_(-1) { 686 : output_volume_(-1) {
687 // Add a fake audio codec. Note that the name must not be "" as there are 687 // Add a fake audio codec. Note that the name must not be "" as there are
688 // sanity checks against that. 688 // sanity checks against that.
689 codecs_.push_back(AudioCodec(101, "fake_audio_codec", 0, 0, 1, 0)); 689 codecs_.push_back(AudioCodec(101, "fake_audio_codec", 0, 0, 1, 0));
690 } 690 }
691 bool Init(rtc::Thread* worker_thread) { return true; } 691 bool Init() { return true; }
692 void Terminate() {} 692 void Terminate() {}
693 rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const { 693 rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const {
694 return rtc::scoped_refptr<webrtc::AudioState>(); 694 return rtc::scoped_refptr<webrtc::AudioState>();
695 } 695 }
696 696
697 VoiceMediaChannel* CreateChannel(webrtc::Call* call, 697 VoiceMediaChannel* CreateChannel(webrtc::Call* call,
698 const MediaConfig& config, 698 const MediaConfig& config,
699 const AudioOptions& options) { 699 const AudioOptions& options) {
700 if (fail_create_channel_) { 700 if (fail_create_channel_) {
701 return nullptr; 701 return nullptr;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 std::vector<VideoCodec> codecs_; 789 std::vector<VideoCodec> codecs_;
790 bool capture_; 790 bool capture_;
791 VideoOptions options_; 791 VideoOptions options_;
792 792
793 friend class FakeMediaEngine; 793 friend class FakeMediaEngine;
794 }; 794 };
795 795
796 class FakeMediaEngine : 796 class FakeMediaEngine :
797 public CompositeMediaEngine<FakeVoiceEngine, FakeVideoEngine> { 797 public CompositeMediaEngine<FakeVoiceEngine, FakeVideoEngine> {
798 public: 798 public:
799 FakeMediaEngine() {} 799 FakeMediaEngine() :
800 CompositeMediaEngine<FakeVoiceEngine, FakeVideoEngine>(nullptr) {}
800 virtual ~FakeMediaEngine() {} 801 virtual ~FakeMediaEngine() {}
801 802
802 void SetAudioCodecs(const std::vector<AudioCodec>& codecs) { 803 void SetAudioCodecs(const std::vector<AudioCodec>& codecs) {
803 voice_.SetCodecs(codecs); 804 voice_.SetCodecs(codecs);
804 } 805 }
805 void SetVideoCodecs(const std::vector<VideoCodec>& codecs) { 806 void SetVideoCodecs(const std::vector<VideoCodec>& codecs) {
806 video_.SetCodecs(codecs); 807 video_.SetCodecs(codecs);
807 } 808 }
808 809
809 void SetAudioRtpHeaderExtensions( 810 void SetAudioRtpHeaderExtensions(
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 893
893 private: 894 private:
894 std::vector<FakeDataMediaChannel*> channels_; 895 std::vector<FakeDataMediaChannel*> channels_;
895 std::vector<DataCodec> data_codecs_; 896 std::vector<DataCodec> data_codecs_;
896 DataChannelType last_channel_type_; 897 DataChannelType last_channel_type_;
897 }; 898 };
898 899
899 } // namespace cricket 900 } // namespace cricket
900 901
901 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_ 902 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/media/base/mediaengine.h » ('j') | webrtc/media/engine/webrtcvoiceengine.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698