OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 // sanity checks against that. | 725 // sanity checks against that. |
726 codecs_.push_back(AudioCodec(101, "fake_audio_codec", 0, 0, 1, 0)); | 726 codecs_.push_back(AudioCodec(101, "fake_audio_codec", 0, 0, 1, 0)); |
727 } | 727 } |
728 bool Init(rtc::Thread* worker_thread) { return true; } | 728 bool Init(rtc::Thread* worker_thread) { return true; } |
729 void Terminate() {} | 729 void Terminate() {} |
730 rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const { | 730 rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const { |
731 return rtc::scoped_refptr<webrtc::AudioState>(); | 731 return rtc::scoped_refptr<webrtc::AudioState>(); |
732 } | 732 } |
733 | 733 |
734 VoiceMediaChannel* CreateChannel(webrtc::Call* call, | 734 VoiceMediaChannel* CreateChannel(webrtc::Call* call, |
735 const AudioOptions& options) { | 735 const MediaChannelOptions& options, |
| 736 const AudioOptions& audio_options) { |
736 if (fail_create_channel_) { | 737 if (fail_create_channel_) { |
737 return nullptr; | 738 return nullptr; |
738 } | 739 } |
739 | 740 |
740 FakeVoiceMediaChannel* ch = new FakeVoiceMediaChannel(this, options); | 741 FakeVoiceMediaChannel* ch = new FakeVoiceMediaChannel(this, audio_options); |
741 channels_.push_back(ch); | 742 channels_.push_back(ch); |
742 return ch; | 743 return ch; |
743 } | 744 } |
744 FakeVoiceMediaChannel* GetChannel(size_t index) { | 745 FakeVoiceMediaChannel* GetChannel(size_t index) { |
745 return (channels_.size() > index) ? channels_[index] : NULL; | 746 return (channels_.size() > index) ? channels_[index] : NULL; |
746 } | 747 } |
747 void UnregisterChannel(VoiceMediaChannel* channel) { | 748 void UnregisterChannel(VoiceMediaChannel* channel) { |
748 channels_.erase(std::find(channels_.begin(), channels_.end(), channel)); | 749 channels_.erase(std::find(channels_.begin(), channels_.end(), channel)); |
749 } | 750 } |
750 | 751 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 codecs_.push_back(VideoCodec(0, "fake_video_codec", 0, 0, 0, 0)); | 789 codecs_.push_back(VideoCodec(0, "fake_video_codec", 0, 0, 0, 0)); |
789 } | 790 } |
790 void Init() {} | 791 void Init() {} |
791 bool SetOptions(const VideoOptions& options) { | 792 bool SetOptions(const VideoOptions& options) { |
792 options_ = options; | 793 options_ = options; |
793 options_changed_ = true; | 794 options_changed_ = true; |
794 return true; | 795 return true; |
795 } | 796 } |
796 | 797 |
797 VideoMediaChannel* CreateChannel(webrtc::Call* call, | 798 VideoMediaChannel* CreateChannel(webrtc::Call* call, |
798 const VideoOptions& options) { | 799 const MediaChannelOptions& options, |
| 800 const VideoOptions& video_options) { |
799 if (fail_create_channel_) { | 801 if (fail_create_channel_) { |
800 return NULL; | 802 return NULL; |
801 } | 803 } |
802 | 804 |
803 FakeVideoMediaChannel* ch = new FakeVideoMediaChannel(this, options); | 805 FakeVideoMediaChannel* ch = new FakeVideoMediaChannel(this, video_options); |
804 channels_.push_back(ch); | 806 channels_.push_back(ch); |
805 return ch; | 807 return ch; |
806 } | 808 } |
807 FakeVideoMediaChannel* GetChannel(size_t index) { | 809 FakeVideoMediaChannel* GetChannel(size_t index) { |
808 return (channels_.size() > index) ? channels_[index] : NULL; | 810 return (channels_.size() > index) ? channels_[index] : NULL; |
809 } | 811 } |
810 void UnregisterChannel(VideoMediaChannel* channel) { | 812 void UnregisterChannel(VideoMediaChannel* channel) { |
811 channels_.erase(std::find(channels_.begin(), channels_.end(), channel)); | 813 channels_.erase(std::find(channels_.begin(), channels_.end(), channel)); |
812 } | 814 } |
813 | 815 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
941 | 943 |
942 private: | 944 private: |
943 std::vector<FakeDataMediaChannel*> channels_; | 945 std::vector<FakeDataMediaChannel*> channels_; |
944 std::vector<DataCodec> data_codecs_; | 946 std::vector<DataCodec> data_codecs_; |
945 DataChannelType last_channel_type_; | 947 DataChannelType last_channel_type_; |
946 }; | 948 }; |
947 | 949 |
948 } // namespace cricket | 950 } // namespace cricket |
949 | 951 |
950 #endif // TALK_MEDIA_BASE_FAKEMEDIAENGINE_H_ | 952 #endif // TALK_MEDIA_BASE_FAKEMEDIAENGINE_H_ |
OLD | NEW |