| 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 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 // Flag used by optionsmessagehandler_unittest for checking whether any | 746 // Flag used by optionsmessagehandler_unittest for checking whether any |
| 747 // relevant setting has been updated. | 747 // relevant setting has been updated. |
| 748 // TODO(thaloun): Replace with explicit checks of before & after values. | 748 // TODO(thaloun): Replace with explicit checks of before & after values. |
| 749 bool options_changed_; | 749 bool options_changed_; |
| 750 bool fail_create_channel_; | 750 bool fail_create_channel_; |
| 751 RtpCapabilities capabilities_; | 751 RtpCapabilities capabilities_; |
| 752 }; | 752 }; |
| 753 | 753 |
| 754 class FakeVoiceEngine : public FakeBaseEngine { | 754 class FakeVoiceEngine : public FakeBaseEngine { |
| 755 public: | 755 public: |
| 756 FakeVoiceEngine( | 756 FakeVoiceEngine(webrtc::AudioDeviceModule* adm, |
| 757 webrtc::AudioDeviceModule* adm, | 757 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& |
| 758 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& | 758 audio_decoder_factory, |
| 759 audio_decoder_factory) { | 759 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer) { |
| 760 // Add a fake audio codec. Note that the name must not be "" as there are | 760 // Add a fake audio codec. Note that the name must not be "" as there are |
| 761 // sanity checks against that. | 761 // sanity checks against that. |
| 762 codecs_.push_back(AudioCodec(101, "fake_audio_codec", 0, 0, 1)); | 762 codecs_.push_back(AudioCodec(101, "fake_audio_codec", 0, 0, 1)); |
| 763 } | 763 } |
| 764 rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const { | 764 rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const { |
| 765 return rtc::scoped_refptr<webrtc::AudioState>(); | 765 return rtc::scoped_refptr<webrtc::AudioState>(); |
| 766 } | 766 } |
| 767 | 767 |
| 768 VoiceMediaChannel* CreateChannel(webrtc::Call* call, | 768 VoiceMediaChannel* CreateChannel(webrtc::Call* call, |
| 769 const MediaConfig& config, | 769 const MediaConfig& config, |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 VideoOptions options_; | 857 VideoOptions options_; |
| 858 | 858 |
| 859 friend class FakeMediaEngine; | 859 friend class FakeMediaEngine; |
| 860 }; | 860 }; |
| 861 | 861 |
| 862 class FakeMediaEngine : | 862 class FakeMediaEngine : |
| 863 public CompositeMediaEngine<FakeVoiceEngine, FakeVideoEngine> { | 863 public CompositeMediaEngine<FakeVoiceEngine, FakeVideoEngine> { |
| 864 public: | 864 public: |
| 865 FakeMediaEngine() | 865 FakeMediaEngine() |
| 866 : CompositeMediaEngine<FakeVoiceEngine, FakeVideoEngine>(nullptr, | 866 : CompositeMediaEngine<FakeVoiceEngine, FakeVideoEngine>(nullptr, |
| 867 nullptr, |
| 867 nullptr) {} | 868 nullptr) {} |
| 868 virtual ~FakeMediaEngine() {} | 869 virtual ~FakeMediaEngine() {} |
| 869 | 870 |
| 870 void SetAudioCodecs(const std::vector<AudioCodec>& codecs) { | 871 void SetAudioCodecs(const std::vector<AudioCodec>& codecs) { |
| 871 voice_.SetCodecs(codecs); | 872 voice_.SetCodecs(codecs); |
| 872 } | 873 } |
| 873 void SetVideoCodecs(const std::vector<VideoCodec>& codecs) { | 874 void SetVideoCodecs(const std::vector<VideoCodec>& codecs) { |
| 874 video_.SetCodecs(codecs); | 875 video_.SetCodecs(codecs); |
| 875 } | 876 } |
| 876 | 877 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 969 | 970 |
| 970 private: | 971 private: |
| 971 std::vector<FakeDataMediaChannel*> channels_; | 972 std::vector<FakeDataMediaChannel*> channels_; |
| 972 std::vector<DataCodec> data_codecs_; | 973 std::vector<DataCodec> data_codecs_; |
| 973 DataChannelType last_channel_type_; | 974 DataChannelType last_channel_type_; |
| 974 }; | 975 }; |
| 975 | 976 |
| 976 } // namespace cricket | 977 } // namespace cricket |
| 977 | 978 |
| 978 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_ | 979 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_ |
| OLD | NEW |