| 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 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 return ch; | 753 return ch; |
| 754 } | 754 } |
| 755 FakeVideoMediaChannel* GetChannel(size_t index) { | 755 FakeVideoMediaChannel* GetChannel(size_t index) { |
| 756 return (channels_.size() > index) ? channels_[index] : NULL; | 756 return (channels_.size() > index) ? channels_[index] : NULL; |
| 757 } | 757 } |
| 758 void UnregisterChannel(VideoMediaChannel* channel) { | 758 void UnregisterChannel(VideoMediaChannel* channel) { |
| 759 channels_.erase(std::find(channels_.begin(), channels_.end(), channel)); | 759 channels_.erase(std::find(channels_.begin(), channels_.end(), channel)); |
| 760 } | 760 } |
| 761 | 761 |
| 762 const std::vector<VideoCodec>& codecs() const { return codecs_; } | 762 const std::vector<VideoCodec>& codecs() const { return codecs_; } |
| 763 bool FindCodec(const VideoCodec& in) { | |
| 764 for (size_t i = 0; i < codecs_.size(); ++i) { | |
| 765 if (codecs_[i].Matches(in)) { | |
| 766 return true; | |
| 767 } | |
| 768 } | |
| 769 return false; | |
| 770 } | |
| 771 void SetCodecs(const std::vector<VideoCodec> codecs) { codecs_ = codecs; } | 763 void SetCodecs(const std::vector<VideoCodec> codecs) { codecs_ = codecs; } |
| 772 | 764 |
| 773 bool SetCaptureDevice(const Device* device) { | 765 bool SetCaptureDevice(const Device* device) { |
| 774 in_device_ = (device) ? device->name : ""; | 766 in_device_ = (device) ? device->name : ""; |
| 775 options_changed_ = true; | 767 options_changed_ = true; |
| 776 return true; | 768 return true; |
| 777 } | 769 } |
| 778 bool SetCapture(bool capture) { | 770 bool SetCapture(bool capture) { |
| 779 capture_ = capture; | 771 capture_ = capture; |
| 780 return true; | 772 return true; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 | 881 |
| 890 private: | 882 private: |
| 891 std::vector<FakeDataMediaChannel*> channels_; | 883 std::vector<FakeDataMediaChannel*> channels_; |
| 892 std::vector<DataCodec> data_codecs_; | 884 std::vector<DataCodec> data_codecs_; |
| 893 DataChannelType last_channel_type_; | 885 DataChannelType last_channel_type_; |
| 894 }; | 886 }; |
| 895 | 887 |
| 896 } // namespace cricket | 888 } // namespace cricket |
| 897 | 889 |
| 898 #endif // TALK_MEDIA_BASE_FAKEMEDIAENGINE_H_ | 890 #endif // TALK_MEDIA_BASE_FAKEMEDIAENGINE_H_ |
| OLD | NEW |