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 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 channels_.push_back(ch); | 719 channels_.push_back(ch); |
720 return ch; | 720 return ch; |
721 } | 721 } |
722 FakeVoiceMediaChannel* GetChannel(size_t index) { | 722 FakeVoiceMediaChannel* GetChannel(size_t index) { |
723 return (channels_.size() > index) ? channels_[index] : NULL; | 723 return (channels_.size() > index) ? channels_[index] : NULL; |
724 } | 724 } |
725 void UnregisterChannel(VoiceMediaChannel* channel) { | 725 void UnregisterChannel(VoiceMediaChannel* channel) { |
726 channels_.erase(std::find(channels_.begin(), channels_.end(), channel)); | 726 channels_.erase(std::find(channels_.begin(), channels_.end(), channel)); |
727 } | 727 } |
728 | 728 |
729 const std::vector<AudioCodec>& codecs() { return codecs_; } | 729 // TODO(ossu): For proper testing, These should either individually settable |
730 void SetCodecs(const std::vector<AudioCodec> codecs) { codecs_ = codecs; } | 730 // or the voice engine should reference mockable factories. |
| 731 const std::vector<AudioCodec>& send_codecs() { return codecs_; } |
| 732 const std::vector<AudioCodec>& recv_codecs() { return codecs_; } |
| 733 void SetCodecs(const std::vector<AudioCodec>& codecs) { codecs_ = codecs; } |
731 | 734 |
732 bool GetOutputVolume(int* level) { | 735 bool GetOutputVolume(int* level) { |
733 *level = output_volume_; | 736 *level = output_volume_; |
734 return true; | 737 return true; |
735 } | 738 } |
736 bool SetOutputVolume(int level) { | 739 bool SetOutputVolume(int level) { |
737 output_volume_ = level; | 740 output_volume_ = level; |
738 return true; | 741 return true; |
739 } | 742 } |
740 | 743 |
(...skipping 166 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 |