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

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

Issue 1991233004: Moved creation of AudioDecoderFactory to inside PeerConnectionFactory. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@audio-decoder-factory-injections-3
Patch Set: Removed explicit constructor qualifier. Fixed comment grammar. 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
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 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 // Flag used by optionsmessagehandler_unittest for checking whether any 721 // Flag used by optionsmessagehandler_unittest for checking whether any
722 // relevant setting has been updated. 722 // relevant setting has been updated.
723 // TODO(thaloun): Replace with explicit checks of before & after values. 723 // TODO(thaloun): Replace with explicit checks of before & after values.
724 bool options_changed_; 724 bool options_changed_;
725 bool fail_create_channel_; 725 bool fail_create_channel_;
726 RtpCapabilities capabilities_; 726 RtpCapabilities capabilities_;
727 }; 727 };
728 728
729 class FakeVoiceEngine : public FakeBaseEngine { 729 class FakeVoiceEngine : public FakeBaseEngine {
730 public: 730 public:
731 explicit FakeVoiceEngine(webrtc::AudioDeviceModule* adm) 731 explicit FakeVoiceEngine(
732 webrtc::AudioDeviceModule* adm,
733 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>&
734 audio_decoder_factory)
732 : output_volume_(-1) { 735 : output_volume_(-1) {
733 // Add a fake audio codec. Note that the name must not be "" as there are 736 // Add a fake audio codec. Note that the name must not be "" as there are
734 // sanity checks against that. 737 // sanity checks against that.
735 codecs_.push_back(AudioCodec(101, "fake_audio_codec", 0, 0, 1)); 738 codecs_.push_back(AudioCodec(101, "fake_audio_codec", 0, 0, 1));
736 } 739 }
737 rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const { 740 rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const {
738 return rtc::scoped_refptr<webrtc::AudioState>(); 741 return rtc::scoped_refptr<webrtc::AudioState>();
739 } 742 }
740 743
741 VoiceMediaChannel* CreateChannel(webrtc::Call* call, 744 VoiceMediaChannel* CreateChannel(webrtc::Call* call,
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 std::vector<VideoCodec> codecs_; 838 std::vector<VideoCodec> codecs_;
836 bool capture_; 839 bool capture_;
837 VideoOptions options_; 840 VideoOptions options_;
838 841
839 friend class FakeMediaEngine; 842 friend class FakeMediaEngine;
840 }; 843 };
841 844
842 class FakeMediaEngine : 845 class FakeMediaEngine :
843 public CompositeMediaEngine<FakeVoiceEngine, FakeVideoEngine> { 846 public CompositeMediaEngine<FakeVoiceEngine, FakeVideoEngine> {
844 public: 847 public:
845 FakeMediaEngine() : 848 FakeMediaEngine()
846 CompositeMediaEngine<FakeVoiceEngine, FakeVideoEngine>(nullptr) {} 849 : CompositeMediaEngine<FakeVoiceEngine, FakeVideoEngine>(nullptr,
850 nullptr) {}
847 virtual ~FakeMediaEngine() {} 851 virtual ~FakeMediaEngine() {}
848 852
849 void SetAudioCodecs(const std::vector<AudioCodec>& codecs) { 853 void SetAudioCodecs(const std::vector<AudioCodec>& codecs) {
850 voice_.SetCodecs(codecs); 854 voice_.SetCodecs(codecs);
851 } 855 }
852 void SetVideoCodecs(const std::vector<VideoCodec>& codecs) { 856 void SetVideoCodecs(const std::vector<VideoCodec>& codecs) {
853 video_.SetCodecs(codecs); 857 video_.SetCodecs(codecs);
854 } 858 }
855 859
856 void SetAudioRtpHeaderExtensions( 860 void SetAudioRtpHeaderExtensions(
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 943
940 private: 944 private:
941 std::vector<FakeDataMediaChannel*> channels_; 945 std::vector<FakeDataMediaChannel*> channels_;
942 std::vector<DataCodec> data_codecs_; 946 std::vector<DataCodec> data_codecs_;
943 DataChannelType last_channel_type_; 947 DataChannelType last_channel_type_;
944 }; 948 };
945 949
946 } // namespace cricket 950 } // namespace cricket
947 951
948 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_ 952 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698