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