| 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 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 FakeVideoMediaChannel* GetChannel(size_t index) { | 742 FakeVideoMediaChannel* GetChannel(size_t index) { |
| 743 return (channels_.size() > index) ? channels_[index] : NULL; | 743 return (channels_.size() > index) ? channels_[index] : NULL; |
| 744 } | 744 } |
| 745 void UnregisterChannel(VideoMediaChannel* channel) { | 745 void UnregisterChannel(VideoMediaChannel* channel) { |
| 746 channels_.erase(std::find(channels_.begin(), channels_.end(), channel)); | 746 channels_.erase(std::find(channels_.begin(), channels_.end(), channel)); |
| 747 } | 747 } |
| 748 | 748 |
| 749 const std::vector<VideoCodec>& codecs() const { return codecs_; } | 749 const std::vector<VideoCodec>& codecs() const { return codecs_; } |
| 750 void SetCodecs(const std::vector<VideoCodec> codecs) { codecs_ = codecs; } | 750 void SetCodecs(const std::vector<VideoCodec> codecs) { codecs_ = codecs; } |
| 751 | 751 |
| 752 bool SetCaptureDevice(const Device* device) { | |
| 753 in_device_ = (device) ? device->name : ""; | |
| 754 options_changed_ = true; | |
| 755 return true; | |
| 756 } | |
| 757 bool SetCapture(bool capture) { | 752 bool SetCapture(bool capture) { |
| 758 capture_ = capture; | 753 capture_ = capture; |
| 759 return true; | 754 return true; |
| 760 } | 755 } |
| 761 | 756 |
| 762 private: | 757 private: |
| 763 std::vector<FakeVideoMediaChannel*> channels_; | 758 std::vector<FakeVideoMediaChannel*> channels_; |
| 764 std::vector<VideoCodec> codecs_; | 759 std::vector<VideoCodec> codecs_; |
| 765 std::string in_device_; | |
| 766 bool capture_; | 760 bool capture_; |
| 767 VideoOptions options_; | 761 VideoOptions options_; |
| 768 | 762 |
| 769 friend class FakeMediaEngine; | 763 friend class FakeMediaEngine; |
| 770 }; | 764 }; |
| 771 | 765 |
| 772 class FakeMediaEngine : | 766 class FakeMediaEngine : |
| 773 public CompositeMediaEngine<FakeVoiceEngine, FakeVideoEngine> { | 767 public CompositeMediaEngine<FakeVoiceEngine, FakeVideoEngine> { |
| 774 public: | 768 public: |
| 775 FakeMediaEngine() {} | 769 FakeMediaEngine() {} |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 | 862 |
| 869 private: | 863 private: |
| 870 std::vector<FakeDataMediaChannel*> channels_; | 864 std::vector<FakeDataMediaChannel*> channels_; |
| 871 std::vector<DataCodec> data_codecs_; | 865 std::vector<DataCodec> data_codecs_; |
| 872 DataChannelType last_channel_type_; | 866 DataChannelType last_channel_type_; |
| 873 }; | 867 }; |
| 874 | 868 |
| 875 } // namespace cricket | 869 } // namespace cricket |
| 876 | 870 |
| 877 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_ | 871 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_ |
| OLD | NEW |