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 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 // Flag used by optionsmessagehandler_unittest for checking whether any | 691 // Flag used by optionsmessagehandler_unittest for checking whether any |
692 // relevant setting has been updated. | 692 // relevant setting has been updated. |
693 // TODO(thaloun): Replace with explicit checks of before & after values. | 693 // TODO(thaloun): Replace with explicit checks of before & after values. |
694 bool options_changed_; | 694 bool options_changed_; |
695 bool fail_create_channel_; | 695 bool fail_create_channel_; |
696 RtpCapabilities capabilities_; | 696 RtpCapabilities capabilities_; |
697 }; | 697 }; |
698 | 698 |
699 class FakeVoiceEngine : public FakeBaseEngine { | 699 class FakeVoiceEngine : public FakeBaseEngine { |
700 public: | 700 public: |
701 explicit FakeVoiceEngine(webrtc::AudioDeviceModule* adm) | 701 explicit FakeVoiceEngine( |
| 702 webrtc::AudioDeviceModule* adm, |
| 703 std::shared_ptr<webrtc::AudioDecoderFactory> audio_decoder_factory) |
702 : output_volume_(-1) { | 704 : output_volume_(-1) { |
703 // Add a fake audio codec. Note that the name must not be "" as there are | 705 // Add a fake audio codec. Note that the name must not be "" as there are |
704 // sanity checks against that. | 706 // sanity checks against that. |
705 codecs_.push_back(AudioCodec(101, "fake_audio_codec", 0, 0, 1)); | 707 codecs_.push_back(AudioCodec(101, "fake_audio_codec", 0, 0, 1)); |
706 } | 708 } |
707 rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const { | 709 rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const { |
708 return rtc::scoped_refptr<webrtc::AudioState>(); | 710 return rtc::scoped_refptr<webrtc::AudioState>(); |
709 } | 711 } |
710 | 712 |
711 VoiceMediaChannel* CreateChannel(webrtc::Call* call, | 713 VoiceMediaChannel* CreateChannel(webrtc::Call* call, |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 bool capture_; | 806 bool capture_; |
805 VideoOptions options_; | 807 VideoOptions options_; |
806 | 808 |
807 friend class FakeMediaEngine; | 809 friend class FakeMediaEngine; |
808 }; | 810 }; |
809 | 811 |
810 class FakeMediaEngine : | 812 class FakeMediaEngine : |
811 public CompositeMediaEngine<FakeVoiceEngine, FakeVideoEngine> { | 813 public CompositeMediaEngine<FakeVoiceEngine, FakeVideoEngine> { |
812 public: | 814 public: |
813 FakeMediaEngine() : | 815 FakeMediaEngine() : |
814 CompositeMediaEngine<FakeVoiceEngine, FakeVideoEngine>(nullptr) {} | 816 CompositeMediaEngine<FakeVoiceEngine, FakeVideoEngine>( |
| 817 nullptr, std::shared_ptr<webrtc::AudioDecoderFactory>()) {} |
815 virtual ~FakeMediaEngine() {} | 818 virtual ~FakeMediaEngine() {} |
816 | 819 |
817 void SetAudioCodecs(const std::vector<AudioCodec>& codecs) { | 820 void SetAudioCodecs(const std::vector<AudioCodec>& codecs) { |
818 voice_.SetCodecs(codecs); | 821 voice_.SetCodecs(codecs); |
819 } | 822 } |
820 void SetVideoCodecs(const std::vector<VideoCodec>& codecs) { | 823 void SetVideoCodecs(const std::vector<VideoCodec>& codecs) { |
821 video_.SetCodecs(codecs); | 824 video_.SetCodecs(codecs); |
822 } | 825 } |
823 | 826 |
824 void SetAudioRtpHeaderExtensions( | 827 void SetAudioRtpHeaderExtensions( |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 | 910 |
908 private: | 911 private: |
909 std::vector<FakeDataMediaChannel*> channels_; | 912 std::vector<FakeDataMediaChannel*> channels_; |
910 std::vector<DataCodec> data_codecs_; | 913 std::vector<DataCodec> data_codecs_; |
911 DataChannelType last_channel_type_; | 914 DataChannelType last_channel_type_; |
912 }; | 915 }; |
913 | 916 |
914 } // namespace cricket | 917 } // namespace cricket |
915 | 918 |
916 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_ | 919 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_ |
OLD | NEW |