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 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 // Flag used by optionsmessagehandler_unittest for checking whether any | 729 // Flag used by optionsmessagehandler_unittest for checking whether any |
730 // relevant setting has been updated. | 730 // relevant setting has been updated. |
731 // TODO(thaloun): Replace with explicit checks of before & after values. | 731 // TODO(thaloun): Replace with explicit checks of before & after values. |
732 bool options_changed_; | 732 bool options_changed_; |
733 bool fail_create_channel_; | 733 bool fail_create_channel_; |
734 RtpCapabilities capabilities_; | 734 RtpCapabilities capabilities_; |
735 }; | 735 }; |
736 | 736 |
737 class FakeVoiceEngine : public FakeBaseEngine { | 737 class FakeVoiceEngine : public FakeBaseEngine { |
738 public: | 738 public: |
739 explicit FakeVoiceEngine(webrtc::AudioDeviceModule* adm) | 739 FakeVoiceEngine( |
| 740 webrtc::AudioDeviceModule* adm, |
| 741 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& |
| 742 audio_decoder_factory) |
740 : output_volume_(-1) { | 743 : output_volume_(-1) { |
741 // Add a fake audio codec. Note that the name must not be "" as there are | 744 // Add a fake audio codec. Note that the name must not be "" as there are |
742 // sanity checks against that. | 745 // sanity checks against that. |
743 codecs_.push_back(AudioCodec(101, "fake_audio_codec", 0, 0, 1)); | 746 codecs_.push_back(AudioCodec(101, "fake_audio_codec", 0, 0, 1)); |
744 } | 747 } |
745 rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const { | 748 rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const { |
746 return rtc::scoped_refptr<webrtc::AudioState>(); | 749 return rtc::scoped_refptr<webrtc::AudioState>(); |
747 } | 750 } |
748 | 751 |
749 VoiceMediaChannel* CreateChannel(webrtc::Call* call, | 752 VoiceMediaChannel* CreateChannel(webrtc::Call* call, |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 std::vector<VideoCodec> codecs_; | 846 std::vector<VideoCodec> codecs_; |
844 bool capture_; | 847 bool capture_; |
845 VideoOptions options_; | 848 VideoOptions options_; |
846 | 849 |
847 friend class FakeMediaEngine; | 850 friend class FakeMediaEngine; |
848 }; | 851 }; |
849 | 852 |
850 class FakeMediaEngine : | 853 class FakeMediaEngine : |
851 public CompositeMediaEngine<FakeVoiceEngine, FakeVideoEngine> { | 854 public CompositeMediaEngine<FakeVoiceEngine, FakeVideoEngine> { |
852 public: | 855 public: |
853 FakeMediaEngine() : | 856 FakeMediaEngine() |
854 CompositeMediaEngine<FakeVoiceEngine, FakeVideoEngine>(nullptr) {} | 857 : CompositeMediaEngine<FakeVoiceEngine, FakeVideoEngine>(nullptr, |
| 858 nullptr) {} |
855 virtual ~FakeMediaEngine() {} | 859 virtual ~FakeMediaEngine() {} |
856 | 860 |
857 void SetAudioCodecs(const std::vector<AudioCodec>& codecs) { | 861 void SetAudioCodecs(const std::vector<AudioCodec>& codecs) { |
858 voice_.SetCodecs(codecs); | 862 voice_.SetCodecs(codecs); |
859 } | 863 } |
860 void SetVideoCodecs(const std::vector<VideoCodec>& codecs) { | 864 void SetVideoCodecs(const std::vector<VideoCodec>& codecs) { |
861 video_.SetCodecs(codecs); | 865 video_.SetCodecs(codecs); |
862 } | 866 } |
863 | 867 |
864 void SetAudioRtpHeaderExtensions( | 868 void SetAudioRtpHeaderExtensions( |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 | 960 |
957 private: | 961 private: |
958 std::vector<FakeDataMediaChannel*> channels_; | 962 std::vector<FakeDataMediaChannel*> channels_; |
959 std::vector<DataCodec> data_codecs_; | 963 std::vector<DataCodec> data_codecs_; |
960 DataChannelType last_channel_type_; | 964 DataChannelType last_channel_type_; |
961 }; | 965 }; |
962 | 966 |
963 } // namespace cricket | 967 } // namespace cricket |
964 | 968 |
965 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_ | 969 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_ |
OLD | NEW |